aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/he/sprite_he.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2019-01-05 20:09:23 +0100
committerFilippos Karapetis2019-07-14 14:58:19 +0300
commit1e23d43006705a1d25e04d9cc90674044789cb92 (patch)
tree74982033219756724bc69b27cfc962531682b502 /engines/scumm/he/sprite_he.cpp
parent4eef7a42e3f45a18a57674898f5fb5409f6daf5d (diff)
downloadscummvm-rg350-1e23d43006705a1d25e04d9cc90674044789cb92.tar.gz
scummvm-rg350-1e23d43006705a1d25e04d9cc90674044789cb92.tar.bz2
scummvm-rg350-1e23d43006705a1d25e04d9cc90674044789cb92.zip
SCUMM: Silence GCC memset() warnings
Recent GCC versions complain if you memset() a class or struct that contain non-POD data types. Get around that by either initializing the object when created, or by adding a reset() method.
Diffstat (limited to 'engines/scumm/he/sprite_he.cpp')
-rw-r--r--engines/scumm/he/sprite_he.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/engines/scumm/he/sprite_he.cpp b/engines/scumm/he/sprite_he.cpp
index e210e0b6b2..9e20ab6c84 100644
--- a/engines/scumm/he/sprite_he.cpp
+++ b/engines/scumm/he/sprite_he.cpp
@@ -1086,8 +1086,13 @@ void Sprite::resetGroup(int spriteGroupId) {
}
void Sprite::resetTables(bool refreshScreen) {
- memset(_spriteTable, 0, (_varNumSprites + 1) * sizeof(SpriteInfo));
- memset(_spriteGroups, 0, (_varNumSpriteGroups + 1) * sizeof(SpriteGroup));
+ for (int i = 0; i < _varNumSprites; i++) {
+ _spriteTable[i].reset();
+ }
+ for (int i = 0; i < _varNumSpriteGroups; i++) {
+ _spriteGroups[i].reset();
+ }
+
for (int curGrp = 1; curGrp < _varNumSpriteGroups; ++curGrp)
resetGroup(curGrp);