diff options
author | Arnaud Boutonné | 2011-01-23 00:05:52 +0000 |
---|---|---|
committer | Arnaud Boutonné | 2011-01-23 00:05:52 +0000 |
commit | 3f6496d5b5b2caf0b935b27bca557ae53a880302 (patch) | |
tree | 0b1da465ca9b7c1787ab73865366df4e4c89c721 /engines/hugo/util.cpp | |
parent | 257a6b2e6d432cd343e213218474a61f61a72980 (diff) | |
download | scummvm-rg350-3f6496d5b5b2caf0b935b27bca557ae53a880302.tar.gz scummvm-rg350-3f6496d5b5b2caf0b935b27bca557ae53a880302.tar.bz2 scummvm-rg350-3f6496d5b5b2caf0b935b27bca557ae53a880302.zip |
HUGO: Cleanup
Suppress almost all defines, rename constants
svn-id: r55451
Diffstat (limited to 'engines/hugo/util.cpp')
-rw-r--r-- | engines/hugo/util.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/engines/hugo/util.cpp b/engines/hugo/util.cpp index ab9fcb0c2b..212f10b36d 100644 --- a/engines/hugo/util.cpp +++ b/engines/hugo/util.cpp @@ -89,7 +89,7 @@ void Utils::reverseByte(byte *data) { } char *Utils::Box(box_t dismiss, const char *s, ...) { - static char buffer[MAX_STRLEN + 1]; // Format text into this + static char buffer[kMaxStrLength + 1]; // Format text into this if (!s) return 0; // NULL strings catered for @@ -97,7 +97,7 @@ char *Utils::Box(box_t dismiss, const char *s, ...) { if (s[0] == '\0') return 0; - if (strlen(s) > MAX_STRLEN - 100) { // Test length + if (strlen(s) > kMaxStrLength - 100) { // Test length warning("String too long: '%s'", s); return 0; } @@ -111,25 +111,29 @@ char *Utils::Box(box_t dismiss, const char *s, ...) { return 0; switch(dismiss) { - case BOX_ANY: - case BOX_OK: { + case kBoxAny: + case kBoxOk: { GUI::MessageDialog dialog(buffer, "OK"); dialog.runModal(); break; } - case BOX_YESNO: { + case kBoxYesNo: { GUI::MessageDialog dialog(buffer, "YES", "NO"); if (dialog.runModal() == GUI::kMessageOK) return buffer; return 0; break; } - case BOX_PROMPT: + case kBoxPrompt: { + // TODO: Some boxes (i.e. the combination code for the shed), needs to return an input. warning("Box: unhandled BOX_PROMPT"); int boxTime = strlen(buffer) * 30; GUI::TimedMessageDialog dialog(buffer, MAX(1500, boxTime)); dialog.runModal(); - // TODO: Some boxes (i.e. the combination code for the shed), needs to return an input. + break; + } + default: + error("Unknown BOX Type %d", dismiss); } return buffer; @@ -139,7 +143,7 @@ char *Utils::Box(box_t dismiss, const char *s, ...) { * Print options for user when dead */ void Utils::gameOverMsg(void) { - Utils::Box(BOX_OK, "%s", HugoEngine::get()._textUtil[kGameOver]); + Utils::Box(kBoxOk, "%s", HugoEngine::get()._textUtil[kGameOver]); } char *Utils::strlwr(char *buffer) { |