[Scummvm-git-logs] scummvm master -> 9346c6bd8206f6af1192bea8a13d1face62dd28b
dreammaster
noreply at scummvm.org
Mon May 5 22:08:51 UTC 2025
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
5e4e96d8e8 AWE: Give a descriptive error for Anniversary versions not being supported
9346c6bd82 AWE: Fixes for gcc warnings, thanks to digitall
Commit: 5e4e96d8e86c1766469e08ef0b9ee98f43df072d
https://github.com/scummvm/scummvm/commit/5e4e96d8e86c1766469e08ef0b9ee98f43df072d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2025-05-05T14:53:55-07:00
Commit Message:
AWE: Give a descriptive error for Anniversary versions not being supported
Changed paths:
engines/awe/awe.cpp
diff --git a/engines/awe/awe.cpp b/engines/awe/awe.cpp
index 47e2846132a..8682930f75d 100644
--- a/engines/awe/awe.cpp
+++ b/engines/awe/awe.cpp
@@ -148,7 +148,9 @@ Common::Error AweEngine::run() {
}
Gfx *graphics = createGraphics(graphicsType);
- assert(graphics);
+
+ if (!graphics)
+ error("The Anniversary versions graphics is not currently supported");
if (dataType == DT_20TH_EDITION) {
switch (Script::_difficulty) {
Commit: 9346c6bd8206f6af1192bea8a13d1face62dd28b
https://github.com/scummvm/scummvm/commit/9346c6bd8206f6af1192bea8a13d1face62dd28b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2025-05-05T15:08:35-07:00
Commit Message:
AWE: Fixes for gcc warnings, thanks to digitall
Changed paths:
engines/awe/graphics_soft.cpp
engines/awe/intern.h
engines/awe/resource_nth.cpp
engines/awe/sfx_player.cpp
engines/awe/sfx_player.h
diff --git a/engines/awe/graphics_soft.cpp b/engines/awe/graphics_soft.cpp
index e37943dc2c9..13f8793716b 100644
--- a/engines/awe/graphics_soft.cpp
+++ b/engines/awe/graphics_soft.cpp
@@ -82,7 +82,6 @@ struct GraphicsSoft : public Gfx {
GraphicsSoft::GraphicsSoft() {
_fixUpPalette = FIXUP_PALETTE_NONE;
memset(_pagePtrs, 0, sizeof(_pagePtrs));
- memset(_pal, 0, sizeof(_pal));
}
GraphicsSoft::~GraphicsSoft() {
diff --git a/engines/awe/intern.h b/engines/awe/intern.h
index 310ad2472c5..d05d0fb50c7 100644
--- a/engines/awe/intern.h
+++ b/engines/awe/intern.h
@@ -87,6 +87,13 @@ struct Color {
uint8 &r = rgb[0];
uint8 &g = rgb[1];
uint8 &b = rgb[2];
+
+ Color() {
+ clear();
+ }
+ void clear() {
+ r = g = b = 0;
+ }
};
struct Frac {
diff --git a/engines/awe/resource_nth.cpp b/engines/awe/resource_nth.cpp
index efc680f6542..889cc52c2e8 100644
--- a/engines/awe/resource_nth.cpp
+++ b/engines/awe/resource_nth.cpp
@@ -85,7 +85,7 @@ struct Resource15th : ResourceNth {
}
virtual uint8 *loadBmp(int num) {
- char name[16];
+ char name[32];
if (num >= 3000) {
snprintf(name, sizeof(name), "e%04d.bmp", num);
} else {
@@ -95,7 +95,7 @@ struct Resource15th : ResourceNth {
}
virtual uint8 *loadDat(int num, uint8 *dst, uint32 *size) {
- char name[16];
+ char name[32];
snprintf(name, sizeof(name), "file%03d.dat", num);
const PakEntry *e = _pak.find(name);
if (e) {
diff --git a/engines/awe/sfx_player.cpp b/engines/awe/sfx_player.cpp
index b89ffa750ec..5dab99e8e99 100644
--- a/engines/awe/sfx_player.cpp
+++ b/engines/awe/sfx_player.cpp
@@ -26,6 +26,26 @@
namespace Awe {
+void SfxInstrument::clear() {
+ data = nullptr;
+ volume = 0;
+}
+
+void SfxModule::clear() {
+ data = nullptr;
+ curPos = 0;
+ curOrder = 0;
+ numOrder = 0;
+ orderTable = nullptr;
+
+ clearSamples();
+}
+
+void SfxModule::clearSamples() {
+ for (int i = 0; i < 15; ++i)
+ samples[i].clear();
+}
+
SfxPlayer::SfxPlayer(Resource *res)
: _res(res), _delay(0) {
_playing = false;
@@ -40,7 +60,8 @@ void SfxPlayer::loadSfxModule(uint16 resNum, uint16 delay, uint8 pos) {
debugC(kDebugSound, "SfxPlayer::loadSfxModule(0x%X, %d, %d)", resNum, delay, pos);
MemEntry *me = &_res->_memList[resNum];
if (me->status == Resource::STATUS_LOADED && me->type == Resource::RT_MUSIC) {
- memset(&_sfxMod, 0, sizeof(SfxModule));
+ _sfxMod.clear();
+
_sfxMod.curOrder = pos;
_sfxMod.numOrder = me->bufPtr[0x3F];
debugC(kDebugSound, "SfxPlayer::loadSfxModule() curOrder = 0x%X numOrder = 0x%X", _sfxMod.curOrder, _sfxMod.numOrder);
@@ -59,7 +80,8 @@ void SfxPlayer::loadSfxModule(uint16 resNum, uint16 delay, uint8 pos) {
}
void SfxPlayer::prepareInstruments(const uint8 *p) {
- memset(_sfxMod.samples, 0, sizeof(_sfxMod.samples));
+ _sfxMod.clearSamples();
+
for (int i = 0; i < 15; ++i) {
SfxInstrument *ins = &_sfxMod.samples[i];
const uint16 resNum = READ_BE_UINT16(p); p += 2;
@@ -179,7 +201,7 @@ void SfxPlayer::handleEvents() {
void SfxPlayer::handlePattern(uint8 channel, const uint8 *data) {
SfxPattern pat;
- memset(&pat, 0, sizeof(SfxPattern));
+
pat.note_1 = READ_BE_UINT16(data + 0);
pat.note_2 = READ_BE_UINT16(data + 2);
if (pat.note_1 != 0xFFFD) {
diff --git a/engines/awe/sfx_player.h b/engines/awe/sfx_player.h
index 9a94f53d382..6b76f58d8fb 100644
--- a/engines/awe/sfx_player.h
+++ b/engines/awe/sfx_player.h
@@ -29,6 +29,8 @@ namespace Awe {
struct SfxInstrument {
uint8 *data = nullptr;
uint16 volume = 0;
+
+ void clear();
};
struct SfxModule {
@@ -38,6 +40,9 @@ struct SfxModule {
uint8 numOrder = 0;
uint8 *orderTable = nullptr;
SfxInstrument samples[15];
+
+ void clear();
+ void clearSamples();
};
struct SfxPattern {
More information about the Scummvm-git-logs
mailing list