diff options
author | Peter Kohaut | 2019-02-12 23:04:00 +0100 |
---|---|---|
committer | Peter Kohaut | 2019-02-12 23:07:14 +0100 |
commit | d8eb3c14a488fb7b678aab926de1a0d46ead8a46 (patch) | |
tree | 95b318f8597c8570eaad12481b805817fb4690d1 /engines/bladerunner/script | |
parent | 37e083dcafd4e1243271760974f3671d8a537cf9 (diff) | |
download | scummvm-rg350-d8eb3c14a488fb7b678aab926de1a0d46ead8a46.tar.gz scummvm-rg350-d8eb3c14a488fb7b678aab926de1a0d46ead8a46.tar.bz2 scummvm-rg350-d8eb3c14a488fb7b678aab926de1a0d46ead8a46.zip |
BLADERUNNER: Removal of memory leaks
Diffstat (limited to 'engines/bladerunner/script')
-rw-r--r-- | engines/bladerunner/script/ai/izo.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/mccoy.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/script/police_maze.cpp | 23 | ||||
-rw-r--r-- | engines/bladerunner/script/police_maze.h | 1 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/rc03.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/script/scene_script.cpp | 1 |
6 files changed, 11 insertions, 20 deletions
diff --git a/engines/bladerunner/script/ai/izo.cpp b/engines/bladerunner/script/ai/izo.cpp index 78c6f4f03d..9e48995816 100644 --- a/engines/bladerunner/script/ai/izo.cpp +++ b/engines/bladerunner/script/ai/izo.cpp @@ -558,7 +558,7 @@ bool AIScriptIzo::UpdateAnimation(int *animation, int *frame) { if (Actor_Query_Goal_Number(kActorIzo) == kGoalIzoWaitingAtRC03 && _animationFrame == 6 ) { - Actor_Change_Animation_Mode(kActorMcCoy, 20); + Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDodge); } Actor_Query_Goal_Number(kActorIzo); if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) { diff --git a/engines/bladerunner/script/ai/mccoy.cpp b/engines/bladerunner/script/ai/mccoy.cpp index 6dd8c90eb1..b5ba45429e 100644 --- a/engines/bladerunner/script/ai/mccoy.cpp +++ b/engines/bladerunner/script/ai/mccoy.cpp @@ -1593,7 +1593,7 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { } break; - case 20: + case kAnimationModeDodge: dodge(); break; diff --git a/engines/bladerunner/script/police_maze.cpp b/engines/bladerunner/script/police_maze.cpp index b7b627fd63..c45826fc8e 100644 --- a/engines/bladerunner/script/police_maze.cpp +++ b/engines/bladerunner/script/police_maze.cpp @@ -34,7 +34,12 @@ namespace BladeRunner { PoliceMaze::PoliceMaze(BladeRunnerEngine *vm) : ScriptBase(vm) { - reset(); + _isPaused = false; + _isActive = false; + _isEnding = false; + + _pm_var1 = 0; + _pm_var2 = 0; for (int i = 0; i < kNumMazeTracks; i++) { _tracks[i] = new PoliceMazeTargetTrack(vm); @@ -44,22 +49,8 @@ PoliceMaze::PoliceMaze(BladeRunnerEngine *vm) : ScriptBase(vm) { PoliceMaze::~PoliceMaze() { for (int i = 0; i < kNumMazeTracks; i++) { delete _tracks[i]; + _tracks[i] = nullptr; } - - reset(); -} - -void PoliceMaze::reset() { - _isPaused = false; - _isActive = false; - _isEnding = false; - - for (int i = 0; i < kNumMazeTracks; i++) { - _tracks[i] = 0; - } - - _pm_var1 = 0; - _pm_var2 = 0; } void PoliceMaze::clear(bool isLoadingGame) { diff --git a/engines/bladerunner/script/police_maze.h b/engines/bladerunner/script/police_maze.h index 725fbd4319..9e79497040 100644 --- a/engines/bladerunner/script/police_maze.h +++ b/engines/bladerunner/script/police_maze.h @@ -92,7 +92,6 @@ public: ~PoliceMaze(); void tick(); - void reset(); void clear(bool isLoadingGame); void setPauseState(bool state); void activate(); diff --git a/engines/bladerunner/script/scene/rc03.cpp b/engines/bladerunner/script/scene/rc03.cpp index a8696c75ea..fd18b8a460 100644 --- a/engines/bladerunner/script/scene/rc03.cpp +++ b/engines/bladerunner/script/scene/rc03.cpp @@ -258,7 +258,7 @@ void SceneScriptRC03::PlayerWalkedIn() { if (Game_Flag_Query(kFlagIzoIsReplicant) ) { Actor_Set_Goal_Number(kActorSteele, kGoalSteeleApprehendIzo); } - Actor_Change_Animation_Mode(kActorMcCoy, 20); + Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDodge); Loop_Actor_Walk_To_XYZ(kActorIzo, 180.0f, -4.0f, 184.0f, 0, false, false, 0); Actor_Change_Animation_Mode(kActorIzo, 6); if (!Game_Flag_Query(kFlagIzoIsReplicant)) { diff --git a/engines/bladerunner/script/scene_script.cpp b/engines/bladerunner/script/scene_script.cpp index 7c890d6538..c4a5a1bc3f 100644 --- a/engines/bladerunner/script/scene_script.cpp +++ b/engines/bladerunner/script/scene_script.cpp @@ -35,6 +35,7 @@ SceneScript::~SceneScript() { bool SceneScript::open(const Common::String &name) { delete _currentScript; + _currentScript = nullptr; if (name == "AR01") { _currentScript = new SceneScriptAR01(_vm); return true; } if (name == "AR02") { _currentScript = new SceneScriptAR02(_vm); return true; } |