[Scummvm-git-logs] scummvm master -> 50b0d62334e42aa9030d36c3ba5385b3408c378e

digitall 547637+digitall at users.noreply.github.com
Fri Oct 4 04:33:21 CEST 2019


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:
50b0d62334 SCI: Really Fix MSVC Warning


Commit: 50b0d62334e42aa9030d36c3ba5385b3408c378e
    https://github.com/scummvm/scummvm/commit/50b0d62334e42aa9030d36c3ba5385b3408c378e
Author: D G Turner (digitall at scummvm.org)
Date: 2019-10-04T03:28:35+01:00

Commit Message:
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.

Changed paths:
    engines/sci/graphics/palette32.cpp


diff --git a/engines/sci/graphics/palette32.cpp b/engines/sci/graphics/palette32.cpp
index 7a3b396..803dc74 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();





More information about the Scummvm-git-logs mailing list