diff options
author | Willem Jan Palenstijn | 2013-04-18 23:35:23 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2013-05-08 20:40:58 +0200 |
commit | 9c2341678ef4984bf92b3878295250faf980b066 (patch) | |
tree | 2fb4805e05e16b9924e80c9947e6bad723b28c4b /engines/agi/text.cpp | |
parent | 8172d679df5148a4a32f46074b20cb6caf91844f (diff) | |
parent | a5f4ff36ffc386d48f2da49387a9655ce9295a4d (diff) | |
download | scummvm-rg350-9c2341678ef4984bf92b3878295250faf980b066.tar.gz scummvm-rg350-9c2341678ef4984bf92b3878295250faf980b066.tar.bz2 scummvm-rg350-9c2341678ef4984bf92b3878295250faf980b066.zip |
Merge branch 'master'
Diffstat (limited to 'engines/agi/text.cpp')
-rw-r--r-- | engines/agi/text.cpp | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/engines/agi/text.cpp b/engines/agi/text.cpp index d5027588f9..1886a74ab1 100644 --- a/engines/agi/text.cpp +++ b/engines/agi/text.cpp @@ -240,7 +240,6 @@ char *AgiEngine::wordWrapString(const char *s, int *len) { while (*s) { pWord = s; - wLen = 0; while (*s != '\0' && *s != ' ' && *s != '\n' && *s != '\r') s++; @@ -341,8 +340,6 @@ int AgiEngine::messageBox(const char *s) { int AgiEngine::selectionBox(const char *m, const char **b) { int numButtons = 0; int x, y, i, s; - int key, active = 0; - int rc = -1; int bx[5], by[5]; _noSaveLoadAllowed = true; @@ -381,7 +378,9 @@ int AgiEngine::selectionBox(const char *m, const char **b) { AllowSyntheticEvents on(this); debugC(4, kDebugLevelText, "selectionBox(): waiting..."); - while (!(shouldQuit() || _restartGame)) { + int key, active = 0; + int rc = -1; + while (rc == -1 && !(shouldQuit() || _restartGame)) { for (i = 0; b[i]; i++) _gfx->drawCurrentStyleButton(bx[i], by[i], b[i], i == active, false, i == 0); @@ -390,10 +389,8 @@ int AgiEngine::selectionBox(const char *m, const char **b) { switch (key) { case KEY_ENTER: rc = active; - goto press; - case KEY_ESCAPE: - rc = -1; - goto getout; + debugC(4, kDebugLevelText, "selectionBox(): Button pressed: %d", rc); + break; case KEY_RIGHT: active++; if (active >= numButtons) @@ -408,7 +405,8 @@ int AgiEngine::selectionBox(const char *m, const char **b) { for (i = 0; b[i]; i++) { if (_gfx->testButton(bx[i], by[i], b[i])) { rc = active = i; - goto press; + debugC(4, kDebugLevelText, "selectionBox(): Button pressed: %d", rc); + break; } } break; @@ -419,12 +417,11 @@ int AgiEngine::selectionBox(const char *m, const char **b) { break; } _gfx->doUpdate(); - } -press: - debugC(4, kDebugLevelText, "selectionBox(): Button pressed: %d", rc); + if (key == KEY_ESCAPE) + break; + } -getout: closeWindow(); debugC(2, kDebugLevelText, "selectionBox(): Result = %d", rc); |