diff options
Diffstat (limited to 'engines/mohawk')
-rw-r--r-- | engines/mohawk/myst.cpp | 16 | ||||
-rw-r--r-- | engines/mohawk/myst.h | 3 |
2 files changed, 6 insertions, 13 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(); } diff --git a/engines/mohawk/myst.h b/engines/mohawk/myst.h index 1e5ddd85da..12ec21b52c 100644 --- a/engines/mohawk/myst.h +++ b/engines/mohawk/myst.h @@ -137,9 +137,8 @@ struct MystView { uint16 id; // Not used by type 3 // TODO: Type 3 has more. Maybe use a union? uint16 var; // Used by type 3 only - uint16 count; // Used by type 3 only uint16 u0; // Used by type 3 only - int16 *resource_list; // Used by type 3 only + Common::Array<int16> resourceList; // Used by type 3 only }; Common::Array<ScriptResource> scriptResources; |