diff --git a/src/Bitmaps.c b/src/Bitmaps.c index 4930d47..ed906a0 100644 --- a/src/Bitmaps.c +++ b/src/Bitmaps.c @@ -159,12 +159,12 @@ int16_t Bitmaps_GetOverrideBaseResID() PicHandle Bitmaps_GetPict(const int16_t baseResID, const int16_t offset) { PicHandle pic; - pic = GetPicture(baseResID + offset); + pic = (PicHandle)Get1Resource('PICT', baseResID + offset); if (pic == nil) { // No override pic, get default - pic = GetPicture(BasePictResID + offset); + pic = (PicHandle)Get1Resource('PICT', BasePictResID + offset); } return pic; diff --git a/src/GameEngine.c b/src/GameEngine.c index 100540d..c21f38f 100644 --- a/src/GameEngine.c +++ b/src/GameEngine.c @@ -37,8 +37,22 @@ void GameEngine_Init(GameEngine *pGameEngine) void GameEngine_NewGame(GameEngine *pGameEngine, const bool setB) { + int8_t level, startLevel; + pGameEngine->SetB = setB; - GameEngine_StartLevel(pGameEngine, 0); + + startLevel = 0; + for (level = 0; level < LevelCount; level++) + { + // Find the first uncompleted level + if (GameEngine_GetScore(pGameEngine, level) == 0) + { + startLevel = level; + break; + } + } + + GameEngine_StartLevel(pGameEngine, startLevel); } void GameEngine_ResetGame(GameEngine *pGameEngine) @@ -52,7 +66,7 @@ void GameEngine_ResetGame(GameEngine *pGameEngine) } } -void GameEngine_StartLevel(GameEngine *pGameEngine, const uint8_t level) +void GameEngine_StartLevel(GameEngine *pGameEngine, const int8_t level) { GameEngine_LoadLevel(pGameEngine, level, pGameEngine->SetB); } diff --git a/src/GameEngine.h b/src/GameEngine.h index de76126..167e612 100644 --- a/src/GameEngine.h +++ b/src/GameEngine.h @@ -32,7 +32,7 @@ void GameEngine_NewGame(GameEngine *pGameEngine, const bool setB); void GameEngine_ResetGame(GameEngine *pGameEngine); -void GameEngine_StartLevel(GameEngine *pGameEngine, const uint8_t level); +void GameEngine_StartLevel(GameEngine *pGameEngine, const int8_t level); void GameEngine_CompleteLevel(GameEngine *pGameEngine); diff --git a/src/GameWindow.c b/src/GameWindow.c index ff56839..f98f38f 100644 --- a/src/GameWindow.c +++ b/src/GameWindow.c @@ -135,7 +135,7 @@ void GameWindow_Show(const GameWindow *pGameWindow) void GameWindow_ClearScores(GameWindow *pGameWindow) { - if (ShowConfirm("\pClear all scores?")) + if (ShowConfirm("\pAre you sure you want to clear all scores?")) { GameEngine_ResetGame(&(pGameWindow->Engine)); GameWindow_SetScene(pGameWindow, Title); diff --git a/src/LevelSelectScene.c b/src/LevelSelectScene.c index aae1e9c..42da3db 100644 --- a/src/LevelSelectScene.c +++ b/src/LevelSelectScene.c @@ -26,7 +26,6 @@ void LevelSelectScene_Init(GameWindow *pGameWindow) GetScaledPicFrame(pGameWindow->Engine.SetB ? pGameWindow->Bitmaps.BCharPict : pGameWindow->Bitmaps.ACharPict, SetTextScale, &(pGameWindow->LevelSelectScene.SetRect)); GetBoxRect(pContentRect, Top, &r); - //GetBoxRect(&r, Top, &r); CenterRect(&r, &(pGameWindow->LevelSelectScene.SetRect)); // Setup score @@ -37,21 +36,18 @@ void LevelSelectScene_Init(GameWindow *pGameWindow) ConcatenateRect(&(pGameWindow->LevelSelectScene.ScoreRect), &r, &(pGameWindow->LevelSelectScene.ScoreRect)); GetBoxRect(pContentRect, Bottom, &r); - //GetBoxRect(&r, Bottom, &r); CenterRect(&r, &(pGameWindow->LevelSelectScene.ScoreRect)); // Setup previous button GetPictureRect(pGameWindow->Bitmaps.NextButtonPict, &(pGameWindow->LevelSelectScene.PrevButtonRect)); GetBoxRect(pContentRect, BottomLeft, &r); - //GetBoxRect(&r, Bottom, &r); CenterRect(&r, &(pGameWindow->LevelSelectScene.PrevButtonRect)); // Setup next button GetPictureRect(pGameWindow->Bitmaps.NextButtonPict, &(pGameWindow->LevelSelectScene.NextButtonRect)); GetBoxRect(pContentRect, BottomRight, &r); - //GetBoxRect(&r, Bottom, &r); CenterRect(&r, &(pGameWindow->LevelSelectScene.NextButtonRect)); // Setup LevelGrid diff --git a/src/MacCommon.c b/src/MacCommon.c index ce23085..89e2b63 100644 --- a/src/MacCommon.c +++ b/src/MacCommon.c @@ -6,7 +6,7 @@ #define ErrorAlertResID BaseResID #define ConfirmAlertResID (ErrorAlertResID + 1) -#define YesResult 2 +#define ConfirmYesResult 2 const int16_t MonthOffset[] = { 0, // Jan @@ -41,7 +41,7 @@ bool ShowConfirm(Str255 message) ParamText(message, EmptyString, EmptyString, EmptyString); result = CautionAlert(ConfirmAlertResID, NilFilterProc); - return result == YesResult; + return result == ConfirmYesResult; } void CenterRect(const Rect *pOuterRect, Rect *pInnerRect) diff --git a/src/MacLO.c b/src/MacLO.c index 2a09934..94e1837 100644 --- a/src/MacLO.c +++ b/src/MacLO.c @@ -250,7 +250,7 @@ void MacLO_HandleGameMenuChoice(const int16_t item) void MacLO_Quit() { - if (ShowConfirm("\pQuit MacLO?")) + if (ShowConfirm("\pAre you sure you want to quit MacLO?")) { gExitApp = true; } diff --git a/src/MacLO.pi.bin b/src/MacLO.pi.bin index cde80a9..c5f410f 100644 Binary files a/src/MacLO.pi.bin and b/src/MacLO.pi.bin differ diff --git a/src/MacLO.pi.rsrc.bin b/src/MacLO.pi.rsrc.bin index 2255171..da1b709 100644 Binary files a/src/MacLO.pi.rsrc.bin and b/src/MacLO.pi.rsrc.bin differ diff --git a/src/Sounds.c b/src/Sounds.c index 0412bbe..3b902d1 100644 --- a/src/Sounds.c +++ b/src/Sounds.c @@ -16,19 +16,19 @@ void Sounds_Init(Sounds *pSounds) { pSounds->Enabled = DefaultEnabled; - pSounds->ClickSnd = GetResource('snd ', ClickSndResID); + pSounds->ClickSnd = Get1Resource('snd ', ClickSndResID); if (pSounds->ClickSnd == nil) { ShowError("\pClick snd resource missing!", true); } - pSounds->RetrySnd = GetResource('snd ', RetrySndResID); + pSounds->RetrySnd = Get1Resource('snd ', RetrySndResID); if (pSounds->RetrySnd == nil) { ShowError("\pRetry snd resource missing!", true); } - pSounds->DoneSnd = GetResource('snd ', DoneSndResID); + pSounds->DoneSnd = Get1Resource('snd ', DoneSndResID); if (pSounds->DoneSnd == nil) { ShowError("\pDone snd resource missing!", true);