aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorD G Turner2019-10-04 03:28:35 +0100
committerD G Turner2019-10-04 03:28:35 +0100
commit50b0d62334e42aa9030d36c3ba5385b3408c378e (patch)
tree890a78676cde6fd9c47cbc5047d28572b4870503 /engines
parent8a96a1854d65b61b8e57498f1e66c42735e6cdb9 (diff)
downloadscummvm-rg350-50b0d62334e42aa9030d36c3ba5385b3408c378e.tar.gz
scummvm-rg350-50b0d62334e42aa9030d36c3ba5385b3408c378e.tar.bz2
scummvm-rg350-50b0d62334e42aa9030d36c3ba5385b3408c378e.zip
SCI: Really Fix MSVC Warning
The Palette structure referred to here is in sci/graphics/helpers.h not in the Graphics CursorMan class as previously thought. Rather than adding a structure constructor which could have side effects currently, the full structure is initialized here to avoid the MSVC warning. The previous change to CursorMan class Palette can be retained as it is a reasonable code improvement in any case.
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/graphics/palette32.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/engines/sci/graphics/palette32.cpp b/engines/sci/graphics/palette32.cpp
index 7a3b396da8..803dc74044 100644
--- a/engines/sci/graphics/palette32.cpp
+++ b/engines/sci/graphics/palette32.cpp
@@ -108,12 +108,20 @@ const HunkPalette::EntryHeader HunkPalette::getEntryHeader() const {
const Palette HunkPalette::toPalette() const {
Palette outPalette;
+ // Set outPalette structures to 0
+ for (int16 i = 0; i < ARRAYSIZE(outPalette.mapping); ++i) {
+ outPalette.mapping[i] = 0;
+ }
+ outPalette.timestamp = 0;
for (int16 i = 0; i < ARRAYSIZE(outPalette.colors); ++i) {
outPalette.colors[i].used = false;
outPalette.colors[i].r = 0;
outPalette.colors[i].g = 0;
outPalette.colors[i].b = 0;
}
+ for (int16 i = 0; i < ARRAYSIZE(outPalette.intensity); ++i) {
+ outPalette.intensity[i] = 0;
+ }
if (_numPalettes) {
const EntryHeader header = getEntryHeader();