aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2012-06-15 21:47:22 +0300
committerFilippos Karapetis2012-06-15 22:32:14 +0300
commit160732b2f73a5df173c1fa867f82fa2913ec2236 (patch)
treeef87e73e2d9c1d12c2a7dd32f8b08db663cbc1f5
parent5961609a56a910d81d38389c6ac61d06eca6f029 (diff)
downloadscummvm-rg350-160732b2f73a5df173c1fa867f82fa2913ec2236.tar.gz
scummvm-rg350-160732b2f73a5df173c1fa867f82fa2913ec2236.tar.bz2
scummvm-rg350-160732b2f73a5df173c1fa867f82fa2913ec2236.zip
Revert "SCI: Change Script::getObject() to accept a reg_t"
This reverts commit 577d7e41c9ca2c498dc85e41c373fbdca8d2ed41.
-rw-r--r--engines/sci/engine/kernel.cpp2
-rw-r--r--engines/sci/engine/script.cpp14
-rw-r--r--engines/sci/engine/script.h4
-rw-r--r--engines/sci/engine/seg_manager.cpp2
4 files changed, 11 insertions, 11 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 0266414b26..c99bc4fe47 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -377,7 +377,7 @@ uint16 Kernel::findRegType(reg_t reg) {
if (reg.offset <= (*(Script *)mobj).getBufSize() &&
reg.offset >= -SCRIPT_OBJECT_MAGIC_OFFSET &&
RAW_IS_OBJECT((*(Script *)mobj).getBuf(reg.offset)) ) {
- result |= ((Script *)mobj)->getObject(reg) ? SIG_TYPE_OBJECT : SIG_TYPE_REFERENCE;
+ result |= ((Script *)mobj)->getObject(reg.offset) ? SIG_TYPE_OBJECT : SIG_TYPE_REFERENCE;
} else
result |= SIG_TYPE_REFERENCE;
break;
diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp
index 7714983120..0ed9598b41 100644
--- a/engines/sci/engine/script.cpp
+++ b/engines/sci/engine/script.cpp
@@ -223,16 +223,16 @@ const byte *Script::getSci3ObjectsPointer() {
return ptr;
}
-Object *Script::getObject(reg_t pos) {
- if (_objects.contains(pos.offset))
- return &_objects[pos.offset];
+Object *Script::getObject(uint16 offset) {
+ if (_objects.contains(offset))
+ return &_objects[offset];
else
return 0;
}
-const Object *Script::getObject(reg_t pos) const {
- if (_objects.contains(pos.offset))
- return &_objects[pos.offset];
+const Object *Script::getObject(uint16 offset) const {
+ if (_objects.contains(offset))
+ return &_objects[offset];
else
return 0;
}
@@ -726,7 +726,7 @@ Common::Array<reg_t> Script::listAllDeallocatable(SegmentId segId) const {
Common::Array<reg_t> Script::listAllOutgoingReferences(reg_t addr) const {
Common::Array<reg_t> tmp;
if (addr.offset <= _bufSize && addr.offset >= -SCRIPT_OBJECT_MAGIC_OFFSET && RAW_IS_OBJECT(_buf + addr.offset)) {
- const Object *obj = getObject(addr);
+ const Object *obj = getObject(addr.offset);
if (obj) {
// Note all local variables, if we have a local variable environment
if (_localsSegment)
diff --git a/engines/sci/engine/script.h b/engines/sci/engine/script.h
index 4d23ffbba8..df7f42cc0d 100644
--- a/engines/sci/engine/script.h
+++ b/engines/sci/engine/script.h
@@ -118,8 +118,8 @@ public:
virtual void saveLoadWithSerializer(Common::Serializer &ser);
- Object *getObject(reg_t pos);
- const Object *getObject(reg_t pos) const;
+ Object *getObject(uint16 offset);
+ const Object *getObject(uint16 offset) const;
/**
* Initializes an object within the segment manager
diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp
index 8f85577fb8..20a8240641 100644
--- a/engines/sci/engine/seg_manager.cpp
+++ b/engines/sci/engine/seg_manager.cpp
@@ -228,7 +228,7 @@ Object *SegManager::getObject(reg_t pos) const {
Script *scr = (Script *)mobj;
if (pos.offset <= scr->getBufSize() && pos.offset >= -SCRIPT_OBJECT_MAGIC_OFFSET
&& RAW_IS_OBJECT(scr->getBuf(pos.offset))) {
- obj = scr->getObject(pos);
+ obj = scr->getObject(pos.offset);
}
}
}