aboutsummaryrefslogtreecommitdiff
path: root/engines/hdb
diff options
context:
space:
mode:
authorD G Turner2019-09-13 23:05:22 +0100
committerD G Turner2019-09-13 23:06:32 +0100
commitc0d6a8fc7a051f31c0cf209b74c213b1d9643ca8 (patch)
tree303f3819d5bfb351375399ab0d01b6c135ea141e /engines/hdb
parentbc7d30fb07f85e2a099cbebded3f48e0dc131c15 (diff)
downloadscummvm-rg350-c0d6a8fc7a051f31c0cf209b74c213b1d9643ca8.tar.gz
scummvm-rg350-c0d6a8fc7a051f31c0cf209b74c213b1d9643ca8.tar.bz2
scummvm-rg350-c0d6a8fc7a051f31c0cf209b74c213b1d9643ca8.zip
HDB: Further Fixes for GCC Compiler Warnings
Diffstat (limited to 'engines/hdb')
-rw-r--r--engines/hdb/ai-init.cpp4
-rw-r--r--engines/hdb/ai.h13
-rw-r--r--engines/hdb/hdb.cpp2
3 files changed, 16 insertions, 3 deletions
diff --git a/engines/hdb/ai-init.cpp b/engines/hdb/ai-init.cpp
index 7d9a15cde9..e2e42cc04c 100644
--- a/engines/hdb/ai-init.cpp
+++ b/engines/hdb/ai-init.cpp
@@ -1246,7 +1246,9 @@ void AI::restartSystem() {
_hereList->clear();
// Clear Bridges
- memset(&_bridges[0], 0, sizeof(_bridges));
+ for (uint8 i = 0; i < ARRAYSIZE(_bridges); i++) {
+ _bridges[i].reset();
+ }
_numBridges = 0;
// Clear waypoints
diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h
index 86c3709aeb..37fc7efb3c 100644
--- a/engines/hdb/ai.h
+++ b/engines/hdb/ai.h
@@ -634,6 +634,7 @@ struct DlvEnt {
destTextName[0] = 0;
destGfxName[0] = 0;
}
+
~DlvEnt() {
itemGfx = NULL;
destGfx = NULL;
@@ -765,7 +766,17 @@ struct Bridge {
uint16 delay;
uint16 anim;
- Bridge() : x(0), y(0), dir(DIR_NONE), delay(0), anim(0) {}
+ void reset() {
+ x = 0;
+ y = 0;
+ dir = DIR_NONE;
+ delay = 0;
+ anim = 0;
+ }
+
+ Bridge() {
+ reset();
+ }
};
struct CineCommand {
diff --git a/engines/hdb/hdb.cpp b/engines/hdb/hdb.cpp
index 14b7eb110e..8788c2037f 100644
--- a/engines/hdb/hdb.cpp
+++ b/engines/hdb/hdb.cpp
@@ -574,7 +574,7 @@ void HDBGame::useEntity(AIEntity *e) {
AIEntity temp;
if (_ai->getTableEnt(e->type)) {
- memcpy(&temp, e, sizeof(AIEntity));
+ temp = *e;
_ai->getItemSound(e->type);