aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNipun Garg2019-06-20 19:33:50 +0530
committerEugene Sandulenko2019-09-03 17:16:52 +0200
commitb0cd169cb9aab153f5c9fe24dad4e099d5734d76 (patch)
treea0b128f505cb98b2877fd208ff42fd379c7bce2b
parentf81314580885e717d0dc82a082296e09d66f4fa1 (diff)
downloadscummvm-rg350-b0cd169cb9aab153f5c9fe24dad4e099d5734d76.tar.gz
scummvm-rg350-b0cd169cb9aab153f5c9fe24dad4e099d5734d76.tar.bz2
scummvm-rg350-b0cd169cb9aab153f5c9fe24dad4e099d5734d76.zip
HDB: Clear Player Graphics in restartSystem()
-rw-r--r--engines/hdb/ai-init.cpp33
-rw-r--r--engines/hdb/ai.h122
2 files changed, 94 insertions, 61 deletions
diff --git a/engines/hdb/ai-init.cpp b/engines/hdb/ai-init.cpp
index 1230ed09d2..82f03313d0 100644
--- a/engines/hdb/ai-init.cpp
+++ b/engines/hdb/ai-init.cpp
@@ -710,6 +710,39 @@ void AI::restartSystem() {
_playerOnIce = false;
_playerEmerging = false;
+ // Clean up Player Graphics Storage
+ memset(_horrible1Gfx, NULL, kMaxDeathFrames * sizeof(Tile *));
+ memset(_horrible2Gfx, NULL, kMaxDeathFrames * sizeof(Tile *));
+ memset(_horrible3Gfx, NULL, kMaxDeathFrames * sizeof(Tile *));
+ memset(_horrible4Gfx, NULL, kMaxDeathFrames * sizeof(Tile *));
+ memset(_plummetGfx, NULL, kMaxDeathFrames * sizeof(Tile *));
+ memset(_dyingGfx, NULL, kMaxDeathFrames * sizeof(Tile *));
+
+ memset(_pushdownGfx, NULL, kMaxAnimFrames * sizeof(Tile *));
+ memset(_pushupGfx, NULL, kMaxAnimFrames * sizeof(Tile *));
+ memset(_pushleftGfx, NULL, kMaxAnimFrames * sizeof(Tile *));
+ memset(_pushrightGfx, NULL, kMaxAnimFrames * sizeof(Tile *));
+ memset(_stunDownGfx, NULL, kMaxAnimFrames * sizeof(Tile *));
+ memset(_stunUpGfx, NULL, kMaxAnimFrames * sizeof(Tile *));
+ memset(_stunLeftGfx, NULL, kMaxAnimFrames * sizeof(Tile *));
+ memset(_stunRightGfx, NULL, kMaxAnimFrames * sizeof(Tile *));
+ memset(_slugDownGfx, NULL, kMaxAnimFrames * sizeof(Tile *));
+ memset(_slugUpGfx, NULL, kMaxAnimFrames * sizeof(Tile *));
+ memset(_slugLeftGfx, NULL, kMaxAnimFrames * sizeof(Tile *));
+ memset(_slugRightGfx, NULL, kMaxAnimFrames * sizeof(Tile *));
+
+ if (_clubDownFrames) {
+ _clubDownFrames = 3;
+ _clubUpFrames = 3;
+ _clubLeftFrames = 3;
+ _clubRightFrames = 3;
+ }
+
+ memset(_clubDownGfx, NULL, kMaxAnimFrames * sizeof(Tile *));
+ memset(_clubUpGfx, NULL, kMaxAnimFrames * sizeof(Tile *));
+ memset(_clubLeftGfx, NULL, kMaxAnimFrames * sizeof(Tile *));
+ memset(_clubRightGfx, NULL, kMaxAnimFrames * sizeof(Tile *));
+
// Clear the Entity List
_ents->clear();
diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h
index 171979940d..5e140f7d50 100644
--- a/engines/hdb/ai.h
+++ b/engines/hdb/ai.h
@@ -566,67 +566,67 @@ private:
bool _playerEmerging;
bool _playerRunning;
- uint16 pushupFrames;
- Tile *pushupGfx[kMaxAnimFrames];
-
- uint16 pushdownFrames;
- Tile *pushdownGfx[kMaxAnimFrames];
-
- uint16 pushleftFrames;
- Tile *pushleftGfx[kMaxAnimFrames];
-
- uint16 pushrightFrames;
- Tile *pushrightGfx[kMaxAnimFrames];
-
- Tile *getGfx[5]; // only 1 frame in each direction (+1 for DIR_NONE at start)
-
- uint16 dyingFrames;
- Tile *dyingGfx[kMaxDeathFrames];
-
- Tile *goodjobGfx; // only 1 frame
-
- uint16 horrible1Frames;
- Tile *horrible1Gfx[kMaxDeathFrames];
- uint16 horrible2Frames;
- Tile *horrible2Gfx[kMaxDeathFrames];
- uint16 horrible3Frames;
- Tile *horrible3Gfx[kMaxDeathFrames];
- uint16 horrible4Frames;
- Tile *horrible4Gfx[kMaxDeathFrames];
- uint16 plummetFrames;
- Tile *plummetGfx[kMaxDeathFrames];
-
- uint16 clubUpFrames;
- Tile *clubUpGfx[kMaxAnimFrames];
- uint16 clubDownFrames;
- Tile *clubDownGfx[kMaxAnimFrames];
- uint16 clubLeftFrames;
- Tile *clubLeftGfx[kMaxAnimFrames];
- uint16 clubRightFrames;
- Tile *clubRightGfx[kMaxAnimFrames];
-
- uint16 stunUpFrames;
- Tile *stunUpGfx[kMaxAnimFrames];
- uint16 stunDownFrames;
- Tile *stunDownGfx[kMaxAnimFrames];
- uint16 stunLeftFrames;
- Tile *stunLeftGfx[kMaxAnimFrames];
- uint16 stunRightFrames;
- Tile *stunRightGfx[kMaxAnimFrames];
- Tile *stun_lightningGfx[kMaxAnimFrames];
- Tile *stunnedGfx[kMaxAnimFrames];
-
- uint16 slugUpFrames;
- Tile *slugUpGfx[kMaxAnimFrames];
- uint16 slugDownFrames;
- Tile *slugDownGfx[kMaxAnimFrames];
- uint16 slugLeftFrames;
- Tile *slugLeftGfx[kMaxAnimFrames];
- uint16 slugRightFrames;
- Tile *slugRightGfx[kMaxAnimFrames];
-
- uint16 slugAttackFrames;
- Tile *slugAttackGfx[kMaxAnimFrames];
+ uint16 _pushupFrames;
+ Tile *_pushupGfx[kMaxAnimFrames];
+
+ uint16 _pushdownFrames;
+ Tile *_pushdownGfx[kMaxAnimFrames];
+
+ uint16 _pushleftFrames;
+ Tile *_pushleftGfx[kMaxAnimFrames];
+
+ uint16 _pushrightFrames;
+ Tile *_pushrightGfx[kMaxAnimFrames];
+
+ Tile *_getGfx[5]; // only 1 frame in each direction (+1 for DIR_NONE at start)
+
+ uint16 _dyingFrames;
+ Tile *_dyingGfx[kMaxDeathFrames];
+
+ Tile *_goodjobGfx; // only 1 frame
+
+ uint16 _horrible1Frames;
+ Tile *_horrible1Gfx[kMaxDeathFrames];
+ uint16 _horrible2Frames;
+ Tile *_horrible2Gfx[kMaxDeathFrames];
+ uint16 _horrible3Frames;
+ Tile *_horrible3Gfx[kMaxDeathFrames];
+ uint16 _horrible4Frames;
+ Tile *_horrible4Gfx[kMaxDeathFrames];
+ uint16 _plummetFrames;
+ Tile *_plummetGfx[kMaxDeathFrames];
+
+ uint16 _clubUpFrames;
+ Tile *_clubUpGfx[kMaxAnimFrames];
+ uint16 _clubDownFrames;
+ Tile *_clubDownGfx[kMaxAnimFrames];
+ uint16 _clubLeftFrames;
+ Tile *_clubLeftGfx[kMaxAnimFrames];
+ uint16 _clubRightFrames;
+ Tile *_clubRightGfx[kMaxAnimFrames];
+
+ uint16 _stunUpFrames;
+ Tile *_stunUpGfx[kMaxAnimFrames];
+ uint16 _stunDownFrames;
+ Tile *_stunDownGfx[kMaxAnimFrames];
+ uint16 _stunLeftFrames;
+ Tile *_stunLeftGfx[kMaxAnimFrames];
+ uint16 _stunRightFrames;
+ Tile *_stunRightGfx[kMaxAnimFrames];
+ Tile *_stun_lightningGfx[kMaxAnimFrames];
+ Tile *_stunnedGfx[kMaxAnimFrames];
+
+ uint16 _slugUpFrames;
+ Tile *_slugUpGfx[kMaxAnimFrames];
+ uint16 _slugDownFrames;
+ Tile *_slugDownGfx[kMaxAnimFrames];
+ uint16 _slugLeftFrames;
+ Tile *_slugLeftGfx[kMaxAnimFrames];
+ uint16 _slugRightFrames;
+ Tile *_slugRightGfx[kMaxAnimFrames];
+
+ uint16 _slugAttackFrames;
+ Tile *_slugAttackGfx[kMaxAnimFrames];
// Player Resources and Deliveries