[Scummvm-git-logs] scummvm master -> 9a76e14e545ae71dd072df29c4c4b42b98d67353

Strangerke noreply at scummvm.org
Fri Apr 3 09:21:42 UTC 2026


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

Summary:
9a76e14e54 WAYNESWORLD: Janitorial: Fix some issues reported by CppCheck


Commit: 9a76e14e545ae71dd072df29c4c4b42b98d67353
    https://github.com/scummvm/scummvm/commit/9a76e14e545ae71dd072df29c4c4b42b98d67353
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2026-04-03T11:21:05+02:00

Commit Message:
WAYNESWORLD: Janitorial: Fix some issues reported by CppCheck

Changed paths:
    engines/waynesworld/gamelogic.h
    engines/waynesworld/graphics.cpp
    engines/waynesworld/graphics.h
    engines/waynesworld/intro.cpp
    engines/waynesworld/waynesworld.cpp
    engines/waynesworld/waynesworld.h


diff --git a/engines/waynesworld/gamelogic.h b/engines/waynesworld/gamelogic.h
index 33ad8525c19..0cae5f68e30 100644
--- a/engines/waynesworld/gamelogic.h
+++ b/engines/waynesworld/gamelogic.h
@@ -109,7 +109,7 @@ public:
 	int _r37_safeCombinationLockIndex;
 	byte _r38_flags;
 	byte _r39_flags;
-	bool _didScratchTicket;
+	bool _didScratchTicket = false;
 	byte _pizzathonListFlags1;
 	byte _pizzathonListFlags2;
 
diff --git a/engines/waynesworld/graphics.cpp b/engines/waynesworld/graphics.cpp
index 24a1a40d0b9..e30e7b0bf60 100644
--- a/engines/waynesworld/graphics.cpp
+++ b/engines/waynesworld/graphics.cpp
@@ -450,7 +450,7 @@ void ScreenEffect::drawBlock(int blockX, int blockY) {
 	}
 }
 
-uint ScreenEffect::getBitCount(int value) const {
+uint ScreenEffect::getBitCount(int value) {
 	int bitCount = 0;
 	while ((value >> bitCount) != 0) {
 		bitCount++;
diff --git a/engines/waynesworld/graphics.h b/engines/waynesworld/graphics.h
index b13dfac587c..b4511ff6689 100644
--- a/engines/waynesworld/graphics.h
+++ b/engines/waynesworld/graphics.h
@@ -54,11 +54,12 @@ public:
 	int getTextWidth(const char *text) const;
 	int getCharWidth(byte ch) const;
 protected:
-	byte _firstChar;
-	byte _lastChar;
-	uint16 *_charTable;
-	byte *_fontData;
-	int16 _formWidth, _formHeight;
+	byte _firstChar = 0;
+	byte _lastChar = 0;
+	uint16 *_charTable = nullptr;
+	byte *_fontData = nullptr;
+	int16 _formWidth = 0;
+	int16 _formHeight = 0;
 };
 
 class Screen {
@@ -99,10 +100,10 @@ protected:
 	int _blockCountW, _blockCountH;
 	int _blockCtr;
 	uint32 _timePerSlice;
-	uint32 _totalSliceTicks;
+	uint32 _totalSliceTicks = 0;
 	int _blocksPerSlice;
 	void drawBlock(int blockX, int blockY);
-	uint getBitCount(int value) const;
+	static uint getBitCount(int value);
 	uint getSeed(uint bitCount) const;
 };
 
diff --git a/engines/waynesworld/intro.cpp b/engines/waynesworld/intro.cpp
index 26b60715f90..932561d01d8 100644
--- a/engines/waynesworld/intro.cpp
+++ b/engines/waynesworld/intro.cpp
@@ -411,9 +411,6 @@ void WaynesWorldEngine::introPt6() {
 			scrollSurface->copyRectToSurface((Graphics::Surface)*introPt6Surface[4], 0, 0, Common::Rect(0, 200 - i, 319, 200));
 			scrollSurface->copyRectToSurface((Graphics::Surface)*signBottomSurface, 0, i, Common::Rect(0, 0, 319, 200 - i));
 			_screen->drawSurface(scrollSurface, 0, 0);
-			if (_escPressed) {
-				break;
-			}
 		}
 	}
 
diff --git a/engines/waynesworld/waynesworld.cpp b/engines/waynesworld/waynesworld.cpp
index e6dbee1d1e1..d9af9916b02 100644
--- a/engines/waynesworld/waynesworld.cpp
+++ b/engines/waynesworld/waynesworld.cpp
@@ -2040,11 +2040,11 @@ void WaynesWorldEngine::handleVerbUse() {
 }
 
 void WaynesWorldEngine::handleVerbTalkTo() {
-	int actionTextIndex;
 	_dialogChoices[0] = -1;
 
 	if (_objectNumber == -3 || _objectNumber == -2) {
 		const bool room1Special = !(_logic->_r1_flags1 & 0x10) && isActorWayne() && _currentRoomNumber == 1 && (_logic->_r1_flags2 & 0x01);
+		int actionTextIndex;
 		if (room1Special) {
 			actionTextIndex = 14;
 		} else {
diff --git a/engines/waynesworld/waynesworld.h b/engines/waynesworld/waynesworld.h
index f1e88823e66..33680c05329 100644
--- a/engines/waynesworld/waynesworld.h
+++ b/engines/waynesworld/waynesworld.h
@@ -192,8 +192,8 @@ private:
 	GxlArchive *_oanGxl = nullptr;
 
 public:
-	Common::RandomSource *_random;
-	GameLogic *_logic;
+	Common::RandomSource *_random = nullptr;
+	GameLogic *_logic = nullptr;
 
 	void updateEvents();
 
@@ -215,8 +215,8 @@ public:
 	GxlArchive *_r10Gxl = nullptr;
 
 	// Sound and Music
-	SoundManager *_sound;
-	MusicManager *_midi;
+	SoundManager *_sound = nullptr;
+	MusicManager *_midi = nullptr;
 
 	// Room
 	Common::String _roomName;
@@ -234,18 +234,18 @@ public:
 
 	// Input
 	int _mouseX = 0, _mouseY = 0;
-	int _mouseClickY, _mouseClickX;
+	int _mouseClickY = 0, _mouseClickX = 0;
 	Common::Rect _mouseZone = {0, 0, 319, 199};
-	uint _mouseClickButtons;
-	Common::KeyCode _keyCode;
+	uint _mouseClickButtons = 0;
+	Common::KeyCode _keyCode = Common::KEYCODE_INVALID;
 
 	// Text
 	Common::String _currentText;
-	int _currentTextX, _currentTextY;
-	bool _isTextVisible;
+	int _currentTextX = 0, _currentTextY = 0;
+	bool _isTextVisible = false;
 
 	// Audio
-	int _musicIndex;
+	int _musicIndex = 0;
 
 	// Game
 	int _gameState; // TODO Use enum




More information about the Scummvm-git-logs mailing list