diff options
author | D G Turner | 2019-08-26 05:58:02 +0100 |
---|---|---|
committer | D G Turner | 2019-08-26 05:58:02 +0100 |
commit | 5f901676ff0e9007f74a80327e787ae424cfd063 (patch) | |
tree | 9381bf5dff487c96b067dbdf168bf4b1d333d237 /engines/hopkins/globals.h | |
parent | 5035c81857839ba86127f18ae66bfed3ee71a85f (diff) | |
download | scummvm-rg350-5f901676ff0e9007f74a80327e787ae424cfd063.tar.gz scummvm-rg350-5f901676ff0e9007f74a80327e787ae424cfd063.tar.bz2 scummvm-rg350-5f901676ff0e9007f74a80327e787ae424cfd063.zip |
HOPKINS: Fix GCC Compiler Warnings
These were from using memset to clear non-trivial structures.
Diffstat (limited to 'engines/hopkins/globals.h')
-rw-r--r-- | engines/hopkins/globals.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/engines/hopkins/globals.h b/engines/hopkins/globals.h index 2e17389a45..ae69524b5d 100644 --- a/engines/hopkins/globals.h +++ b/engines/hopkins/globals.h @@ -25,6 +25,7 @@ #include "common/scummsys.h" #include "common/str.h" +#include "common/util.h" #include "common/events.h" namespace Hopkins { @@ -39,6 +40,16 @@ struct CharacterLocation { int _startSpriteIndex; int _location; int _zoomFactor; + + void reset() { + _pos.x = 0; + _pos.y = 0; + _startSpriteIndex = 0; + _location = 0; + _zoomFactor = 0; + } + + CharacterLocation() { reset(); } }; enum SauvegardeOffset { @@ -115,6 +126,22 @@ struct Savegame { int16 _inventory[35]; // Originally at offset 1300 of data array int16 _mapCarPosX; int16 _mapCarPosY; + + void reset() { + for (uint16 i = 0; i < ARRAYSIZE(_data); i++) { + _data[i] = 0; + } + _cloneHopkins.reset(); + _realHopkins.reset(); + _samantha.reset(); + for (uint16 i = 0; i < ARRAYSIZE(_inventory); i++) { + _inventory[i] = 0; + } + _mapCarPosX = 0; + _mapCarPosY = 0; + } + + Savegame() { reset(); } }; struct CreditItem { |