[Scummvm-git-logs] scummvm master -> 6552ec1bfb68d67beab7e884d39151aa6534aa9f

bluegr noreply at scummvm.org
Thu Nov 7 21:31:56 UTC 2024


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

Summary:
55646e8442 DGDS: Plugged several memory leaks upon engine destruction
58e63df101 DGDS: Add support for returning to launcher
6552ec1bfb DGDS: Add support for Johnny Castaway's hires screen resolution


Commit: 55646e8442ecc8aef29d7f0b71a9f99e9943e33e
    https://github.com/scummvm/scummvm/commit/55646e8442ecc8aef29d7f0b71a9f99e9943e33e
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2024-11-07T23:31:32+02:00

Commit Message:
DGDS: Plugged several memory leaks upon engine destruction

Changed paths:
    engines/dgds/dgds.cpp
    engines/dgds/sound/drivers/adlib.cpp
    engines/dgds/sound/drivers/amigamac1.cpp
    engines/dgds/sound/drivers/cms.cpp
    engines/dgds/sound/drivers/midi.cpp
    engines/dgds/sound/music.cpp


diff --git a/engines/dgds/dgds.cpp b/engines/dgds/dgds.cpp
index c80d4c71917..0431c39cfaa 100644
--- a/engines/dgds/dgds.cpp
+++ b/engines/dgds/dgds.cpp
@@ -127,9 +127,11 @@ DgdsEngine::~DgdsEngine() {
 	delete _resource;
 	delete _scene;
 	delete _gdsScene;
+	delete _gameGlobals;
 	delete _soundPlayer;
 	delete _fontManager;
 	delete _menu;
+	delete _adsInterp;
 	delete _inventory;
 	delete _shellGame;
 	delete _hocIntro;
diff --git a/engines/dgds/sound/drivers/adlib.cpp b/engines/dgds/sound/drivers/adlib.cpp
index 210b20a67eb..d29b6913817 100644
--- a/engines/dgds/sound/drivers/adlib.cpp
+++ b/engines/dgds/sound/drivers/adlib.cpp
@@ -863,6 +863,7 @@ int MidiPlayer_AdLib::open() {
 
 	if (res) {
 		ok = static_cast<MidiDriver_AdLib *>(_driver)->loadResource(*res);
+		delete res;
 	} else {
 		// Early SCI0 games have the sound bank embedded in the AdLib driver
 
diff --git a/engines/dgds/sound/drivers/amigamac1.cpp b/engines/dgds/sound/drivers/amigamac1.cpp
index d6493dcfe63..40813744325 100644
--- a/engines/dgds/sound/drivers/amigamac1.cpp
+++ b/engines/dgds/sound/drivers/amigamac1.cpp
@@ -961,6 +961,8 @@ int MidiPlayer_Mac1::open() {
 		return MidiDriver::MERR_DEVICE_NOT_AVAILABLE;
 	}
 
+	delete patch;
+
 	for (byte vi = 0; vi < kVoices; ++vi)
 		_voices.push_back(new MacVoice(*this, vi));
 
@@ -1151,6 +1153,8 @@ int MidiPlayer_Amiga1::open() {
 		return MidiDriver::MERR_DEVICE_NOT_AVAILABLE;
 	}
 
+	delete patch;
+
 	for (byte vi = 0; vi < kVoices; ++vi)
 		_voices.push_back(new AmigaVoice(*this, vi));
 
diff --git a/engines/dgds/sound/drivers/cms.cpp b/engines/dgds/sound/drivers/cms.cpp
index a2f02559bea..a88e7e2c6a9 100644
--- a/engines/dgds/sound/drivers/cms.cpp
+++ b/engines/dgds/sound/drivers/cms.cpp
@@ -748,6 +748,8 @@ int MidiDriver_CMS::open() {
 		_voice[i] = new CMSVoice_V1(i, this, _cms, *_patchData);
 	}
 
+	delete res;
+
 	_playSwitch = true;
 	_masterVolume = 15;
 
diff --git a/engines/dgds/sound/drivers/midi.cpp b/engines/dgds/sound/drivers/midi.cpp
index b90e3d7642f..45692e38dfa 100644
--- a/engines/dgds/sound/drivers/midi.cpp
+++ b/engines/dgds/sound/drivers/midi.cpp
@@ -1033,6 +1033,8 @@ int MidiPlayer_Midi::open() {
 		}
 	}
 
+	delete res;
+
 	return 0;
 }
 
diff --git a/engines/dgds/sound/music.cpp b/engines/dgds/sound/music.cpp
index b6153a86f2f..2c77e4b8c8d 100644
--- a/engines/dgds/sound/music.cpp
+++ b/engines/dgds/sound/music.cpp
@@ -67,6 +67,8 @@ SciMusic::SciMusic(bool useDigitalSFX) :
 }
 
 SciMusic::~SciMusic() {
+	clearPlayList();
+
 	if (_pMidiDrv) {
 		_pMidiDrv->close();
 		delete _pMidiDrv;


Commit: 58e63df101a2e4dbd7d02eead2f34615184254aa
    https://github.com/scummvm/scummvm/commit/58e63df101a2e4dbd7d02eead2f34615184254aa
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2024-11-07T23:31:33+02:00

Commit Message:
DGDS: Add support for returning to launcher

Changed paths:
    engines/dgds/dgds.h


diff --git a/engines/dgds/dgds.h b/engines/dgds/dgds.h
index 8c1aa25756d..57f4f2c5a77 100644
--- a/engines/dgds/dgds.h
+++ b/engines/dgds/dgds.h
@@ -242,6 +242,7 @@ public:
 
 	bool hasFeature(EngineFeature f) const override {
 		return
+			(f == kSupportsReturnToLauncher) ||
 			(f == kSupportsLoadingDuringRuntime) ||
 			(f == kSupportsSavingDuringRuntime);
 	};


Commit: 6552ec1bfb68d67beab7e884d39151aa6534aa9f
    https://github.com/scummvm/scummvm/commit/6552ec1bfb68d67beab7e884d39151aa6534aa9f
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2024-11-07T23:31:33+02:00

Commit Message:
DGDS: Add support for Johnny Castaway's hires screen resolution

This does not affect existing lowres titles

Changed paths:
    engines/dgds/image.cpp
    engines/dgds/includes.h


diff --git a/engines/dgds/image.cpp b/engines/dgds/image.cpp
index 24b08fe6ef5..4fcad07af39 100644
--- a/engines/dgds/image.cpp
+++ b/engines/dgds/image.cpp
@@ -359,7 +359,7 @@ struct VQTDecodeState {
 	uint32 offset;
 	const byte *srcPtr;
 	byte *dstPtr;
-	uint16 rowStarts[SCREEN_HEIGHT];
+	uint16 rowStarts[SCREEN_HEIGHT_FIXED];
 };
 
 static inline byte _getVqtBits(struct VQTDecodeState *state, uint16 nbits) {
@@ -474,6 +474,7 @@ uint32 Image::loadVQT(Graphics::ManagedSurface *surf, uint32 toffset, Common::Se
 	uint32 tw = surf->w;
 	uint32 th = surf->h;
 	assert(th != 0);
+	assert(DgdsEngine::getInstance()->getGameId() != GID_CASTAWAY);
 	if (th > SCREEN_HEIGHT)
 		error("Max VQT height supported is 200px");
 	VQTDecodeState state;
diff --git a/engines/dgds/includes.h b/engines/dgds/includes.h
index 3d766236fa0..607cc6676d3 100644
--- a/engines/dgds/includes.h
+++ b/engines/dgds/includes.h
@@ -86,8 +86,9 @@ namespace Dgds {
 
 #define EX_OVL MKTAG24('O', 'V', 'L')
 
-#define SCREEN_WIDTH 320
-#define SCREEN_HEIGHT 200
+#define SCREEN_WIDTH (DgdsEngine::getInstance()->getGameId() != GID_CASTAWAY ? 320 : 640)
+#define SCREEN_HEIGHT (DgdsEngine::getInstance()->getGameId() != GID_CASTAWAY ? 200 : 480)
+#define SCREEN_HEIGHT_FIXED 200
 
 } // End of namespace Dgds
 




More information about the Scummvm-git-logs mailing list