Refactor neighboring rooms sync-ups. Remove all of the neighboring room objects and recreate them, which fixes a bunch of problems with objects becoming out-of-frame after resize.

This commit is contained in:
elasota
2020-04-05 18:34:37 -04:00
parent b827048c36
commit d7353ff6ed
8 changed files with 163 additions and 27 deletions

View File

@@ -440,6 +440,29 @@ void HandleSplashResolutionChange(void)
//DumpScreenOn(&justRoomsRect);
}
void HandleEditorResolutionChange(void)
{
FlushResolutionChange();
RecomputeInterfaceRects();
RecreateOffscreens();
CloseMainWindow();
OpenMainWindow();
UpdateMainWindow();
//ResetLocale(true);
InitScoreboardMap();
//RefreshScoreboard(wasScoreboardTitleMode);
//DumpScreenOn(&justRoomsRect);
if (toolsWindow)
PortabilityLayer::WindowManager::GetInstance()->PutWindowBehind(toolsWindow, PortabilityLayer::WindowManager::GetInstance()->GetPutInFrontSentinel());
if (mapWindow)
PortabilityLayer::WindowManager::GetInstance()->PutWindowBehind(mapWindow, PortabilityLayer::WindowManager::GetInstance()->GetPutInFrontSentinel());
}
//-------------------------------------------------------------- HandleIdleTask
// Handle some processing during event lulls.
@@ -447,6 +470,11 @@ void HandleIdleTask (void)
{
if (theMode == kEditMode)
{
if (thisMac.isResolutionDirty)
{
HandleEditorResolutionChange();
}
SetPort(&mainWindow->GetDrawSurface()->m_port);
DoMarquee();