SCI: Inline Script::offsetIsObject()

This commit is contained in:
Miro Kropacek 2023-03-27 19:29:48 +02:00 committed by Eugene Sandulenko
parent 94a80395ef
commit 0a1d1cb29b
2 changed files with 5 additions and 5 deletions

View File

@ -1292,10 +1292,6 @@ Common::Array<reg_t> Script::listObjectReferences() const {
return tmp;
}
bool Script::offsetIsObject(uint32 offset) const {
return _buf->getUint16SEAt(offset + SCRIPT_OBJECT_MAGIC_OFFSET) == SCRIPT_OBJECT_MAGIC_NUMBER;
}
void Script::applySaidWorkarounds() {
// WORKAROUND: SQ3 version 1.018 has a messy vocab problem.
// Sierra added the vocab entry "scout" to this version at group id 0x953

View File

@ -125,7 +125,11 @@ public:
void syncLocalsBlock(SegManager *segMan);
ObjMap &getObjectMap() { return _objects; }
const ObjMap &getObjectMap() const { return _objects; }
bool offsetIsObject(uint32 offset) const;
// speed optimization: inline due to frequent calling
bool offsetIsObject(uint32 offset) const {
return _buf->getUint16SEAt(offset + SCRIPT_OBJECT_MAGIC_OFFSET) == SCRIPT_OBJECT_MAGIC_NUMBER;
}
public:
Script();