diff --git a/engines/twine/menu.cpp b/engines/twine/menu.cpp index eb5353ca52b..557bb4182d0 100644 --- a/engines/twine/menu.cpp +++ b/engines/twine/menu.cpp @@ -74,6 +74,7 @@ enum _MenuButtonTypes { }; } +#define checkMenuQuit(callMenu) if ((callMenu) == kQuitEngine) { return kQuitEngine; } #define kBackground 9999 namespace _priv { @@ -670,15 +671,15 @@ int32 Menu::optionsMenu() { return 0; } case TextId::kVolumeSettings: { - volumeMenu(); + checkMenuQuit(volumeMenu()) break; } case TextId::kSaveManage: { - savemanageMenu(); + checkMenuQuit(savemanageMenu()) break; } case TextId::kAdvanced: { - advoptionsMenu(); + checkMenuQuit(advoptionsMenu()) break; } case kQuitEngine: diff --git a/engines/twine/menuoptions.cpp b/engines/twine/menuoptions.cpp index 4b5a5ea4f8f..220f9f9ced8 100644 --- a/engines/twine/menuoptions.cpp +++ b/engines/twine/menuoptions.cpp @@ -38,11 +38,6 @@ namespace TwinE { -/** Main menu continue game option key */ -#define MAINMENU_CONTINUEGAME 21 -/** Main menu enter players name */ -#define MAINMENU_ENTERPLAYERNAME 42 - #define ONSCREENKEYBOARD_WIDTH 14 #define ONSCREENKEYBOARD_HEIGHT 5 @@ -283,7 +278,7 @@ bool MenuOptions::enterPlayerName(int32 textIdx) { } void MenuOptions::newGameMenu() { - if (enterPlayerName(MAINMENU_ENTERPLAYERNAME)) { + if (enterPlayerName(TextId::kEnterYourName)) { _engine->_gameState->initEngineVars(); newGame(); @@ -320,7 +315,7 @@ int MenuOptions::chooseSave(int textIdx) { } void MenuOptions::continueGameMenu() { - const int slot = chooseSave(MAINMENU_CONTINUEGAME); + const int slot = chooseSave(TextId::kContinueGame); if (slot >= 0) { _engine->_gameState->initEngineVars(); _engine->loadSaveSlot(slot); diff --git a/engines/twine/text.cpp b/engines/twine/text.cpp index e5b30aff588..5871fbd6a3c 100644 --- a/engines/twine/text.cpp +++ b/engines/twine/text.cpp @@ -594,7 +594,7 @@ int Text::printText10() { } // TODO: refactor this code -void Text::drawTextFullscreen(int32 index) { // printTextFullScreen +void Text::drawTextFullscreen(int32 index) { ScopedKeyMap scopedKeyMap(_engine, cutsceneKeyMapId); _engine->_interface->saveClip(); @@ -668,7 +668,7 @@ void Text::setFontParameters(int32 spaceBetween, int32 charSpace) { dialCharSpace = charSpace; } -void Text::setFontCrossColor(int32 color) { // TestCoulDial +void Text::setFontCrossColor(int32 color) { dialTextStepSize = -1; dialTextBufferSize = 14; dialTextStartColor = color << 4; @@ -686,7 +686,7 @@ void Text::setTextCrossColor(int32 stopColor, int32 startColor, int32 stepSize) dialTextBufferSize = ((startColor - stopColor) + 1) / stepSize; } -bool Text::getText(int32 index) { // findString +bool Text::getText(int32 index) { int32 currIdx = 0; int32 orderIdx = 0; diff --git a/engines/twine/text.h b/engines/twine/text.h index 3e4e0acd9ce..a90d7de0b37 100644 --- a/engines/twine/text.h +++ b/engines/twine/text.h @@ -99,15 +99,16 @@ private: int16 pt8s4[96] {0}; int32 printText8PrepareBufferVar2 = 0; // --- + + /** Current dialogue text pointer */ + char *currDialTextPtr = nullptr; + /** Current dialogue text size */ + int32 currDialTextSize = 0; public: Text(TwinEEngine *engine) : _engine(engine) {} /** Current text bank */ int32 currentTextBank = -1; - /** Current dialogue text size */ - int32 currDialTextSize = 0; - /** Current dialogue text pointer */ - char *currDialTextPtr = nullptr; /** Dialogue text size */ int32 dialTextSize = 0;