diff options
-rw-r--r-- | engines/gob/draw.cpp | 33 | ||||
-rw-r--r-- | engines/gob/draw.h | 2 | ||||
-rw-r--r-- | engines/gob/inter.h | 6 | ||||
-rw-r--r-- | engines/gob/inter_fascin.cpp | 74 | ||||
-rw-r--r-- | engines/gob/inter_v1.cpp | 3 |
5 files changed, 27 insertions, 91 deletions
diff --git a/engines/gob/draw.cpp b/engines/gob/draw.cpp index 90877a553b..5a385f5a64 100644 --- a/engines/gob/draw.cpp +++ b/engines/gob/draw.cpp @@ -824,7 +824,7 @@ int16 Draw::handleCurWin() { int8 matchNum = 0; int16 bestMatch = -1; - if ((_vm->_game->_mouseButtons != 1) || ((_vm->_draw->_renderFlags & 128) == 0)) + if ((_vm->_game->_mouseButtons != 1) || ((_renderFlags & 128) == 0)) return 0; for (int i = 0; i < 10; i++) @@ -878,10 +878,10 @@ int16 Draw::handleCurWin() { return 0; } -void Draw::winDecomp(int16 x, int16 y, SurfaceDescPtr bmp) { - // TODO: Implementation to be confirmed (used cut and paste from another part of the code) - Resource *resource; +void Draw::winDecomp(int16 x, int16 y, SurfaceDescPtr destPtr) { + warning("winDecomp %d %d - getResource %d %d %d", x, y, _spriteLeft, _spriteRight, _spriteBottom); + Resource *resource; resource = _vm->_game->_resources->getResource((uint16) _spriteLeft, &_spriteRight, &_spriteBottom); @@ -889,11 +889,7 @@ void Draw::winDecomp(int16 x, int16 y, SurfaceDescPtr bmp) { return; _vm->_video->drawPackedSprite(resource->getData(), - _spriteRight, _spriteBottom, _destSpriteX, _destSpriteY, - _transparency, *_spritesArray[_destSurface]); - - dirtiedRect(_destSurface, _destSpriteX, _destSpriteY, - _destSpriteX + _spriteRight - 1, _destSpriteY + _spriteBottom - 1); + _spriteRight, _spriteBottom, x, y, _transparency, *destPtr); delete resource; return; @@ -1125,9 +1121,11 @@ void Draw::winDraw(int16 fct) { break; case DRAW_DRAWLETTER: // 10 - Display a character - if (_fontToSprite[_fontIndex].sprite == -1) - _vm->_video->drawLetter(_letterToPrint, 0, 0, *_fonts[_fontIndex], _transparency, _frontColor, _backColor, *tempSrf); - else { + if (_fontToSprite[_fontIndex].sprite == -1) { + + if (_letterToPrint) + _vm->_video->drawLetter(_letterToPrint, 0, 0, *_fonts[_fontIndex], _transparency, _frontColor, _backColor, *tempSrf); + } else { int xx, yy, nn; nn = _spritesArray[_fontToSprite[_fontIndex].sprite]->getWidth() / _fontToSprite[_fontIndex].width; yy = ((_letterToPrint - _fontToSprite[_fontIndex].base) / nn) * _fontToSprite[_fontIndex].height; @@ -1240,10 +1238,11 @@ void Draw::winDraw(int16 fct) { break; case DRAW_DRAWLETTER: // 10 - Display a character - if (_fontToSprite[_fontIndex].sprite == -1) - _vm->_video->drawLetter(_letterToPrint, _destSpriteX, _destSpriteY, *_fonts[_fontIndex], _transparency, - _frontColor, _backColor, *_spritesArray[_destSurface]); - else { + if (_fontToSprite[_fontIndex].sprite == -1) { + if (_letterToPrint) + _vm->_video->drawLetter(_letterToPrint, _destSpriteX, _destSpriteY, *_fonts[_fontIndex], _transparency, + _frontColor, _backColor, *_spritesArray[_destSurface]); + } else { int xx, yy, nn; nn = _spritesArray[_fontToSprite[_fontIndex].sprite]->getWidth() / _fontToSprite[_fontIndex].width; yy = ((_letterToPrint - _fontToSprite[_fontIndex].base) / nn) * _fontToSprite[_fontIndex].height; @@ -1282,7 +1281,7 @@ void Draw::winDraw(int16 fct) { int16 Draw::isOverWin(int16 &dx, int16 &dy) { int16 bestMatch = -1; - if ((_vm->_draw->_renderFlags & 128) == 0) + if ((_renderFlags & 128) == 0) return -1; for (int i = 0; i < 10; i++) diff --git a/engines/gob/draw.h b/engines/gob/draw.h index 303c1b818c..68308a416e 100644 --- a/engines/gob/draw.h +++ b/engines/gob/draw.h @@ -190,7 +190,7 @@ public: int16 openWin(int16 id); int16 handleCurWin(); bool winOverlap(int16 idWin1, int16 idWin2); - void winDecomp(int16 x, int16 y, SurfaceDescPtr bmp); + void winDecomp(int16 x, int16 y, SurfaceDescPtr destPtr); void activeWin(int16 id); void closeWin(int16 id); void closeAllWin(); diff --git a/engines/gob/inter.h b/engines/gob/inter.h index a9b6179e48..9eeea29b2a 100644 --- a/engines/gob/inter.h +++ b/engines/gob/inter.h @@ -447,11 +447,9 @@ protected: void oFascin_loadBatt1(OpGobParams ¶ms); void oFascin_loadBatt2(OpGobParams ¶ms); void oFascin_loadBatt3(OpGobParams ¶ms); - void oFascin_geUnknown1000(OpGobParams ¶ms); - void oFascin_geUnknown1001(OpGobParams ¶ms); + void oFascin_loadMod(OpGobParams ¶ms); + void oFascin_playMod(OpGobParams ¶ms); void oFascin_geUnknown1002(OpGobParams ¶ms); -// bool oFascin_feUnknown4(OpFuncParams ¶ms); -// bool oFascin_feUnknown27(OpFuncParams ¶ms); void oFascin_setWinSize(); void oFascin_closeWin(); void oFascin_activeWin(); diff --git a/engines/gob/inter_fascin.cpp b/engines/gob/inter_fascin.cpp index b5d7e6f0ad..8df9c6dff2 100644 --- a/engines/gob/inter_fascin.cpp +++ b/engines/gob/inter_fascin.cpp @@ -86,7 +86,6 @@ void Inter_Fascination::setupOpcodesFunc() { Inter_v2::setupOpcodesFunc(); OPCODEFUNC(0x09, o1_assign); - OPCODEFUNC(0x14, oFascin_keyFunc); OPCODEFUNC(0x32, oFascin_copySprite); } @@ -106,8 +105,8 @@ void Inter_Fascination::setupOpcodesGob() { OPCODEGOB( 11, oFascin_loadBatt2); OPCODEGOB( 12, oFascin_loadBatt3); - OPCODEGOB(1000, oFascin_geUnknown1000); - OPCODEGOB(1001, oFascin_geUnknown1001); //protrackerPlay doesn't play correctly "mod.extasy" + OPCODEGOB(1000, oFascin_loadMod); + OPCODEGOB(1001, oFascin_playMod); //protrackerPlay doesn't play correctly "mod.extasy" OPCODEGOB(1002, oFascin_geUnknown1002); //to be replaced by o2_stopProtracker when protrackerPlay is fixed } @@ -129,56 +128,6 @@ bool Inter_Fascination::oFascin_copySprite(OpFuncParams ¶ms) { return false; } -bool Inter_Fascination::oFascin_keyFunc(OpFuncParams ¶ms) { - static uint32 lastCalled = 0; - int16 cmd; - int16 key; - uint32 now; - - cmd = _vm->_game->_script->readInt16(); - animPalette(); - _vm->_draw->blitInvalidated(); - - now = _vm->_util->getTimeKey(); - if (!_noBusyWait) - if ((now - lastCalled) <= 20) - _vm->_util->longDelay(1); - lastCalled = now; - _noBusyWait = false; - - switch (cmd) { - case 0: - key = _vm->_game->_hotspots->check(0, 0); - storeKey(key); - - _vm->_util->clearKeyBuf(); - break; - - case 1: - key = _vm->_game->checkKeys(&_vm->_global->_inter_mouseX, - &_vm->_global->_inter_mouseY, &_vm->_game->_mouseButtons, 0); - storeKey(key); - break; - - case 2: -// _vm->_util->processInput(true); -// key = _vm->_util->checkKey(); -// WRITE_VAR(0, key); -// _vm->_util->clearKeyBuf(); - _vm->_util->delay(cmd); - break; - - default: - _vm->_util->processInput(true); - key = _vm->_util->checkKey(); - WRITE_VAR(0, key); - _vm->_util->clearKeyBuf(); - break; - } - - return false; -} - void Inter_Fascination::oFascin_playTirb(OpGobParams ¶ms) { warning("funcPlayImd with parameter : 'tirb.imd'"); @@ -246,11 +195,12 @@ void Inter_Fascination::oFascin_loadBatt3(OpGobParams ¶ms) { _vm->_sound->adlibLoadMDY("batt3.mdy"); } -void Inter_Fascination::oFascin_geUnknown1000(OpGobParams ¶ms) { - warning("Fascination Unknown GE Function 1000 - Load MOD music"); +void Inter_Fascination::oFascin_loadMod(OpGobParams ¶ms) { + // Fascination GE Function 1000 - Load MOD music + // Useless as it's included in playMod } -void Inter_Fascination::oFascin_geUnknown1001(OpGobParams ¶ms) { +void Inter_Fascination::oFascin_playMod(OpGobParams ¶ms) { warning("Fascination oFascin_playProtracker - MOD not compatible (sample > 32768), To Be Fixed"); } @@ -258,18 +208,6 @@ void Inter_Fascination::oFascin_geUnknown1002(OpGobParams ¶ms) { warning("Fascination o2_stopProtracker - Commented out"); } -/* -bool Inter_Fascination::oFascin_feUnknown4(OpFuncParams ¶ms) { - warning("Fascination Unknown FE Function 4"); - return true; -} - -bool Inter_Fascination::oFascin_feUnknown27(OpFuncParams ¶ms) { - warning("Fascination Unknown FE Function 27h"); - return true; -} -*/ - void Inter_Fascination::oFascin_setWinSize() { _vm->_draw->_winMaxWidth = _vm->_game->_script->readUint16(); _vm->_draw->_winMaxHeight = _vm->_game->_script->readUint16(); diff --git a/engines/gob/inter_v1.cpp b/engines/gob/inter_v1.cpp index 3dd677ad47..7fedcda4bb 100644 --- a/engines/gob/inter_v1.cpp +++ b/engines/gob/inter_v1.cpp @@ -1212,7 +1212,8 @@ bool Inter_v1::o1_keyFunc(OpFuncParams ¶ms) { break; case 1: - _vm->_util->forceMouseUp(true); + if (_vm->getGameType() != kGameTypeFascination) + _vm->_util->forceMouseUp(true); key = _vm->_game->checkKeys(&_vm->_global->_inter_mouseX, &_vm->_global->_inter_mouseY, &_vm->_game->_mouseButtons, 0); storeKey(key); |