PRINCE: Fix Memset on Non-Trivial Structure GCC Compiler Warnings

This commit is contained in:
D G Turner 2021-03-22 03:25:22 +00:00
parent 61b31bbcc6
commit cf3d419119
2 changed files with 14 additions and 2 deletions

View File

@ -88,7 +88,16 @@ struct Text {
uint16 _time;
uint32 _color;
Text() : _str(nullptr), _x(0), _y(0), _time(0), _color(255){
Text() {
clear();
}
void clear() {
_str = nullptr;
_x = 0;
_y = 0;
_time = 0;
_color = 255;
}
};

View File

@ -93,7 +93,10 @@ bool PrinceEngine::loadLocation(uint16 locationNr) {
_flicPlayer.close();
memset(_textSlots, 0, sizeof(_textSlots));
for (uint i = 0; i < ARRAYSIZE(_textSlots); i++) {
_textSlots[i].clear();
_textSlots[i]._color = 0; // FIXME: Can be left at default of 255?
}
freeAllSamples();
debugEngine("PrinceEngine::loadLocation %d", locationNr);