diff options
author | Filippos Karapetis | 2009-05-10 14:04:56 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-05-10 14:04:56 +0000 |
commit | d34d5f56b6a025e305c190e34a0713e4c6399b8f (patch) | |
tree | 337c6b0b4f8fc3afa325b613e61726cd0177f11a /engines | |
parent | 53f24f3e43f78e974367dfe2c87951e7d2589689 (diff) | |
download | scummvm-rg350-d34d5f56b6a025e305c190e34a0713e4c6399b8f.tar.gz scummvm-rg350-d34d5f56b6a025e305c190e34a0713e4c6399b8f.tar.bz2 scummvm-rg350-d34d5f56b6a025e305c190e34a0713e4c6399b8f.zip |
Cleanup
svn-id: r40422
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/message.cpp | 23 | ||||
-rw-r--r-- | engines/sci/engine/message.h | 4 |
2 files changed, 7 insertions, 20 deletions
diff --git a/engines/sci/engine/message.cpp b/engines/sci/engine/message.cpp index 2bed850a31..f8e69e16b3 100644 --- a/engines/sci/engine/message.cpp +++ b/engines/sci/engine/message.cpp @@ -34,18 +34,6 @@ void MessageState::initIndexRecordCursor() { _engineCursor.index = 1; } -void MessageState::setVersion(int version) { - _version = version; - - if (version == 2101) { - _headerSize = 6; - _indexRecordSize = 4; - } else { - _headerSize = 10; - _indexRecordSize = 11; - } -} - void MessageState::parse(IndexRecordCursor *cursor, MessageTuple *t) { t->noun = *(cursor->index_record + 0); t->verb = *(cursor->index_record + 1); @@ -81,7 +69,7 @@ int MessageState::getSpecific(MessageTuple *t) { int MessageState::getNext() { if (_engineCursor.index == _recordCount) return 0; - _engineCursor.index_record += _indexRecordSize; + _engineCursor.index_record += ((_version == 2101) ? 4 : 11); _engineCursor.index ++; return 1; } @@ -122,12 +110,13 @@ int MessageState::loadRes(int module) { return 0; } - if (_version == 2101) + if (_version == 2101) { _recordCount = READ_LE_UINT16(_currentResource->data + 4); - else + _indexRecords = _currentResource->data + 6; + } else { _recordCount = READ_LE_UINT16(_currentResource->data + 8); - - _indexRecords = _currentResource->data + _headerSize; + _indexRecords = _currentResource->data + 10; + } initIndexRecordCursor(); return 1; diff --git a/engines/sci/engine/message.h b/engines/sci/engine/message.h index c125d1b898..788330368c 100644 --- a/engines/sci/engine/message.h +++ b/engines/sci/engine/message.h @@ -59,7 +59,7 @@ public: int loadRes(int module); int isInitialized() { return _initialized; } void initialize(ResourceManager *resmgr); - void setVersion(int version); + void setVersion(int version) { _version = version; } private: void initIndexRecordCursor(); @@ -73,8 +73,6 @@ private: byte *_indexRecords; IndexRecordCursor _engineCursor; int _version; - int _headerSize; - int _indexRecordSize; }; void message_state_initialize(ResourceManager *resmgr, MessageState *state); |