diff options
author | Sven Hesse | 2011-01-29 22:44:06 +0000 |
---|---|---|
committer | Sven Hesse | 2011-01-29 22:44:06 +0000 |
commit | 14678f059b65e9e5eb3704bde557d8c4d76063f3 (patch) | |
tree | d02939bf569a2db8e230f6548be9e2f30b23e6bd /engines/gob | |
parent | c450ac28e9031e35a93415dab29f77962b97d6a9 (diff) | |
download | scummvm-rg350-14678f059b65e9e5eb3704bde557d8c4d76063f3.tar.gz scummvm-rg350-14678f059b65e9e5eb3704bde557d8c4d76063f3.tar.bz2 scummvm-rg350-14678f059b65e9e5eb3704bde557d8c4d76063f3.zip |
GOB: Move OpcodeFunc's return flag into its parameter
To make the meaning of the flag more clear and make the func
opcodes more similar to draw and gob opcodes.
svn-id: r55627
Diffstat (limited to 'engines/gob')
-rw-r--r-- | engines/gob/inter.cpp | 21 | ||||
-rw-r--r-- | engines/gob/inter.h | 185 | ||||
-rw-r--r-- | engines/gob/inter_fascin.cpp | 10 | ||||
-rw-r--r-- | engines/gob/inter_inca2.cpp | 3 | ||||
-rw-r--r-- | engines/gob/inter_playtoons.cpp | 33 | ||||
-rw-r--r-- | engines/gob/inter_v1.cpp | 270 | ||||
-rw-r--r-- | engines/gob/inter_v2.cpp | 54 | ||||
-rw-r--r-- | engines/gob/inter_v3.cpp | 14 | ||||
-rw-r--r-- | engines/gob/inter_v5.cpp | 4 | ||||
-rw-r--r-- | engines/gob/inter_v6.cpp | 30 |
10 files changed, 258 insertions, 366 deletions
diff --git a/engines/gob/inter.cpp b/engines/gob/inter.cpp index 06bf9a216f..ee7e6cbe51 100644 --- a/engines/gob/inter.cpp +++ b/engines/gob/inter.cpp @@ -79,22 +79,15 @@ void Inter::executeOpcodeDraw(byte i) { warning("unimplemented opcodeDraw: %d [0x%X]", i, i); } -bool Inter::executeOpcodeFunc(byte i, byte j, OpFuncParams ¶ms) { +void Inter::executeOpcodeFunc(byte i, byte j, OpFuncParams ¶ms) { debugC(1, kDebugFuncOp, "opcodeFunc %d.%d [0x%X.0x%X] (%s)", i, j, i, j, getDescOpcodeFunc(i, j)); - if ((i > 4) || (j > 15)) { - warning("unimplemented opcodeFunc: %d.%d [0x%X.0x%X]", i, j, i, j); - return false; - } - - i = i * 16 + j; - if (_opcodesFunc[i].proc && _opcodesFunc[i].proc->isValid()) - return (*_opcodesFunc[i].proc)(params); + int n = i * 16 + j; + if ((i <= 4) && (j <= 15) && _opcodesFunc[n].proc && _opcodesFunc[n].proc->isValid()) + (*_opcodesFunc[n].proc)(params); else warning("unimplemented opcodeFunc: %d.%d [0x%X.0x%X]", i, j, i, j); - - return false; } void Inter::executeOpcodeGob(int i, OpGobParams ¶ms) { @@ -329,7 +322,10 @@ void Inter::funcBlock(int16 retFlag) { if (cmd2 == 0) cmd >>= 4; - if (executeOpcodeFunc(cmd2, cmd, params)) + params.doReturn = false; + executeOpcodeFunc(cmd2, cmd, params); + + if (params.doReturn) return; if (_vm->shouldQuit()) @@ -346,7 +342,6 @@ void Inter::funcBlock(int16 retFlag) { } while (params.counter != params.cmdCount); _vm->_game->_script->setFinished(true); - return; } void Inter::callSub(int16 retFlag) { diff --git a/engines/gob/inter.h b/engines/gob/inter.h index 726502982e..a7dec07a71 100644 --- a/engines/gob/inter.h +++ b/engines/gob/inter.h @@ -39,11 +39,11 @@ namespace Gob { // to save a bit of memory used by opcode names in the Gob engine. #ifndef REDUCE_MEMORY_USAGE #define _OPCODEDRAW(ver, x) setProc(new Common::Functor0Mem<void, ver>(this, &ver::x), #x) - #define _OPCODEFUNC(ver, x) setProc(new Common::Functor1Mem<OpFuncParams &, bool, ver>(this, &ver::x), #x) + #define _OPCODEFUNC(ver, x) setProc(new Common::Functor1Mem<OpFuncParams &, void, ver>(this, &ver::x), #x) #define _OPCODEGOB(ver, x) setProc(new Common::Functor1Mem<OpGobParams &, void, ver>(this, &ver::x), #x) #else #define _OPCODEDRAW(ver, x) setProc(new Common::Functor0Mem<void, ver>(this, &ver::x), "") - #define _OPCODEFUNC(ver, x) setProc(new Common::Functor1Mem<OpFuncParams &, bool, ver>(this, &ver::x), "") + #define _OPCODEFUNC(ver, x) setProc(new Common::Functor1Mem<OpFuncParams &, void, ver>(this, &ver::x), "") #define _OPCODEGOB(ver, x) setProc(new Common::Functor1Mem<OpGobParams &, void, ver>(this, &ver::x), "") #endif @@ -52,13 +52,14 @@ namespace Gob { #define CLEAROPCODEGOB(i) _opcodesGob.erase(i) typedef Common::Functor0<void> OpcodeDraw; -typedef Common::Functor1<struct OpFuncParams &, bool> OpcodeFunc; +typedef Common::Functor1<struct OpFuncParams &, void> OpcodeFunc; typedef Common::Functor1<struct OpGobParams &, void> OpcodeGob; struct OpFuncParams { byte cmdCount; byte counter; int16 retFlag; + bool doReturn; }; struct OpGobParams { int16 extraData; @@ -138,7 +139,7 @@ protected: GobEngine *_vm; void executeOpcodeDraw(byte i); - bool executeOpcodeFunc(byte i, byte j, OpFuncParams ¶ms); + void executeOpcodeFunc(byte i, byte j, OpFuncParams ¶ms); void executeOpcodeGob(int i, OpGobParams ¶ms); const char *getDescOpcodeDraw(byte i); @@ -152,7 +153,7 @@ protected: virtual void checkSwitchTable(uint32 &offset) = 0; void o_drawNOP() {} - bool o_funcNOP(OpFuncParams ¶ms) { return false; } + void o_funcNOP(OpFuncParams ¶ms) {} void o_gobNOP(OpGobParams ¶ms) {} }; @@ -196,63 +197,63 @@ protected: void o1_stopCD(); void o1_loadFontToSprite(); void o1_freeFontToSprite(); - bool o1_callSub(OpFuncParams ¶ms); - bool o1_printTotText(OpFuncParams ¶ms); - bool o1_loadCursor(OpFuncParams ¶ms); - bool o1_switch (OpFuncParams ¶ms); - bool o1_repeatUntil(OpFuncParams ¶ms); - bool o1_whileDo(OpFuncParams ¶ms); - bool o1_if(OpFuncParams ¶ms); - bool o1_assign(OpFuncParams ¶ms); - bool o1_loadSpriteToPos(OpFuncParams ¶ms); - bool o1_printText(OpFuncParams ¶ms); - bool o1_loadTot(OpFuncParams ¶ms); - bool o1_palLoad(OpFuncParams ¶ms); - bool o1_keyFunc(OpFuncParams ¶ms); - bool o1_capturePush(OpFuncParams ¶ms); - bool o1_capturePop(OpFuncParams ¶ms); - bool o1_animPalInit(OpFuncParams ¶ms); - bool o1_drawOperations(OpFuncParams ¶ms); - bool o1_setcmdCount(OpFuncParams ¶ms); - bool o1_return(OpFuncParams ¶ms); - bool o1_renewTimeInVars(OpFuncParams ¶ms); - bool o1_speakerOn(OpFuncParams ¶ms); - bool o1_speakerOff(OpFuncParams ¶ms); - bool o1_putPixel(OpFuncParams ¶ms); - bool o1_goblinFunc(OpFuncParams ¶ms); - bool o1_createSprite(OpFuncParams ¶ms); - bool o1_freeSprite(OpFuncParams ¶ms); - bool o1_returnTo(OpFuncParams ¶ms); - bool o1_loadSpriteContent(OpFuncParams ¶ms); - bool o1_copySprite(OpFuncParams ¶ms); - bool o1_fillRect(OpFuncParams ¶ms); - bool o1_drawLine(OpFuncParams ¶ms); - bool o1_strToLong(OpFuncParams ¶ms); - bool o1_invalidate(OpFuncParams ¶ms); - bool o1_setBackDelta(OpFuncParams ¶ms); - bool o1_playSound(OpFuncParams ¶ms); - bool o1_stopSound(OpFuncParams ¶ms); - bool o1_loadSound(OpFuncParams ¶ms); - bool o1_freeSoundSlot(OpFuncParams ¶ms); - bool o1_waitEndPlay(OpFuncParams ¶ms); - bool o1_playComposition(OpFuncParams ¶ms); - bool o1_getFreeMem(OpFuncParams ¶ms); - bool o1_checkData(OpFuncParams ¶ms); - bool o1_cleanupStr(OpFuncParams ¶ms); - bool o1_insertStr(OpFuncParams ¶ms); - bool o1_cutStr(OpFuncParams ¶ms); - bool o1_strstr(OpFuncParams ¶ms); - bool o1_istrlen(OpFuncParams ¶ms); - bool o1_setMousePos(OpFuncParams ¶ms); - bool o1_setFrameRate(OpFuncParams ¶ms); - bool o1_animatePalette(OpFuncParams ¶ms); - bool o1_animateCursor(OpFuncParams ¶ms); - bool o1_blitCursor(OpFuncParams ¶ms); - bool o1_loadFont(OpFuncParams ¶ms); - bool o1_freeFont(OpFuncParams ¶ms); - bool o1_readData(OpFuncParams ¶ms); - bool o1_writeData(OpFuncParams ¶ms); - bool o1_manageDataFile(OpFuncParams ¶ms); + void o1_callSub(OpFuncParams ¶ms); + void o1_printTotText(OpFuncParams ¶ms); + void o1_loadCursor(OpFuncParams ¶ms); + void o1_switch (OpFuncParams ¶ms); + void o1_repeatUntil(OpFuncParams ¶ms); + void o1_whileDo(OpFuncParams ¶ms); + void o1_if(OpFuncParams ¶ms); + void o1_assign(OpFuncParams ¶ms); + void o1_loadSpriteToPos(OpFuncParams ¶ms); + void o1_printText(OpFuncParams ¶ms); + void o1_loadTot(OpFuncParams ¶ms); + void o1_palLoad(OpFuncParams ¶ms); + void o1_keyFunc(OpFuncParams ¶ms); + void o1_capturePush(OpFuncParams ¶ms); + void o1_capturePop(OpFuncParams ¶ms); + void o1_animPalInit(OpFuncParams ¶ms); + void o1_drawOperations(OpFuncParams ¶ms); + void o1_setcmdCount(OpFuncParams ¶ms); + void o1_return(OpFuncParams ¶ms); + void o1_renewTimeInVars(OpFuncParams ¶ms); + void o1_speakerOn(OpFuncParams ¶ms); + void o1_speakerOff(OpFuncParams ¶ms); + void o1_putPixel(OpFuncParams ¶ms); + void o1_goblinFunc(OpFuncParams ¶ms); + void o1_createSprite(OpFuncParams ¶ms); + void o1_freeSprite(OpFuncParams ¶ms); + void o1_returnTo(OpFuncParams ¶ms); + void o1_loadSpriteContent(OpFuncParams ¶ms); + void o1_copySprite(OpFuncParams ¶ms); + void o1_fillRect(OpFuncParams ¶ms); + void o1_drawLine(OpFuncParams ¶ms); + void o1_strToLong(OpFuncParams ¶ms); + void o1_invalidate(OpFuncParams ¶ms); + void o1_setBackDelta(OpFuncParams ¶ms); + void o1_playSound(OpFuncParams ¶ms); + void o1_stopSound(OpFuncParams ¶ms); + void o1_loadSound(OpFuncParams ¶ms); + void o1_freeSoundSlot(OpFuncParams ¶ms); + void o1_waitEndPlay(OpFuncParams ¶ms); + void o1_playComposition(OpFuncParams ¶ms); + void o1_getFreeMem(OpFuncParams ¶ms); + void o1_checkData(OpFuncParams ¶ms); + void o1_cleanupStr(OpFuncParams ¶ms); + void o1_insertStr(OpFuncParams ¶ms); + void o1_cutStr(OpFuncParams ¶ms); + void o1_strstr(OpFuncParams ¶ms); + void o1_istrlen(OpFuncParams ¶ms); + void o1_setMousePos(OpFuncParams ¶ms); + void o1_setFrameRate(OpFuncParams ¶ms); + void o1_animatePalette(OpFuncParams ¶ms); + void o1_animateCursor(OpFuncParams ¶ms); + void o1_blitCursor(OpFuncParams ¶ms); + void o1_loadFont(OpFuncParams ¶ms); + void o1_freeFont(OpFuncParams ¶ms); + void o1_readData(OpFuncParams ¶ms); + void o1_writeData(OpFuncParams ¶ms); + void o1_manageDataFile(OpFuncParams ¶ms); void o1_setState(OpGobParams ¶ms); void o1_setCurFrame(OpGobParams ¶ms); void o1_setNextState(OpGobParams ¶ms); @@ -377,18 +378,18 @@ protected: void o2_closeItk(); void o2_setImdFrontSurf(); void o2_resetImdFrontSurf(); - bool o2_assign(OpFuncParams ¶ms); - bool o2_printText(OpFuncParams ¶ms); - bool o2_animPalInit(OpFuncParams ¶ms); - bool o2_addHotspot(OpFuncParams ¶ms); - bool o2_removeHotspot(OpFuncParams ¶ms); - bool o2_goblinFunc(OpFuncParams ¶ms); - bool o2_stopSound(OpFuncParams ¶ms); - bool o2_loadSound(OpFuncParams ¶ms); - bool o2_getFreeMem(OpFuncParams ¶ms); - bool o2_checkData(OpFuncParams ¶ms); - bool o2_readData(OpFuncParams ¶ms); - bool o2_writeData(OpFuncParams ¶ms); + void o2_assign(OpFuncParams ¶ms); + void o2_printText(OpFuncParams ¶ms); + void o2_animPalInit(OpFuncParams ¶ms); + void o2_addHotspot(OpFuncParams ¶ms); + void o2_removeHotspot(OpFuncParams ¶ms); + void o2_goblinFunc(OpFuncParams ¶ms); + void o2_stopSound(OpFuncParams ¶ms); + void o2_loadSound(OpFuncParams ¶ms); + void o2_getFreeMem(OpFuncParams ¶ms); + void o2_checkData(OpFuncParams ¶ms); + void o2_readData(OpFuncParams ¶ms); + void o2_writeData(OpFuncParams ¶ms); void o2_loadInfogramesIns(OpGobParams ¶ms); void o2_playInfogrames(OpGobParams ¶ms); void o2_startInfogrames(OpGobParams ¶ms); @@ -432,10 +433,10 @@ protected: void oFascin_playProtracker(OpGobParams ¶ms); - bool oFascin_repeatUntil(OpFuncParams ¶ms); - bool oFascin_assign(OpFuncParams ¶ms); - bool oFascin_copySprite(OpFuncParams ¶ms); - bool oFascin_keyFunc(OpFuncParams ¶ms); + void oFascin_repeatUntil(OpFuncParams ¶ms); + void oFascin_assign(OpFuncParams ¶ms); + void oFascin_copySprite(OpFuncParams ¶ms); + void oFascin_keyFunc(OpFuncParams ¶ms); void oFascin_playTirb(OpGobParams ¶ms); void oFascin_playTira(OpGobParams ¶ms); @@ -469,8 +470,8 @@ protected: virtual void setupOpcodesFunc(); virtual void setupOpcodesGob(); - bool o3_getTotTextItemPart(OpFuncParams ¶ms); - bool o3_copySprite(OpFuncParams ¶ms); + void o3_getTotTextItemPart(OpFuncParams ¶ms); + void o3_copySprite(OpFuncParams ¶ms); void o3_wobble(OpGobParams ¶ms); }; @@ -485,7 +486,7 @@ protected: virtual void setupOpcodesFunc(); virtual void setupOpcodesGob(); - bool oInca2_spaceShooter(OpFuncParams ¶ms); + void oInca2_spaceShooter(OpFuncParams ¶ms); }; class Inter_v4 : public Inter_v3 { @@ -517,7 +518,7 @@ protected: void o5_deleteFile(); void o5_initScreen(); - bool o5_istrlen(OpFuncParams ¶ms); + void o5_istrlen(OpFuncParams ¶ms); void o5_spaceShooter(OpGobParams ¶ms); void o5_getSystemCDSpeed(OpGobParams ¶ms); @@ -552,10 +553,10 @@ protected: void o6_totSub(); void o6_playVmdOrMusic(); - bool o6_loadCursor(OpFuncParams ¶ms); - bool o6_assign(OpFuncParams ¶ms); - bool o6_removeHotspot(OpFuncParams ¶ms); - bool o6_fillRect(OpFuncParams ¶ms); + void o6_loadCursor(OpFuncParams ¶ms); + void o6_assign(OpFuncParams ¶ms); + void o6_removeHotspot(OpFuncParams ¶ms); + void o6_fillRect(OpFuncParams ¶ms); void probe16bitMusic(char *fileName); }; @@ -570,12 +571,12 @@ protected: virtual void setupOpcodesFunc(); virtual void setupOpcodesGob(); - bool oPlaytoons_printText(OpFuncParams ¶ms); - bool oPlaytoons_F_1B(OpFuncParams ¶ms); - bool oPlaytoons_putPixel(OpFuncParams ¶ms); - bool oPlaytoons_freeSprite(OpFuncParams ¶ms); - bool oPlaytoons_checkData(OpFuncParams ¶ms); - bool oPlaytoons_readData(OpFuncParams ¶ms); + void oPlaytoons_printText(OpFuncParams ¶ms); + void oPlaytoons_F_1B(OpFuncParams ¶ms); + void oPlaytoons_putPixel(OpFuncParams ¶ms); + void oPlaytoons_freeSprite(OpFuncParams ¶ms); + void oPlaytoons_checkData(OpFuncParams ¶ms); + void oPlaytoons_readData(OpFuncParams ¶ms); void oPlaytoons_getObjAnimSize(); void oPlaytoons_CD_20_23(); diff --git a/engines/gob/inter_fascin.cpp b/engines/gob/inter_fascin.cpp index 895eb85440..b1dc9e0348 100644 --- a/engines/gob/inter_fascin.cpp +++ b/engines/gob/inter_fascin.cpp @@ -114,7 +114,7 @@ void Inter_Fascination::setupOpcodesGob() { OPCODEGOB(1002, o2_stopProtracker); } -bool Inter_Fascination::oFascin_repeatUntil(OpFuncParams ¶ms) { +void Inter_Fascination::oFascin_repeatUntil(OpFuncParams ¶ms) { int16 size; bool flag; @@ -149,10 +149,9 @@ bool Inter_Fascination::oFascin_repeatUntil(OpFuncParams ¶ms) { _break = false; *_breakFromLevel = -1; } - return false; } -bool Inter_Fascination::oFascin_assign(OpFuncParams ¶ms) { +void Inter_Fascination::oFascin_assign(OpFuncParams ¶ms) { byte destType = _vm->_game->_script->peekByte(); int16 dest = _vm->_game->_script->readVarIndex(); @@ -195,11 +194,9 @@ bool Inter_Fascination::oFascin_assign(OpFuncParams ¶ms) { break; } } - - return false; } -bool Inter_Fascination::oFascin_copySprite(OpFuncParams ¶ms) { +void Inter_Fascination::oFascin_copySprite(OpFuncParams ¶ms) { _vm->_draw->_sourceSurface = _vm->_game->_script->readInt16(); _vm->_draw->_destSurface = _vm->_game->_script->readInt16(); _vm->_draw->_spriteLeft = _vm->_game->_script->readValExpr(); @@ -213,7 +210,6 @@ bool Inter_Fascination::oFascin_copySprite(OpFuncParams ¶ms) { _vm->_draw->_transparency = _vm->_game->_script->readInt16(); _vm->_draw->spriteOperation(DRAW_BLITSURF); - return false; } void Inter_Fascination::oFascin_playTirb(OpGobParams ¶ms) { diff --git a/engines/gob/inter_inca2.cpp b/engines/gob/inter_inca2.cpp index f90fb3f9da..01d3cda33e 100644 --- a/engines/gob/inter_inca2.cpp +++ b/engines/gob/inter_inca2.cpp @@ -53,14 +53,13 @@ void Inter_Inca2::setupOpcodesFunc() { void Inter_Inca2::setupOpcodesGob() { } -bool Inter_Inca2::oInca2_spaceShooter(OpFuncParams ¶ms) { +void Inter_Inca2::oInca2_spaceShooter(OpFuncParams ¶ms) { // TODO: Not yet implemented. We'll pretend we won the match for now _vm->_game->_script->skip(4); uint16 resVar = _vm->_game->_script->readUint16(); _vm->_game->_script->skip(4); WRITE_VAR(resVar, 1); - return false; } } // End of namespace Gob diff --git a/engines/gob/inter_playtoons.cpp b/engines/gob/inter_playtoons.cpp index 46587cd6a0..96f7de55e1 100644 --- a/engines/gob/inter_playtoons.cpp +++ b/engines/gob/inter_playtoons.cpp @@ -96,7 +96,7 @@ void Inter_Playtoons::setupOpcodesFunc() { void Inter_Playtoons::setupOpcodesGob() { } -bool Inter_Playtoons::oPlaytoons_printText(OpFuncParams ¶ms) { +void Inter_Playtoons::oPlaytoons_printText(OpFuncParams ¶ms) { char buf[60]; int i; int16 oldTransparency; @@ -178,16 +178,13 @@ bool Inter_Playtoons::oPlaytoons_printText(OpFuncParams ¶ms) { } while (_vm->_game->_script->peekByte() != 200); _vm->_game->_script->skip(1); - - return false; } -bool Inter_Playtoons::oPlaytoons_F_1B(OpFuncParams ¶ms) { +void Inter_Playtoons::oPlaytoons_F_1B(OpFuncParams ¶ms) { _vm->_game->_hotspots->oPlaytoons_F_1B(); - return false; } -bool Inter_Playtoons::oPlaytoons_putPixel(OpFuncParams ¶ms) { +void Inter_Playtoons::oPlaytoons_putPixel(OpFuncParams ¶ms) { _vm->_draw->_destSurface = _vm->_game->_script->readInt16(); _vm->_draw->_destSpriteX = _vm->_game->_script->readValExpr(); @@ -201,21 +198,18 @@ bool Inter_Playtoons::oPlaytoons_putPixel(OpFuncParams ¶ms) { _vm->_draw->_pattern = _vm->_game->_script->getResultInt()>>16; _vm->_draw->spriteOperation(DRAW_PUTPIXEL); - - return false; } -bool Inter_Playtoons::oPlaytoons_freeSprite(OpFuncParams ¶ms) { +void Inter_Playtoons::oPlaytoons_freeSprite(OpFuncParams ¶ms) { int16 index; if (_vm->_game->_script->peekByte(1) == 0) index = _vm->_game->_script->readInt16(); else index = _vm->_game->_script->readValExpr(); _vm->_draw->freeSprite(index); - return false; } -bool Inter_Playtoons::oPlaytoons_checkData(OpFuncParams ¶ms) { +void Inter_Playtoons::oPlaytoons_checkData(OpFuncParams ¶ms) { int16 handle; uint16 varOff; int32 size; @@ -275,11 +269,9 @@ bool Inter_Playtoons::oPlaytoons_checkData(OpFuncParams ¶ms) { WRITE_VAR_OFFSET(varOff, handle); WRITE_VAR(16, (uint32) size); - - return false; } -bool Inter_Playtoons::oPlaytoons_readData(OpFuncParams ¶ms) { +void Inter_Playtoons::oPlaytoons_readData(OpFuncParams ¶ms) { int32 retSize; int32 size; int32 offset; @@ -318,15 +310,15 @@ bool Inter_Playtoons::oPlaytoons_readData(OpFuncParams ¶ms) { } else WRITE_VAR(1, 0); - return false; + return; } else if (mode == SaveLoad::kSaveModeIgnore) - return false; + return; if (size < 0) { warning("Attempted to read a raw sprite from file \"%s\"", file); - return false ; + return; } else if (size == 0) { dataVar = 0; size = _vm->_game->_script->getVariablesCount() * 4; @@ -336,20 +328,20 @@ bool Inter_Playtoons::oPlaytoons_readData(OpFuncParams ¶ms) { if (file[0] == 0) { WRITE_VAR(1, size); - return false; + return; } WRITE_VAR(1, 1); Common::SeekableReadStream *stream = _vm->_dataIO->getFile(file); if (!stream) - return false; + return; _vm->_draw->animateCursor(4); if (offset > stream->size()) { warning("oPlaytoons_readData: File \"%s\", Offset (%d) > file size (%d)", file, offset, stream->size()); delete stream; - return false; + return; } if (offset < 0) @@ -370,7 +362,6 @@ bool Inter_Playtoons::oPlaytoons_readData(OpFuncParams ¶ms) { WRITE_VAR(1, 0); delete stream; - return false; } void Inter_Playtoons::oPlaytoons_getObjAnimSize() { diff --git a/engines/gob/inter_v1.cpp b/engines/gob/inter_v1.cpp index b8c834c547..8ee2d79405 100644 --- a/engines/gob/inter_v1.cpp +++ b/engines/gob/inter_v1.cpp @@ -653,7 +653,7 @@ void Inter_v1::o1_freeFontToSprite() { _vm->_draw->_fontToSprite[i].height = -1; } -bool Inter_v1::o1_callSub(OpFuncParams ¶ms) { +void Inter_v1::o1_callSub(OpFuncParams ¶ms) { uint16 offset = _vm->_game->_script->readUint16(); debugC(5, kDebugGameFlow, "tot = \"%s\", offset = %d", @@ -662,51 +662,49 @@ bool Inter_v1::o1_callSub(OpFuncParams ¶ms) { if (offset < 128) { warning("Inter_v1::o1_callSub(): Offset %d points into the header. " "Skipping call", offset); - return false; + return; } // Skipping the copy protection screen in Gobliiins if (!_vm->_copyProtection && (_vm->getGameType() == kGameTypeGob1) && (offset == 3905) && !scumm_stricmp(_vm->_game->_curTotFile, _vm->_startTot.c_str())) { debugC(2, kDebugGameFlow, "Skipping copy protection screen"); - return false; + return; } // Skipping the copy protection screen in Gobliins 2 if (!_vm->_copyProtection && (_vm->getGameType() == kGameTypeGob2) && (offset == 1746) && !scumm_stricmp(_vm->_game->_curTotFile, "intro0.tot")) { debugC(2, kDebugGameFlow, "Skipping copy protection screen"); - return false; + return; } _vm->_game->_script->call(offset); if ((params.counter == params.cmdCount) && (params.retFlag == 2)) { _vm->_game->_script->pop(false); - return true; + params.doReturn = true; + return; } callSub(2); _vm->_game->_script->pop(); - - return false; } -bool Inter_v1::o1_printTotText(OpFuncParams ¶ms) { +void Inter_v1::o1_printTotText(OpFuncParams ¶ms) { _vm->_draw->printTotText(_vm->_game->_script->readInt16()); - return false; } -bool Inter_v1::o1_loadCursor(OpFuncParams ¶ms) { +void Inter_v1::o1_loadCursor(OpFuncParams ¶ms) { int16 id = _vm->_game->_script->readInt16(); int8 index = _vm->_game->_script->readInt8(); if ((index * _vm->_draw->_cursorWidth) >= _vm->_draw->_cursorSprites->getWidth()) - return false; + return; Resource *resource = _vm->_game->_resources->getResource(id); if (!resource) - return false; + return; _vm->_draw->_cursorSprites->fillRect(index * _vm->_draw->_cursorWidth, 0, index * _vm->_draw->_cursorWidth + _vm->_draw->_cursorWidth - 1, @@ -718,10 +716,9 @@ bool Inter_v1::o1_loadCursor(OpFuncParams ¶ms) { _vm->_draw->_cursorAnimLow[index] = 0; delete resource; - return false; } -bool Inter_v1::o1_switch(OpFuncParams ¶ms) { +void Inter_v1::o1_switch(OpFuncParams ¶ms) { uint32 offset; checkSwitchTable(offset); @@ -733,17 +730,16 @@ bool Inter_v1::o1_switch(OpFuncParams ¶ms) { if ((params.counter == params.cmdCount) && (params.retFlag == 2)) { _vm->_game->_script->pop(false); - return true; + params.doReturn = true; + return; } funcBlock(0); _vm->_game->_script->pop(); - - return false; } -bool Inter_v1::o1_repeatUntil(OpFuncParams ¶ms) { +void Inter_v1::o1_repeatUntil(OpFuncParams ¶ms) { int16 size; bool flag; @@ -768,10 +764,9 @@ bool Inter_v1::o1_repeatUntil(OpFuncParams ¶ms) { _break = false; *_breakFromLevel = -1; } - return false; } -bool Inter_v1::o1_whileDo(OpFuncParams ¶ms) { +void Inter_v1::o1_whileDo(OpFuncParams ¶ms) { bool flag; int16 size; @@ -782,7 +777,7 @@ bool Inter_v1::o1_whileDo(OpFuncParams ¶ms) { flag = _vm->_game->_script->evalBoolResult(); if (_terminate) - return false; + return; uint32 blockPos = _vm->_game->_script->pos(); @@ -806,10 +801,9 @@ bool Inter_v1::o1_whileDo(OpFuncParams ¶ms) { _break = false; *_breakFromLevel = -1; } - return false; } -bool Inter_v1::o1_if(OpFuncParams ¶ms) { +void Inter_v1::o1_if(OpFuncParams ¶ms) { byte cmd; bool boolRes; @@ -823,8 +817,10 @@ bool Inter_v1::o1_if(OpFuncParams ¶ms) { boolRes = _vm->_game->_script->evalBoolResult(); if (boolRes) { - if ((params.counter == params.cmdCount) && (params.retFlag == 2)) - return true; + if ((params.counter == params.cmdCount) && (params.retFlag == 2)) { + params.doReturn = true; + return; + } _vm->_game->_script->push(); funcBlock(0); @@ -836,7 +832,7 @@ bool Inter_v1::o1_if(OpFuncParams ¶ms) { cmd = _vm->_game->_script->readByte() >> 4; if (cmd != 12) - return false; + return; _vm->_game->_script->skip(_vm->_game->_script->peekUint16(2) + 2); } else { @@ -846,10 +842,12 @@ bool Inter_v1::o1_if(OpFuncParams ¶ms) { cmd = _vm->_game->_script->readByte() >> 4; if (cmd != 12) - return false; + return; - if ((params.counter == params.cmdCount) && (params.retFlag == 2)) - return true; + if ((params.counter == params.cmdCount) && (params.retFlag == 2)) { + params.doReturn = true; + return; + } _vm->_game->_script->push(); funcBlock(0); @@ -857,10 +855,9 @@ bool Inter_v1::o1_if(OpFuncParams ¶ms) { _vm->_game->_script->skip(_vm->_game->_script->peekUint16(2) + 2); } - return false; } -bool Inter_v1::o1_assign(OpFuncParams ¶ms) { +void Inter_v1::o1_assign(OpFuncParams ¶ms) { byte destType = _vm->_game->_script->peekByte(); int16 dest = _vm->_game->_script->readVarIndex(); @@ -882,10 +879,9 @@ bool Inter_v1::o1_assign(OpFuncParams ¶ms) { break; } - return false; } -bool Inter_v1::o1_loadSpriteToPos(OpFuncParams ¶ms) { +void Inter_v1::o1_loadSpriteToPos(OpFuncParams ¶ms) { _vm->_draw->_spriteLeft = _vm->_game->_script->readInt16(); _vm->_draw->_destSpriteX = _vm->_game->_script->readValExpr(); @@ -908,11 +904,9 @@ bool Inter_v1::o1_loadSpriteToPos(OpFuncParams ¶ms) { _vm->_game->_script->skip(2); _vm->_draw->spriteOperation(DRAW_LOADSPRITE); - - return false; } -bool Inter_v1::o1_printText(OpFuncParams ¶ms) { +void Inter_v1::o1_printText(OpFuncParams ¶ms) { char buf[60]; int i; @@ -961,11 +955,9 @@ bool Inter_v1::o1_printText(OpFuncParams ¶ms) { } while (_vm->_game->_script->peekByte() != 200); _vm->_game->_script->skip(1); - - return false; } -bool Inter_v1::o1_loadTot(OpFuncParams ¶ms) { +void Inter_v1::o1_loadTot(OpFuncParams ¶ms) { char buf[20]; int8 size; @@ -987,11 +979,9 @@ bool Inter_v1::o1_loadTot(OpFuncParams ¶ms) { if (_terminate != 2) _terminate = 1; strcpy(_vm->_game->_totToLoad, buf); - - return false; } -bool Inter_v1::o1_palLoad(OpFuncParams ¶ms) { +void Inter_v1::o1_palLoad(OpFuncParams ¶ms) { int index1, index2; int16 id; byte cmd; @@ -1003,7 +993,7 @@ bool Inter_v1::o1_palLoad(OpFuncParams ¶ms) { if ((_vm->_global->_fakeVideoMode < 0x32) || (_vm->_global->_fakeVideoMode > 0x63)) { _vm->_game->_script->skip(48); - return false; + return; } break; @@ -1011,55 +1001,55 @@ bool Inter_v1::o1_palLoad(OpFuncParams ¶ms) { if ((_vm->_global->_fakeVideoMode != 5) && (_vm->_global->_fakeVideoMode != 7)) { _vm->_game->_script->skip(18); - return false; + return; } break; case 50: if (_vm->_global->_colorCount == 256) { _vm->_game->_script->skip(16); - return false; + return; } break; case 51: if (_vm->_global->_fakeVideoMode < 0x64) { _vm->_game->_script->skip(2); - return false; + return; } break; case 52: if (_vm->_global->_colorCount == 256) { _vm->_game->_script->skip(48); - return false; + return; } break; case 53: if (_vm->_global->_colorCount != 256) { _vm->_game->_script->skip(2); - return false; + return; } break; case 54: if (_vm->_global->_fakeVideoMode < 0x13) { - return false; + return; } break; case 61: if (_vm->_global->_fakeVideoMode < 0x13) { _vm->_game->_script->skip(4); - return false; + return; } break; } if ((cmd & 0x7F) == 0x30) { _vm->_game->_script->skip(48); - return false; + return; } _vm->_draw->_applyPal = !(cmd & 0x80); @@ -1078,7 +1068,7 @@ bool Inter_v1::o1_palLoad(OpFuncParams ¶ms) { _vm->_draw->_frontSurface->clear(); _vm->_draw->_noInvalidated57 = true; _vm->_game->_script->skip(48); - return false; + return; } _vm->_draw->_noInvalidated57 = false; @@ -1105,7 +1095,7 @@ bool Inter_v1::o1_palLoad(OpFuncParams ¶ms) { _vm->_global->_pPaletteDesc->unused1 = _vm->_draw->_unusedPalette1; _vm->_video->setFullPalette(_vm->_global->_pPaletteDesc); - return false; + return; } switch (cmd) { @@ -1157,7 +1147,7 @@ bool Inter_v1::o1_palLoad(OpFuncParams ¶ms) { if (_vm->_draw->_applyPal) { _vm->_draw->_applyPal = false; _vm->_video->setFullPalette(_vm->_global->_pPaletteDesc); - return false; + return; } break; } @@ -1169,22 +1159,20 @@ bool Inter_v1::o1_palLoad(OpFuncParams ¶ms) { if (_vm->_global->_videoMode < 0x13) { _vm->_global->_pPaletteDesc->vgaPal = _vm->_draw->_vgaPalette; _vm->_palAnim->fade(_vm->_global->_pPaletteDesc, 0, 0); - return false; + return; } if ((_vm->_global->_videoMode < 0x32) || (_vm->_global->_videoMode >= 0x64)) { _vm->_global->_pPaletteDesc->vgaPal = _vm->_draw->_vgaPalette; _vm->_palAnim->fade(_vm->_global->_pPaletteDesc, 0, 0); - return false; + return; } _vm->_global->_pPaletteDesc->vgaPal = _vm->_draw->_vgaSmallPalette; _vm->_palAnim->fade(_vm->_global->_pPaletteDesc, 0, 0); } - - return false; } -bool Inter_v1::o1_keyFunc(OpFuncParams ¶ms) { +void Inter_v1::o1_keyFunc(OpFuncParams ¶ms) { static uint32 lastCalled = 0; int16 cmd; int16 key; @@ -1252,11 +1240,9 @@ bool Inter_v1::o1_keyFunc(OpFuncParams ¶ms) { _vm->_util->longDelay(cmd); break; } - - return false; } -bool Inter_v1::o1_capturePush(OpFuncParams ¶ms) { +void Inter_v1::o1_capturePush(OpFuncParams ¶ms) { int16 left, top; int16 width, height; @@ -1266,78 +1252,68 @@ bool Inter_v1::o1_capturePush(OpFuncParams ¶ms) { height = _vm->_game->_script->readValExpr(); if ((width < 0) || (height < 0)) - return false; + return; _vm->_game->capturePush(left, top, width, height); (*_vm->_scenery->_pCaptureCounter)++; - return false; } -bool Inter_v1::o1_capturePop(OpFuncParams ¶ms) { +void Inter_v1::o1_capturePop(OpFuncParams ¶ms) { if (*_vm->_scenery->_pCaptureCounter != 0) { (*_vm->_scenery->_pCaptureCounter)--; _vm->_game->capturePop(1); } - return false; } -bool Inter_v1::o1_animPalInit(OpFuncParams ¶ms) { +void Inter_v1::o1_animPalInit(OpFuncParams ¶ms) { _animPalDir[0] = _vm->_game->_script->readInt16(); _animPalLowIndex[0] = _vm->_game->_script->readValExpr(); _animPalHighIndex[0] = _vm->_game->_script->readValExpr(); - return false; } -bool Inter_v1::o1_drawOperations(OpFuncParams ¶ms) { +void Inter_v1::o1_drawOperations(OpFuncParams ¶ms) { byte cmd; cmd = _vm->_game->_script->readByte(); executeOpcodeDraw(cmd); - - return false; } -bool Inter_v1::o1_setcmdCount(OpFuncParams ¶ms) { +void Inter_v1::o1_setcmdCount(OpFuncParams ¶ms) { params.cmdCount = _vm->_game->_script->readByte(); params.counter = 0; - return false; } -bool Inter_v1::o1_return(OpFuncParams ¶ms) { +void Inter_v1::o1_return(OpFuncParams ¶ms) { if (params.retFlag != 2) _break = true; _vm->_game->_script->setFinished(true); - return true; + params.doReturn = true; } -bool Inter_v1::o1_renewTimeInVars(OpFuncParams ¶ms) { +void Inter_v1::o1_renewTimeInVars(OpFuncParams ¶ms) { renewTimeInVars(); - return false; } -bool Inter_v1::o1_speakerOn(OpFuncParams ¶ms) { +void Inter_v1::o1_speakerOn(OpFuncParams ¶ms) { _vm->_sound->speakerOn(_vm->_game->_script->readValExpr(), -1); - return false; } -bool Inter_v1::o1_speakerOff(OpFuncParams ¶ms) { +void Inter_v1::o1_speakerOff(OpFuncParams ¶ms) { _vm->_sound->speakerOff(); - return false; } -bool Inter_v1::o1_putPixel(OpFuncParams ¶ms) { +void Inter_v1::o1_putPixel(OpFuncParams ¶ms) { _vm->_draw->_destSurface = _vm->_game->_script->readInt16(); _vm->_draw->_destSpriteX = _vm->_game->_script->readValExpr(); _vm->_draw->_destSpriteY = _vm->_game->_script->readValExpr(); _vm->_draw->_frontColor = _vm->_game->_script->readValExpr(); _vm->_draw->spriteOperation(DRAW_PUTPIXEL); - return false; } -bool Inter_v1::o1_goblinFunc(OpFuncParams ¶ms) { +void Inter_v1::o1_goblinFunc(OpFuncParams ¶ms) { OpGobParams gobParams; bool objDescSet = false; int16 cmd; @@ -1385,14 +1361,12 @@ bool Inter_v1::o1_goblinFunc(OpFuncParams ¶ms) { */ if ((cmd < 40) && objDescSet && !gobParams.objDesc) - return false; + return; executeOpcodeGob(cmd, gobParams); - - return false; } -bool Inter_v1::o1_createSprite(OpFuncParams ¶ms) { +void Inter_v1::o1_createSprite(OpFuncParams ¶ms) { int16 index; int16 width, height; int16 flag; @@ -1409,32 +1383,31 @@ bool Inter_v1::o1_createSprite(OpFuncParams ¶ms) { flag = _vm->_game->_script->readInt16(); _vm->_draw->initSpriteSurf(index, width, height, flag ? 2 : 0); - - return false; } -bool Inter_v1::o1_freeSprite(OpFuncParams ¶ms) { +void Inter_v1::o1_freeSprite(OpFuncParams ¶ms) { _vm->_draw->freeSprite(_vm->_game->_script->readInt16()); - return false; } -bool Inter_v1::o1_returnTo(OpFuncParams ¶ms) { +void Inter_v1::o1_returnTo(OpFuncParams ¶ms) { if (params.retFlag == 1) { _break = true; _vm->_game->_script->setFinished(true); - return true; + params.doReturn = true; + return; } if (*_nestLevel == 0) - return false; + return; *_breakFromLevel = *_nestLevel; _break = true; _vm->_game->_script->setFinished(true); - return true; + + params.doReturn = true; } -bool Inter_v1::o1_loadSpriteContent(OpFuncParams ¶ms) { +void Inter_v1::o1_loadSpriteContent(OpFuncParams ¶ms) { _vm->_draw->_spriteLeft = _vm->_game->_script->readInt16(); _vm->_draw->_destSurface = _vm->_game->_script->readInt16(); _vm->_draw->_transparency = _vm->_game->_script->readInt16(); @@ -1442,10 +1415,9 @@ bool Inter_v1::o1_loadSpriteContent(OpFuncParams ¶ms) { _vm->_draw->_destSpriteY = 0; _vm->_draw->spriteOperation(DRAW_LOADSPRITE); - return false; } -bool Inter_v1::o1_copySprite(OpFuncParams ¶ms) { +void Inter_v1::o1_copySprite(OpFuncParams ¶ms) { if (_vm->_game->_script->peekByte(1) == 0) _vm->_draw->_sourceSurface = _vm->_game->_script->readInt16(); else @@ -1467,10 +1439,9 @@ bool Inter_v1::o1_copySprite(OpFuncParams ¶ms) { _vm->_draw->_transparency = _vm->_game->_script->readInt16(); _vm->_draw->spriteOperation(DRAW_BLITSURF); - return false; } -bool Inter_v1::o1_fillRect(OpFuncParams ¶ms) { +void Inter_v1::o1_fillRect(OpFuncParams ¶ms) { int16 destSurf; _vm->_draw->_destSurface = destSurf = _vm->_game->_script->readInt16(); @@ -1483,7 +1454,7 @@ bool Inter_v1::o1_fillRect(OpFuncParams ¶ms) { _vm->_draw->_backColor = _vm->_game->_script->readValExpr(); if (!_vm->_draw->_spritesArray[(destSurf >= 100) ? (destSurf - 80) : destSurf]) - return false; + return; if (_vm->_draw->_spriteRight < 0) { _vm->_draw->_destSpriteX += _vm->_draw->_spriteRight - 1; @@ -1495,10 +1466,9 @@ bool Inter_v1::o1_fillRect(OpFuncParams ¶ms) { } _vm->_draw->spriteOperation(DRAW_FILLRECT); - return false; } -bool Inter_v1::o1_drawLine(OpFuncParams ¶ms) { +void Inter_v1::o1_drawLine(OpFuncParams ¶ms) { _vm->_draw->_destSurface = _vm->_game->_script->readInt16(); _vm->_draw->_destSpriteX = _vm->_game->_script->readValExpr(); @@ -1508,10 +1478,9 @@ bool Inter_v1::o1_drawLine(OpFuncParams ¶ms) { _vm->_draw->_frontColor = _vm->_game->_script->readValExpr(); _vm->_draw->spriteOperation(DRAW_DRAWLINE); - return false; } -bool Inter_v1::o1_strToLong(OpFuncParams ¶ms) { +void Inter_v1::o1_strToLong(OpFuncParams ¶ms) { char str[20]; int16 strVar; int16 destVar; @@ -1523,26 +1492,23 @@ bool Inter_v1::o1_strToLong(OpFuncParams ¶ms) { destVar = _vm->_game->_script->readVarIndex(); WRITE_VAR_OFFSET(destVar, res); - return false; } -bool Inter_v1::o1_invalidate(OpFuncParams ¶ms) { +void Inter_v1::o1_invalidate(OpFuncParams ¶ms) { _vm->_draw->_destSurface = _vm->_game->_script->readInt16(); _vm->_draw->_destSpriteX = _vm->_game->_script->readValExpr(); _vm->_draw->_destSpriteY = _vm->_game->_script->readValExpr(); _vm->_draw->_spriteRight = _vm->_game->_script->readValExpr(); _vm->_draw->_frontColor = _vm->_game->_script->readValExpr(); _vm->_draw->spriteOperation(DRAW_INVALIDATE); - return false; } -bool Inter_v1::o1_setBackDelta(OpFuncParams ¶ms) { +void Inter_v1::o1_setBackDelta(OpFuncParams ¶ms) { _vm->_draw->_backDeltaX = _vm->_game->_script->readValExpr(); _vm->_draw->_backDeltaY = _vm->_game->_script->readValExpr(); - return false; } -bool Inter_v1::o1_playSound(OpFuncParams ¶ms) { +void Inter_v1::o1_playSound(OpFuncParams ¶ms) { int16 frequency; int16 freq2; int16 repCount; @@ -1557,11 +1523,11 @@ bool Inter_v1::o1_playSound(OpFuncParams ¶ms) { _soundEndTimeKey = 0; if (!sample || sample->empty()) - return false; + return; if (repCount < 0) { if (_vm->_global->_soundFlags < 2) - return false; + return; repCount = -repCount; _soundEndTimeKey = _vm->_util->getTimeKey(); @@ -1581,34 +1547,28 @@ bool Inter_v1::o1_playSound(OpFuncParams ¶ms) { _vm->_sound->blasterStop(0); _vm->_sound->blasterPlay(sample, repCount - 1, frequency); } - - return false; } -bool Inter_v1::o1_stopSound(OpFuncParams ¶ms) { +void Inter_v1::o1_stopSound(OpFuncParams ¶ms) { _vm->_sound->adlibStop(); _vm->_sound->blasterStop(_vm->_game->_script->readValExpr()); _soundEndTimeKey = 0; - return false; } -bool Inter_v1::o1_loadSound(OpFuncParams ¶ms) { +void Inter_v1::o1_loadSound(OpFuncParams ¶ms) { loadSound(-1); - return false; } -bool Inter_v1::o1_freeSoundSlot(OpFuncParams ¶ms) { +void Inter_v1::o1_freeSoundSlot(OpFuncParams ¶ms) { _vm->_game->freeSoundSlot(-1); - return false; } -bool Inter_v1::o1_waitEndPlay(OpFuncParams ¶ms) { +void Inter_v1::o1_waitEndPlay(OpFuncParams ¶ms) { _vm->_sound->blasterWaitEndPlay(); - return false; } -bool Inter_v1::o1_playComposition(OpFuncParams ¶ms) { +void Inter_v1::o1_playComposition(OpFuncParams ¶ms) { int16 composition[50]; int16 dataVar; int16 freqVal; @@ -1619,10 +1579,9 @@ bool Inter_v1::o1_playComposition(OpFuncParams ¶ms) { composition[i] = (int16) VAR_OFFSET(dataVar + i * 4); _vm->_sound->blasterPlayComposition(composition, freqVal); - return false; } -bool Inter_v1::o1_getFreeMem(OpFuncParams ¶ms) { +void Inter_v1::o1_getFreeMem(OpFuncParams ¶ms) { int16 freeVar; int16 maxFreeVar; @@ -1632,10 +1591,9 @@ bool Inter_v1::o1_getFreeMem(OpFuncParams ¶ms) { // HACK WRITE_VAR_OFFSET(freeVar, 1000000); WRITE_VAR_OFFSET(maxFreeVar, 1000000); - return false; } -bool Inter_v1::o1_checkData(OpFuncParams ¶ms) { +void Inter_v1::o1_checkData(OpFuncParams ¶ms) { int16 varOff; _vm->_game->_script->evalExpr(0); @@ -1646,19 +1604,16 @@ bool Inter_v1::o1_checkData(OpFuncParams ¶ms) { WRITE_VAR_OFFSET(varOff, (uint32) -1); } else WRITE_VAR_OFFSET(varOff, 50); // "handle" between 50 and 128 = in archive - - return false; } -bool Inter_v1::o1_cleanupStr(OpFuncParams ¶ms) { +void Inter_v1::o1_cleanupStr(OpFuncParams ¶ms) { int16 strVar; strVar = _vm->_game->_script->readVarIndex(); _vm->_util->cleanupStr(GET_VARO_FSTR(strVar)); - return false; } -bool Inter_v1::o1_insertStr(OpFuncParams ¶ms) { +void Inter_v1::o1_insertStr(OpFuncParams ¶ms) { int16 pos; int16 strVar; @@ -1668,10 +1623,9 @@ bool Inter_v1::o1_insertStr(OpFuncParams ¶ms) { char *str = GET_VARO_FSTR(strVar); _vm->_util->insertStr(_vm->_game->_script->getResultStr(), str, pos); - return false; } -bool Inter_v1::o1_cutStr(OpFuncParams ¶ms) { +void Inter_v1::o1_cutStr(OpFuncParams ¶ms) { int16 strVar; int16 pos; int16 size; @@ -1680,10 +1634,9 @@ bool Inter_v1::o1_cutStr(OpFuncParams ¶ms) { pos = _vm->_game->_script->readValExpr(); size = _vm->_game->_script->readValExpr(); _vm->_util->cutFromStr(GET_VARO_STR(strVar), pos, size); - return false; } -bool Inter_v1::o1_strstr(OpFuncParams ¶ms) { +void Inter_v1::o1_strstr(OpFuncParams ¶ms) { int16 strVar; int16 resVar; int16 pos; @@ -1695,10 +1648,9 @@ bool Inter_v1::o1_strstr(OpFuncParams ¶ms) { char *res = strstr(GET_VARO_STR(strVar), _vm->_game->_script->getResultStr()); pos = res ? (res - (GET_VARO_STR(strVar))) : -1; WRITE_VAR_OFFSET(resVar, pos); - return false; } -bool Inter_v1::o1_istrlen(OpFuncParams ¶ms) { +void Inter_v1::o1_istrlen(OpFuncParams ¶ms) { int16 len; int16 strVar; @@ -1707,10 +1659,9 @@ bool Inter_v1::o1_istrlen(OpFuncParams ¶ms) { strVar = _vm->_game->_script->readVarIndex(); WRITE_VAR_OFFSET(strVar, len); - return false; } -bool Inter_v1::o1_setMousePos(OpFuncParams ¶ms) { +void Inter_v1::o1_setMousePos(OpFuncParams ¶ms) { _vm->_global->_inter_mouseX = _vm->_game->_script->readValExpr(); _vm->_global->_inter_mouseY = _vm->_game->_script->readValExpr(); _vm->_global->_inter_mouseX -= _vm->_video->_scrollOffsetX; @@ -1718,60 +1669,52 @@ bool Inter_v1::o1_setMousePos(OpFuncParams ¶ms) { if (_vm->_global->_useMouse != 0) _vm->_util->setMousePos(_vm->_global->_inter_mouseX, _vm->_global->_inter_mouseY); - return false; } -bool Inter_v1::o1_setFrameRate(OpFuncParams ¶ms) { +void Inter_v1::o1_setFrameRate(OpFuncParams ¶ms) { _vm->_util->setFrameRate(_vm->_game->_script->readValExpr()); - return false; } -bool Inter_v1::o1_animatePalette(OpFuncParams ¶ms) { +void Inter_v1::o1_animatePalette(OpFuncParams ¶ms) { _vm->_draw->blitInvalidated(); _vm->_util->waitEndFrame(); animPalette(); storeKey(_vm->_game->checkKeys(&_vm->_global->_inter_mouseX, &_vm->_global->_inter_mouseY, &_vm->_game->_mouseButtons, 0)); - return false; } -bool Inter_v1::o1_animateCursor(OpFuncParams ¶ms) { +void Inter_v1::o1_animateCursor(OpFuncParams ¶ms) { _vm->_draw->animateCursor(1); - return false; } -bool Inter_v1::o1_blitCursor(OpFuncParams ¶ms) { +void Inter_v1::o1_blitCursor(OpFuncParams ¶ms) { _vm->_draw->blitCursor(); - return false; } -bool Inter_v1::o1_loadFont(OpFuncParams ¶ms) { +void Inter_v1::o1_loadFont(OpFuncParams ¶ms) { _vm->_game->_script->evalExpr(0); uint16 index = _vm->_game->_script->readInt16(); _vm->_draw->animateCursor(4); _vm->_draw->loadFont(index, _vm->_game->_script->getResultStr()); - - return false; } -bool Inter_v1::o1_freeFont(OpFuncParams ¶ms) { +void Inter_v1::o1_freeFont(OpFuncParams ¶ms) { int16 index; index = _vm->_game->_script->readInt16(); if (index >= Draw::kFontCount) { warning("o1_freeFont(): Index %d > count %d", index, Draw::kFontCount); - return false; + return; } delete _vm->_draw->_fonts[index]; _vm->_draw->_fonts[index] = 0; - return false; } -bool Inter_v1::o1_readData(OpFuncParams ¶ms) { +void Inter_v1::o1_readData(OpFuncParams ¶ms) { int16 retSize; int16 size; int16 dataVar; @@ -1787,7 +1730,7 @@ bool Inter_v1::o1_readData(OpFuncParams ¶ms) { Common::SeekableReadStream *stream = _vm->_dataIO->getFile(_vm->_game->_script->getResultStr()); if (!stream) - return false; + return; _vm->_draw->animateCursor(4); if (offset < 0) @@ -1804,11 +1747,9 @@ bool Inter_v1::o1_readData(OpFuncParams ¶ms) { WRITE_VAR(1, 0); delete stream; - - return false; } -bool Inter_v1::o1_writeData(OpFuncParams ¶ms) { +void Inter_v1::o1_writeData(OpFuncParams ¶ms) { int16 offset; int16 size; int16 dataVar; @@ -1824,18 +1765,15 @@ bool Inter_v1::o1_writeData(OpFuncParams ¶ms) { warning("Attempted to write to file \"%s\"", _vm->_game->_script->getResultStr()); WRITE_VAR(1, 0); - - return false; } -bool Inter_v1::o1_manageDataFile(OpFuncParams ¶ms) { +void Inter_v1::o1_manageDataFile(OpFuncParams ¶ms) { _vm->_game->_script->evalExpr(0); if (_vm->_game->_script->getResultStr()[0] != 0) _vm->_dataIO->openArchive(_vm->_game->_script->getResultStr(), true); else _vm->_dataIO->closeArchive(true); - return false; } void Inter_v1::o1_setState(OpGobParams ¶ms) { diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp index 7e47e9f4f9..3cdde460b8 100644 --- a/engines/gob/inter_v2.cpp +++ b/engines/gob/inter_v2.cpp @@ -1037,7 +1037,7 @@ void Inter_v2::o2_setImdFrontSurf() { void Inter_v2::o2_resetImdFrontSurf() { } -bool Inter_v2::o2_assign(OpFuncParams ¶ms) { +void Inter_v2::o2_assign(OpFuncParams ¶ms) { byte destType = _vm->_game->_script->peekByte(); int16 dest = _vm->_game->_script->readVarIndex(); @@ -1081,11 +1081,9 @@ bool Inter_v2::o2_assign(OpFuncParams ¶ms) { break; } } - - return false; } -bool Inter_v2::o2_printText(OpFuncParams ¶ms) { +void Inter_v2::o2_printText(OpFuncParams ¶ms) { char buf[60]; int i; @@ -1153,11 +1151,9 @@ bool Inter_v2::o2_printText(OpFuncParams ¶ms) { } while (_vm->_game->_script->peekByte() != 200); _vm->_game->_script->skip(1); - - return false; } -bool Inter_v2::o2_animPalInit(OpFuncParams ¶ms) { +void Inter_v2::o2_animPalInit(OpFuncParams ¶ms) { int16 index; index = _vm->_game->_script->readInt16(); @@ -1176,10 +1172,9 @@ bool Inter_v2::o2_animPalInit(OpFuncParams ¶ms) { _animPalHighIndex[index] = _vm->_game->_script->readValExpr(); _animPalDir[index] = -1; } - return false; } -bool Inter_v2::o2_addHotspot(OpFuncParams ¶ms) { +void Inter_v2::o2_addHotspot(OpFuncParams ¶ms) { int16 id = _vm->_game->_script->readValExpr(); uint16 funcPos = _vm->_game->_script->pos(); int16 left = _vm->_game->_script->readValExpr(); @@ -1209,11 +1204,9 @@ bool Inter_v2::o2_addHotspot(OpFuncParams ¶ms) { else index = _vm->_game->_hotspots->add(0xE000 + id, left, top, left + width - 1, top + height - 1, flags, key, 0, 0, funcPos); - - return false; } -bool Inter_v2::o2_removeHotspot(OpFuncParams ¶ms) { +void Inter_v2::o2_removeHotspot(OpFuncParams ¶ms) { int16 id = _vm->_game->_script->readValExpr(); uint8 stateType1 = Hotspots::kStateFilledDisabled | Hotspots::kStateType1; uint8 stateType2 = Hotspots::kStateFilledDisabled | Hotspots::kStateType2; @@ -1224,11 +1217,9 @@ bool Inter_v2::o2_removeHotspot(OpFuncParams ¶ms) { _vm->_game->_hotspots->removeState(stateType2); else _vm->_game->_hotspots->remove((stateType2 << 12) + id); - - return false; } -bool Inter_v2::o2_goblinFunc(OpFuncParams ¶ms) { +void Inter_v2::o2_goblinFunc(OpFuncParams ¶ms) { OpGobParams gobParams; int16 cmd; @@ -1239,10 +1230,9 @@ bool Inter_v2::o2_goblinFunc(OpFuncParams ¶ms) { if (cmd != 101) executeOpcodeGob(cmd, gobParams); - return false; } -bool Inter_v2::o2_stopSound(OpFuncParams ¶ms) { +void Inter_v2::o2_stopSound(OpFuncParams ¶ms) { int16 expr; expr = _vm->_game->_script->readValExpr(); @@ -1253,15 +1243,13 @@ bool Inter_v2::o2_stopSound(OpFuncParams ¶ms) { _vm->_sound->blasterStop(expr); _soundEndTimeKey = 0; - return false; } -bool Inter_v2::o2_loadSound(OpFuncParams ¶ms) { +void Inter_v2::o2_loadSound(OpFuncParams ¶ms) { loadSound(0); - return false; } -bool Inter_v2::o2_getFreeMem(OpFuncParams ¶ms) { +void Inter_v2::o2_getFreeMem(OpFuncParams ¶ms) { uint16 freeVar; uint16 maxFreeVar; @@ -1272,10 +1260,9 @@ bool Inter_v2::o2_getFreeMem(OpFuncParams ¶ms) { WRITE_VAR_OFFSET(freeVar , 1000000); WRITE_VAR_OFFSET(maxFreeVar, 1000000); WRITE_VAR(16, _vm->_game->_script->getVariablesCount() * 4); - return false; } -bool Inter_v2::o2_checkData(OpFuncParams ¶ms) { +void Inter_v2::o2_checkData(OpFuncParams ¶ms) { int16 varOff; int32 size; SaveLoad::SaveMode mode; @@ -1309,11 +1296,9 @@ bool Inter_v2::o2_checkData(OpFuncParams ¶ms) { WRITE_VAR_OFFSET(varOff, (size == -1) ? -1 : 50); WRITE_VAR(16, (uint32) size); - - return false; } -bool Inter_v2::o2_readData(OpFuncParams ¶ms) { +void Inter_v2::o2_readData(OpFuncParams ¶ms) { int32 retSize; int32 size; int32 offset; @@ -1346,15 +1331,15 @@ bool Inter_v2::o2_readData(OpFuncParams ¶ms) { } else WRITE_VAR(1, 0); - return false; + return; } else if (mode == SaveLoad::kSaveModeIgnore) - return false; + return; if (size < 0) { warning("Attempted to read a raw sprite from file \"%s\"", file); - return false ; + return; } else if (size == 0) { dataVar = 0; size = _vm->_game->_script->getVariablesCount() * 4; @@ -1364,13 +1349,13 @@ bool Inter_v2::o2_readData(OpFuncParams ¶ms) { if (file[0] == 0) { WRITE_VAR(1, size); - return false; + return; } WRITE_VAR(1, 1); Common::SeekableReadStream *stream = _vm->_dataIO->getFile(file); if (!stream) - return false; + return; _vm->_draw->animateCursor(4); if (offset < 0) @@ -1391,10 +1376,9 @@ bool Inter_v2::o2_readData(OpFuncParams ¶ms) { WRITE_VAR(1, 0); delete stream; - return false; } -bool Inter_v2::o2_writeData(OpFuncParams ¶ms) { +void Inter_v2::o2_writeData(OpFuncParams ¶ms) { int32 offset; int32 size; int16 dataVar; @@ -1425,11 +1409,9 @@ bool Inter_v2::o2_writeData(OpFuncParams ¶ms) { WRITE_VAR(1, 0); } else if (mode == SaveLoad::kSaveModeIgnore) - return false; + return; else if (mode == SaveLoad::kSaveModeNone) warning("Attempted to write to file \"%s\"", file); - - return false; } void Inter_v2::o2_loadInfogramesIns(OpGobParams ¶ms) { diff --git a/engines/gob/inter_v3.cpp b/engines/gob/inter_v3.cpp index 10ed23619d..8a5a839244 100644 --- a/engines/gob/inter_v3.cpp +++ b/engines/gob/inter_v3.cpp @@ -66,7 +66,7 @@ void Inter_v3::setupOpcodesGob() { OPCODEGOB(100, o3_wobble); } -bool Inter_v3::o3_getTotTextItemPart(OpFuncParams ¶ms) { +void Inter_v3::o3_getTotTextItemPart(OpFuncParams ¶ms) { byte *totData; int16 totTextItem; int16 part, curPart = 0; @@ -89,7 +89,7 @@ bool Inter_v3::o3_getTotTextItemPart(OpFuncParams ¶ms) { TextItem *textItem = _vm->_game->_resources->getTextItem(totTextItem); if (!textItem) - return false; + return; totData = textItem->getData(); @@ -143,7 +143,7 @@ bool Inter_v3::o3_getTotTextItemPart(OpFuncParams ¶ms) { (*totData == 6) || (*totData == 7)) { WRITE_VARO_UINT8(stringVar, 0); delete textItem; - return false; + return; } switch (*totData) { @@ -177,7 +177,7 @@ bool Inter_v3::o3_getTotTextItemPart(OpFuncParams ¶ms) { totData - _vm->_game->_resources->getTexts()); WRITE_VARO_UINT8(stringVar + 6, 0); delete textItem; - return false; + return; } end = false; @@ -224,7 +224,7 @@ bool Inter_v3::o3_getTotTextItemPart(OpFuncParams ¶ms) { if (curPart == part) { delete textItem; - return false; + return; } stringVar = stringStartVar; @@ -246,16 +246,14 @@ bool Inter_v3::o3_getTotTextItemPart(OpFuncParams ¶ms) { } delete textItem; - return false; } -bool Inter_v3::o3_copySprite(OpFuncParams ¶ms) { +void Inter_v3::o3_copySprite(OpFuncParams ¶ms) { o1_copySprite(params); // For the close-up "fading" in the CD version if (_vm->_draw->_destSurface == Draw::kFrontSurface) _vm->_video->sparseRetrace(Draw::kFrontSurface); - return false; } void Inter_v3::o3_wobble(OpGobParams ¶ms) { diff --git a/engines/gob/inter_v5.cpp b/engines/gob/inter_v5.cpp index 23164cea99..b2f4d76c1a 100644 --- a/engines/gob/inter_v5.cpp +++ b/engines/gob/inter_v5.cpp @@ -219,7 +219,7 @@ void Inter_v5::o5_initScreen() { } } -bool Inter_v5::o5_istrlen(OpFuncParams ¶ms) { +void Inter_v5::o5_istrlen(OpFuncParams ¶ms) { int16 strVar1, strVar2; int16 len; uint16 type; @@ -249,8 +249,6 @@ bool Inter_v5::o5_istrlen(OpFuncParams ¶ms) { } writeVar(strVar2, type, (int32) len); - - return false; } void Inter_v5::o5_spaceShooter(OpGobParams ¶ms) { diff --git a/engines/gob/inter_v6.cpp b/engines/gob/inter_v6.cpp index 0fc0cb6bba..72cf8b5ae2 100644 --- a/engines/gob/inter_v6.cpp +++ b/engines/gob/inter_v6.cpp @@ -204,7 +204,7 @@ void Inter_v6::o6_playVmdOrMusic() { } -bool Inter_v6::o6_loadCursor(OpFuncParams ¶ms) { +void Inter_v6::o6_loadCursor(OpFuncParams ¶ms) { int16 id = _vm->_game->_script->readInt16(); if ((id == -1) || (id == -2)) { @@ -228,7 +228,7 @@ bool Inter_v6::o6_loadCursor(OpFuncParams ¶ms) { int vmdSlot = _vm->_vidPlayer->openVideo(false, file, props); if (vmdSlot == -1) { warning("Can't open video \"%s\" as cursor", file); - return false; + return; } int16 framesCount = _vm->_vidPlayer->getFrameCount(vmdSlot); @@ -250,17 +250,17 @@ bool Inter_v6::o6_loadCursor(OpFuncParams ¶ms) { _vm->_draw->_cursorAnimHigh[index] = framesCount + start - 1; _vm->_draw->_cursorAnimDelays[index] = 10; - return false; + return; } int8 index = _vm->_game->_script->readInt8(); if ((index * _vm->_draw->_cursorWidth) >= _vm->_draw->_cursorSprites->getWidth()) - return false; + return; Resource *resource = _vm->_game->_resources->getResource((uint16) id); if (!resource) - return false; + return; _vm->_draw->_cursorSprites->fillRect(index * _vm->_draw->_cursorWidth, 0, index * _vm->_draw->_cursorWidth + _vm->_draw->_cursorWidth - 1, @@ -272,10 +272,9 @@ bool Inter_v6::o6_loadCursor(OpFuncParams ¶ms) { _vm->_draw->_cursorAnimLow[index] = 0; delete resource; - return false; } -bool Inter_v6::o6_assign(OpFuncParams ¶ms) { +void Inter_v6::o6_assign(OpFuncParams ¶ms) { uint16 size, destType; uint16 dest = _vm->_game->_script->readVarIndex(&size, &destType); @@ -293,7 +292,7 @@ bool Inter_v6::o6_assign(OpFuncParams ¶ms) { _vm->_game->_script->evalExpr(&src); - return false; + return; } byte loopCount; @@ -310,7 +309,7 @@ bool Inter_v6::o6_assign(OpFuncParams ¶ms) { dest += n; } - return false; + return; } else if (_vm->_game->_script->peekByte() == 99) { _vm->_game->_script->skip(1); @@ -351,11 +350,9 @@ bool Inter_v6::o6_assign(OpFuncParams ¶ms) { break; } } - - return false; } -bool Inter_v6::o6_removeHotspot(OpFuncParams ¶ms) { +void Inter_v6::o6_removeHotspot(OpFuncParams ¶ms) { int16 id; uint8 stateType1 = Hotspots::kStateFilledDisabled | Hotspots::kStateType1; uint8 stateType2 = Hotspots::kStateFilledDisabled | Hotspots::kStateType2; @@ -384,11 +381,9 @@ bool Inter_v6::o6_removeHotspot(OpFuncParams ¶ms) { _vm->_game->_hotspots->remove((stateType2 << 12) + id); break; } - - return false; } -bool Inter_v6::o6_fillRect(OpFuncParams ¶ms) { +void Inter_v6::o6_fillRect(OpFuncParams ¶ms) { int16 destSurf; _vm->_draw->_destSurface = destSurf = _vm->_game->_script->readInt16(); @@ -418,14 +413,13 @@ bool Inter_v6::o6_fillRect(OpFuncParams ¶ms) { if (destSurf & 0x80) { warning("Urban Stub: o6_fillRect(), destSurf & 0x80"); - return false; + return; } if (!_vm->_draw->_spritesArray[(destSurf > 100) ? (destSurf - 80) : destSurf]) - return false; + return; _vm->_draw->spriteOperation(DRAW_FILLRECT); - return false; } void Inter_v6::probe16bitMusic(char *fileName) { |