[Scummvm-git-logs] scummvm master -> 342d8ab1c8d35c9c1c3d408099b01e14cc25b5c3

mduggan noreply at scummvm.org
Sat Aug 3 23:17:28 UTC 2024


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

Summary:
afec75acac DGDS: Simplify casts to avoid nulls
342d8ab1c8 DGDS: Fix int overflow warning


Commit: afec75acacb0a50ddc356c240b2eb4a901f9aeaa
    https://github.com/scummvm/scummvm/commit/afec75acacb0a50ddc356c240b2eb4a901f9aeaa
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2024-08-04T09:15:56+10:00

Commit Message:
DGDS: Simplify casts to avoid nulls

Changed paths:
    engines/dgds/shell_game.cpp


diff --git a/engines/dgds/shell_game.cpp b/engines/dgds/shell_game.cpp
index aef6473a0ad..118923b9592 100644
--- a/engines/dgds/shell_game.cpp
+++ b/engines/dgds/shell_game.cpp
@@ -40,7 +40,8 @@ _reverseDirection(0), _clockwise(false)
 
 void ShellGame::init() {
 	DgdsEngine *engine = DgdsEngine::getInstance();
-	HocGlobals *globals = dynamic_cast<HocGlobals *>(engine->getGameGlobals());
+	HocGlobals *globals = static_cast<HocGlobals *>(engine->getGameGlobals());
+	assert(globals);
 	_shellGameImg.reset(new Image(engine->getResourceManager(), engine->getDecompressor()));
 	_shellGameImg->loadBitmap("SHELLGM2.BMP");
 	globals->setShellPea(engine->getRandom().getRandomNumber(2));
@@ -85,7 +86,8 @@ void ShellGame::drawShells() const {
 
 void ShellGame::shellGameTick() {
 	DgdsEngine *engine = DgdsEngine::getInstance();
-	HocGlobals *globals = dynamic_cast<HocGlobals *>(engine->getGameGlobals());
+	HocGlobals *globals = static_cast<HocGlobals *>(engine->getGameGlobals());
+	assert(globals);
 
 	if (!_shellGameImg)
 		init();


Commit: 342d8ab1c8d35c9c1c3d408099b01e14cc25b5c3
    https://github.com/scummvm/scummvm/commit/342d8ab1c8d35c9c1c3d408099b01e14cc25b5c3
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2024-08-04T09:17:05+10:00

Commit Message:
DGDS: Fix int overflow warning

Changed paths:
    engines/dgds/scene.cpp
    engines/dgds/sound.cpp


diff --git a/engines/dgds/scene.cpp b/engines/dgds/scene.cpp
index 70a9034c328..ef712bc022e 100644
--- a/engines/dgds/scene.cpp
+++ b/engines/dgds/scene.cpp
@@ -1706,7 +1706,7 @@ static bool _isInRect(const Common::Point &pt, const DgdsRect rect) {
 			&& rect.y <= pt.y && (rect.y + rect.height) > pt.y;
 }
 
-static const ObjectInteraction * _findInteraction(const Common::Array<ObjectInteraction> &interList, int16 droppedNum, int16 targetNum) {
+static const ObjectInteraction * _findInteraction(const Common::Array<ObjectInteraction> &interList, int16 droppedNum, uint16 targetNum) {
 	for (const auto &i : interList) {
 		if (i.matches(droppedNum, targetNum)) {
 			return &i;
diff --git a/engines/dgds/sound.cpp b/engines/dgds/sound.cpp
index 7b28f18a533..5fade1d0747 100644
--- a/engines/dgds/sound.cpp
+++ b/engines/dgds/sound.cpp
@@ -284,7 +284,7 @@ void Sound::loadMacMusic(const Common::String &filename) {
 		} else if (chunk.isSection(ID_TAG) || chunk.isSection(ID_FNM)) {
 			_readStrings(stream);
 		} else if (chunk.isSection(ID_DAT)) {
-			// TODO: Should we record the indices?
+			// TODO: Should we record the indexes?
 			/*uint16 idx = */ stream->readUint16LE();
 			/*uint16 type = */ stream->readUint16LE();
 			uint32 sz;
@@ -294,7 +294,7 @@ void Sound::loadMacMusic(const Common::String &filename) {
 	}
 
 	delete musicStream;
-	
+
 	stopMusic();
 }
 




More information about the Scummvm-git-logs mailing list