* Made Game::_variables private and, instead, added Game::{get,set}Variable() methods.

* Removed obsolete comment about the cyclic field not being used in Game::loadAnimation()

svn-id: r42246
This commit is contained in:
Denis Kasak 2009-07-07 21:30:36 +00:00
parent bab9293f97
commit dd955bb08e
3 changed files with 16 additions and 5 deletions

View File

@ -211,7 +211,9 @@ int Game::loadAnimation(uint animNum, uint z) {
// FIXME: handle these properly
animationReader.readByte(); // Memory logic field, not used
animationReader.readByte(); // Disable erasing field, not used
bool cyclic = animationReader.readByte(); // Cyclic field, not used
bool cyclic = animationReader.readByte();
animationReader.readByte(); // Relative field, not used
Animation *anim = _vm->_anims->addAnimation(animNum, z, false);
@ -339,6 +341,14 @@ int Game::getRoomNum() {
return _currentRoom._roomNum;
}
int Game::getVariable(int numVar) {
return _variables[numVar];
}
void Game::setVariable(int numVar, int value) {
_variables[numVar] = value;
}
Game::~Game() {
delete[] _persons;
delete[] _variables;

View File

@ -129,11 +129,12 @@ public:
GameObject *getObject(uint objNum);
int *_variables;
int getVariable(int varNum);
void setVariable(int varNum, int value);
private:
DraciEngine *_vm;
int *_variables;
GameInfo *_info;
Person *_persons;
uint16 *_dialogOffsets;

View File

@ -303,10 +303,10 @@ int Script::handleMathExpression(Common::MemoryReadStream &reader) {
case kMathVariable:
value = reader.readUint16LE();
stk.push(_vm->_game->_variables[value-1]);
stk.push(_vm->_game->getVariable(value-1));
debugC(3, kDraciBytecodeDebugLevel, "\t\tvariable: %d (%d)", value,
_vm->_game->_variables[value-1]);
_vm->_game->getVariable(value-1));
break;
case kMathFunctionCall: