diff --git a/src/stratagus/mainloop.cpp b/src/stratagus/mainloop.cpp index 9c9b24692..738f2d497 100644 --- a/src/stratagus/mainloop.cpp +++ b/src/stratagus/mainloop.cpp @@ -342,35 +342,36 @@ global void UpdateDisplay(void) DrawMapArea(); DrawMessages(); - for (i = 0; i < TheUI.NumFillers; ++i) { - VideoDrawSubClip(TheUI.Filler[i].Graphic, 0, 0, - TheUI.Filler[i].Graphic->Width, - TheUI.Filler[i].Graphic->Height, - TheUI.FillerX[i], TheUI.FillerY[i]); - } - DrawMenuButtonArea(); + if (!BigMapMode) { + for (i = 0; i < TheUI.NumFillers; ++i) { + VideoDrawSubClip(TheUI.Filler[i].Graphic, 0, 0, + TheUI.Filler[i].Graphic->Width, + TheUI.Filler[i].Graphic->Height, + TheUI.FillerX[i], TheUI.FillerY[i]); + } + DrawMenuButtonArea(); - if (TheUI.MinimapPanel.Graphic) { - VideoDrawSubClip(TheUI.MinimapPanel.Graphic, 0, 0, - TheUI.MinimapPanel.Graphic->Width, - TheUI.MinimapPanel.Graphic->Height, - TheUI.MinimapPanelX, TheUI.MinimapPanelY); - } else { - VideoDrawRectangle(TheUI.CompletedBarColor, - TheUI.MinimapPosX - 1, TheUI.MinimapPosY - 1, - TheUI.MinimapW + 2, TheUI.MinimapH + 2); + if (TheUI.MinimapPanel.Graphic) { + VideoDrawSubClip(TheUI.MinimapPanel.Graphic, 0, 0, + TheUI.MinimapPanel.Graphic->Width, + TheUI.MinimapPanel.Graphic->Height, + TheUI.MinimapPanelX, TheUI.MinimapPanelY); + } else { + VideoDrawRectangle(TheUI.CompletedBarColor, + TheUI.MinimapPosX - 1, TheUI.MinimapPosY - 1, + TheUI.MinimapW + 2, TheUI.MinimapH + 2); + } + + DrawMinimap(TheUI.SelectedViewport->MapX, TheUI.SelectedViewport->MapY); + DrawMinimapCursor(TheUI.SelectedViewport->MapX, + TheUI.SelectedViewport->MapY); + + DrawInfoPanel(); + DrawButtonPanel(); + DrawResources(); + DrawStatusLine(); } - // FIXME: redraw only 1* per second! - // HELPME: Viewpoint rectangle must be drawn faster (if implemented) ? - DrawMinimap(TheUI.SelectedViewport->MapX, TheUI.SelectedViewport->MapY); - DrawMinimapCursor(TheUI.SelectedViewport->MapX, - TheUI.SelectedViewport->MapY); - - DrawInfoPanel(); - DrawButtonPanel(); - DrawResources(); - DrawStatusLine(); DrawCosts(); DrawTimer(); } diff --git a/src/ui/interface.cpp b/src/ui/interface.cpp index 45b45194a..aed4e842b 100644 --- a/src/ui/interface.cpp +++ b/src/ui/interface.cpp @@ -464,7 +464,6 @@ local void UiToggleBigMap(void) EnableRedraw = RedrawMap | RedrawCursor | RedrawMessage | RedrawMenu | RedrawTimer | RedrawAll; SetStatusLine("Big map enabled"); - VideoClearScreen(); } else { TheUI.MapArea.X = mapx; TheUI.MapArea.Y = mapy; @@ -475,7 +474,6 @@ local void UiToggleBigMap(void) EnableRedraw = RedrawEverything; SetStatusLine("Returning to old map"); - VideoClearScreen(); } } diff --git a/src/ui/ui.cpp b/src/ui/ui.cpp index b58ba5eb4..6ecb8168a 100644 --- a/src/ui/ui.cpp +++ b/src/ui/ui.cpp @@ -518,19 +518,28 @@ local void FinishViewportModeConfiguration(Viewport new_vps[], int num_vps) { int i; - // Compute location of the viewport using oldviewport - for (i = 0; i < num_vps; ++i) { - const Viewport* vp; + if (TheUI.NumViewports < num_vps) { + // Compute location of the viewport using oldviewport + for (i = 0; i < num_vps; ++i) { + const Viewport* vp; - new_vps[i].MapX = 0; - new_vps[i].MapY = 0; - vp = GetViewport(new_vps[i].X, new_vps[i].Y); - if (vp) { - new_vps[i].OffsetX = new_vps[i].X - vp->X + vp->MapX * TileSizeX + vp->OffsetX; - new_vps[i].OffsetY = new_vps[i].Y - vp->Y + vp->MapY * TileSizeY + vp->OffsetY; - } else { - new_vps[i].OffsetX = 0; - new_vps[i].OffsetY = 0; + new_vps[i].MapX = 0; + new_vps[i].MapY = 0; + vp = GetViewport(new_vps[i].X, new_vps[i].Y); + if (vp) { + new_vps[i].OffsetX = new_vps[i].X - vp->X + vp->MapX * TileSizeX + vp->OffsetX; + new_vps[i].OffsetY = new_vps[i].Y - vp->Y + vp->MapY * TileSizeY + vp->OffsetY; + } else { + new_vps[i].OffsetX = 0; + new_vps[i].OffsetY = 0; + } + } + } else { + for (i = 0; i < num_vps; ++i) { + new_vps[i].MapX = TheUI.Viewports[i].MapX; + new_vps[i].MapY = TheUI.Viewports[i].MapY; + new_vps[i].OffsetX = TheUI.Viewports[i].OffsetX; + new_vps[i].OffsetY = TheUI.Viewports[i].OffsetY; } }