Replace CMinimap::DrawCursor by DrawViewportArea.
This commit is contained in:
parent
fb2469658a
commit
6ba4c4a96e
4 changed files with 11 additions and 11 deletions
src
|
@ -1083,7 +1083,7 @@ void EditorUpdateDisplay()
|
|||
//
|
||||
if (UI.SelectedViewport) {
|
||||
UI.Minimap.Draw();
|
||||
UI.Minimap.DrawCursor(UI.SelectedViewport->MapPos.x, UI.SelectedViewport->MapPos.y);
|
||||
UI.Minimap.DrawViewportArea(*UI.SelectedViewport);
|
||||
}
|
||||
//
|
||||
// Info panel
|
||||
|
|
|
@ -59,8 +59,8 @@ public:
|
|||
void FreeOpenGL();
|
||||
void Reload();
|
||||
void Destroy();
|
||||
void Draw();
|
||||
void DrawCursor(int vx, int vy);
|
||||
void Draw() const;
|
||||
void DrawViewportArea(const CViewport &viewport) const;
|
||||
void AddEvent(const Vec2i &pos, Uint32 color);
|
||||
|
||||
Vec2i ScreenToTilePos(const PixelPos &screenPos) const;
|
||||
|
|
|
@ -590,7 +590,7 @@ static void DrawEvents()
|
|||
/**
|
||||
** Draw the minimap on the screen
|
||||
*/
|
||||
void CMinimap::Draw()
|
||||
void CMinimap::Draw() const
|
||||
{
|
||||
if (!UseOpenGL) {
|
||||
SDL_Rect drect = {X, Y, 0, 0};
|
||||
|
@ -723,13 +723,13 @@ void CMinimap::Destroy()
|
|||
** @param vx View point X position.
|
||||
** @param vy View point Y position.
|
||||
*/
|
||||
void CMinimap::DrawCursor(int vx, int vy)
|
||||
void CMinimap::DrawViewportArea(const CViewport &viewport) const
|
||||
{
|
||||
// Determine and save region below minimap cursor
|
||||
int x = X + XOffset + (vx * MinimapScaleX) / MINIMAP_FAC;
|
||||
int y = Y + YOffset + (vy * MinimapScaleY) / MINIMAP_FAC;
|
||||
int w = (UI.SelectedViewport->MapWidth * MinimapScaleX) / MINIMAP_FAC;
|
||||
int h = (UI.SelectedViewport->MapHeight * MinimapScaleY) / MINIMAP_FAC;
|
||||
int x = X + XOffset + (viewport.MapPos.x * MinimapScaleX) / MINIMAP_FAC;
|
||||
int y = Y + YOffset + (viewport.MapPos.y * MinimapScaleY) / MINIMAP_FAC;
|
||||
int w = (viewport.MapWidth * MinimapScaleX) / MINIMAP_FAC;
|
||||
int h = (viewport.MapHeight * MinimapScaleY) / MINIMAP_FAC;
|
||||
|
||||
// Draw cursor as rectangle (Note: unclipped, as it is always visible)
|
||||
Video.DrawTransRectangle(UI.ViewportCursorColor, x, y, w, h, 128);
|
||||
|
|
|
@ -195,7 +195,7 @@ void UpdateDisplay()
|
|||
}
|
||||
|
||||
if (!BigMapMode) {
|
||||
for (int i = 0; i < (int)UI.Fillers.size(); ++i) {
|
||||
for (size_t i = 0; i < UI.Fillers.size(); ++i) {
|
||||
UI.Fillers[i].G->DrawSubClip(0, 0,
|
||||
UI.Fillers[i].G->Width,
|
||||
UI.Fillers[i].G->Height,
|
||||
|
@ -204,7 +204,7 @@ void UpdateDisplay()
|
|||
DrawMenuButtonArea();
|
||||
|
||||
UI.Minimap.Draw();
|
||||
UI.Minimap.DrawCursor(UI.SelectedViewport->MapPos.x, UI.SelectedViewport->MapPos.y);
|
||||
UI.Minimap.DrawViewportArea(*UI.SelectedViewport);
|
||||
|
||||
UI.InfoPanel.Draw();
|
||||
UI.ButtonPanel.Draw();
|
||||
|
|
Loading…
Add table
Reference in a new issue