From 2f663646f5f5bd655477f67e784718154fecc3c6 Mon Sep 17 00:00:00 2001 From: elasota Date: Sun, 5 Apr 2020 00:35:01 -0400 Subject: [PATCH] Remove unused menu bar window --- GpApp/Events.cpp | 5 ----- GpApp/GliderProtos.h | 2 -- GpApp/InterfaceInit.cpp | 2 -- GpApp/MainWindow.cpp | 30 +----------------------------- GpApp/Play.cpp | 1 - GpApp/Scoreboard.cpp | 8 -------- 6 files changed, 1 insertion(+), 47 deletions(-) diff --git a/GpApp/Events.cpp b/GpApp/Events.cpp index e0ea34c..693becc 100644 --- a/GpApp/Events.cpp +++ b/GpApp/Events.cpp @@ -349,11 +349,6 @@ void HandleUpdateEvent (EventRecord *theEvent) UpdateCoordWindow(); EndUpdate(coordWindow); } - else if ((WindowPtr)theEvent->message == menuWindow) - { - UpdateMenuBarWindow(menuWindow->GetDrawSurface()); - EndUpdate(menuWindow); - } } //-------------------------------------------------------------- HandleOSEvent diff --git a/GpApp/GliderProtos.h b/GpApp/GliderProtos.h index a5ac24c..51b981d 100644 --- a/GpApp/GliderProtos.h +++ b/GpApp/GliderProtos.h @@ -151,7 +151,6 @@ void HandleLinkClick (Point); void RedrawSplashScreen (void); // --- MainWindow.c void UpdateMainWindow (void); -void UpdateMenuBarWindow (DrawSurface *surface); void OpenMainWindow (void); void CloseMainWindow (void); void ZoomBetweenWindows (void); @@ -434,7 +433,6 @@ void QuickBandsRefresh (Boolean); void QuickFoilRefresh (Boolean); void HandleScore (void); void AdjustScoreboardHeight (void); -void BlackenScoreboard (DrawSurface *); //void PutRoomScrap (void); // --- Scrap.c //void PutObjectScrap (void); diff --git a/GpApp/InterfaceInit.cpp b/GpApp/InterfaceInit.cpp index 1077f62..4e62e79 100644 --- a/GpApp/InterfaceInit.cpp +++ b/GpApp/InterfaceInit.cpp @@ -26,7 +26,6 @@ struct IGpCursor; extern THandle mirrorRects; extern WindowPtr mapWindow, toolsWindow, linkWindow; -extern WindowPtr menuWindow; extern Rect boardSrcRect, localRoomsDest[]; extern IGpCursor *handCursor, *vertCursor, *horiCursor; extern IGpCursor *diagCursor; @@ -213,7 +212,6 @@ void VariableInit (void) coordWindow = nil; toolSrcMap = nil; nailSrcMap = nil; - menuWindow = nil; RecomputeInterfaceRects(); } diff --git a/GpApp/MainWindow.cpp b/GpApp/MainWindow.cpp index 452f02b..4398b01 100644 --- a/GpApp/MainWindow.cpp +++ b/GpApp/MainWindow.cpp @@ -41,7 +41,7 @@ IGpCursor *diagCursor; Rect workSrcRect; DrawSurface *workSrcMap; Rect mainWindowRect; -WindowPtr mainWindow, menuWindow, boardWindow; +WindowPtr mainWindow, boardWindow; short isEditH, isEditV; short playOriginH, playOriginV; short splashOriginH, splashOriginV; @@ -165,22 +165,6 @@ void UpdateMainWindow (void) splashDrawn = true; } -//-------------------------------------------------------------- UpdateMenuBarWindow -// Ugly kludge to cover over the menu bar when playing game on 2nd monitor. - -void UpdateMenuBarWindow (DrawSurface *surface) -{ - Rect bounds; - - if (menuWindow == nil) - return; - - GetLocalWindowRect(menuWindow, &bounds); - - surface->SetForeColor(StdColors::Black()); - surface->FillRect(bounds); -} - //-------------------------------------------------------------- OpenMainWindow // Opens up the main window (how it does this depends on mode were in). @@ -197,10 +181,6 @@ void OpenMainWindow (void) if (theMode == kEditMode) { - if (menuWindow != nil) - PortabilityLayer::WindowManager::GetInstance()->DestroyWindow(menuWindow); - menuWindow = nil; - QSetRect(&mainWindowRect, 0, 0, 512, 322); mainWindow = GetNewCWindow(kEditWindowID, nil, kPutInFront); SizeWindow(mainWindow, mainWindowRect.right, @@ -226,14 +206,6 @@ void OpenMainWindow (void) } else { - if (menuWindow == nil) - { - menuWindow = GetNewCWindow(kMenuWindowID, nil, kPutInFront); - SizeWindow(menuWindow, RectWide(&thisMac.constrainedScreen), 20, false); - MoveWindow(menuWindow, thisMac.constrainedScreen.left, - thisMac.constrainedScreen.top, true); - ShowWindow(menuWindow); - } if (boardWindow == nil) { PortabilityLayer::WindowManager *windowManager = PortabilityLayer::WindowManager::GetInstance(); diff --git a/GpApp/Play.cpp b/GpApp/Play.cpp index 0b260cf..27a41c7 100644 --- a/GpApp/Play.cpp +++ b/GpApp/Play.cpp @@ -54,7 +54,6 @@ short batteryTotal, bandsTotal, foilTotal, mortals; Boolean playing, evenFrame, twoPlayerGame, showFoil, demoGoing; Boolean doBackground, playerSuicide, phoneBitSet, tvOn; -extern WindowPtr menuWindow; extern VFileSpec *theHousesSpecs; extern demoPtr demoData; extern gameType smallGame; diff --git a/GpApp/Scoreboard.cpp b/GpApp/Scoreboard.cpp index b9136a8..a41c9d6 100644 --- a/GpApp/Scoreboard.cpp +++ b/GpApp/Scoreboard.cpp @@ -450,11 +450,3 @@ void AdjustScoreboardHeight (void) wasScoreboardMode = newMode; } } - -//-------------------------------------------------------------- BlackenScoreboard - -void BlackenScoreboard (DrawSurface *surface) -{ - UpdateMenuBarWindow(surface); -} -