aboutsummaryrefslogtreecommitdiff
path: root/engines/tinsel
diff options
context:
space:
mode:
authorD G Turner2019-08-25 09:09:26 +0100
committerD G Turner2019-08-25 09:09:26 +0100
commit0c479251c794f536c9bcaf18c2ce10fcb1537be2 (patch)
tree24269c49b3a8682c2b041c8f085c61eac51b7a78 /engines/tinsel
parent5022d879565e86d00d4d9d103e13c3f56ee1476b (diff)
downloadscummvm-rg350-0c479251c794f536c9bcaf18c2ce10fcb1537be2.tar.gz
scummvm-rg350-0c479251c794f536c9bcaf18c2ce10fcb1537be2.tar.bz2
scummvm-rg350-0c479251c794f536c9bcaf18c2ce10fcb1537be2.zip
TINSEL: Fix GCC Compilation Warnings
These are also associated with memset on non-trivial structures.
Diffstat (limited to 'engines/tinsel')
-rw-r--r--engines/tinsel/object.cpp2
-rw-r--r--engines/tinsel/object.h27
2 files changed, 28 insertions, 1 deletions
diff --git a/engines/tinsel/object.cpp b/engines/tinsel/object.cpp
index caf41ab81c..38d44d60e1 100644
--- a/engines/tinsel/object.cpp
+++ b/engines/tinsel/object.cpp
@@ -114,7 +114,7 @@ OBJECT *AllocObject() {
pFreeObjects = pObj->pNext;
// clear out object
- memset(pObj, 0, sizeof(OBJECT));
+ pObj->reset();
// set default drawing mode and set changed bit
pObj->flags = DMA_WNZ | DMA_CHANGED;
diff --git a/engines/tinsel/object.h b/engines/tinsel/object.h
index 097e1872d1..351b4d36ef 100644
--- a/engines/tinsel/object.h
+++ b/engines/tinsel/object.h
@@ -92,6 +92,33 @@ struct OBJECT {
SCNHANDLE hShape; ///< objects current animation frame
SCNHANDLE hMirror; ///< objects previous animation frame
int oid; ///< object identifier
+
+ void reset() {
+ pNext = nullptr;
+ pSlave = nullptr;
+ //pOnDispList = nullptr;
+ //xVel = 0;
+ //yVel = 0;
+ xPos = 0;
+ yPos = 0;
+ zPos = 0;
+ rcPrev.top = 0;
+ rcPrev.left = 0;
+ rcPrev.bottom = 0;
+ rcPrev.right = 0;
+ flags = 0;
+ pPal = nullptr;
+ constant = 0;
+ width = 0;
+ height = 0;
+ hBits = 0;
+ hImg = 0;
+ hShape = 0;
+ hMirror = 0;
+ oid = 0;
+ }
+
+ OBJECT() { reset(); }
};
typedef OBJECT *POBJECT;