[Scummvm-git-logs] scummvm master -> ef385b14bc56cf1aba97c1b99d92a60eccbd0826
sev-
sev at scummvm.org
Wed Aug 26 20:45:02 UTC 2020
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:
1b17c8f371 AGI: Winnie Apple ][ was mislabeled as Apple //gs
4f8a6ae527 HDB: Free sounds when they're not needed
ef385b14bc HDB: Plug a few memory leaks. Bug #11142
Commit: 1b17c8f37151cea13041a014ca489bd600a7983c
https://github.com/scummvm/scummvm/commit/1b17c8f37151cea13041a014ca489bd600a7983c
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-08-26T22:44:09+02:00
Commit Message:
AGI: Winnie Apple ][ was mislabeled as Apple //gs
Changed paths:
engines/agi/detection_tables.h
engines/agi/preagi_winnie.cpp
diff --git a/engines/agi/detection_tables.h b/engines/agi/detection_tables.h
index 40b904bc81..c60088756b 100644
--- a/engines/agi/detection_tables.h
+++ b/engines/agi/detection_tables.h
@@ -670,8 +670,8 @@ static const AGIGameDescription gameDescriptions[] = {
// Winnie the Pooh in the Hundred Acre Wood (C64)
GAMEpre_P("winnie", "", "title.pic", "d4eb97cffc866110f71e1ec9f84fe643", 0x0000, GID_WINNIE, Common::kPlatformC64),
- // Winnie the Pooh in the Hundred Acre Wood (Apple //gs)
- GAMEpre_P("winnie", "", "title.pic", "45e06010a3c61d78f4661103c901ae11", 0x0000, GID_WINNIE, Common::kPlatformApple2GS),
+ // Winnie the Pooh in the Hundred Acre Wood (Apple ][)
+ GAMEpre_P("winnie", "", "title.pic", "45e06010a3c61d78f4661103c901ae11", 0x0000, GID_WINNIE, Common::kPlatformApple2),
// Xmas Card 1986 (PC) [AGI 2.272]
GAME("xmascard", "1986-11-13 [version 1]", "3067b8d5957e2861e069c3c0011bd43d", 0x2272, GID_XMASCARD),
diff --git a/engines/agi/preagi_winnie.cpp b/engines/agi/preagi_winnie.cpp
index 6a3aa5374b..b4b8773226 100644
--- a/engines/agi/preagi_winnie.cpp
+++ b/engines/agi/preagi_winnie.cpp
@@ -96,7 +96,7 @@ uint32 WinnieEngine::readRoom(int iRoom, uint8 *buffer, WTP_ROOM_HDR &roomHdr) {
fileName = Common::String::format(IDS_WTP_ROOM_AMIGA, iRoom);
else if (getPlatform() == Common::kPlatformC64)
fileName = Common::String::format(IDS_WTP_ROOM_C64, iRoom);
- else if (getPlatform() == Common::kPlatformApple2GS)
+ else if (getPlatform() == Common::kPlatformApple2)
fileName = Common::String::format(IDS_WTP_ROOM_APPLE, iRoom);
Common::File file;
@@ -129,7 +129,7 @@ uint32 WinnieEngine::readObj(int iObj, uint8 *buffer) {
fileName = Common::String::format(IDS_WTP_OBJ_AMIGA, iObj);
else if (getPlatform() == Common::kPlatformC64)
fileName = Common::String::format(IDS_WTP_OBJ_C64, iObj);
- else if (getPlatform() == Common::kPlatformApple2GS)
+ else if (getPlatform() == Common::kPlatformApple2)
fileName = Common::String::format(IDS_WTP_OBJ_APPLE, iObj);
Common::File file;
@@ -1366,7 +1366,7 @@ void WinnieEngine::init() {
_objOffset = 0;
}
- if (getPlatform() == Common::kPlatformC64 || getPlatform() == Common::kPlatformApple2GS)
+ if (getPlatform() == Common::kPlatformC64 || getPlatform() == Common::kPlatformApple2)
_picture->setPictureVersion(AGIPIC_C64);
hotspotNorth = Common::Rect(20, 0, (IDI_WTP_PIC_WIDTH + 10) * 2, 10);
@@ -1380,7 +1380,7 @@ Common::Error WinnieEngine::go() {
randomize();
// The intro is not supported on these platforms yet
- if (getPlatform() != Common::kPlatformC64 && getPlatform() != Common::kPlatformApple2GS)
+ if (getPlatform() != Common::kPlatformC64 && getPlatform() != Common::kPlatformApple2)
intro();
gameLoop();
Commit: 4f8a6ae527668384fb0073bc9bf707a132068479
https://github.com/scummvm/scummvm/commit/4f8a6ae527668384fb0073bc9bf707a132068479
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-08-26T22:44:09+02:00
Commit Message:
HDB: Free sounds when they're not needed
Changed paths:
engines/hdb/sound.cpp
engines/hdb/sound.h
diff --git a/engines/hdb/sound.cpp b/engines/hdb/sound.cpp
index 3a62f8ad34..98b28ad740 100644
--- a/engines/hdb/sound.cpp
+++ b/engines/hdb/sound.cpp
@@ -1887,6 +1887,12 @@ void Song::update() {
}
}
+Sound::~Sound() {
+ for (int i = 0; i < kMaxSounds; i++) {
+ freeSound(i);
+ }
+}
+
void Sound::updateMusic() {
if (_song1.isPlaying()) {
_song1.update();
@@ -1924,6 +1930,8 @@ void Sound::freeSound(int index) {
if (_soundCache[index].loaded == SNDMEM_LOADED) {
_soundCache[index].loaded = SNDMEM_NOTCACHED;
_soundCache[index].ext = SNDTYPE_NONE;
+ free(_soundCache[index].data);
+ _soundCache[index].data = nullptr;
}
}
diff --git a/engines/hdb/sound.h b/engines/hdb/sound.h
index 3ae5b3b252..9331fe2c23 100644
--- a/engines/hdb/sound.h
+++ b/engines/hdb/sound.h
@@ -1495,6 +1495,7 @@ class Sound {
public:
Sound();
+ ~Sound();
void test(); // FIXME. Remove
Commit: ef385b14bc56cf1aba97c1b99d92a60eccbd0826
https://github.com/scummvm/scummvm/commit/ef385b14bc56cf1aba97c1b99d92a60eccbd0826
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-08-26T22:44:19+02:00
Commit Message:
HDB: Plug a few memory leaks. Bug #11142
Changed paths:
engines/hdb/ai-cinematic.cpp
engines/hdb/sound.cpp
engines/hdb/window.cpp
diff --git a/engines/hdb/ai-cinematic.cpp b/engines/hdb/ai-cinematic.cpp
index 1d0715e3e1..995bff6f55 100644
--- a/engines/hdb/ai-cinematic.cpp
+++ b/engines/hdb/ai-cinematic.cpp
@@ -461,6 +461,7 @@ void AI::processCines() {
return;
if (complete && _cine.size()) {
+ delete _cine[i];
_cine.remove_at(i);
i--;
complete = false;
diff --git a/engines/hdb/sound.cpp b/engines/hdb/sound.cpp
index 98b28ad740..47f78b1a01 100644
--- a/engines/hdb/sound.cpp
+++ b/engines/hdb/sound.cpp
@@ -1889,7 +1889,7 @@ void Song::update() {
Sound::~Sound() {
for (int i = 0; i < kMaxSounds; i++) {
- freeSound(i);
+ free(_soundCache[i].data);
}
}
@@ -1930,8 +1930,6 @@ void Sound::freeSound(int index) {
if (_soundCache[index].loaded == SNDMEM_LOADED) {
_soundCache[index].loaded = SNDMEM_NOTCACHED;
_soundCache[index].ext = SNDTYPE_NONE;
- free(_soundCache[index].data);
- _soundCache[index].data = nullptr;
}
}
diff --git a/engines/hdb/window.cpp b/engines/hdb/window.cpp
index ee53f2cd9f..049993b23b 100644
--- a/engines/hdb/window.cpp
+++ b/engines/hdb/window.cpp
@@ -1925,6 +1925,7 @@ void Window::drawTextOut() {
g_hdb->_gfx->drawText(t->text);
if (t->timer < time) {
+ delete _textOutList[i];
_textOutList.remove_at(i);
i--;
}
More information about the Scummvm-git-logs
mailing list