diff options
author | Filippos Karapetis | 2010-05-22 16:54:13 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-05-22 16:54:13 +0000 |
commit | 80ffcc621dfea5bf00abbdd761dedcf83270021a (patch) | |
tree | ab54c36bc25de68cd6dbbb9aa03e5d6fc61b45e2 | |
parent | 9b6a3712d6c237ac8453221b07a5a14ad0409e96 (diff) | |
download | scummvm-rg350-80ffcc621dfea5bf00abbdd761dedcf83270021a.tar.gz scummvm-rg350-80ffcc621dfea5bf00abbdd761dedcf83270021a.tar.bz2 scummvm-rg350-80ffcc621dfea5bf00abbdd761dedcf83270021a.zip |
Cleanup
svn-id: r49143
-rw-r--r-- | engines/sci/detection.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp index 55816b769b..beea025aea 100644 --- a/engines/sci/detection.cpp +++ b/engines/sci/detection.cpp @@ -212,23 +212,21 @@ Common::String getSierraGameId(ResourceManager *resMan) { Resource *script = resMan->findResource(ResourceId(kResourceTypeScript, 0), false); // In SCI0-SCI1, the heap is embedded in the script. In SCI1.1+, it's separated Resource *heap = 0; - int nameSelector = 0; - byte *exportPtr, *heapPtr; + byte *seeker = 0; // Seek to the name selector of the first export if (getSciVersion() < SCI_VERSION_1_1) { + const int nameSelector = 3; int extraSci0EarlyBytes = (getSciVersion() == SCI_VERSION_0_EARLY) ? 2 : 0; - nameSelector = 3; - exportPtr = script->data + extraSci0EarlyBytes + 4 + 2; - heapPtr = script->data; + byte *exportPtr = script->data + extraSci0EarlyBytes + 4 + 2; + seeker = script->data + READ_UINT16(script->data + READ_UINT16(exportPtr) + nameSelector * 2); } else { - nameSelector = 5 + 3; - exportPtr = script->data + 4 + 2 + 2; + const int nameSelector = 5 + 3; heap = resMan->findResource(ResourceId(kResourceTypeHeap, 0), false); - heapPtr = heap->data; + byte *exportPtr = script->data + 4 + 2 + 2; + seeker = heap->data + READ_UINT16(heap->data + READ_UINT16(exportPtr) + nameSelector * 2); } - byte *seeker = heapPtr + READ_UINT16(heapPtr + READ_UINT16(exportPtr) + nameSelector * 2); char sierraId[20]; int i = 0; byte curChar = 0; |