diff options
author | Matthew Hoops | 2011-07-20 09:27:39 -0400 |
---|---|---|
committer | Matthew Hoops | 2011-07-20 09:27:39 -0400 |
commit | ad293b249e74dd1cfbdbd721d02145efbdaf9eca (patch) | |
tree | e568d96f6d7f64c5e58b4c7cd1c4fda7e649bfc7 /engines/hugo | |
parent | d7411acc2b1c7702280dbff1c3e1bafee528184b (diff) | |
parent | e25e85fbb047fef895ede97c3c2c73451631052c (diff) | |
download | scummvm-rg350-ad293b249e74dd1cfbdbd721d02145efbdaf9eca.tar.gz scummvm-rg350-ad293b249e74dd1cfbdbd721d02145efbdaf9eca.tar.bz2 scummvm-rg350-ad293b249e74dd1cfbdbd721d02145efbdaf9eca.zip |
Merge remote branch 'upstream/master' into pegasus
Diffstat (limited to 'engines/hugo')
-rw-r--r-- | engines/hugo/console.cpp | 12 | ||||
-rw-r--r-- | engines/hugo/dialogs.cpp | 10 | ||||
-rw-r--r-- | engines/hugo/display.cpp | 2 | ||||
-rw-r--r-- | engines/hugo/file_v1d.cpp | 2 | ||||
-rw-r--r-- | engines/hugo/file_v1w.cpp | 2 | ||||
-rw-r--r-- | engines/hugo/file_v2d.cpp | 2 | ||||
-rw-r--r-- | engines/hugo/file_v3d.cpp | 4 | ||||
-rw-r--r-- | engines/hugo/hugo.cpp | 6 | ||||
-rw-r--r-- | engines/hugo/hugo.h | 2 | ||||
-rw-r--r-- | engines/hugo/inventory.h | 2 | ||||
-rw-r--r-- | engines/hugo/object.cpp | 4 | ||||
-rw-r--r-- | engines/hugo/parser.cpp | 6 | ||||
-rw-r--r-- | engines/hugo/parser.h | 4 | ||||
-rw-r--r-- | engines/hugo/schedule.cpp | 4 | ||||
-rw-r--r-- | engines/hugo/schedule.h | 2 | ||||
-rw-r--r-- | engines/hugo/sound.cpp | 4 | ||||
-rw-r--r-- | engines/hugo/util.cpp | 2 |
17 files changed, 36 insertions, 34 deletions
diff --git a/engines/hugo/console.cpp b/engines/hugo/console.cpp index 0a67b5cd0a..19fd91e3fa 100644 --- a/engines/hugo/console.cpp +++ b/engines/hugo/console.cpp @@ -64,8 +64,8 @@ bool HugoConsole::Cmd_gotoScreen(int argc, const char **argv) { if ((argc != 2) || (strToInt(argv[1]) > _vm->_numScreens)){ DebugPrintf("Usage: %s <screen number>\n", argv[0]); return true; - } - + } + _vm->_scheduler->newScreen(strToInt(argv[1])); return false; } @@ -78,7 +78,7 @@ bool HugoConsole::Cmd_listScreens(int argc, const char **argv) { DebugPrintf("Usage: %s\n", argv[0]); return true; } - + DebugPrintf("Available screens for this game are:\n"); for (int i = 0; i < _vm->_numScreens; i++) DebugPrintf("%2d - %s\n", i, _vm->_text->getScreenNames(i)); @@ -93,7 +93,7 @@ bool HugoConsole::Cmd_listObjects(int argc, const char **argv) { DebugPrintf("Usage: %s\n", argv[0]); return true; } - + DebugPrintf("Available objects for this game are:\n"); for (int i = 0; i < _vm->_object->_numObj; i++) { if (_vm->_object->_objects[i].genericCmd & TAKE) @@ -110,7 +110,7 @@ bool HugoConsole::Cmd_getObject(int argc, const char **argv) { DebugPrintf("Usage: %s <object number>\n", argv[0]); return true; } - + if (_vm->_object->_objects[strToInt(argv[1])].genericCmd & TAKE) _vm->_parser->takeObject(&_vm->_object->_objects[strToInt(argv[1])]); else @@ -127,7 +127,7 @@ bool HugoConsole::Cmd_getAllObjects(int argc, const char **argv) { DebugPrintf("Usage: %s\n", argv[0]); return true; } - + for (int i = 0; i < _vm->_object->_numObj; i++) { if (_vm->_object->_objects[i].genericCmd & TAKE) _vm->_parser->takeObject(&_vm->_object->_objects[i]); diff --git a/engines/hugo/dialogs.cpp b/engines/hugo/dialogs.cpp index 6c816141f7..c43cdd7b46 100644 --- a/engines/hugo/dialogs.cpp +++ b/engines/hugo/dialogs.cpp @@ -95,15 +95,15 @@ void TopMenu::reflowLayout() { _recallButton->resize(x * scale, y * scale, kButtonWidth * scale, kButtonHeight * scale); x += kButtonWidth + kButtonPad; - + _turboButton->resize(x * scale, y * scale, kButtonWidth * scale, kButtonHeight * scale); x += kButtonWidth + kButtonPad; x += kButtonSpace; - + _lookButton->resize(x * scale, y * scale, kButtonWidth * scale, kButtonHeight * scale); x += kButtonWidth + kButtonPad; - + _inventButton->resize(x * scale, y * scale, kButtonWidth * scale, kButtonHeight * scale); x += kButtonWidth + kButtonPad; @@ -133,7 +133,7 @@ void TopMenu::loadBmpArr(Common::SeekableReadStream &in) { arrayBmp[i * 2 + 1]->create(arrayBmp[i * 2]->w * 2, arrayBmp[i * 2]->h * 2, g_system->getOverlayFormat()); byte *src = (byte *)arrayBmp[i * 2]->pixels; byte *dst = (byte *)arrayBmp[i * 2 + 1]->pixels; - + for (int j = 0; j < arrayBmp[i * 2]->h; j++) { src = (byte *)arrayBmp[i * 2]->getBasePtr(0, j); dst = (byte *)arrayBmp[i * 2 + 1]->getBasePtr(0, j * 2); @@ -153,7 +153,7 @@ void TopMenu::loadBmpArr(Common::SeekableReadStream &in) { *dst++ = *src++; } } - + in.skip(bmpSize); } } diff --git a/engines/hugo/display.cpp b/engines/hugo/display.cpp index c716e80d87..2d35bb0448 100644 --- a/engines/hugo/display.cpp +++ b/engines/hugo/display.cpp @@ -736,7 +736,7 @@ overlayState_t Screen_v1d::findOvl(seq_t *seq_p, image_pt dst_p, uint16 y) { uint16 index = (uint16)(dst_p - _frontBuffer) >> 3; for (int i = 0; i < seq_p->lines-y; i++) { // Each line in object - if (_vm->_object->getBaseBoundary(index)) // If any overlay base byte is non-zero then the object is foreground, else back. + if (_vm->_object->getBaseBoundary(index)) // If any overlay base byte is non-zero then the object is foreground, else back. return kOvlForeground; index += kCompLineSize; } diff --git a/engines/hugo/file_v1d.cpp b/engines/hugo/file_v1d.cpp index 9ebd9d284c..0795923536 100644 --- a/engines/hugo/file_v1d.cpp +++ b/engines/hugo/file_v1d.cpp @@ -62,7 +62,7 @@ void FileManager_v1d::readOverlay(const int screenNum, image_pt image, const ovl Common::String buf = Common::String(_vm->_text->getScreenNames(screenNum)) + Common::String(ovl_ext[overlayType]); if (!Common::File::exists(buf)) { - memset(image, 0, sizeof(image)); + memset(image, 0, kOvlSize); warning("File not found: %s", buf.c_str()); return; } diff --git a/engines/hugo/file_v1w.cpp b/engines/hugo/file_v1w.cpp index eb2226f18a..162019dd2e 100644 --- a/engines/hugo/file_v1w.cpp +++ b/engines/hugo/file_v1w.cpp @@ -80,7 +80,7 @@ void FileManager_v1w::readOverlay(const int screenNum, image_pt image, ovl_t ove break; } if (i == 0) { - memset(image, 0, sizeof(image)); + memset(image, 0, kOvlSize); return; } _sceneryArchive1.read(tmpImage, kOvlSize); diff --git a/engines/hugo/file_v2d.cpp b/engines/hugo/file_v2d.cpp index 2a663edcfa..7e44e756d5 100644 --- a/engines/hugo/file_v2d.cpp +++ b/engines/hugo/file_v2d.cpp @@ -136,7 +136,7 @@ void FileManager_v2d::readOverlay(const int screenNum, image_pt image, ovl_t ove break; } if (i == 0) { - memset(image, 0, sizeof(image)); + memset(image, 0, kOvlSize); return; } diff --git a/engines/hugo/file_v3d.cpp b/engines/hugo/file_v3d.cpp index 7ac0ffc48a..69371bb030 100644 --- a/engines/hugo/file_v3d.cpp +++ b/engines/hugo/file_v3d.cpp @@ -143,7 +143,7 @@ void FileManager_v3d::readOverlay(const int screenNum, image_pt image, ovl_t ove break; } if (i == 0) { - memset(image, 0, sizeof(image)); + memset(image, 0, kOvlSize); return; } @@ -182,7 +182,7 @@ void FileManager_v3d::readOverlay(const int screenNum, image_pt image, ovl_t ove break; } if (i == 0) { - memset(image, 0, sizeof(image)); + memset(image, 0, kOvlSize); return; } diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp index 10d61f25a2..df8abf32eb 100644 --- a/engines/hugo/hugo.cpp +++ b/engines/hugo/hugo.cpp @@ -299,7 +299,7 @@ Common::Error HugoEngine::run() { _status.helpFl = false; _file->instructions(); } - + _mouse->mouseHandler(); // Mouse activity - adds to display list _screen->displayList(kDisplayDisplay); // Blit the display list to screen _status.doQuitFl |= shouldQuit(); // update game quit flag @@ -315,7 +315,7 @@ void HugoEngine::initMachine() { _object->readObjectImages(); // Read all object images if (_platform == Common::kPlatformWindows) _file->readUIFImages(); // Read all uif images (only in Win versions) - + _sound->initPcspkrPlayer(); } @@ -463,7 +463,7 @@ bool HugoEngine::loadHugoDat() { if (varnt == _gameVariant) { _numStates = numElem; _screenStates = (byte *)malloc(sizeof(byte) * numElem); - memset(_screenStates, 0, sizeof(_screenStates)); + memset(_screenStates, 0, sizeof(byte) * numElem); } } diff --git a/engines/hugo/hugo.h b/engines/hugo/hugo.h index 81d194f1d6..125819a39b 100644 --- a/engines/hugo/hugo.h +++ b/engines/hugo/hugo.h @@ -177,7 +177,7 @@ struct status_t { // Game status (not saved) bool recallFl; // Toolbar "recall" button pressed bool newScreenFl; // New screen just loaded in dib_a bool godModeFl; // Allow DEBUG features in live version - bool showBoundariesFl; // Flag used to show and hide boundaries, + bool showBoundariesFl; // Flag used to show and hide boundaries, // used by the console bool doQuitFl; bool skipIntroFl; diff --git a/engines/hugo/inventory.h b/engines/hugo/inventory.h index de9e4cd1f0..666cc37b51 100644 --- a/engines/hugo/inventory.h +++ b/engines/hugo/inventory.h @@ -56,7 +56,7 @@ private: HugoEngine *_vm; static const int kStepDy = 8; // Pixels per step movement - + int16 _firstIconId; // Index of first icon to display int16 *_invent; istate_t _inventoryState; // Inventory icon bar state diff --git a/engines/hugo/object.cpp b/engines/hugo/object.cpp index e888a1d998..e5c7b4bf90 100644 --- a/engines/hugo/object.cpp +++ b/engines/hugo/object.cpp @@ -157,7 +157,7 @@ void ObjectHandler::useObject(int16 objId) { if (inventObjId == use->objId) { // Look for secondary object, if found use matching verb bool foundFl = false; - + for (target_t *target = use->targets; target->nounIndex != 0; target++) if (target->nounIndex == obj->nounIndex) { foundFl = true; @@ -425,7 +425,7 @@ void ObjectHandler::loadObjectUses(Common::ReadStream &in) { } for (int i = 0; i < numElem; i++) { - if (varnt == _vm->_gameVariant) + if (varnt == _vm->_gameVariant) readUse(in, _uses[i]); else { readUse(in, tmpUse); diff --git a/engines/hugo/parser.cpp b/engines/hugo/parser.cpp index 4a53d67377..38a8e4e3ff 100644 --- a/engines/hugo/parser.cpp +++ b/engines/hugo/parser.cpp @@ -60,7 +60,7 @@ Parser::~Parser() { uint16 Parser::getCmdDefaultVerbIdx(const uint16 index) const { return _cmdList[index][0].verbIndex; } - + /** * Read a cmd structure from Hugo.dat */ @@ -235,7 +235,7 @@ void Parser::charHandler() { if (_cmdLineIndex >= kMaxLineSize) { //MessageBeep(MB_ICONASTERISK); warning("STUB: MessageBeep() - Command line too long"); - } else if (isprint(c)) { + } else if (isprint(static_cast<unsigned char>(c))) { _cmdLine[_cmdLineIndex++] = c; _cmdLine[_cmdLineIndex] = '\0'; } @@ -391,6 +391,8 @@ void Parser::command(const char *format, ...) { va_list marker; va_start(marker, format); +// TODO: +// _vm->_line = Common::String::vformat(format, marker); vsprintf(_vm->_line, format, marker); va_end(marker); diff --git a/engines/hugo/parser.h b/engines/hugo/parser.h index faa6dc2303..f8b9d9f13b 100644 --- a/engines/hugo/parser.h +++ b/engines/hugo/parser.h @@ -81,9 +81,9 @@ public: virtual ~Parser(); bool isWordPresent(char **wordArr) const; - + uint16 getCmdDefaultVerbIdx(const uint16 index) const; - + void charHandler(); void command(const char *format, ...); void freeParser(); diff --git a/engines/hugo/schedule.cpp b/engines/hugo/schedule.cpp index a099bec21c..d1b4aa6a9c 100644 --- a/engines/hugo/schedule.cpp +++ b/engines/hugo/schedule.cpp @@ -1040,7 +1040,7 @@ void Scheduler::saveActions(Common::WriteStream *f) const { * Find the index in the action list to be able to serialize the action to save game */ void Scheduler::findAction(const act* action, int16* index, int16* subElem) { - + assert(index && subElem); if (!action) { *index = -1; @@ -1106,7 +1106,7 @@ void Scheduler::restoreEvents(Common::ReadStream *f) { else _events[i].action = (act*)&_actListArr[index][subElem]; - _events[i].localActionFl = (f->readByte() == 1) ? true : false; + _events[i].localActionFl = (f->readByte() == 1) ? true : false; _events[i].time = f->readUint32BE(); int16 prevIndex = f->readSint16BE(); diff --git a/engines/hugo/schedule.h b/engines/hugo/schedule.h index e3107809cf..60d51f0673 100644 --- a/engines/hugo/schedule.h +++ b/engines/hugo/schedule.h @@ -616,7 +616,7 @@ public: protected: virtual const char *getCypher() const; - + void promptAction(act *action); }; diff --git a/engines/hugo/sound.cpp b/engines/hugo/sound.cpp index 9473536a47..1fea1f4343 100644 --- a/engines/hugo/sound.cpp +++ b/engines/hugo/sound.cpp @@ -127,7 +127,7 @@ SoundHandler::SoundHandler(HugoEngine *vm) : _vm(vm) { curPriority = 0; pcspkrTimer = 0; pcspkrOctave = 3; - pcspkrNoteDuration = 2; + pcspkrNoteDuration = 2; } SoundHandler::~SoundHandler() { @@ -290,7 +290,7 @@ void SoundHandler::pcspkr_player() { } else if (pcspkrTimer >= 0) { // Note still going return; } - + // Time to play next note do { cmd_note = true; diff --git a/engines/hugo/util.cpp b/engines/hugo/util.cpp index a936a23de1..6dc9890c3a 100644 --- a/engines/hugo/util.cpp +++ b/engines/hugo/util.cpp @@ -119,7 +119,7 @@ char *strlwr(char *buffer) { char *result = buffer; while (*buffer != '\0') { - if (isupper(*buffer)) + if (isupper(static_cast<unsigned char>(*buffer))) *buffer = tolower(*buffer); buffer++; } |