____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
A futuristic real-time strategy game.
This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project.
Distributed under the "GNU General Public License"#include <minimap.h>
Public Member Functions | |
| CMinimap () | |
| void | UpdateTerrain () |
| void | Update () |
| void | Create () |
| void | FreeOpenGL () |
| void | Reload () |
| void | Destroy () |
| void | Draw (int vx, int vy) |
| void | DrawCursor (int vx, int vy) |
| void | AddEvent (int x, int y) |
| int | Screen2MapX (int x) |
| int | Screen2MapY (int y) |
Public Attributes | |
| int | X |
| int | Y |
| int | W |
| int | H |
| int | XOffset |
| int | YOffset |
| bool | WithTerrain |
| bool | ShowSelected |
| bool | Transparent |
Definition at line 37 of file minimap.h.
| void CMinimap::UpdateTerrain | ( | ) |
Update a mini-map from the tiles of the map.
Definition at line 251 of file minimap.cpp.
References ColorBlack, GetColor(), CPatchManager::getPatch(), H, Map, Minimap2MapX, Minimap2MapY, MINIMAP_FAC, MinimapScaleX, MinimapScaleY, MinimapTerrainSurface, CMap::PatchManager, SCALE_PRECISION, SetMinimapTerrainPixel(), UseOpenGL, W, XOffset, and YOffset.
Referenced by Create(), and EditorMainLoop().
| void CMinimap::Update | ( | ) |
Update the minimap with the current game information
Definition at line 401 of file minimap.cpp.
References ClearMinimap(), ColorBlack, CopyMinimapTerrain(), DrawUnitOn(), FrameCounter, FRAMES_PER_SECOND, H, CMap::IsTileVisible(), Map, Minimap2MapX, Minimap2MapY, MinimapSurface, MinimapTerrainSurface, NumUnits, ReplayRevealMap, SetMinimapPixel(), ThisPlayer, Transparent, Units, UseOpenGL, W, and WithTerrain.
Referenced by EditorMainLoop(), and GameMainLoop().
| void CMinimap::Create | ( | void | ) |
Create a minimap from the tiles of the map.
Definition at line 120 of file minimap.cpp.
References CreateMinimapTexture(), H, CMap::Info, Map, Map2MinimapX, Map2MinimapY, CMapInfo::MapHeight, CMapInfo::MapWidth, Minimap2MapX, Minimap2MapY, MINIMAP_FAC, MinimapScaleX, MinimapScaleY, MinimapSurface, MinimapSurfaceGL, MinimapTerrainSurface, MinimapTerrainSurfaceGL, MinimapTextureHeight, MinimapTextureWidth, NumMinimapEvents, TheScreen, UpdateTerrain(), UseOpenGL, W, XOffset, and YOffset.
Referenced by CreateGame(), and LoadModules().
| void CMinimap::FreeOpenGL | ( | ) |
Free OpenGL minimap
Definition at line 176 of file minimap.cpp.
References MinimapTexture.
Referenced by CVideo::ResizeScreen().
| void CMinimap::Reload | ( | ) |
Reload OpenGL minimap
Definition at line 184 of file minimap.cpp.
References CreateMinimapTexture().
Referenced by ReloadOpenGL().
| void CMinimap::Destroy | ( | ) |
Destroy mini-map.
Definition at line 545 of file minimap.cpp.
References Minimap2MapX, Minimap2MapY, MinimapSurface, MinimapSurfaceGL, MinimapTerrainSurface, MinimapTerrainSurfaceGL, MinimapTexture, and UseOpenGL.
Referenced by CMap::Clean().
| void CMinimap::Draw | ( | int | vx, | |
| int | vy | |||
| ) |
Draw the minimap on the screen
Definition at line 486 of file minimap.cpp.
References DrawEvents(), H, MinimapSurface, MinimapSurfaceGL, MinimapTexture, MinimapTextureHeight, MinimapTextureWidth, TheScreen, UseOpenGL, W, X, and Y.
Referenced by EditorUpdateDisplay(), and UpdateDisplay().
| void CMinimap::DrawCursor | ( | int | vx, | |
| int | vy | |||
| ) |
Draw minimap cursor.
| vx | View point X position. | |
| vy | View point Y position. |
Definition at line 578 of file minimap.cpp.
References CVideo::DrawTransRectangle(), CViewport::MapHeight, CViewport::MapWidth, MINIMAP_FAC, MinimapScaleX, MinimapScaleY, CUserInterface::SelectedViewport, UI, Video, CUserInterface::ViewportCursorColor, X, XOffset, Y, y, and YOffset.
Referenced by EditorUpdateDisplay(), and UpdateDisplay().
| void CMinimap::AddEvent | ( | int | x, | |
| int | y | |||
| ) |
Add a minimap event
| x | Map X tile position | |
| y | Map Y tile position |
Definition at line 596 of file minimap.cpp.
References H, MAX_MINIMAP_EVENTS, MINIMAP_FAC, MinimapEvents, MinimapScaleX, MinimapScaleY, NumMinimapEvents, MinimapEvent::Size, W, X, MinimapEvent::X, XOffset, Y, MinimapEvent::Y, and YOffset.
Referenced by CPlayer::Notify().
| int CMinimap::Screen2MapX | ( | int | x | ) |
Convert minimap cursor X position to tile map coordinate.
| x | Screen X pixel coordinate. |
Definition at line 519 of file minimap.cpp.
References CMap::Info, Map, CMapInfo::MapWidth, MINIMAP_FAC, MinimapScaleX, X, and XOffset.
Referenced by EditorCallbackButtonDown(), EditorCallbackMouse(), UIHandleButtonDown(), UIHandleMouseMove(), and UISelectStateButtonDown().
| int CMinimap::Screen2MapY | ( | int | y | ) |
Convert minimap cursor Y position to tile map coordinate.
| y | Screen Y pixel coordinate. |
Definition at line 534 of file minimap.cpp.
References CMap::Info, Map, CMapInfo::MapHeight, MINIMAP_FAC, MinimapScaleY, Y, and YOffset.
Referenced by EditorCallbackButtonDown(), EditorCallbackMouse(), UIHandleButtonDown(), UIHandleMouseMove(), and UISelectStateButtonDown().
| int CMinimap::X |
Definition at line 56 of file minimap.h.
Referenced by AddEvent(), Draw(), DrawCursor(), DrawEvents(), EditorCallbackMouse(), HandleMouseOn(), RestrictCursorToMinimap(), and Screen2MapX().
| int CMinimap::Y |
Definition at line 57 of file minimap.h.
Referenced by AddEvent(), Draw(), DrawCursor(), DrawEvents(), EditorCallbackMouse(), HandleMouseOn(), RestrictCursorToMinimap(), and Screen2MapY().
| int CMinimap::W |
Definition at line 58 of file minimap.h.
Referenced by AddEvent(), Create(), Draw(), DrawUnitOn(), EditorCallbackMouse(), HandleMouseOn(), RestrictCursorToMinimap(), Update(), and UpdateTerrain().
| int CMinimap::H |
Definition at line 59 of file minimap.h.
Referenced by AddEvent(), Create(), Draw(), DrawUnitOn(), EditorCallbackMouse(), HandleMouseOn(), RestrictCursorToMinimap(), Update(), and UpdateTerrain().
Definition at line 60 of file minimap.h.
Referenced by AddEvent(), Create(), DrawCursor(), DrawUnitOn(), Screen2MapX(), and UpdateTerrain().
Definition at line 61 of file minimap.h.
Referenced by AddEvent(), Create(), DrawCursor(), DrawUnitOn(), Screen2MapY(), and UpdateTerrain().
Definition at line 62 of file minimap.h.
Referenced by CclSetMinimapTerrain(), UiToggleTerrain(), and Update().
1.5.6