diff options
author | Travis Howell | 2011-08-28 10:40:23 +1000 |
---|---|---|
committer | Travis Howell | 2011-08-28 10:40:23 +1000 |
commit | b3457144ed6a4002ea8b51ac93ba14047950c262 (patch) | |
tree | 377c407a860c73cf578ac705c37ef741980e0be0 /engines/scumm/he | |
parent | 4e83a49b0fe42de37827ecffe5a65e492e76ea06 (diff) | |
download | scummvm-rg350-b3457144ed6a4002ea8b51ac93ba14047950c262.tar.gz scummvm-rg350-b3457144ed6a4002ea8b51ac93ba14047950c262.tar.bz2 scummvm-rg350-b3457144ed6a4002ea8b51ac93ba14047950c262.zip |
SCUMM: Add basic support for setOffHeap resource flag in HE90+ games.
Diffstat (limited to 'engines/scumm/he')
-rw-r--r-- | engines/scumm/he/intern_he.h | 1 | ||||
-rw-r--r-- | engines/scumm/he/resource_he.cpp | 34 | ||||
-rw-r--r-- | engines/scumm/he/script_v90he.cpp | 2 |
3 files changed, 36 insertions, 1 deletions
diff --git a/engines/scumm/he/intern_he.h b/engines/scumm/he/intern_he.h index f4df6571fa..cdc5faa084 100644 --- a/engines/scumm/he/intern_he.h +++ b/engines/scumm/he/intern_he.h @@ -458,6 +458,7 @@ protected: virtual void saveOrLoad(Serializer *s); virtual void readMAXS(int blockSize); + void setResourceOffHeap(int typeId, int resId, int val); virtual void processActors(); diff --git a/engines/scumm/he/resource_he.cpp b/engines/scumm/he/resource_he.cpp index 39240e347f..42748d08ed 100644 --- a/engines/scumm/he/resource_he.cpp +++ b/engines/scumm/he/resource_he.cpp @@ -386,6 +386,40 @@ int ScummEngine_v72he::getSoundResourceSize(ResId id) { return size; } +void ScummEngine_v90he::setResourceOffHeap(int typeId, int resId, int val) { + debug(0, "setResourceOffHeap: type %d resId %d toggle %d", typeId, resId, val); + ResType type; + + switch (typeId) { + case 1: + type = rtRoom; + break; + case 2: + type = rtScript; + break; + case 3: + type = rtCostume; + break; + case 4: + type = rtSound; + break; + case 6: + type = rtCharset; + break; + case 19: + type = rtImage; + break; + default: + error("setResourceOffHeap: default case %d", typeId); + } + + if (val == 1) { + _res->setOffHeap(type, resId); + } else { + _res->setOnHeap(type, resId); + } +} + #endif } // End of namespace Scumm diff --git a/engines/scumm/he/script_v90he.cpp b/engines/scumm/he/script_v90he.cpp index 66a0a34d16..877f8b239d 100644 --- a/engines/scumm/he/script_v90he.cpp +++ b/engines/scumm/he/script_v90he.cpp @@ -2358,7 +2358,7 @@ void ScummEngine_v90he::o90_kernelSetFunctions() { _wiz->_rectOverrideEnabled = false; break; case 714: - debug(5, "o90_kernelSetFunctions: case 714: type %d resId %d unk1 %d", args[1], args[2], args[3]); + setResourceOffHeap(args[1], args[2], args[3]); break; case 1492: // Remote start script function |