From 2d5a140725194f8a44d98091b510469f5889275a Mon Sep 17 00:00:00 2001 From: Kari Salminen Date: Mon, 11 Aug 2008 20:41:13 +0000 Subject: Changed partBuffer from a pointer to a Common::Array. Removed numElementInPart variable as it's now equivalent with partBuffer.size(). svn-id: r33783 --- engines/cine/cine.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'engines/cine/cine.cpp') diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp index 6c5069038a..fad6cf3f6a 100644 --- a/engines/cine/cine.cpp +++ b/engines/cine/cine.cpp @@ -75,7 +75,6 @@ CineEngine::~CineEngine() { Common::clearAllSpecialDebugLevels(); free(palPtr); - free(partBuffer); free(textDataPtr); } @@ -154,7 +153,9 @@ void CineEngine::initialize() { collisionPage = new byte[320 * 200]; textDataPtr = (byte *)malloc(8000); - partBuffer = (PartBuffer *)malloc(NUM_MAX_PARTDATA * sizeof(PartBuffer)); + // Clear part buffer as there's nothing loaded into it yet. + // Its size will change when loading data into it with the loadPart function. + partBuffer.clear(); if (g_cine->getGameType() == Cine::GType_OS) { readVolCnf(); -- cgit v1.2.3 From d6dde4b85f3f32fe0f602270b9223eaa299db91c Mon Sep 17 00:00:00 2001 From: Kari Salminen Date: Mon, 11 Aug 2008 21:26:41 +0000 Subject: Removed textDataPtr pointer as it's not used beyond the loadTextData function. Reworked loadTextData a bit so there are no two loops for the same thing (Also renamed some of the local variables). svn-id: r33784 --- engines/cine/cine.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'engines/cine/cine.cpp') diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp index fad6cf3f6a..cf33b2c186 100644 --- a/engines/cine/cine.cpp +++ b/engines/cine/cine.cpp @@ -75,7 +75,6 @@ CineEngine::~CineEngine() { Common::clearAllSpecialDebugLevels(); free(palPtr); - free(textDataPtr); } int CineEngine::init() { @@ -151,7 +150,6 @@ void CineEngine::initialize() { } collisionPage = new byte[320 * 200]; - textDataPtr = (byte *)malloc(8000); // Clear part buffer as there's nothing loaded into it yet. // Its size will change when loading data into it with the loadPart function. @@ -161,7 +159,7 @@ void CineEngine::initialize() { readVolCnf(); } - loadTextData("texte.dat", textDataPtr); + loadTextData("texte.dat"); if (g_cine->getGameType() == Cine::GType_OS && !(g_cine->getFeatures() & GF_DEMO)) { loadPoldatDat("poldat.dat"); -- cgit v1.2.3 From 8aaba9d38e8a0c2259cf7617bb1b07c725a49b0b Mon Sep 17 00:00:00 2001 From: Kari Salminen Date: Mon, 11 Aug 2008 21:45:47 +0000 Subject: Changed palPtr from a pointer to a Common::Array named palArray. Removed palEntriesCount variable as it's now equivalent to palArray.size(). svn-id: r33785 --- engines/cine/cine.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'engines/cine/cine.cpp') diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp index cf33b2c186..5e0506c286 100644 --- a/engines/cine/cine.cpp +++ b/engines/cine/cine.cpp @@ -73,8 +73,6 @@ CineEngine::~CineEngine() { freeErrmessDat(); } Common::clearAllSpecialDebugLevels(); - - free(palPtr); } int CineEngine::init() { -- cgit v1.2.3 From 36e0d2eab8bc920d337d8e6f1436e057049ffac6 Mon Sep 17 00:00:00 2001 From: Kari Salminen Date: Mon, 11 Aug 2008 22:26:25 +0000 Subject: Moved fontParamTable inside TextHandler struct and made it a constant size as that's what it is (No need for using malloc & free anymore). Previously we would've tried to free an array that wasn't heap-allocated in freePoldatDat (Freeing fontParamTable_standard or fontParamTable_alt), that's fixed. svn-id: r33786 --- engines/cine/cine.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'engines/cine/cine.cpp') diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp index 5e0506c286..9eb751835e 100644 --- a/engines/cine/cine.cpp +++ b/engines/cine/cine.cpp @@ -69,7 +69,6 @@ CineEngine::CineEngine(OSystem *syst, const CINEGameDescription *gameDesc) : Eng CineEngine::~CineEngine() { if (g_cine->getGameType() == Cine::GType_OS) { - freePoldatDat(); freeErrmessDat(); } Common::clearAllSpecialDebugLevels(); -- cgit v1.2.3