From 4e70129d6033f2d9e4c7ec3d6806de66a61ad5c1 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Sun, 5 Jul 2009 11:28:57 +0000 Subject: Merging Game_v1's and Game_v2's prepareStart() svn-id: r42127 --- engines/gob/draw_v1.cpp | 6 ++++++ engines/gob/game.cpp | 36 ++++++++++++++++++++++++++++++++++++ engines/gob/game.h | 8 ++------ engines/gob/game_v1.cpp | 42 ------------------------------------------ engines/gob/game_v2.cpp | 36 ------------------------------------ engines/gob/game_v6.cpp | 2 +- 6 files changed, 45 insertions(+), 85 deletions(-) (limited to 'engines') diff --git a/engines/gob/draw_v1.cpp b/engines/gob/draw_v1.cpp index 625b738b8a..91f2a45637 100644 --- a/engines/gob/draw_v1.cpp +++ b/engines/gob/draw_v1.cpp @@ -45,6 +45,12 @@ Draw_v1::Draw_v1(GobEngine *vm) : Draw(vm) { void Draw_v1::initScreen() { _backSurface = _vm->_video->initSurfDesc(_vm->_global->_videoMode, 320, 200, 0); + _frontSurface = _vm->_global->_primarySurfDesc; + + _cursorSprites = + _vm->_video->initSurfDesc(_vm->_global->_videoMode, 32, 16, 2); + _scummvmCursor = + _vm->_video->initSurfDesc(_vm->_global->_videoMode, 16, 16, SCUMMVM_CURSOR); } void Draw_v1::closeScreen() { diff --git a/engines/gob/game.cpp b/engines/gob/game.cpp index b75726cc75..d8db743450 100644 --- a/engines/gob/game.cpp +++ b/engines/gob/game.cpp @@ -205,6 +205,42 @@ Game::~Game() { delete _hotspots; } +void Game::prepareStart() { + _vm->_global->_pPaletteDesc->unused2 = _vm->_draw->_unusedPalette2; + _vm->_global->_pPaletteDesc->unused1 = _vm->_draw->_unusedPalette1; + _vm->_global->_pPaletteDesc->vgaPal = _vm->_draw->_vgaPalette; + + _vm->_video->setFullPalette(_vm->_global->_pPaletteDesc); + + _vm->_draw->initScreen(); + _vm->_video->fillRect(*_vm->_draw->_frontSurface, 0, 0, + _vm->_video->_surfWidth - 1, _vm->_video->_surfHeight - 1, 1); + + _vm->_util->setMousePos(152, 92); + _vm->_draw->_cursorX = _vm->_global->_inter_mouseX = 152; + _vm->_draw->_cursorY = _vm->_global->_inter_mouseY = 92; + + _vm->_draw->_invalidatedCount = 0; + _vm->_draw->_noInvalidated = true; + _vm->_draw->_applyPal = false; + _vm->_draw->_paletteCleared = false; + _vm->_draw->_cursorWidth = 16; + _vm->_draw->_cursorHeight = 16; + _vm->_draw->_transparentCursor = 1; + + for (int i = 0; i < 40; i++) { + _vm->_draw->_cursorAnimLow[i] = -1; + _vm->_draw->_cursorAnimDelays[i] = 0; + _vm->_draw->_cursorAnimHigh[i] = 0; + } + + _vm->_draw->_renderFlags = 0; + _vm->_draw->_backDeltaX = 0; + _vm->_draw->_backDeltaY = 0; + + _startTimeKey = _vm->_util->getTimeKey(); +} + void Game::capturePush(int16 left, int16 top, int16 width, int16 height) { int16 right; diff --git a/engines/gob/game.h b/engines/gob/game.h index c6c7bd76d9..2c2c89a490 100644 --- a/engines/gob/game.h +++ b/engines/gob/game.h @@ -92,6 +92,8 @@ public: Game(GobEngine *vm); virtual ~Game(); + virtual void prepareStart(); + void capturePush(int16 left, int16 top, int16 width, int16 height); void capturePop(char doDraw); @@ -108,8 +110,6 @@ public: virtual void playTot(int16 skipPlay) = 0; - virtual void prepareStart(void) = 0; - protected: uint32 _menuLevel; @@ -135,8 +135,6 @@ public: virtual ~Game_v1() {} virtual void playTot(int16 skipPlay); - - virtual void prepareStart(void); }; class Game_v2 : public Game_v1 { @@ -145,8 +143,6 @@ public: virtual ~Game_v2() {} virtual void playTot(int16 skipPlay); - - virtual void prepareStart(void); }; class Game_v6 : public Game_v2 { diff --git a/engines/gob/game_v1.cpp b/engines/gob/game_v1.cpp index 5948a21b9c..936311a986 100644 --- a/engines/gob/game_v1.cpp +++ b/engines/gob/game_v1.cpp @@ -160,46 +160,4 @@ void Game_v1::playTot(int16 skipPlay) { _script->pop(); } -void Game_v1::prepareStart(void) { - _vm->_global->_pPaletteDesc->unused2 = _vm->_draw->_unusedPalette2; - _vm->_global->_pPaletteDesc->unused1 = _vm->_draw->_unusedPalette1; - _vm->_global->_pPaletteDesc->vgaPal = _vm->_draw->_vgaPalette; - - _vm->_video->setFullPalette(_vm->_global->_pPaletteDesc); - - _vm->_draw->initScreen(); - _vm->_video->fillRect(*_vm->_draw->_backSurface, 0, 0, 319, 199, 1); - _vm->_draw->_frontSurface = _vm->_global->_primarySurfDesc; - _vm->_video->fillRect(*_vm->_draw->_frontSurface, 0, 0, 319, 199, 1); - - _vm->_util->setMousePos(152, 92); - _vm->_draw->_cursorX = _vm->_global->_inter_mouseX = 152; - _vm->_draw->_cursorY = _vm->_global->_inter_mouseY = 92; - - _vm->_draw->_invalidatedCount = 0; - _vm->_draw->_noInvalidated = true; - _vm->_draw->_applyPal = false; - _vm->_draw->_paletteCleared = false; - _vm->_draw->_cursorWidth = 16; - _vm->_draw->_cursorHeight = 16; - _vm->_draw->_transparentCursor = 1; - - for (int i = 0; i < 40; i++) { - _vm->_draw->_cursorAnimLow[i] = -1; - _vm->_draw->_cursorAnimDelays[i] = 0; - _vm->_draw->_cursorAnimHigh[i] = 0; - } - - _vm->_draw->_cursorAnimLow[1] = 0; - _vm->_draw->_cursorSprites = - _vm->_video->initSurfDesc(_vm->_global->_videoMode, 32, 16, 2); - _vm->_draw->_scummvmCursor = - _vm->_video->initSurfDesc(_vm->_global->_videoMode, 16, 16, SCUMMVM_CURSOR); - _vm->_draw->_renderFlags = 0; - _vm->_draw->_backDeltaX = 0; - _vm->_draw->_backDeltaY = 0; - - _startTimeKey = _vm->_util->getTimeKey(); -} - } // End of namespace Gob diff --git a/engines/gob/game_v2.cpp b/engines/gob/game_v2.cpp index 9cc4da3cc9..725a66e4d6 100644 --- a/engines/gob/game_v2.cpp +++ b/engines/gob/game_v2.cpp @@ -179,40 +179,4 @@ void Game_v2::playTot(int16 skipPlay) { _script->pop(); } -void Game_v2::prepareStart(void) { - _vm->_global->_pPaletteDesc->unused2 = _vm->_draw->_unusedPalette2; - _vm->_global->_pPaletteDesc->unused1 = _vm->_draw->_unusedPalette1; - _vm->_global->_pPaletteDesc->vgaPal = _vm->_draw->_vgaPalette; - - _vm->_video->setFullPalette(_vm->_global->_pPaletteDesc); - - _vm->_draw->initScreen(); - _vm->_video->fillRect(*_vm->_draw->_frontSurface, 0, 0, - _vm->_video->_surfWidth - 1, _vm->_video->_surfHeight - 1, 1); - - _vm->_util->setMousePos(152, 92); - _vm->_draw->_cursorX = _vm->_global->_inter_mouseX = 152; - _vm->_draw->_cursorY = _vm->_global->_inter_mouseY = 92; - - _vm->_draw->_invalidatedCount = 0; - _vm->_draw->_noInvalidated = true; - _vm->_draw->_applyPal = false; - _vm->_draw->_paletteCleared = false; - _vm->_draw->_cursorWidth = 16; - _vm->_draw->_cursorHeight = 16; - _vm->_draw->_transparentCursor = 1; - - for (int i = 0; i < 40; i++) { - _vm->_draw->_cursorAnimLow[i] = -1; - _vm->_draw->_cursorAnimDelays[i] = 0; - _vm->_draw->_cursorAnimHigh[i] = 0; - } - - _vm->_draw->_renderFlags = 0; - _vm->_draw->_backDeltaX = 0; - _vm->_draw->_backDeltaY = 0; - - _startTimeKey = _vm->_util->getTimeKey(); -} - } // End of namespace Gob diff --git a/engines/gob/game_v6.cpp b/engines/gob/game_v6.cpp index 95e8ddf930..4881772aed 100644 --- a/engines/gob/game_v6.cpp +++ b/engines/gob/game_v6.cpp @@ -107,7 +107,7 @@ void Game_v6::prepareStart(void) { _noCd = true; } - Game_v2::prepareStart(); + Game::prepareStart(); } } // End of namespace Gob -- cgit v1.2.3