[Scummvm-git-logs] scummvm master -> cf3d41911950341cce5cc0d6043e28ffff4e2915
digitall
547637+digitall at users.noreply.github.com
Mon Mar 22 03:25:55 UTC 2021
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:
cf3d419119 PRINCE: Fix Memset on Non-Trivial Structure GCC Compiler Warnings
Commit: cf3d41911950341cce5cc0d6043e28ffff4e2915
https://github.com/scummvm/scummvm/commit/cf3d41911950341cce5cc0d6043e28ffff4e2915
Author: D G Turner (digitall at scummvm.org)
Date: 2021-03-22T03:25:22Z
Commit Message:
PRINCE: Fix Memset on Non-Trivial Structure GCC Compiler Warnings
Changed paths:
engines/prince/prince.h
engines/prince/resource.cpp
diff --git a/engines/prince/prince.h b/engines/prince/prince.h
index 978256f79c..2014fafff3 100644
--- a/engines/prince/prince.h
+++ b/engines/prince/prince.h
@@ -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;
}
};
diff --git a/engines/prince/resource.cpp b/engines/prince/resource.cpp
index 34de29b388..25d8ec55ce 100644
--- a/engines/prince/resource.cpp
+++ b/engines/prince/resource.cpp
@@ -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);
More information about the Scummvm-git-logs
mailing list