[Scummvm-git-logs] scummvm master -> 81288f2cac5773274ba09469552f48b5d3ca696f

bluegr bluegr at gmail.com
Sun Dec 23 19:56:12 CET 2018


This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
9fe1491a64 DM: Fix class member naming, and silence some MSVC warnings
92aa713958 FULLPIPE: Silence a false positive warning in MSVC
7c5acdaa4b SLUDGE: Fix a potentially uninitialized variable
424e71cfdc TITANIC: Silence an MSVC false positive about an uninitialized variable
81288f2cac SCI: Fix the wording in some patch comments


Commit: 9fe1491a640b87e906b7039dbcbe3902857aed94
    https://github.com/scummvm/scummvm/commit/9fe1491a640b87e906b7039dbcbe3902857aed94
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2018-12-23T20:40:21+02:00

Commit Message:
DM: Fix class member naming, and silence some MSVC warnings

MSVC complained about some potentially uninitialized variables (false
positives), as well as missing default cases in switch blocks

Changed paths:
    engines/dm/gfx.cpp
    engines/dm/gfx.h


diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp
index f728ffd..e54e4e5 100644
--- a/engines/dm/gfx.cpp
+++ b/engines/dm/gfx.cpp
@@ -126,7 +126,7 @@ DisplayMan::DisplayMan(DMEngine *dmEngine) : _vm(dmEngine) {
 	_bitmapWallSetD3LCR = nullptr;
 	_bitmapWallSetD2LCR = nullptr;
 	_bitmapWallSetD1LCR = nullptr;
-	bitmapWallSetWallD0L = nullptr;
+	_bitmapWallSetWallD0L = nullptr;
 	_bitmapWallSetWallD0R = nullptr;
 	_bitmapWallSetDoorFrameTopD2LCR = nullptr;
 	_bitmapWallSetDoorFrameTopD1LCR = nullptr;
@@ -645,7 +645,7 @@ DisplayMan::~DisplayMan() {
 	delete[] _bitmapWallSetD3LCR;
 	delete[] _bitmapWallSetD2LCR;
 	delete[] _bitmapWallSetD1LCR;
-	delete[] bitmapWallSetWallD0L;
+	delete[] _bitmapWallSetWallD0L;
 	delete[] _bitmapWallSetWallD0R;
 	delete[] _bitmapWallSetDoorFrameTopD2LCR;
 	delete[] _bitmapWallSetDoorFrameTopD1LCR;
@@ -690,7 +690,7 @@ void DisplayMan::initializeGraphicData() {
 	_bitmapWallSetD3LCR = new byte[128 * 51];
 	_bitmapWallSetD2LCR = new byte[144 * 71];
 	_bitmapWallSetD1LCR = new byte[256 * 111];
-	bitmapWallSetWallD0L = new byte[32 * 136];
+	_bitmapWallSetWallD0L = new byte[32 * 136];
 	_bitmapWallSetWallD0R = new byte[32 * 136];
 	_bitmapWallSetDoorFrameTopD2LCR = new byte[96 * 3];
 	_bitmapWallSetDoorFrameTopD1LCR = new byte[128 * 4];
@@ -1423,7 +1423,7 @@ void DisplayMan::drawSquareD3L(Direction dir, int16 posX, int16 posY) {
 	);
 
 	uint16 squareAspect[5];
-	CellOrder order;
+	CellOrder order = kDMCellOrderNone;
 	bool skip = false;
 	DungeonMan &dungeon = *_vm->_dungeonMan;
 
@@ -1586,7 +1586,7 @@ void DisplayMan::drawSquareD3C(Direction dir, int16 posX, int16 posY) {
 	);
 
 	uint16 squareAspect[5];
-	CellOrder order;
+	CellOrder order = kDMCellOrderNone;
 	bool skip = false;
 
 	DungeonMan &dungeon = *_vm->_dungeonMan;
@@ -1665,7 +1665,7 @@ void DisplayMan::drawSquareD2L(Direction dir, int16 posX, int16 posY) {
 		Frame(40, 63, 24, 82, 32, 61, 32, 0)   /* Right Horizontal Closed three fourth */
 	);
 
-	CellOrder order;
+	CellOrder order = kDMCellOrderNone;
 	uint16 squareAspect[5];
 	bool skip = false;
 
@@ -1748,7 +1748,7 @@ void DisplayMan::drawSquareD2R(Direction dir, int16 posX, int16 posY) {
 		Frame(200, 223, 24, 82, 32, 61, 32, 0)  /* Right Horizontal Closed three fourth */
 	);
 
-	CellOrder order;
+	CellOrder order = kDMCellOrderNone;
 	uint16 squareAspect[5];
 	bool skip = false;
 
@@ -1835,7 +1835,7 @@ void DisplayMan::drawSquareD2C(Direction dir, int16 posX, int16 posY) {
 		Frame(120, 143, 24, 82, 32, 61, 32, 0)   /* Right Horizontal Closed three fourth */
 	);
 
-	CellOrder order;
+	CellOrder order = kDMCellOrderNone;
 	uint16 squareAspect[5];
 	bool skip = false;
 
@@ -1918,7 +1918,7 @@ void DisplayMan::drawSquareD1L(Direction dir, int16 posX, int16 posY) {
 		Frame(0, 31, 17, 102, 48, 88, 52, 0)    /* Right Horizontal Closed three fourth */
 	);
 
-	CellOrder order;
+	CellOrder order = kDMCellOrderNone;
 	uint16 squareAspect[5];
 	bool skip = false;
 
@@ -2003,7 +2003,7 @@ void DisplayMan::drawSquareD1R(Direction dir, int16 posX, int16 posY) {
 		Frame(0, 0, 0, 0, 0, 0, 0, 0)             /* Right Horizontal Closed three fourth */
 	);
 
-	CellOrder order;
+	CellOrder order = kDMCellOrderNone;
 	uint16 squareAspect[5];
 	bool skip = false;
 
@@ -2075,7 +2075,7 @@ void DisplayMan::drawSquareD1C(Direction dir, int16 posX, int16 posY) {
 
 	ChampionMan &championMan = *_vm->_championMan;
 
-	CellOrder order;
+	CellOrder order = kDMCellOrderNone;
 	uint16 squareAspect[5];
 	bool skip = false;
 
@@ -2174,8 +2174,10 @@ void DisplayMan::drawSquareD0L(Direction dir, int16 posX, int16 posY) {
 		drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, kDMViewSquareD0L, kDMCellOrderBackRight);
 		break;
 	case kDMElementTypeWall:
-		drawWallSetBitmap(bitmapWallSetWallD0L, _frameWalls163[kDMViewSquareD0L]);
+		drawWallSetBitmap(_bitmapWallSetWallD0L, _frameWalls163[kDMViewSquareD0L]);
 		return;
+	default:
+		break;
 	}
 
 	drawCeilingPit(kDMGraphicIdxCeilingPitD0L, &frameCeilingPitD0L, posX, posY, false);
@@ -2208,6 +2210,8 @@ void DisplayMan::drawSquareD0R(Direction dir, int16 posX, int16 posY) {
 	case kDMElementTypeWall:
 		drawWallSetBitmap(_bitmapWallSetWallD0R, _frameWalls163[kDMViewSquareD0R]);
 		return;
+	default:
+		break;
 	}
 	if ((squareAspect[kDMSquareAspectElement] == kDMElementTypeTeleporter) && squareAspect[kDMSquareAspectTeleporterVisible])
 		drawField(&_fieldAspects188[kDMViewSquareD0R], _frameWalls163[kDMViewSquareD0R]._box);
@@ -2251,6 +2255,8 @@ void DisplayMan::drawSquareD0C(Direction dir, int16 posX, int16 posY) {
 	case kDMElementTypePit:
 		drawFloorPitOrStairsBitmap(squareAspect[kDMSquareAspectPitInvisible] ? kDMGraphicIdxFloorPitInvisibleD0C : kDMGraphicIdxFloorPitD0C, frameFloorPitD0C);
 		break;
+	default:
+		break;
 	}
 	drawCeilingPit(kDMGraphicIdxCeilingPitD0C, &frameCeilingPitD0C, posX, posY, false);
 	drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, kDMViewSquareD0C, kDMCellOrderBackLeftBackRight);
@@ -2284,7 +2290,7 @@ void DisplayMan::drawDungeon(Direction dir, int16 posX, int16 posY) {
 		_bitmapWallSetD3LCR = _bitmapWallD3LCRFlipped;
 		_bitmapWallSetD2LCR = _bitmapWallD2LCRFlipped;
 		_bitmapWallSetD1LCR = _bitmapWallD1LCRFlipped;
-		bitmapWallSetWallD0L = _bitmapWallD0LFlipped;
+		_bitmapWallSetWallD0L = _bitmapWallD0LFlipped;
 		_bitmapWallSetWallD0R = _bitmapWallD0RFlipped;
 	} else {
 		copyBitmapAndFlipHorizontal(_bitmapCeiling, _tmpBitmap, k112_byteWidthViewport, 29);
@@ -2360,7 +2366,7 @@ void DisplayMan::drawDungeon(Direction dir, int16 posX, int16 posY) {
 		_bitmapWallSetD3LCR = _bitmapWallD3LCRNative;
 		_bitmapWallSetD2LCR = _bitmapWallD2LCRNative;
 		_bitmapWallSetD1LCR = _bitmapWallD1LCRNative;
-		bitmapWallSetWallD0L = _bitmapWallD0LNative;
+		_bitmapWallSetWallD0L = _bitmapWallD0LNative;
 		_bitmapWallSetWallD0R = _bitmapWallD0RNative;
 	}
 
@@ -2409,7 +2415,7 @@ void DisplayMan::loadWallSet(WallSet set) {
 	loadIntoBitmap(graphicIndice++, _bitmapWallSetDoorFrameTopD1LCR);
 	loadIntoBitmap(graphicIndice++, _bitmapWallSetDoorFrameTopD2LCR);
 	loadIntoBitmap(graphicIndice++, _bitmapWallSetWallD0R);
-	loadIntoBitmap(graphicIndice++, bitmapWallSetWallD0L);
+	loadIntoBitmap(graphicIndice++, _bitmapWallSetWallD0L);
 	loadIntoBitmap(graphicIndice++, _bitmapWallSetD1LCR);
 	loadIntoBitmap(graphicIndice++, _bitmapWallSetD2LCR);
 	loadIntoBitmap(graphicIndice++, _bitmapWallSetD3LCR);
@@ -2536,7 +2542,7 @@ void DisplayMan::loadCurrentMapGraphics() {
 
 	copyBitmapAndFlipHorizontal(_bitmapWallD1LCRNative = _bitmapWallSetD1LCR, _bitmapWallD1LCRFlipped,
 									_frameWalls163[kDMViewSquareD1C]._srcByteWidth, _frameWalls163[kDMViewSquareD1C]._srcHeight);
-	copyBitmapAndFlipHorizontal(_bitmapWallD0LNative = bitmapWallSetWallD0L, _bitmapWallD0RFlipped,
+	copyBitmapAndFlipHorizontal(_bitmapWallD0LNative = _bitmapWallSetWallD0L, _bitmapWallD0RFlipped,
 									_frameWalls163[kDMViewSquareD0L]._srcByteWidth, _frameWalls163[kDMViewSquareD0L]._srcHeight);
 	copyBitmapAndFlipHorizontal(_bitmapWallD0RNative = _bitmapWallSetWallD0R, _bitmapWallD0LFlipped,
 									_frameWalls163[kDMViewSquareD0L]._srcByteWidth, _frameWalls163[kDMViewSquareD0L]._srcHeight);
diff --git a/engines/dm/gfx.h b/engines/dm/gfx.h
index c2ccea5..9da3a63 100644
--- a/engines/dm/gfx.h
+++ b/engines/dm/gfx.h
@@ -644,7 +644,7 @@ private:
 	byte _palChangesDoorButtonAndWallOrnD3[16]; // @ G0198_auc_Graphic558_PaletteChanges_DoorButtonAndWallOrnament_D3
 	byte _palChangesDoorButtonAndWallOrnD2[16]; // @ G0199_auc_Graphic558_PaletteChanges_DoorButtonAndWallOrnament_D2
 
-	byte *bitmapWallSetWallD0L; // @ G0701_puc_Bitmap_WallSet_Wall_D0L
+	byte *_bitmapWallSetWallD0L; // @ G0701_puc_Bitmap_WallSet_Wall_D0L
 	byte *_bitmapWallSetWallD0R; // @ G0702_puc_Bitmap_WallSet_Wall_D0R
 	byte *_bitmapWallSetDoorFrameTopD2LCR; // @ G0703_puc_Bitmap_WallSet_DoorFrameTop_D2LCR
 	byte *_bitmapWallSetDoorFrameTopD1LCR; // @ G0704_puc_Bitmap_WallSet_DoorFrameTop_D1LCR


Commit: 92aa71395849afc4b31cec8af71b82d1330c1ab5
    https://github.com/scummvm/scummvm/commit/92aa71395849afc4b31cec8af71b82d1330c1ab5
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2018-12-23T20:41:33+02:00

Commit Message:
FULLPIPE: Silence a false positive warning in MSVC

MSVC complained about a potentially uninitialized variable here

Changed paths:
    engines/fullpipe/statesaver.cpp


diff --git a/engines/fullpipe/statesaver.cpp b/engines/fullpipe/statesaver.cpp
index 942c07a..7cd10e5 100644
--- a/engines/fullpipe/statesaver.cpp
+++ b/engines/fullpipe/statesaver.cpp
@@ -63,7 +63,7 @@ bool GameLoader::writeSavegame(Scene *sc, const char *fname, const Common::Strin
 
 	GameVar *nxt = 0;
 	GameVar *prv = 0;
-	GameVar *par;
+	GameVar *par = 0;
 	if (v) {
 		nxt = v->_nextVarObj;
 		prv = v->_prevVarObj;


Commit: 7c5acdaa4b390198df20afc0c88ff22a87203342
    https://github.com/scummvm/scummvm/commit/7c5acdaa4b390198df20afc0c88ff22a87203342
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2018-12-23T20:43:28+02:00

Commit Message:
SLUDGE: Fix a potentially uninitialized variable

Variable "n" was not initialized if "stillToGo" was non-zero

Changed paths:
    engines/sludge/zbuffer.cpp


diff --git a/engines/sludge/zbuffer.cpp b/engines/sludge/zbuffer.cpp
index 02dddd0..4d2ae01 100644
--- a/engines/sludge/zbuffer.cpp
+++ b/engines/sludge/zbuffer.cpp
@@ -137,7 +137,7 @@ bool GraphicsManager::setZBuffer(int num) {
 
 	for (uint y = 0; y < _sceneHeight; y++) {
 		for (uint x = 0; x < _sceneWidth; x++) {
-			int n;
+			int n = 0;
 			if (stillToGo == 0) {
 				n = readStream->readByte();
 				stillToGo = n >> 4;


Commit: 424e71cfdc4caa342c0f45e987e31a8768efcadd
    https://github.com/scummvm/scummvm/commit/424e71cfdc4caa342c0f45e987e31a8768efcadd
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2018-12-23T20:44:28+02:00

Commit Message:
TITANIC: Silence an MSVC false positive about an uninitialized variable

Changed paths:
    engines/titanic/pet_control/pet_sound.cpp


diff --git a/engines/titanic/pet_control/pet_sound.cpp b/engines/titanic/pet_control/pet_sound.cpp
index c2c9110..6e88d7d 100644
--- a/engines/titanic/pet_control/pet_sound.cpp
+++ b/engines/titanic/pet_control/pet_sound.cpp
@@ -202,9 +202,9 @@ bool CPetSound::MouseButtonDownMsg(const Point &pt) {
 	CPetSlider *sliders[4] = { &_masterVolume, &_musicVolume, &_parrotVolume, &_speechVolume };
 	for (int idx = MASTER_SLIDER; idx <= SPEECH_SLIDER; ++idx) {
 		CPetSlider *slider = sliders[idx];
-		bool isLeft = rectLeft.contains(pt);
-		bool isRight = rectRight.contains(pt);
-		double offset;
+		const bool isLeft = rectLeft.contains(pt);
+		const bool isRight = rectRight.contains(pt);
+		double offset = 0.0;
 
 		if (isLeft) {
 			slider->stepPosition(-1);


Commit: 81288f2cac5773274ba09469552f48b5d3ca696f
    https://github.com/scummvm/scummvm/commit/81288f2cac5773274ba09469552f48b5d3ca696f
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2018-12-23T20:55:22+02:00

Commit Message:
SCI: Fix the wording in some patch comments

Changed paths:
    engines/sci/engine/script_patches.cpp


diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index 592293e..d6224ba 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -8077,7 +8077,7 @@ static const uint16 qg4InnPathfindingPatch[] = {
 };
 
 // When autosave is enabled, Glory::save() (script 0) deletes savegame files in
-// a loop: while disk space is insufficient for a new save, or while there are
+// a loop, while disk space is insufficient for a new save, or while there are
 // 20+ saves. Since ScummVM handles slots differently and allows far more
 // slots, this deletes all but the most recent 19 manual saves, merely by
 // walking from room to room!
@@ -9013,9 +9013,9 @@ static const uint16 qfg4RestartPatch[] = {
 // broadly tolerate nulls. That'd avoid exceptions but wouldn't restore normal
 // scaling after a climb.
 //
-// As last resort, we simply leave the original scaler on hero, erasing the
-// setScale() call that would freeze hero's size. hero shrinks/grows a little
-// while climbing as a side effect.
+// As a last resort, we simply leave the original scaler on hero, erasing the
+// setScale() call that would freeze hero's size. The hero shrinks/grows a
+// little while climbing as a side effect, but that's barely noticeable.
 //
 // Applies to at least: English CD, English floppy, German floppy
 // Responsible method: sUseTheGrapnel::changeState(5) in script 800
@@ -9044,7 +9044,7 @@ static const SciScriptPatcherEntry qfg4Signatures[] = {
 	{  true,     0, "fix inventory leaks across restarts",         1, qfg4RestartSignature,          qfg4RestartPatch },
 	{  true,     1, "disable volume reset on startup",             1, sci2VolumeResetSignature,      sci2VolumeResetPatch },
 	{  true,     1, "disable video benchmarking",                  1, qfg4BenchmarkSignature,        qfg4BenchmarkPatch },
-	{  true,     7, "fix consecutive moonrises",                   1, qfg4MoonriseSignature,         qfg4MoonrisePatch },
+	{  true,     7, "fix consecutive moon rises",                  1, qfg4MoonriseSignature,         qfg4MoonrisePatch },
 	{  true,    10, "fix setLooper calls (2/2)",                   2, qg4SetLooperSignature2,        qg4SetLooperPatch2 },
 	{  true,    31, "fix setScaler calls",                         1, qfg4SetScalerSignature,        qfg4SetScalerPatch },
 	{  true,    41, "fix conditional void calls",                  3, qfg4ConditionalVoidSignature,  qfg4ConditionalVoidPatch },
@@ -9091,11 +9091,12 @@ static const SciScriptPatcherEntry qfg4Signatures[] = {
 
 // ===========================================================================
 //  script 298 of sq4/floppy has an issue. object "nest" uses another property
-//   which isn't included in property count. We return 0 in that case, the game
-//   adds it to nest::x. The problem is that the script also checks if x exceeds
-//   we never reach that of course, so the pterodactyl-flight will go endlessly
-//   we could either calculate property count differently somehow fixing this
-//   but I think just patching it out is cleaner.
+//   which isn't included in property count. We return 0 in that case, so that
+//   the game does not increment nest::x. The problem is that the script also
+//   checks if x exceeds nest::x. We never reach that of course, so the
+//   incorrect property means that the pterodactyl flight will continue
+//	 endlessly. We could either calculate the property count differently,
+//   thereby fixing this bug, but I think that just patching it out is cleaner.
 // Fixes bug: #5093
 static const uint16 sq4FloppySignatureEndlessFlight[] = {
 	0x39, 0x04,                         // pushi 04 (selector x)





More information about the Scummvm-git-logs mailing list