Add saving of previous GrafPort before drawing to avoid conflicts with DAs

This commit is contained in:
Jon Thysell 2021-11-19 13:15:41 -08:00
parent 6989dcb185
commit 85e3d0f003
1 changed files with 8 additions and 0 deletions

View File

@ -27,13 +27,19 @@ void GameWindow_Init(GameWindow *pGameWindow)
// Load snd resources
Sounds_Init(&(pGameWindow->Sounds));
// Set port for first draw
SetPort(pGameWindow->Window);
GameWindow_SetScene(pGameWindow, Title);
}
void GameWindow_Draw(const GameWindow *pGameWindow, bool fullRefresh)
{
GrafPtr oldPort;
const Rect *pContentRect = &(pGameWindow->Window->portRect);
GetPort(&oldPort);
SetPort(pGameWindow->Window);
if (fullRefresh)
@ -57,6 +63,8 @@ void GameWindow_Draw(const GameWindow *pGameWindow, bool fullRefresh)
GameEndScene_Draw(pGameWindow, fullRefresh);
break;
}
SetPort(oldPort);
}
void GameWindow_Click(GameWindow *pGameWindow, const Point *pPosition)