diff options
author | Denis Kasak | 2009-07-04 18:35:08 +0000 |
---|---|---|
committer | Denis Kasak | 2009-07-04 18:35:08 +0000 |
commit | b96b4344468f1ba4214574bc1854e47f62501e76 (patch) | |
tree | 6ea1898f6d30809878f085323a7fbfdd2a66c7fc | |
parent | a06509f3c255b89c322975fcfcc620735789122b (diff) | |
download | scummvm-rg350-b96b4344468f1ba4214574bc1854e47f62501e76.tar.gz scummvm-rg350-b96b4344468f1ba4214574bc1854e47f62501e76.tar.bz2 scummvm-rg350-b96b4344468f1ba4214574bc1854e47f62501e76.zip |
* Added Game::init() and moved some functionality from Game::Game to it (loading objects, changing rooms)
* Made Game::load*(), Game::getObject() and Game::changeRoom() methods public
* Stopped specifying Z coordinate when creating some Sprites (which I forgot in my previous commit)
svn-id: r42101
-rw-r--r-- | engines/draci/draci.cpp | 4 | ||||
-rw-r--r-- | engines/draci/game.cpp | 6 | ||||
-rw-r--r-- | engines/draci/game.h | 20 | ||||
-rw-r--r-- | engines/draci/mouse.cpp | 2 |
4 files changed, 18 insertions, 14 deletions
diff --git a/engines/draci/draci.cpp b/engines/draci/draci.cpp index 429db7e62d..cd9c3eeaed 100644 --- a/engines/draci/draci.cpp +++ b/engines/draci/draci.cpp @@ -92,8 +92,6 @@ int DraciEngine::init() { _script = new Script(this); _game = new Game(this); - - // Load default font _font->setFont(kFontBig); @@ -139,6 +137,8 @@ int DraciEngine::go() { debugC(2, kDraciGeneralDebugLevel, "Running graphics/animation test..."); + _game->init(); + _mouse->setCursorType(kNormalCursor); _mouse->cursorOn(); diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp index 05cc0e6636..be29cf9fda 100644 --- a/engines/draci/game.cpp +++ b/engines/draci/game.cpp @@ -131,7 +131,9 @@ Game::Game(DraciEngine *vm) : _vm(vm) { assert(numPersons == _info->_numPersons); assert(numVariables == _info->_numVariables); assert(numObjects == _info->_numObjects); +} +void Game::init() { loadObject(0); _vm->_script->run(getObject(0)->_program, getObject(0)->_init); @@ -202,7 +204,7 @@ int Game::loadAnimation(uint animNum) { BAFile *spriteFile = _vm->_spritesArchive->getFile(spriteNum); - Sprite *sp = new Sprite(spriteFile->_data, spriteFile->_length, x, y, 1, true); + Sprite *sp = new Sprite(spriteFile->_data, spriteFile->_length, x, y, true); if (mirror) sp->setMirrorOn(); @@ -275,7 +277,7 @@ void Game::loadOverlays() { z = overlayReader.readByte(); overlayFile = _vm->_overlaysArchive->getFile(num); - Sprite *sp = new Sprite(overlayFile->_data, overlayFile->_length, x, y, z, true); + Sprite *sp = new Sprite(overlayFile->_data, overlayFile->_length, x, y, true); _vm->_anims->addOverlay(sp, z); } diff --git a/engines/draci/game.h b/engines/draci/game.h index 1de27d40d0..8f02dd579a 100644 --- a/engines/draci/game.h +++ b/engines/draci/game.h @@ -99,6 +99,17 @@ public: Game(DraciEngine *vm); ~Game(); + void init(); + + void changeRoom(uint roomNum); + + void loadRoom(uint roomNum); + int loadAnimation(uint animNum); + void loadOverlays(); + void loadObject(uint numObj); + + GameObject *getObject(uint objNum); + private: DraciEngine *_vm; @@ -109,15 +120,6 @@ private: byte *_itemStatus; GameObject *_objects; Room _currentRoom; - - void loadRoom(uint roomNum); - int loadAnimation(uint animNum); - void loadOverlays(); - void loadObject(uint numObj); - - GameObject *getObject(uint objNum); - - void changeRoom(uint roomNum); }; } // End of namespace Draci diff --git a/engines/draci/mouse.cpp b/engines/draci/mouse.cpp index b4c0aea542..b342487209 100644 --- a/engines/draci/mouse.cpp +++ b/engines/draci/mouse.cpp @@ -96,7 +96,7 @@ void Mouse::setCursorType(CursorType cur) { return; } - Sprite sp(f->_data, f->_length, 0, 0, 0); + Sprite sp(f->_data, f->_length, 0, 0, true); CursorMan.replaceCursorPalette(_vm->_screen->getPalette(), 0, kNumColours); CursorMan.replaceCursor(sp.getBuffer(), sp.getWidth(), sp.getHeight(), sp.getWidth() / 2, sp.getHeight() / 2); |