[Scummvm-git-logs] scummvm master -> c0d6a8fc7a051f31c0cf209b74c213b1d9643ca8
digitall
dgturner at iee.org
Sat Sep 14 00:09:13 CEST 2019
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
c0d6a8fc7a HDB: Further Fixes for GCC Compiler Warnings
Commit: c0d6a8fc7a051f31c0cf209b74c213b1d9643ca8
https://github.com/scummvm/scummvm/commit/c0d6a8fc7a051f31c0cf209b74c213b1d9643ca8
Author: D G Turner (digitall at scummvm.org)
Date: 2019-09-13T23:06:32+01:00
Commit Message:
HDB: Further Fixes for GCC Compiler Warnings
Changed paths:
engines/hdb/ai-init.cpp
engines/hdb/ai.h
engines/hdb/hdb.cpp
diff --git a/engines/hdb/ai-init.cpp b/engines/hdb/ai-init.cpp
index 7d9a15c..e2e42cc 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 86c3709..37fc7ef 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 14b7eb1..8788c20 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);
More information about the Scummvm-git-logs
mailing list