From ee56120fcff9fdbc5a4e068f104c4d4658b43507 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 13 Dec 2007 17:53:31 +0000 Subject: Added a proper fix for bug #1733238 - "FW: crash in copier room", taken from next_ghost's patch #1848173 - "ScriptVars class implementation for CinE" svn-id: r29852 --- engines/cine/object.cpp | 8 ++------ engines/cine/object.h | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/engines/cine/object.cpp b/engines/cine/object.cpp index 2c68c214f0..f8af6ee28a 100644 --- a/engines/cine/object.cpp +++ b/engines/cine/object.cpp @@ -36,7 +36,7 @@ namespace Cine { objectStruct objectTable[NUM_MAX_OBJECT]; -uint16 globalVars[NUM_MAX_OBJECTDATA]; +uint16 globalVars[NUM_MAX_OBJECTDATA + 1]; overlayHeadElement overlayHead; void unloadAllMasks(void) { @@ -151,11 +151,7 @@ int16 freeOverlay(uint16 objIdx, uint16 param) { tempPtr2->previous = currentHeadPtr->previous; - // FIXME: is this needed? It causes crashes in Windows in the drawOverlays function - // (the currentOverlay pointer is incorrect) - // Removing this fixes bug #1733238 - FW: crash in copier room - // Also, it stops the game from crashing right after the introduction - //free(currentHeadPtr); + free(currentHeadPtr); return 0; } diff --git a/engines/cine/object.h b/engines/cine/object.h index 7d4d492bf2..d7d4e145ff 100644 --- a/engines/cine/object.h +++ b/engines/cine/object.h @@ -53,7 +53,7 @@ struct overlayHeadElement { #define NUM_MAX_OBJECTDATA 255 extern objectStruct objectTable[NUM_MAX_OBJECT]; -extern uint16 globalVars[NUM_MAX_OBJECTDATA]; +extern uint16 globalVars[NUM_MAX_OBJECTDATA + 1]; extern overlayHeadElement overlayHead; -- cgit v1.2.3