aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/myst.cpp
diff options
context:
space:
mode:
authorBastien Bouclet2016-02-06 16:46:02 +0100
committerBastien Bouclet2016-02-07 15:27:03 +0100
commit316dc9c829767f339f66861f016faa4b2bca60df (patch)
treee044260748e8f1913d7e2467cb90d7921f2c35d7 /engines/mohawk/myst.cpp
parenta3064b9027569c44a24d84b4e4a6da4abcdadee5 (diff)
downloadscummvm-rg350-316dc9c829767f339f66861f016faa4b2bca60df.tar.gz
scummvm-rg350-316dc9c829767f339f66861f016faa4b2bca60df.tar.bz2
scummvm-rg350-316dc9c829767f339f66861f016faa4b2bca60df.zip
MOHAWK: Turn ScriptResource::resourceList into a Common::Array
Diffstat (limited to 'engines/mohawk/myst.cpp')
-rw-r--r--engines/mohawk/myst.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp
index f42822f2a7..0cc5a01250 100644
--- a/engines/mohawk/myst.cpp
+++ b/engines/mohawk/myst.cpp
@@ -795,18 +795,16 @@ void MohawkEngine_Myst::loadCard() {
if (scriptResource.type == 3) {
scriptResource.var = viewStream->readUint16LE();
debugC(kDebugView, "\t\t Var: %d", scriptResource.var);
- scriptResource.count = viewStream->readUint16LE();
- debugC(kDebugView, "\t\t Resource List Count: %d", scriptResource.count);
+ uint16 count = viewStream->readUint16LE();
+ debugC(kDebugView, "\t\t Resource List Count: %d", count);
scriptResource.u0 = viewStream->readUint16LE();
debugC(kDebugView, "\t\t u0: %d", scriptResource.u0);
- scriptResource.resource_list = new int16[scriptResource.count];
- for (uint16 j = 0; j < scriptResource.count; j++) {
- scriptResource.resource_list[j] = viewStream->readSint16LE();
- debugC(kDebugView, "\t\t Resource List %d: %d", j, scriptResource.resource_list[j]);
+ for (uint16 j = 0; j < count; j++) {
+ scriptResource.resourceList.push_back(viewStream->readSint16LE());
+ debugC(kDebugView, "\t\t Resource List %d: %d", j, scriptResource.resourceList[j]);
}
} else {
- scriptResource.resource_list = nullptr;
scriptResource.id = viewStream->readUint16LE();
debugC(kDebugView, "\t\t Id: %d", scriptResource.id);
}
@@ -875,10 +873,6 @@ void MohawkEngine_Myst::loadCard() {
void MohawkEngine_Myst::unloadCard() {
_view.conditionalImages.clear();
_view.soundList.clear();
-
- for (uint16 i = 0; i < _view.scriptResources.size(); i++)
- delete[] _view.scriptResources[i].resource_list;
-
_view.scriptResources.clear();
}