Added Script methods to get the TOT major and minor version

svn-id: r41788
This commit is contained in:
Sven Hesse 2009-06-23 01:19:03 +00:00
parent 510700b086
commit f6118f7a85
4 changed files with 35 additions and 4 deletions

View file

@ -376,7 +376,10 @@ bool Script::loadTOT(const Common::String &fileName) {
}
}
return (_totData != 0);
if (_totData == 0)
return false;
return getTOTProperties();
}
bool Script::loadLOM(const Common::String &fileName) {
@ -400,6 +403,17 @@ bool Script::loadLOM(const Common::String &fileName) {
return true;
}
bool Script::getTOTProperties() {
// Offset 39-41: Version in "Major.Minor" string form
if (_totData[40] != '.')
return false;
_versionMajor = _totData[39] - '0';
_versionMinor = _totData[41] - '0';
return true;
}
void Script::unload() {
unloadTOT();
}
@ -473,4 +487,12 @@ void Script::call(uint32 offset) {
seek(offset);
}
uint8 Script::getVersionMajor() const {
return _versionMajor;
}
uint8 Script::getVersionMinor() const {
return _versionMinor;
}
} // End of namespace Gob