Added enum constant for the dragon object (kDragonObject) and made Script::start() a bit more readable.

svn-id: r42236
This commit is contained in:
Denis Kasak 2009-07-07 19:50:12 +00:00
parent c258eefc82
commit fd2ab9e3c0
3 changed files with 8 additions and 2 deletions

View File

@ -134,7 +134,7 @@ Game::Game(DraciEngine *vm) : _vm(vm) {
} }
void Game::init() { void Game::init() {
loadObject(0); loadObject(kDragonObject);
_vm->_script->run(getObject(0)->_program, getObject(0)->_init); _vm->_script->run(getObject(0)->_program, getObject(0)->_init);

View File

@ -35,6 +35,10 @@ namespace Draci {
class DraciEngine; class DraciEngine;
enum {
kDragonObject
};
enum StructSizes { enum StructSizes {
personSize = sizeof(uint16) * 2 + sizeof(byte) personSize = sizeof(uint16) * 2 + sizeof(byte)
}; };

View File

@ -234,8 +234,10 @@ void Script::start(Common::Queue<int> &params) {
int animID = params.pop() - 1; int animID = params.pop() - 1;
GameObject *obj = _vm->_game->getObject(objID); GameObject *obj = _vm->_game->getObject(objID);
bool visible = (objID == kDragonObject || obj->_visible);
if ( ((objID == 0) || (obj->_visible)) && (obj->_location == _vm->_game->getRoomNum())) if (visible && (obj->_location == _vm->_game->getRoomNum()))
_vm->_anims->play(animID); _vm->_anims->play(animID);
} }