mirror of
https://github.com/jonthysell/MacLO.git
synced 2024-06-08 21:29:30 +00:00
Add saving of previous GrafPort before drawing to avoid conflicts with DAs
This commit is contained in:
parent
6989dcb185
commit
85e3d0f003
|
@ -27,13 +27,19 @@ void GameWindow_Init(GameWindow *pGameWindow)
|
||||||
// Load snd resources
|
// Load snd resources
|
||||||
Sounds_Init(&(pGameWindow->Sounds));
|
Sounds_Init(&(pGameWindow->Sounds));
|
||||||
|
|
||||||
|
// Set port for first draw
|
||||||
|
SetPort(pGameWindow->Window);
|
||||||
|
|
||||||
GameWindow_SetScene(pGameWindow, Title);
|
GameWindow_SetScene(pGameWindow, Title);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameWindow_Draw(const GameWindow *pGameWindow, bool fullRefresh)
|
void GameWindow_Draw(const GameWindow *pGameWindow, bool fullRefresh)
|
||||||
{
|
{
|
||||||
|
GrafPtr oldPort;
|
||||||
const Rect *pContentRect = &(pGameWindow->Window->portRect);
|
const Rect *pContentRect = &(pGameWindow->Window->portRect);
|
||||||
|
|
||||||
|
GetPort(&oldPort);
|
||||||
|
|
||||||
SetPort(pGameWindow->Window);
|
SetPort(pGameWindow->Window);
|
||||||
|
|
||||||
if (fullRefresh)
|
if (fullRefresh)
|
||||||
|
@ -57,6 +63,8 @@ void GameWindow_Draw(const GameWindow *pGameWindow, bool fullRefresh)
|
||||||
GameEndScene_Draw(pGameWindow, fullRefresh);
|
GameEndScene_Draw(pGameWindow, fullRefresh);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SetPort(oldPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameWindow_Click(GameWindow *pGameWindow, const Point *pPosition)
|
void GameWindow_Click(GameWindow *pGameWindow, const Point *pPosition)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user