aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2010-05-26 06:53:08 +0000
committerFilippos Karapetis2010-05-26 06:53:08 +0000
commit60dd3106885b9784af15cb96122d28a5f0bf33f1 (patch)
tree3644fc8f256ccaadbefcccff46bbcf834ee38c81 /engines
parentad9772fac6dcd3d462053bb80ebe54a012990a24 (diff)
downloadscummvm-rg350-60dd3106885b9784af15cb96122d28a5f0bf33f1.tar.gz
scummvm-rg350-60dd3106885b9784af15cb96122d28a5f0bf33f1.tar.bz2
scummvm-rg350-60dd3106885b9784af15cb96122d28a5f0bf33f1.zip
Cleanup
svn-id: r49227
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/savegame.cpp17
-rw-r--r--engines/sci/resource.cpp11
2 files changed, 11 insertions, 17 deletions
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index 8dc06dab01..ff51f4015c 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -849,24 +849,19 @@ void SegManager::reconstructScripts(EngineState *s) {
byte *data = scr->_buf + it->_value.getPos().offset;
if (getSciVersion() >= SCI_VERSION_1_1) {
- uint16 *funct_area = (uint16 *)(scr->_buf + READ_LE_UINT16( data + 6 ));
- uint16 *prop_area = (uint16 *)(scr->_buf + READ_LE_UINT16( data + 4 ));
-
- it->_value._baseMethod = funct_area;
- it->_value._baseVars = prop_area;
+ it->_value._baseMethod = (uint16 *)(scr->_buf + READ_LE_UINT16( data + 6 ));
+ it->_value._baseVars = (uint16 *)(scr->_buf + READ_LE_UINT16( data + 4 ));
} else {
int funct_area = READ_LE_UINT16(data + SCRIPT_FUNCTAREAPTR_OFFSET);
- Object *_baseObj;
-
- _baseObj = s->_segMan->getObject(it->_value.getSpeciesSelector());
+ Object *baseObj = s->_segMan->getObject(it->_value.getSpeciesSelector());
- if (!_baseObj) {
+ if (!baseObj) {
warning("Object without a base class: Script %d, index %d (reg address %04x:%04x",
scr->_nr, i, PRINT_REG(it->_value.getSpeciesSelector()));
continue;
}
- it->_value.setVarCount(_baseObj->getVarCount());
- it->_value._baseObj = _baseObj->_baseObj;
+ it->_value.setVarCount(baseObj->getVarCount());
+ it->_value._baseObj = baseObj->_baseObj;
it->_value._baseMethod = (uint16 *)(data + funct_area);
it->_value._baseVars = (uint16 *)(data + it->_value.getVarCount() * 2 + SCRIPT_SELECTOR_OFFSET);
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 428e66ebe2..57a4fbc751 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -2343,6 +2343,7 @@ Common::String ResourceManager::findSierraGameId() {
// In SCI0-SCI1, the heap is embedded in the script. In SCI1.1+, it's separated
Resource *heap = 0;
byte *seeker = 0;
+ Common::String sierraId;
// Seek to the name selector of the first export
if (getSciVersion() < SCI_VERSION_1_1) {
@@ -2357,14 +2358,12 @@ Common::String ResourceManager::findSierraGameId() {
seeker = heap->data + READ_UINT16(heap->data + READ_UINT16(exportPtr) + nameSelector * 2);
}
- char sierraId[20];
- int i = 0;
- byte curChar = 0;
+ char c = 0;
do {
- curChar = *(seeker + i);
- sierraId[i++] = curChar;
- } while (curChar != 0);
+ c = *(seeker++);
+ sierraId += c;
+ } while (c);
return sierraId;
}