[Scummvm-git-logs] scummvm branch-2-9 -> 57ba2399a44a9c286f9f88bd7f841554272277db
bluegr
noreply at scummvm.org
Sat Nov 16 16:57:01 UTC 2024
This automated email contains information about 12 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
f79ba25752 SCUMM: Initialize data to avoid Valgrind warnings on saving
fc9e8e1a71 SCUMM: Initialize _bannerColors
ebaa080d69 SCUMM: Fix one of many Full Throttle Valgrind warnings
5dc111f896 SCUMM: Remove unused variable
5d5e3aca1b SCUMM: Remove unimplemented methods
39e3cf98f8 SCUMM: Remove unused variables
35f89d64ac SCUMM: HE: Initialize class members
640a9213cc SCUMM: DIMUSE: Initialize class members
70c1f5eeae SCUMM: MACGUI: Initialize class members
86749b9530 SCUMM: Initialize class members for sound player code
f1d7176954 SCUMM: Initialize class members
57ba2399a4 DGDS: Raise debuglevel of all debug statements to at least 1
Commit: f79ba25752f252b1233832aa3ef1462ed3a417ae
https://github.com/scummvm/scummvm/commit/f79ba25752f252b1233832aa3ef1462ed3a417ae
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-11-16T18:56:29+02:00
Commit Message:
SCUMM: Initialize data to avoid Valgrind warnings on saving
This is enough to silence all the Valgrind warnings I got when saving in
The Dig.
Changed paths:
engines/scumm/actor.h
engines/scumm/imuse_digi/dimuse_fades.cpp
engines/scumm/imuse_digi/dimuse_files.h
engines/scumm/imuse_digi/dimuse_tracks.cpp
engines/scumm/imuse_digi/dimuse_triggers.cpp
engines/scumm/saveload.cpp
diff --git a/engines/scumm/actor.h b/engines/scumm/actor.h
index 3899c756967..34ba3c4303c 100644
--- a/engines/scumm/actor.h
+++ b/engines/scumm/actor.h
@@ -67,9 +67,9 @@ struct CostumeData {
uint16 frame[16];
/* HE specific */
- uint16 heJumpOffsetTable[16];
- uint16 heJumpCountTable[16];
- uint32 heCondMaskTable[16];
+ uint16 heJumpOffsetTable[16] = {};
+ uint16 heJumpCountTable[16] = {};
+ uint32 heCondMaskTable[16] = {};
void reset() {
animCounter = 0;
diff --git a/engines/scumm/imuse_digi/dimuse_fades.cpp b/engines/scumm/imuse_digi/dimuse_fades.cpp
index d8903f5335c..44c8abbfc1a 100644
--- a/engines/scumm/imuse_digi/dimuse_fades.cpp
+++ b/engines/scumm/imuse_digi/dimuse_fades.cpp
@@ -155,6 +155,14 @@ void IMuseDigiFadesHandler::clearAllFades() {
for (int l = 0; l < DIMUSE_MAX_FADES; l++) {
_fades[l].status = 0;
_fades[l].sound = 0;
+ _fades[l].param = 0;
+ _fades[l].currentVal = 0;
+ _fades[l].counter = 0;
+ _fades[l].length = 0;
+ _fades[l].slope = 0;
+ _fades[l].slopeMod = 0;
+ _fades[l].modOvfloCounter = 0;
+ _fades[l].nudge = 0;
}
_fadesOn = 0;
}
diff --git a/engines/scumm/imuse_digi/dimuse_files.h b/engines/scumm/imuse_digi/dimuse_files.h
index eaf132bcca4..ce13178a893 100644
--- a/engines/scumm/imuse_digi/dimuse_files.h
+++ b/engines/scumm/imuse_digi/dimuse_files.h
@@ -40,7 +40,7 @@ private:
ScummEngine_v7 *_vm;
Common::Mutex _mutex;
IMuseDigiSndBuffer _soundBuffers[4];
- char _currentSpeechFilename[60];
+ char _currentSpeechFilename[60] = {};
ScummFile *_ftSpeechFile;
char _ftSpeechFilename[160];
int _ftSpeechSubFileOffset;
diff --git a/engines/scumm/imuse_digi/dimuse_tracks.cpp b/engines/scumm/imuse_digi/dimuse_tracks.cpp
index 5ff483370d9..d38559decf0 100644
--- a/engines/scumm/imuse_digi/dimuse_tracks.cpp
+++ b/engines/scumm/imuse_digi/dimuse_tracks.cpp
@@ -49,6 +49,17 @@ int IMuseDigital::tracksInit() {
_tracks[l].dispatchPtr = dispatchGetDispatchByTrackId(l);
_tracks[l].dispatchPtr->trackPtr = &_tracks[l];
_tracks[l].soundId = 0;
+ _tracks[l].group = 0;
+ _tracks[l].marker = 0;
+ _tracks[l].priority = 0;
+ _tracks[l].vol = 0;
+ _tracks[l].effVol = 0;
+ _tracks[l].pan = 0;
+ _tracks[l].detune = 0;
+ _tracks[l].transpose = 0;
+ _tracks[l].pitchShift = 0;
+ _tracks[l].mailbox = 0;
+ _tracks[l].jumpHook = 0;
_tracks[l].syncSize_0 = 0;
_tracks[l].syncSize_1 = 0;
_tracks[l].syncSize_2 = 0;
diff --git a/engines/scumm/imuse_digi/dimuse_triggers.cpp b/engines/scumm/imuse_digi/dimuse_triggers.cpp
index 753f31c09e0..9936cfa4e85 100644
--- a/engines/scumm/imuse_digi/dimuse_triggers.cpp
+++ b/engines/scumm/imuse_digi/dimuse_triggers.cpp
@@ -42,8 +42,34 @@ int IMuseDigiTriggersHandler::deinit() {
int IMuseDigiTriggersHandler::clearAllTriggers() {
for (int l = 0; l < DIMUSE_MAX_TRIGGERS; l++) {
_trigs[l].sound = 0;
+ memset(_trigs[l].text, 0, sizeof(_trigs[l].text));
+ _trigs[l].opcode = 0;
+ _trigs[l].a = 0;
+ _trigs[l].b = 0;
+ _trigs[l].c = 0;
+ _trigs[l].d = 0;
+ _trigs[l].e = 0;
+ _trigs[l].f = 0;
+ _trigs[l].g = 0;
+ _trigs[l].h = 0;
+ _trigs[l].i = 0;
+ _trigs[l].j = 0;
_trigs[l].clearLater = 0;
+ }
+
+ for (int l = 0; l < DIMUSE_MAX_DEFERS; l++) {
_defers[l].counter = 0;
+ _defers[l].opcode = 0;
+ _defers[l].a = 0;
+ _defers[l].b = 0;
+ _defers[l].c = 0;
+ _defers[l].d = 0;
+ _defers[l].e = 0;
+ _defers[l].f = 0;
+ _defers[l].g = 0;
+ _defers[l].h = 0;
+ _defers[l].i = 0;
+ _defers[l].j = 0;
}
_defersOn = 0;
_midProcessing = 0;
diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index 0425a08d23a..3ceb1023a89 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -53,7 +53,7 @@ struct SaveGameHeader {
uint32 type;
uint32 size;
uint32 ver;
- char name[32];
+ char name[32] = {};
};
struct SaveInfoSection {
Commit: fc9e8e1a7106a41c5d1c342030f9d9f6ad2a8043
https://github.com/scummvm/scummvm/commit/fc9e8e1a7106a41c5d1c342030f9d9f6ad2a8043
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-11-16T18:56:29+02:00
Commit Message:
SCUMM: Initialize _bannerColors
This silences Valgrind warnings in COMI when saving.
Changed paths:
engines/scumm/gfx_gui.cpp
diff --git a/engines/scumm/gfx_gui.cpp b/engines/scumm/gfx_gui.cpp
index 4a22340221a..d5fbd0d22c3 100644
--- a/engines/scumm/gfx_gui.cpp
+++ b/engines/scumm/gfx_gui.cpp
@@ -39,6 +39,8 @@
namespace Scumm {
void ScummEngine::initBanners() {
+ memset(_bannerColors, 0, sizeof(_bannerColors));
+
setPalColor(7, 0x5A, 0x5A, 0x5A);
setPalColor(8, 0x46, 0x46, 0x46);
setPalColor(15, 0x8C, 0x8C, 0x8C);
Commit: ebaa080d69c0b8d84bb30bc96b186e2189bff533
https://github.com/scummvm/scummvm/commit/ebaa080d69c0b8d84bb30bc96b186e2189bff533
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-11-16T18:56:29+02:00
Commit Message:
SCUMM: Fix one of many Full Throttle Valgrind warnings
Changed paths:
engines/scumm/imuse_digi/dimuse_files.h
diff --git a/engines/scumm/imuse_digi/dimuse_files.h b/engines/scumm/imuse_digi/dimuse_files.h
index ce13178a893..e6739c3c776 100644
--- a/engines/scumm/imuse_digi/dimuse_files.h
+++ b/engines/scumm/imuse_digi/dimuse_files.h
@@ -42,7 +42,7 @@ private:
IMuseDigiSndBuffer _soundBuffers[4];
char _currentSpeechFilename[60] = {};
ScummFile *_ftSpeechFile;
- char _ftSpeechFilename[160];
+ char _ftSpeechFilename[160] = {};
int _ftSpeechSubFileOffset;
int _ftSpeechFileSize;
int _ftSpeechFileCurPos;
Commit: 5dc111f896e96eb4ff31c54af31ceb2e5a45ce48
https://github.com/scummvm/scummvm/commit/5dc111f896e96eb4ff31c54af31ceb2e5a45ce48
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2024-11-16T18:56:30+02:00
Commit Message:
SCUMM: Remove unused variable
Changed paths:
engines/scumm/verbs.cpp
diff --git a/engines/scumm/verbs.cpp b/engines/scumm/verbs.cpp
index 62587e8eef7..ca3d3716255 100644
--- a/engines/scumm/verbs.cpp
+++ b/engines/scumm/verbs.cpp
@@ -329,7 +329,7 @@ void ScummEngine_v2::initNESMouseOver() {
void ScummEngine_v2::checkV2MouseOver(Common::Point pos) {
VirtScreen *vs = &_virtscr[kVerbVirtScreen];
Common::Rect rect;
- byte *ptr, *dst;
+ byte *dst;
int i, x, y, new_box = -1;
// Don't do anything unless the inventory is active
@@ -351,7 +351,7 @@ void ScummEngine_v2::checkV2MouseOver(Common::Point pos) {
if (_mouseOverBoxV2 != -1) {
rect = _mouseOverBoxesV2[_mouseOverBoxV2].rect;
- dst = ptr = vs->getPixels(rect.left, rect.top);
+ dst = vs->getPixels(rect.left, rect.top);
// Remove highlight.
for (y = rect.height() - 1; y >= 0; y--) {
@@ -368,7 +368,7 @@ void ScummEngine_v2::checkV2MouseOver(Common::Point pos) {
if (new_box != -1) {
rect = _mouseOverBoxesV2[new_box].rect;
- dst = ptr = vs->getPixels(rect.left, rect.top);
+ dst = vs->getPixels(rect.left, rect.top);
// Apply highlight
for (y = rect.height() - 1; y >= 0; y--) {
Commit: 5d5e3aca1b39e97d9adf9b1733dfb6cc1c007027
https://github.com/scummvm/scummvm/commit/5d5e3aca1b39e97d9adf9b1733dfb6cc1c007027
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2024-11-16T18:56:30+02:00
Commit Message:
SCUMM: Remove unimplemented methods
Changed paths:
engines/scumm/he/moonbase/moonbase.h
engines/scumm/he/net/net_lobby.h
engines/scumm/insane/insane.h
engines/scumm/players/player_nes.h
engines/scumm/players/player_pce.h
engines/scumm/players/player_v1.h
engines/scumm/players/player_v3a.h
engines/scumm/scumm_v0.h
diff --git a/engines/scumm/he/moonbase/moonbase.h b/engines/scumm/he/moonbase/moonbase.h
index edabbece19b..7586d07801b 100644
--- a/engines/scumm/he/moonbase/moonbase.h
+++ b/engines/scumm/he/moonbase/moonbase.h
@@ -42,9 +42,6 @@ public:
void deallocateArray(int array);
int callScummFunction(int scriptNumber, int paramCount,...);
- void blitDistortion(byte *bufferData, const int bufferWidth, const int bufferHeight, const int bufferPitch,
- const Common::Rect *optionalClippingRect, byte *dataStream, const int x, const int y, byte *altSourceBuffer);
-
// FOW Stuff
bool isFOW(int resNum, int state, uint32 conditionBits) {
return resNum == _fowSentinelImage && state == _fowSentinelState && conditionBits == _fowSentinelConditionBits;
diff --git a/engines/scumm/he/net/net_lobby.h b/engines/scumm/he/net/net_lobby.h
index 616cdb3932c..81105f0893c 100644
--- a/engines/scumm/he/net/net_lobby.h
+++ b/engines/scumm/he/net/net_lobby.h
@@ -185,10 +185,8 @@ protected:
void handleAcceptChallenge();
void startHostingGame(int playerId);
- void handleHostGameResp(int resp);
void handleGameSession(int sessionId);
- void handleGameRelay(int relayId);
void gameStarted(int hoster, int player, int playerNameArray);
void gameFinished();
diff --git a/engines/scumm/insane/insane.h b/engines/scumm/insane/insane.h
index 8b7a9fed326..4ec46f839f0 100644
--- a/engines/scumm/insane/insane.h
+++ b/engines/scumm/insane/insane.h
@@ -395,7 +395,6 @@ class Insane {
void prepareScenePropScene(int32 scenePropNum, bool arg_4, bool arg_8);
int32 calcBenDamage(bool arg_0, bool arg_4);
int32 weaponDamage(int32 actornum);
- void proc47(int32 actornum, int32 val);
bool weaponBenIsEffective();
bool actor1StateFlags(int state);
bool actor0StateFlags1(int state);
diff --git a/engines/scumm/players/player_nes.h b/engines/scumm/players/player_nes.h
index 16c2f015031..11918688c6b 100644
--- a/engines/scumm/players/player_nes.h
+++ b/engines/scumm/players/player_nes.h
@@ -63,7 +63,6 @@ private:
void sound_play();
void playSFX(int nr);
void playMusic();
- byte fetchSoundByte(int nr);
void chainCommand(int chan);
void checkSilenceChannels(int chan);
diff --git a/engines/scumm/players/player_pce.h b/engines/scumm/players/player_pce.h
index 979b0945b4c..74faad1b274 100644
--- a/engines/scumm/players/player_pce.h
+++ b/engines/scumm/players/player_pce.h
@@ -104,9 +104,6 @@ private:
int16* _sampleBuffer;
int _sampleBufferCnt;
- void init();
- bool isPlaying();
-
void PSG_Write(int reg, byte data);
void setupWaveform(byte bank);
@@ -114,15 +111,10 @@ private:
void updateSound();
void procA731(channel_t *channel);
void processSoundData(channel_t *channel);
- void procA9F3(int x);
void procAA62(channel_t *channel, int a);
- uint16 procAAF6(int x);
void procAB7F(channel_t *channel);
void procAC24(channel_t *channel);
void procACEA(channel_t *channel, int a);
- void procAD21(int a, int x);
- void procAD29(int value);
- void procAD3D(int a, int x);
};
} // End of namespace Scumm
diff --git a/engines/scumm/players/player_v1.h b/engines/scumm/players/player_v1.h
index 48215aee06e..7e8023b0a11 100644
--- a/engines/scumm/players/player_v1.h
+++ b/engines/scumm/players/player_v1.h
@@ -47,8 +47,6 @@ protected:
void generateSpkSamples(int16 *data, uint len) override;
void generatePCjrSamples(int16 *data, uint len) override;
- void restartSound();
-
void set_mplex(uint mplex);
void parseSpeakerChunk();
void nextSpeakerCmd();
diff --git a/engines/scumm/players/player_v3a.h b/engines/scumm/players/player_v3a.h
index 2aaf49190b1..5fd0fc69984 100644
--- a/engines/scumm/players/player_v3a.h
+++ b/engines/scumm/players/player_v3a.h
@@ -114,7 +114,6 @@ private:
int8 *_wavetableData;
InstData *_wavetablePtrs;
- void updateProc();
void updateMusicIndy();
void updateMusicLoom();
void updateSounds();
diff --git a/engines/scumm/scumm_v0.h b/engines/scumm/scumm_v0.h
index dc60cb2dc90..233b6b1cf5b 100644
--- a/engines/scumm/scumm_v0.h
+++ b/engines/scumm/scumm_v0.h
@@ -152,7 +152,6 @@ protected:
void o_lights();
void o_unlockCostume();
void o_unlockScript();
- void o_decrement();
void o_nop();
void o_getObjectOwner();
void o_getActorBitVar();
Commit: 39e3cf98f8df8a1382a89df47f5253dbaf28f598
https://github.com/scummvm/scummvm/commit/39e3cf98f8df8a1382a89df47f5253dbaf28f598
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2024-11-16T18:56:31+02:00
Commit Message:
SCUMM: Remove unused variables
Changed paths:
engines/scumm/he/gfx_comp/aux_comp.cpp
engines/scumm/imuse/imuse.cpp
engines/scumm/macgui/macgui_dialogwindow.cpp
engines/scumm/resource_v4.cpp
diff --git a/engines/scumm/he/gfx_comp/aux_comp.cpp b/engines/scumm/he/gfx_comp/aux_comp.cpp
index f109a9ddf12..8aaeee4df06 100644
--- a/engines/scumm/he/gfx_comp/aux_comp.cpp
+++ b/engines/scumm/he/gfx_comp/aux_comp.cpp
@@ -1102,13 +1102,11 @@ void Wiz::auxDecompDRLEStream(WizRawPixel *destPtr, const byte *dataStream, WizR
background8 += runCount;
destPtr = (WizRawPixel *)dest8;
- backgroundPtr = (WizRawPixel *)background8;
} else {
dest16 += runCount;
background16 += runCount;
destPtr = (WizRawPixel *)dest16;
- backgroundPtr = (WizRawPixel *)background16;
}
decompAmount -= runCount;
@@ -1127,13 +1125,11 @@ void Wiz::auxDecompDRLEStream(WizRawPixel *destPtr, const byte *dataStream, WizR
background8 += runCount;
destPtr = (WizRawPixel *)dest8;
- backgroundPtr = (WizRawPixel *)background8;
} else {
dest16 += runCount;
background16 += runCount;
destPtr = (WizRawPixel *)dest16;
- backgroundPtr = (WizRawPixel *)background16;
}
} else {
runCount += decompAmount;
@@ -1151,14 +1147,12 @@ void Wiz::auxDecompDRLEStream(WizRawPixel *destPtr, const byte *dataStream, WizR
background8 += runCount;
destPtr = (WizRawPixel *)dest8;
- backgroundPtr = (WizRawPixel *)background8;
} else {
memcpy(dest16, background16, runCount * sizeof(WizRawPixel16));
dest16 += runCount;
background16 += runCount;
destPtr = (WizRawPixel *)dest16;
- backgroundPtr = (WizRawPixel *)background16;
}
} else {
runCount += decompAmount;
diff --git a/engines/scumm/imuse/imuse.cpp b/engines/scumm/imuse/imuse.cpp
index 73dd8c48599..b2e068c1d3a 100644
--- a/engines/scumm/imuse/imuse.cpp
+++ b/engines/scumm/imuse/imuse.cpp
@@ -125,7 +125,7 @@ byte *IMuseInternal::findStartOfSound(int sound, int ct) {
return ct == trFlag ? ptr + 4 : nullptr;
ptr += 4;
- size = READ_BE_UINT32(ptr);
+ //size = READ_BE_UINT32(ptr);
ptr += 4;
// Okay, we're looking for one of those things: either
diff --git a/engines/scumm/macgui/macgui_dialogwindow.cpp b/engines/scumm/macgui/macgui_dialogwindow.cpp
index 3b21ae22378..d7a9390b320 100644
--- a/engines/scumm/macgui/macgui_dialogwindow.cpp
+++ b/engines/scumm/macgui/macgui_dialogwindow.cpp
@@ -408,8 +408,6 @@ int MacGuiImpl::MacDialogWindow::runDialog(Common::Array<int> &deferredActionIds
if (!_visible) {
show();
- Common::Rect windowBounds(_innerSurface.w, _innerSurface.h);
-
for (uint i = 0; i < _widgets.size(); i++) {
if (_widgets[i]->isVisible()) {
_widgets[i]->setRedraw(true);
diff --git a/engines/scumm/resource_v4.cpp b/engines/scumm/resource_v4.cpp
index 54daef33968..3e8e04b5224 100644
--- a/engines/scumm/resource_v4.cpp
+++ b/engines/scumm/resource_v4.cpp
@@ -127,7 +127,7 @@ void ScummEngine_v4::readIndexFile() {
allocateArrays();
while (true) {
- itemsize = _fileHandle->readUint32LE();
+ /*itemsize = */_fileHandle->readUint32LE();
if (_fileHandle->eos() || _fileHandle->err())
break;
Commit: 35f89d64ac7efc27d02f8dc5d63d871afabd718f
https://github.com/scummvm/scummvm/commit/35f89d64ac7efc27d02f8dc5d63d871afabd718f
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2024-11-16T18:56:31+02:00
Commit Message:
SCUMM: HE: Initialize class members
Changed paths:
engines/scumm/he/basketball/court.h
engines/scumm/he/cup_player_he.h
engines/scumm/he/intern_he.h
engines/scumm/he/logic/funshop.cpp
engines/scumm/he/logic/soccer.cpp
engines/scumm/he/moonbase/ai_weapon.h
engines/scumm/he/moonbase/map_katton.cpp
engines/scumm/he/moonbase/map_katton.h
engines/scumm/he/moonbase/map_mif.h
engines/scumm/he/moonbase/map_spiff.cpp
engines/scumm/he/moonbase/map_spiff.h
engines/scumm/he/sound_he.cpp
engines/scumm/he/sprite_he.cpp
engines/scumm/he/wiz_he.h
diff --git a/engines/scumm/he/basketball/court.h b/engines/scumm/he/basketball/court.h
index 5f19cbfa471..95d0def4a6a 100644
--- a/engines/scumm/he/basketball/court.h
+++ b/engines/scumm/he/basketball/court.h
@@ -77,7 +77,7 @@ public:
_backboardIndex[1] = 0;
}
- ~CBBallCourt() {}
+ ~CBBallCourt() = default;
int getPlayerIndex(int playerID);
CCollisionPlayer *getPlayerPtr(int playerID);
@@ -102,7 +102,7 @@ public:
Common::Array<CCollisionPlayer> _awayPlayerList;
int _objectCount;
int _backboardIndex[2];
- U32Sphere _shotSpot[2];
+ U32Sphere _shotSpot[2] = {};
};
} // End of namespace Scumm
diff --git a/engines/scumm/he/cup_player_he.h b/engines/scumm/he/cup_player_he.h
index 2055d6d81c3..ff5a3165cf0 100644
--- a/engines/scumm/he/cup_player_he.h
+++ b/engines/scumm/he/cup_player_he.h
@@ -83,26 +83,26 @@ protected:
Common::File _fileStream;
- int _playbackRate;
- int _width, _height;
-
- uint8 _paletteData[256 * 3];
- bool _paletteChanged;
- uint8 *_offscreenBuffer;
-
- uint8 *_inLzssBufData;
- uint32 _inLzssBufSize;
- uint8 *_outLzssBufData;
- uint32 _outLzssBufSize;
-
- uint32 _dataSize;
-
- int _sfxCount;
- uint8 *_sfxBuffer;
- CUP_SfxChannel _sfxChannels[kSfxChannels];
- CUP_Sfx _sfxQueue[kSfxQueueSize];
- int _sfxQueuePos;
- int _lastSfxChannel;
+ int _playbackRate = 0;
+ int _width = 0, _height = 0;
+
+ uint8 _paletteData[256 * 3] = {};
+ bool _paletteChanged = false;
+ uint8 *_offscreenBuffer = nullptr;
+
+ uint8 *_inLzssBufData = nullptr;
+ uint32 _inLzssBufSize = 0;
+ uint8 *_outLzssBufData = nullptr;
+ uint32 _outLzssBufSize = 0;
+
+ uint32 _dataSize = 0;
+
+ int _sfxCount = 0;
+ uint8 *_sfxBuffer = nullptr;
+ CUP_SfxChannel _sfxChannels[kSfxChannels] = {};
+ CUP_Sfx _sfxQueue[kSfxQueueSize] = {};
+ int _sfxQueuePos = 0;
+ int _lastSfxChannel = 0;
};
} // End of namespace Scumm
diff --git a/engines/scumm/he/intern_he.h b/engines/scumm/he/intern_he.h
index c420128f4bc..e613b2d5eac 100644
--- a/engines/scumm/he/intern_he.h
+++ b/engines/scumm/he/intern_he.h
@@ -402,10 +402,10 @@ protected:
#include "common/pack-end.h" // END STRUCT PACKING
int _stringLength = 1;
- byte _stringBuffer[4096];
+ byte _stringBuffer[4096] = {};
- WizImageCommand _wizImageCommand;
- FloodFillCommand _floodFillCommand;
+ WizImageCommand _wizImageCommand = {};
+ FloodFillCommand _floodFillCommand = {};
public:
ScummEngine_v72he(OSystem *syst, const DetectorResult &dr);
diff --git a/engines/scumm/he/logic/funshop.cpp b/engines/scumm/he/logic/funshop.cpp
index 1081f432d0f..49f2e1a96ea 100644
--- a/engines/scumm/he/logic/funshop.cpp
+++ b/engines/scumm/he/logic/funshop.cpp
@@ -67,7 +67,7 @@ int32 LogicHEfunshop::dispatch(int op, int numArgs, int32 *args) {
void LogicHEfunshop::op_1004(int32 *args) {
double data[8], at, sq;
int32 x, y;
- int i=0;
+ int i;
for (i = 0; i <= 6; i += 2) {
data[i] = getFromArray(args[0], 0, 519 + i);
diff --git a/engines/scumm/he/logic/soccer.cpp b/engines/scumm/he/logic/soccer.cpp
index 5b97a6930cb..09717b5ed9e 100644
--- a/engines/scumm/he/logic/soccer.cpp
+++ b/engines/scumm/he/logic/soccer.cpp
@@ -61,14 +61,14 @@ private:
// op_1007 allocates some arrays
// they're then filled by op_1019
- byte _collisionObjIds[4096], _collisionNodeEnabled[585];
+ byte _collisionObjIds[4096] = {}, _collisionNodeEnabled[585] = {};
// op_1011 has a subfunction
void calculateDistances(int32 worldPosArray, int32 a2, int32 closestActorArray, int32 maxDistance);
// array containing collision detection tree
- bool _collisionTreeAllocated;
- uint32 *_collisionTree;
+ bool _collisionTreeAllocated = false;
+ uint32 *_collisionTree = nullptr;
int addCollisionTreeChild(int depth, int index, int parent);
// op_1014 has several subops
@@ -85,11 +85,11 @@ private:
// op_1014 sets an array optionally based upon
// setCollisionOutputData; it is then used by op_1008
- int _internalCollisionOutData[10];
+ int _internalCollisionOutData[10] = {};
Common::List<byte> _collisionObjs;
// op_1021 can (optionally) set two variables for use in op_1008
- uint32 _var1021[2];
+ uint32 _var1021[2] = {};
};
int LogicHEsoccer::versionID() {
diff --git a/engines/scumm/he/moonbase/ai_weapon.h b/engines/scumm/he/moonbase/ai_weapon.h
index a8a5f8e1805..43f2d63f8ea 100644
--- a/engines/scumm/he/moonbase/ai_weapon.h
+++ b/engines/scumm/he/moonbase/ai_weapon.h
@@ -25,11 +25,10 @@
namespace Scumm {
class Weapon {
-private:
- int _typeID;
- float _damage;
- int _radius;
- int _cost;
+ int _typeID = 0;
+ float _damage = 0.0f;
+ int _radius = 0;
+ int _cost = 0;
public:
Weapon() {}
diff --git a/engines/scumm/he/moonbase/map_katton.cpp b/engines/scumm/he/moonbase/map_katton.cpp
index 07dcf170ca6..9552e7bf90e 100644
--- a/engines/scumm/he/moonbase/map_katton.cpp
+++ b/engines/scumm/he/moonbase/map_katton.cpp
@@ -27,9 +27,6 @@ KattonGenerator::KattonGenerator(int seed) {
_seed = seed;
}
-KattonGenerator::~KattonGenerator() {
-}
-
int KattonGenerator::getRandomNumber() {
// This is the exact linear congruential generator
// algorithm used on MSVCRT (Windows Visual C++ Runtime), with
diff --git a/engines/scumm/he/moonbase/map_katton.h b/engines/scumm/he/moonbase/map_katton.h
index 2527647d1bf..02899bdffd8 100644
--- a/engines/scumm/he/moonbase/map_katton.h
+++ b/engines/scumm/he/moonbase/map_katton.h
@@ -34,18 +34,18 @@ namespace Scumm {
class KattonGenerator {
public:
KattonGenerator(int seed);
- ~KattonGenerator();
+ ~KattonGenerator() = default;
MapFile *generateMap(int water, int tileSet, int mapSize, int energy, int terrain);
private:
- int _seed;
+ int _seed = 0;
- int _size; // 32, 40, 48, or 56
- int _tileset;
- int _startloc[20][2];
- int _board[MAX_TILE_COUNT][MAX_TILE_COUNT];
- int _special[MAX_TILE_COUNT][MAX_TILE_COUNT];
+ int _size = 0; // 32, 40, 48, or 56
+ int _tileset = 0;
+ int _startloc[20][2] = { {}, {} };;
+ int _board[MAX_TILE_COUNT][MAX_TILE_COUNT] = { {}, {} };
+ int _special[MAX_TILE_COUNT][MAX_TILE_COUNT] = { {}, {} };;
int getRandomNumber();
diff --git a/engines/scumm/he/moonbase/map_mif.h b/engines/scumm/he/moonbase/map_mif.h
index 5b24a2ae24d..4f97c90a57d 100644
--- a/engines/scumm/he/moonbase/map_mif.h
+++ b/engines/scumm/he/moonbase/map_mif.h
@@ -86,11 +86,11 @@ public:
void generateMap(MapFile *map);
- int _dimension; // 32 (small), 40 (medium), 48 (large), 56 (huge), 64 (SAI)
- int _mapType;
- char _name[17];
- byte _cornerMap[MAX_TILE_COUNT][MAX_TILE_COUNT];
- int8 _centerMap[MAX_TILE_COUNT][MAX_TILE_COUNT];
+ int _dimension = 0; // 32 (small), 40 (medium), 48 (large), 56 (huge), 64 (SAI)
+ int _mapType = 0;
+ char _name[17] = {};
+ byte _cornerMap[MAX_TILE_COUNT][MAX_TILE_COUNT] = { {}, {} };
+ int8 _centerMap[MAX_TILE_COUNT][MAX_TILE_COUNT] = { {}, {} };
private:
void defineStartLocations(MapFile *map);
diff --git a/engines/scumm/he/moonbase/map_spiff.cpp b/engines/scumm/he/moonbase/map_spiff.cpp
index 60a7beb762c..7b211bf5586 100644
--- a/engines/scumm/he/moonbase/map_spiff.cpp
+++ b/engines/scumm/he/moonbase/map_spiff.cpp
@@ -29,9 +29,6 @@ SpiffGenerator::SpiffGenerator(int seed) {
_seed = seed;
}
-SpiffGenerator::~SpiffGenerator() {
-}
-
MapFile *SpiffGenerator::generateMap(int water, int tileset, int mapSize, int energy, int terrain) {
_totalMapSizeG = mapSize;
_energyAmountG = (2 + energy) * _totalMapSizeG * _totalMapSizeG;
diff --git a/engines/scumm/he/moonbase/map_spiff.h b/engines/scumm/he/moonbase/map_spiff.h
index 5e4eaad40ee..881ecd220b7 100644
--- a/engines/scumm/he/moonbase/map_spiff.h
+++ b/engines/scumm/he/moonbase/map_spiff.h
@@ -57,28 +57,28 @@ namespace Scumm {
class SpiffGenerator {
public:
SpiffGenerator(int seed);
- ~SpiffGenerator();
+ ~SpiffGenerator() = default;
MapFile *generateMap(int water, int tileset, int mapSize, int energy, int terrain);
private:
- int _seed;
-
- int _numPoolsG; // per quadrant
- int _energyAmountG; // 2048 = min energy on small map, 51200 = max energy on max map, etc.
- int _cliffAmountG; // amount of cliffs, 10 is min, 70 is max
- int _waterAmountG; // 0 is min, 30 is max
- int _totalMapSizeG;
-
- int _terrainSeedFlagG; // disables kElevHigh or kElevLow terrain for the initial elevation when appropriate
- int _islandsFlagG; // enables islands
- int _advancedMirrorOK_G; // low terrain roughness can leave too abrupt changes at the edge, so set false to disable some mirroring types
- int _mirrorTypeG; // what mirroring is used
-
- int _mapCornerMaxG; // size of random section
- int _mapMiddleMaxG;
- int _mapCorner[MAXSIZE+1][MAXSIZE+1];
- int _mapMiddle[MAXSIZE][MAXSIZE];
+ int _seed = 0;
+
+ int _numPoolsG = 0; // per quadrant
+ int _energyAmountG = 0; // 2048 = min energy on small map, 51200 = max energy on max map, etc.
+ int _cliffAmountG = 0; // amount of cliffs, 10 is min, 70 is max
+ int _waterAmountG = 0; // 0 is min, 30 is max
+ int _totalMapSizeG = 0;
+
+ int _terrainSeedFlagG = 0; // disables kElevHigh or kElevLow terrain for the initial elevation when appropriate
+ int _islandsFlagG = 0; // enables islands
+ int _advancedMirrorOK_G = 0; // low terrain roughness can leave too abrupt changes at the edge, so set false to disable some mirroring types
+ int _mirrorTypeG = 0; // what mirroring is used
+
+ int _mapCornerMaxG = 0; // size of random section
+ int _mapMiddleMaxG = 0;
+ int _mapCorner[MAXSIZE+1][MAXSIZE+1] = { {}, {} };;
+ int _mapMiddle[MAXSIZE][MAXSIZE] = { {}, {} };;
float getRandomFloat();
int spiffRand(int min, int max);
diff --git a/engines/scumm/he/sound_he.cpp b/engines/scumm/he/sound_he.cpp
index 6f88c83e6d7..280daa7c32b 100644
--- a/engines/scumm/he/sound_he.cpp
+++ b/engines/scumm/he/sound_he.cpp
@@ -50,10 +50,10 @@ SoundHE::SoundHE(ScummEngine *parent, Audio::Mixer *mixer, Common::Mutex *mutex)
:
Sound(parent, mixer, false),
_vm((ScummEngine_v60he *)parent),
+ _mutex(mutex),
_overrideFreq(0),
_heSpoolingMusicTable(nullptr),
- _heSpoolingMusicCount(0),
- _mutex(mutex) {
+ _heSpoolingMusicCount(0) {
_createSndId = 0;
_createSndLastAppend = 0;
diff --git a/engines/scumm/he/sprite_he.cpp b/engines/scumm/he/sprite_he.cpp
index 2d4a6d7872b..bdcd512f1ad 100644
--- a/engines/scumm/he/sprite_he.cpp
+++ b/engines/scumm/he/sprite_he.cpp
@@ -41,7 +41,9 @@ Sprite::Sprite(ScummEngine_v90he *vm)
_activeSpriteCount(0),
_maxSpriteGroups(0),
_maxSprites(0),
- _maxImageLists(0) {
+ _maxImageLists(0),
+ _imageLists(nullptr),
+ _imageListStack(nullptr) {
}
Sprite::~Sprite() {
diff --git a/engines/scumm/he/wiz_he.h b/engines/scumm/he/wiz_he.h
index d9024218555..0d93fe86a9d 100644
--- a/engines/scumm/he/wiz_he.h
+++ b/engines/scumm/he/wiz_he.h
@@ -631,13 +631,13 @@ public:
NUM_IMAGES = 255
};
- WizBufferElement _wizBuffer[NUM_IMAGES];
- uint16 _wizBufferIndex;
- WizPolygon _polygons[NUM_POLYGONS];
+ WizBufferElement _wizBuffer[NUM_IMAGES] = {};
+ uint16 _wizBufferIndex = 0;
+ WizPolygon _polygons[NUM_POLYGONS] = {};
// For collision
- WizRawPixel _compareBufferA[640];
- WizRawPixel _compareBufferB[640];
+ WizRawPixel _compareBufferA[640] = {};
+ WizRawPixel _compareBufferB[640] = {};
Wiz(ScummEngine_v71he *vm);
~Wiz() {
@@ -968,7 +968,7 @@ public:
// TRLE
int _trlePutSize = 0;
- byte _trleBuf[(128 * 2) * sizeof(WizRawPixel)];
+ byte _trleBuf[(128 * 2) * sizeof(WizRawPixel)] = {};
byte *trlePutDump(byte *dest, int nn);
byte *trlePutRun(byte *dest, int nn, int cc, int tcolor);
@@ -977,8 +977,8 @@ public:
// TRLE FLIP
bool _initializeAlphaTable = true;
- float _alphaTable[256];
- int _precomputed16bppTable[WIZ_QUANTIZED_ALPHA_COUNT][WIZ_COLOR16_COMPONENT_COUNT][WIZ_COLOR16_COMPONENT_COUNT];
+ float _alphaTable[256] = {};
+ int _precomputed16bppTable[WIZ_QUANTIZED_ALPHA_COUNT][WIZ_COLOR16_COMPONENT_COUNT][WIZ_COLOR16_COMPONENT_COUNT] = { {}, {}, {} };
void trleFLIPDecompressImage(
WizRawPixel *bufferPtr, const byte *compData, int bufferWidth, int bufferHeight,
Commit: 640a9213cc787f74e0c224f95d60e4f9a336ba0f
https://github.com/scummvm/scummvm/commit/640a9213cc787f74e0c224f95d60e4f9a336ba0f
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2024-11-16T18:56:31+02:00
Commit Message:
SCUMM: DIMUSE: Initialize class members
Changed paths:
engines/scumm/imuse_digi/dimuse_bndmgr.h
engines/scumm/imuse_digi/dimuse_fades.h
engines/scumm/imuse_digi/dimuse_groups.h
engines/scumm/imuse_digi/dimuse_internalmixer.h
engines/scumm/imuse_digi/dimuse_triggers.h
diff --git a/engines/scumm/imuse_digi/dimuse_bndmgr.h b/engines/scumm/imuse_digi/dimuse_bndmgr.h
index c62ddf4d63d..4062a618779 100644
--- a/engines/scumm/imuse_digi/dimuse_bndmgr.h
+++ b/engines/scumm/imuse_digi/dimuse_bndmgr.h
@@ -76,22 +76,22 @@ private:
BundleDirCache *_cache;
BundleDirCache::AudioTable *_bundleTable;
- BundleDirCache::IndexNode *_indexTable;
+ BundleDirCache::IndexNode *_indexTable = nullptr;
CompTable *_compTable;
- int _numFiles;
- int _numCompItems;
- int _lastBlockDecompressedSize;
- int _curSampleId;
- int _curDecompressedFilePos;
+ int _numFiles = 0;
+ int _numCompItems = 0;
+ int _lastBlockDecompressedSize = 0;
+ int _curSampleId = 0;
+ int _curDecompressedFilePos = 0;
BaseScummFile *_file;
- bool _compTableLoaded;
- bool _isUncompressed;
- int _fileBundleId;
- byte _compOutputBuff[0x2000];
- byte *_compInputBuff;
- int _outputSize;
- int _lastBlock;
+ bool _compTableLoaded = 0;
+ bool _isUncompressed = 0;
+ int _fileBundleId = 0;
+ byte _compOutputBuff[0x2000] = {};
+ byte *_compInputBuff = nullptr;
+ int _outputSize = 0;
+ int _lastBlock = 0;
bool loadCompTable(int32 index);
public:
diff --git a/engines/scumm/imuse_digi/dimuse_fades.h b/engines/scumm/imuse_digi/dimuse_fades.h
index c5db76ed088..ee7457e2133 100644
--- a/engines/scumm/imuse_digi/dimuse_fades.h
+++ b/engines/scumm/imuse_digi/dimuse_fades.h
@@ -32,8 +32,8 @@ class IMuseDigiFadesHandler {
private:
IMuseDigital *_engine;
- IMuseDigiFade _fades[DIMUSE_MAX_FADES];
- int _fadesOn;
+ IMuseDigiFade _fades[DIMUSE_MAX_FADES] = {};
+ int _fadesOn = 0;
void clearAllFades();
public:
diff --git a/engines/scumm/imuse_digi/dimuse_groups.h b/engines/scumm/imuse_digi/dimuse_groups.h
index 38effdf0647..c3933903d6b 100644
--- a/engines/scumm/imuse_digi/dimuse_groups.h
+++ b/engines/scumm/imuse_digi/dimuse_groups.h
@@ -35,8 +35,8 @@ class IMuseDigiGroupsHandler {
private:
IMuseDigital *_engine;
- int _effVols[DIMUSE_MAX_GROUPS];
- int _vols[DIMUSE_MAX_GROUPS];
+ int _effVols[DIMUSE_MAX_GROUPS] = {};
+ int _vols[DIMUSE_MAX_GROUPS] = {};
public:
IMuseDigiGroupsHandler(IMuseDigital *engine);
~IMuseDigiGroupsHandler();
diff --git a/engines/scumm/imuse_digi/dimuse_internalmixer.h b/engines/scumm/imuse_digi/dimuse_internalmixer.h
index 2edc7379bc9..4e8ea57e801 100644
--- a/engines/scumm/imuse_digi/dimuse_internalmixer.h
+++ b/engines/scumm/imuse_digi/dimuse_internalmixer.h
@@ -45,23 +45,23 @@ namespace Scumm {
class IMuseDigiInternalMixer {
private:
- int32 *_amp8Table;
- int32 *_amp12Table;
- int32 *_softLMID;
- int32 *_softLTable;
+ int32 *_amp8Table = nullptr;
+ int32 *_amp12Table = nullptr;
+ int32 *_softLMID = nullptr;
+ int32 *_softLTable = nullptr;
- uint8 *_mixBuf;
+ uint8 *_mixBuf = nullptr;
Audio::Mixer *_mixer;
Audio::SoundHandle _channelHandle;
- int _mixBufSize;
- int _radioChatter;
- int _outWordSize;
- int _outChannelCount;
- int _sampleRate;
- int _stereoReverseFlag;
- bool _isEarlyDiMUSE;
- bool _lowLatencyMode;
+ int _mixBufSize = 0;
+ int _radioChatter = 0;
+ int _outWordSize = 0;
+ int _outChannelCount = 0;
+ int _sampleRate = 0;
+ int _stereoReverseFlag = 0;
+ bool _isEarlyDiMUSE = false;
+ bool _lowLatencyMode = false;
void mixBits8Mono(uint8 *srcBuf, int32 inFrameCount, int feedSize, int32 mixBufStartIndex, int32 *ampTable, bool ftIs11025Hz);
void mixBits12Mono(uint8 *srcBuf, int32 inFrameCount, int feedSize, int32 mixBufStartIndex, int32 *ampTable);
diff --git a/engines/scumm/imuse_digi/dimuse_triggers.h b/engines/scumm/imuse_digi/dimuse_triggers.h
index b694f4e6651..bbe4a878570 100644
--- a/engines/scumm/imuse_digi/dimuse_triggers.h
+++ b/engines/scumm/imuse_digi/dimuse_triggers.h
@@ -33,13 +33,14 @@ class IMuseDigiTriggersHandler {
private:
IMuseDigital *_engine;
- IMuseDigiTrigger _trigs[DIMUSE_MAX_TRIGGERS];
- IMuseDigiDefer _defers[DIMUSE_MAX_DEFERS];
+ IMuseDigiTrigger _trigs[DIMUSE_MAX_TRIGGERS] = {};
+ IMuseDigiDefer _defers[DIMUSE_MAX_DEFERS] = {};
+
+ int _defersOn = 0;
+ int _midProcessing = 0;
+ char _textBuffer[256] = {};
+ char _emptyMarker[1] = {};
- int _defersOn;
- int _midProcessing;
- char _textBuffer[256];
- char _emptyMarker[1];
public:
IMuseDigiTriggersHandler(IMuseDigital *engine);
~IMuseDigiTriggersHandler();
Commit: 70c1f5eeae27d01a8b7dc2dda9b079bbff396638
https://github.com/scummvm/scummvm/commit/70c1f5eeae27d01a8b7dc2dda9b079bbff396638
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2024-11-16T18:56:32+02:00
Commit Message:
SCUMM: MACGUI: Initialize class members
Changed paths:
engines/scumm/macgui/macgui_impl.h
engines/scumm/macgui/macgui_loom.h
diff --git a/engines/scumm/macgui/macgui_impl.h b/engines/scumm/macgui/macgui_impl.h
index f369fd15a7a..71fd9fc5031 100644
--- a/engines/scumm/macgui/macgui_impl.h
+++ b/engines/scumm/macgui/macgui_impl.h
@@ -468,10 +468,10 @@ public:
class MacSlider : public MacSliderBase {
private:
Common::Point _clickPos;
- uint32 _nextRepeat;
+ uint32 _nextRepeat = 0;
- int _pageSize;
- int _paging;
+ int _pageSize = 0;
+ int _paging = 0;
bool _upArrowPressed = false;
bool _downArrowPressed = false;
diff --git a/engines/scumm/macgui/macgui_loom.h b/engines/scumm/macgui/macgui_loom.h
index e54231f3c87..d5fcb706887 100644
--- a/engines/scumm/macgui/macgui_loom.h
+++ b/engines/scumm/macgui/macgui_loom.h
@@ -60,7 +60,7 @@ protected:
private:
Graphics::Surface *_practiceBox = nullptr;
Common::Point _practiceBoxPos;
- int _practiceBoxNotes;
+ int _practiceBoxNotes = 0;
};
} // End of namespace Scumm
Commit: 86749b953000b52cb42621ff05d93c31a47a42ee
https://github.com/scummvm/scummvm/commit/86749b953000b52cb42621ff05d93c31a47a42ee
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2024-11-16T18:56:32+02:00
Commit Message:
SCUMM: Initialize class members for sound player code
Changed paths:
engines/scumm/midiparser_ro.cpp
engines/scumm/players/player_apple2.cpp
engines/scumm/players/player_apple2.h
engines/scumm/players/player_he.cpp
engines/scumm/players/player_nes.cpp
engines/scumm/players/player_v2a.cpp
engines/scumm/players/player_v3a.cpp
diff --git a/engines/scumm/midiparser_ro.cpp b/engines/scumm/midiparser_ro.cpp
index 2b8452f03f3..d08eeb5efac 100644
--- a/engines/scumm/midiparser_ro.cpp
+++ b/engines/scumm/midiparser_ro.cpp
@@ -33,11 +33,9 @@ namespace Scumm {
class MidiParser_RO : public MidiParser {
protected:
- int _markerCount; // Number of markers encountered in stream so far
- int _lastMarkerCount; // Cache markers until parsed event is actually consumed
+ int _markerCount = 0; // Number of markers encountered in stream so far
+ int _lastMarkerCount = 0; // Cache markers until parsed event is actually consumed
-protected:
- void compressToType0();
void parseNextEvent (EventInfo &info) override;
public:
diff --git a/engines/scumm/players/player_apple2.cpp b/engines/scumm/players/player_apple2.cpp
index caec05e94bd..aa390c04ff2 100644
--- a/engines/scumm/players/player_apple2.cpp
+++ b/engines/scumm/players/player_apple2.cpp
@@ -70,11 +70,11 @@ private:
}
protected:
- int _delta;
- int _count;
- byte _interval; // must be unsigned byte ("interval < delta" possible)
- int _limit;
- bool _decInterval;
+ int _delta = 0;
+ int _count = 0;
+ byte _interval = 0; // must be unsigned byte ("interval < delta" possible)
+ int _limit = 0;
+ bool _decInterval = false;
};
/*
@@ -122,8 +122,8 @@ private:
}
protected:
- const byte *_params;
- int _pos;
+ const byte *_params = 0;
+ int _pos = 0;
};
/*
@@ -167,8 +167,8 @@ private:
}
protected:
- const byte *_params;
- int _pos;
+ const byte *_params = nullptr;
+ int _pos = 0;
};
/*
@@ -256,17 +256,17 @@ private:
}
protected:
- const byte *_params;
+ const byte *_params = nullptr;
- byte _updateRemain1;
- byte _updateRemain2;
+ byte _updateRemain1 = 0;
+ byte _updateRemain2 = 0;
- uint16 _count;
- byte _bitmask1;
- byte _bitmask2;
- byte _updateInterval1;
- byte _updateInterval2;
- byte _speakerShiftReg;
+ uint16 _count = 0;
+ byte _bitmask1 = 0;
+ byte _bitmask2 = 0;
+ byte _updateInterval1 = 0;
+ byte _updateInterval2 = 0;
+ byte _speakerShiftReg = 0;
};
/*
@@ -324,8 +324,8 @@ private:
}
protected:
- int _index;
- int _param0;
+ int _index = 0;
+ int _param0 = 0;
private:
static const byte _noiseTable[256];
diff --git a/engines/scumm/players/player_apple2.h b/engines/scumm/players/player_apple2.h
index 778a52b9415..7a1bd64c35f 100644
--- a/engines/scumm/players/player_apple2.h
+++ b/engines/scumm/players/player_apple2.h
@@ -231,7 +231,7 @@ public:
/* returns true if finished */
virtual bool update() = 0;
protected:
- Player_AppleII *_player;
+ Player_AppleII *_player = nullptr;
};
class Player_AppleII : public Audio::AudioStream, public MusicEngine {
@@ -263,28 +263,26 @@ public:
private:
// sound number
- int _soundNr;
+ int _soundNr = 0;
// type of sound
- int _type;
+ int _type = 0;
// number of loops left
- int _loop;
+ int _loop = 0;
// global sound param list
- const byte *_params;
+ const byte *_params = nullptr;
// speaker toggle state (0 / 1)
- byte _speakerState;
+ byte _speakerState = 0;
// sound function
AppleII_SoundFunction *_soundFunc;
// cycle to sample converter
SampleConverter _sampleConverter;
-private:
ScummEngine *_vm;
Audio::Mixer *_mixer;
Audio::SoundHandle _soundHandle;
- int _sampleRate;
+ int _sampleRate = 0;
Common::Mutex _mutex;
-private:
void resetState();
bool updateSound();
};
diff --git a/engines/scumm/players/player_he.cpp b/engines/scumm/players/player_he.cpp
index 9acf7eef4c6..0225133bf05 100644
--- a/engines/scumm/players/player_he.cpp
+++ b/engines/scumm/players/player_he.cpp
@@ -31,10 +31,11 @@ namespace Scumm {
Player_HE::Player_HE(ScummEngine *scumm) :
_vm(scumm),
_currentMusic(-1),
- _bank(NULL),
- _parser(NULL),
- _midi(NULL),
- _masterVolume(256) {
+ _bank(nullptr),
+ _parser(nullptr),
+ _midi(nullptr),
+ _masterVolume(256),
+ _bankSize(0) {
for (int chan = 0; chan < 16; chan++)
_channelVolume[chan] = 127;
diff --git a/engines/scumm/players/player_nes.cpp b/engines/scumm/players/player_nes.cpp
index 17695b23bfd..c97d6c448c2 100644
--- a/engines/scumm/players/player_nes.cpp
+++ b/engines/scumm/players/player_nes.cpp
@@ -89,9 +89,9 @@ static const byte LengthCounts[32] = {
class SoundGen {
protected:
- byte wavehold;
- uint32 freq; // short
- uint32 CurD;
+ byte wavehold = 0;
+ uint32 freq = 0; // short
+ uint32 CurD = 0;
public:
byte Timer;
@@ -103,11 +103,11 @@ public:
class Square : public SoundGen {
protected:
- byte volume, envelope, duty, swpspeed, swpdir, swpstep, swpenab;
- byte Vol;
- byte EnvCtr, Envelope, BendCtr;
- bool Enabled, ValidFreq, Active;
- bool EnvClk, SwpClk;
+ byte volume = 0, envelope = 0, duty = 0, swpspeed = 0, swpdir = 0, swpstep = 0, swpenab = 0;
+ byte Vol = 0;
+ byte EnvCtr = 0, Envelope = 0, BendCtr = 0;
+ bool Enabled = 0, ValidFreq = 0, Active = 0;
+ bool EnvClk = 0, SwpClk = 0;
void CheckActive();
@@ -236,10 +236,10 @@ void Square::HalfFrame() {
class Triangle : public SoundGen {
protected:
- byte linear;
- byte LinCtr;
- bool Enabled, Active;
- bool LinClk;
+ byte linear = 0;
+ byte LinCtr = 0;
+ bool Enabled = false, Active = false;
+ bool LinClk = false;
void CheckActive();
@@ -341,13 +341,11 @@ void Triangle::HalfFrame() {
class Noise : public SoundGen {
protected:
- byte volume, envelope, datatype;
- byte Vol;
- byte EnvCtr, Envelope;
- bool Enabled;
- bool EnvClk;
-
- void CheckActive();
+ byte volume = 0, envelope = 0, datatype = 0;
+ byte Vol = 0;
+ byte EnvCtr = 0, Envelope = 0;
+ bool Enabled = false;
+ bool EnvClk = false;
public:
void Reset();
diff --git a/engines/scumm/players/player_v2a.cpp b/engines/scumm/players/player_v2a.cpp
index 0772e4f6b96..1aa62a2da4c 100644
--- a/engines/scumm/players/player_v2a.cpp
+++ b/engines/scumm/players/player_v2a.cpp
@@ -89,8 +89,8 @@ public:
_data = nullptr;
}
protected:
- const uint16 _offset;
- const uint16 _size;
+ const uint16 _offset = 0;
+ const uint16 _size = 0;
char *_data;
};
@@ -203,16 +203,17 @@ public:
_id = 0;
}
private:
- const uint16 _instoff;
- const uint16 _voloff;
- const uint16 _chan1off;
- const uint16 _chan2off;
- const uint16 _chan3off;
- const uint16 _chan4off;
- const uint16 _sampoff;
- const bool _looped;
+ const uint16 _instoff = 0;
+ const uint16 _voloff = 0;
+ const uint16 _chan1off = 0;
+ const uint16 _chan2off = 0;
+ const uint16 _chan3off = 0;
+ const uint16 _chan4off = 0;
+ const uint16 _sampoff = 0;
+ const bool _looped = false;
+
+ char *_data = nullptr;
- char *_data;
struct tchan {
uint16 dataptr_i;
uint16 dataptr;
@@ -221,7 +222,7 @@ private:
uint16 chan;
uint16 dur;
uint16 ticks;
- } _chan[4];
+ } _chan[4] = {};
};
// plays a single waveform
@@ -247,10 +248,10 @@ public:
return true;
}
private:
- const uint16 _freq;
- const uint8 _vol;
+ const uint16 _freq = 0;
+ const uint8 _vol = 0;
- int _ticks;
+ int _ticks = 0;
};
// plays a single looped waveform
@@ -324,9 +325,9 @@ public:
return true;
}
private:
- const uint16 _duration;
+ const uint16 _duration = 0;
- int _ticks;
+ int _ticks = 0;
};
// plays a single looped waveform which starts at one frequency and bends to another frequency, where it remains until stopped
@@ -361,12 +362,12 @@ public:
return true;
}
private:
- const uint16 _freq1;
- const uint16 _freq2;
- const uint8 _vol;
- const uint16 _step;
+ const uint16 _freq1 = 0;
+ const uint16 _freq2 = 0;
+ const uint8 _vol = 0;
+ const uint16 _step = 0;
- uint16 _curfreq;
+ uint16 _curfreq = 0;
};
// plays a single looped waveform starting at a specific frequency/volume, dropping in frequency and fading volume to zero
@@ -395,11 +396,11 @@ public:
return true;
}
private:
- const uint16 _freq;
- const uint8 _vol;
+ const uint16 _freq = 0;
+ const uint8 _vol = 0;
- uint16 _curfreq;
- uint16 _curvol;
+ uint16 _curfreq = 0;
+ uint16 _curvol = 0;
};
// plays a single looped waveform, fading the volume from zero to maximum at one rate, then back to zero at another rate
@@ -514,12 +515,12 @@ public:
return true;
}
private:
- const uint16 _freq1;
- const uint16 _freq2;
- const uint16 _step;
+ const uint16 _freq1 = 0;
+ const uint16 _freq2 = 0;
+ const uint16 _step = 0;
- uint16 _curfreq;
- int _curvol;
+ uint16 _curfreq = 0;
+ int _curvol = 0;
};
// plays a single looped waveform, starting at one frequency, bending down to another frequency, and then back up to the original frequency
@@ -594,11 +595,11 @@ public:
return true;
}
private:
- const uint16 _freq1;
- const uint16 _freq2;
+ const uint16 _freq1 = 0;
+ const uint16 _freq2 = 0;
- uint16 _curfreq;
- uint8 _curvol;
+ uint16 _curfreq = 0;
+ uint8 _curvol = 0;
};
// intermittently plays two looped waveforms for a specific duration
@@ -685,13 +686,13 @@ public:
return true;
}
private:
- const uint16 _freq;
- const uint8 _vol;
- const uint8 _loopwidth;
- const uint8 _numloops;
+ const uint16 _freq = 0;
+ const uint8 _vol = 0;
+ const uint8 _loopwidth = 0;
+ const uint8 _numloops = 0;
- int _loop;
- int _loopctr;
+ int _loop = 0;
+ int _loopctr = 0;
void soundon() {
char *tmp_data = (char *)malloc(_size);
@@ -732,14 +733,14 @@ public:
return true;
}
private:
- const uint16 _freq;
- const uint8 _vol;
- const uint8 _numdurs;
- const uint8 *_durations;
- const bool _looped;
+ const uint16 _freq = 0;
+ const uint8 _vol = 0;
+ const uint8 _numdurs = 0;
+ const uint8 *_durations = nullptr;
+ const bool _looped = false;
- int _ticks;
- int _curdur;
+ int _ticks = 0;
+ int _curdur = 0;
void soundon() {
char *tmp_data = (char *)malloc(_size);
@@ -790,17 +791,17 @@ public:
return true;
}
private:
- const uint16 _offset1;
- const uint16 _size1;
- const uint16 _offset2;
- const uint16 _size2;
- const uint16 _freq1;
- const uint16 _freq2;
- const uint8 _vol;
-
- int _curfreq;
- uint16 _loopnum;
- uint16 _step;
+ const uint16 _offset1 = 0;
+ const uint16 _size1 = 0;
+ const uint16 _offset2 = 0;
+ const uint16 _size2 = 0;
+ const uint16 _freq1 = 0;
+ const uint16 _freq2 = 0;
+ const uint8 _vol = 0;
+
+ int _curfreq = 0;
+ uint16 _loopnum = 0;
+ uint16 _step = 0;
void soundon(const char *data, int size) {
char *tmp_data1 = (char *)malloc(size);
@@ -858,20 +859,20 @@ public:
return true;
}
private:
- const uint16 _offset1;
- const uint16 _size1;
- const uint16 _offset2;
- const uint16 _size2;
- const uint8 _vol;
-
- uint16 _freq1;
- int16 _step1;
- uint16 _freq2;
- int16 _step2;
- uint16 _freq3;
- int16 _step3;
- uint16 _freq4;
- int16 _step4;
+ const uint16 _offset1 = 0;
+ const uint16 _size1 = 0;
+ const uint16 _offset2 = 0;
+ const uint16 _size2 = 0;
+ const uint8 _vol = 0;
+
+ uint16 _freq1 = 0;
+ int16 _step1 = 0;
+ uint16 _freq2 = 0;
+ int16 _step2 = 0;
+ uint16 _freq3 = 0;
+ int16 _step3 = 0;
+ uint16 _freq4 = 0;
+ int16 _step4 = 0;
void updatefreq(uint16 &freq, int16 &step, uint16 min, uint16 max) {
freq += step;
@@ -944,9 +945,9 @@ public:
return true;
}
private:
- const uint16 _dur;
+ const uint16 _dur = 0;
- int _ticks;
+ int _ticks = 0;
};
// plays a single looped waveform and slowly fades volume to zero
@@ -1014,12 +1015,12 @@ public:
return true;
}
private:
- const uint16 _freq1;
- const uint16 _freq2;
+ const uint16 _freq1 = 0;
+ const uint16 _freq2 = 0;
- uint16 _curfreq;
- int _curvol;
- int _ticks;
+ uint16 _curfreq = 0;
+ int _curvol = 0;
+ int _ticks = 0;
};
// plays 4 looped waveforms, starting at specific frequencies and bending at different rates while fading volume to zero
@@ -1071,14 +1072,14 @@ public:
return true;
}
private:
- const uint16 _offset;
- const uint16 _size;
-
- uint16 _freq1;
- uint16 _freq2;
- uint16 _freq3;
- uint16 _freq4;
- uint8 _vol;
+ const uint16 _offset = 0;
+ const uint16 _size = 0;
+
+ uint16 _freq1 = 0;
+ uint16 _freq2 = 0;
+ uint16 _freq3 = 0;
+ uint16 _freq4 = 0;
+ uint8 _vol = 0;
};
// plays a single looped waveform, bending the frequency upward at a varying rate
@@ -1115,14 +1116,14 @@ public:
return true;
}
private:
- const uint16 _freq1;
- const uint16 _freq2;
- const uint16 _vol;
-
- uint16 _curfreq;
- uint16 _bendrate;
- uint16 _bendctr;
- uint16 _holdctr;
+ const uint16 _freq1 = 0;
+ const uint16 _freq2 = 0;
+ const uint16 _vol = 0;
+
+ uint16 _curfreq = 0;
+ uint16 _bendrate = 0;
+ uint16 _bendctr = 0;
+ uint16 _holdctr = 0;
};
// plays one waveform, then switches to a different looped waveform and slowly fades volume to zero
@@ -1160,14 +1161,14 @@ public:
}
private:
- const uint16 _offset1;
- const uint16 _offset2;
- const uint16 _size1;
- const uint16 _size2;
- const uint16 _freq;
-
- int _vol;
- int _loop;
+ const uint16 _offset1 = 0;
+ const uint16 _offset2 = 0;
+ const uint16 _size1 = 0;
+ const uint16 _size2 = 0;
+ const uint16 _freq = 0;
+
+ int _vol = 0;
+ int _loop = 0;
};
// plays 2 looped waveforms at different frequencies, pulsing at different frequencies and ramping the volume up and down once
@@ -1235,16 +1236,16 @@ public:
return true;
}
private:
- const uint16 _offset1;
- const uint16 _size1;
- const uint16 _offset2;
- const uint16 _size2;
- const uint16 _freq1;
- const uint16 _freq2;
-
- uint16 _loopnum;
- uint16 _vol;
- uint16 _beepcount;
+ const uint16 _offset1 = 0;
+ const uint16 _size1 = 0;
+ const uint16 _offset2 = 0;
+ const uint16 _size2 = 0;
+ const uint16 _freq1 = 0;
+ const uint16 _freq2 = 0;
+
+ uint16 _loopnum = 0;
+ uint16 _vol = 0;
+ uint16 _beepcount = 0;
};
// plays a stereo siren, sweeping up and down quickly several times before sweeping up slowly, stopping, and then going silent
@@ -1312,14 +1313,14 @@ public:
}
}
private:
- const uint16 _offset1;
- const uint16 _offset2;
- const uint16 _size1;
- const uint16 _size2;
-
- uint16 _loopnum;
- int16 _freqmod;
- uint16 _freq;
+ const uint16 _offset1 = 0;
+ const uint16 _offset2 = 0;
+ const uint16 _size1 = 0;
+ const uint16 _size2 = 0;
+
+ uint16 _loopnum = 0;
+ int16 _freqmod = 0;
+ uint16 _freq = 0;
};
// plays a looped waveform, increasing frequency and reducing volume once the frequency reaches a certain point
@@ -1355,10 +1356,10 @@ public:
return false;
}
private:
- const uint16 _offset;
- const uint16 _size;
+ const uint16 _offset = 0;
+ const uint16 _size = 0;
- uint16 _curfreq;
+ uint16 _curfreq = 0;
};
// plays a looped waveform, sweeping the frequency up while modulating it (alternating which channel updates) and fading volume out
@@ -1412,11 +1413,11 @@ public:
return true;
}
private:
- const uint16 _offset;
- const uint16 _size;
+ const uint16 _offset = 0;
+ const uint16 _size = 0;
- uint16 _loop;
- uint16 _curfreq;
+ uint16 _loop = 0;
+ uint16 _curfreq = 0;
};
// just like Zak61, but sweeps frequency in the other direction
@@ -1567,15 +1568,15 @@ public:
return true;
}
private:
- const uint16 _offset;
- const uint16 _size;
-
- uint16 _loop;
- uint16 _playctr;
- uint16 _wait1;
- uint16 _wait2;
- uint16 _wait3;
- uint16 _wait4;
+ const uint16 _offset = 0;
+ const uint16 _size = 0;
+
+ uint16 _loop = 0;
+ uint16 _playctr = 0;
+ uint16 _wait1 = 0;
+ uint16 _wait2 = 0;
+ uint16 _wait3 = 0;
+ uint16 _wait4 = 0;
};
// plays a "ding" (volume 0-max-0) followed by a sound sample, a pause, then loops again
@@ -1647,12 +1648,12 @@ public:
return true;
}
private:
- const uint16 _offset;
- const uint16 _size;
+ const uint16 _offset = 0;
+ const uint16 _size = 0;
- uint16 _mode;
- uint16 _vol;
- int16 _volmod;
+ uint16 _mode = 0;
+ uint16 _vol = 0;
+ int16 _volmod = 0;
};
// modulates volume on 4 samples, frequency on only 2 of them
@@ -1723,13 +1724,13 @@ public:
return true;
}
private:
- const uint16 _offset;
- const uint16 _size;
+ const uint16 _offset = 0;
+ const uint16 _size = 0;
- uint16 _freq[4];
- uint16 _vol[4];
- int16 _freqmod;
- int16 _volmod[2];
+ uint16 _freq[4] = {};
+ uint16 _vol[4] = {};
+ int16 _freqmod = 0;
+ int16 _volmod[2] = {};
};
#define CRCToSound(CRC, SOUND) \
diff --git a/engines/scumm/players/player_v3a.cpp b/engines/scumm/players/player_v3a.cpp
index 0d7a95a25b5..34e6ecaf749 100644
--- a/engines/scumm/players/player_v3a.cpp
+++ b/engines/scumm/players/player_v3a.cpp
@@ -53,7 +53,7 @@ Player_V3A::Player_V3A(ScummEngine *scumm, Audio::Mixer *mixer)
bool Player_V3A::init() {
byte *ptr;
- int numInstruments = 0;
+ int numInstruments;
// Determine which sound resource contains the wavetable data and how large it is
// This is hardcoded into each game's executable
Commit: f1d71769548ea8dbbdec6390988194962231961c
https://github.com/scummvm/scummvm/commit/f1d71769548ea8dbbdec6390988194962231961c
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2024-11-16T18:56:32+02:00
Commit Message:
SCUMM: Initialize class members
Changed paths:
engines/scumm/actor.cpp
engines/scumm/actor.h
engines/scumm/actor_he.h
engines/scumm/akos.h
engines/scumm/base-costume.h
engines/scumm/charset.h
engines/scumm/dialogs.h
engines/scumm/file.h
engines/scumm/metaengine.cpp
engines/scumm/scumm_v7.h
engines/scumm/scumm_v8.h
diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index 8784d906255..ae990aaa732 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -105,11 +105,8 @@ static const byte v0WalkboxSlantedModifier[0x16] = {
};
Actor::Actor(ScummEngine *scumm, int id) :
- _vm(scumm), _number(id), _visible(false), _shadowMode(0), _flip(false), _frame(0), _walkbox(0), _talkPosX(0), _talkPosY(0),
- _talkScript(0), _walkScript(0), _ignoreTurns(false), _drawToBackBuf(false), _layer(0), _heOffsX(0), _heOffsY(0), _heSkipLimbs(false),
- _heCondMask(0), _hePaletteNum(0), _heShadow(0), _elevation(0), _facing(0), _targetFacing(0), _speedx(0), _speedy(0),
- _animProgress(0), _animSpeed(0), _costumeNeedsInit(false) {
- assert(_vm != nullptr);
+ _vm(scumm), _number(id) {
+ assert(_vm != nullptr);
}
ActorHE::ActorHE(ScummEngine *scumm, int id) : Actor(scumm,id) {
diff --git a/engines/scumm/actor.h b/engines/scumm/actor.h
index 34ba3c4303c..01c3e82c6b9 100644
--- a/engines/scumm/actor.h
+++ b/engines/scumm/actor.h
@@ -105,67 +105,67 @@ protected:
Common::Point _pos;
public:
- int _top, _bottom;
- uint _width;
- byte _number;
- uint16 _costume;
- byte _room;
+ int _top = 0, _bottom = 0;
+ uint _width = 0;
+ byte _number = 0;
+ uint16 _costume = 0;
+ byte _room = 0;
public:
- byte _talkColor;
- int _talkFrequency;
- byte _talkPan;
- byte _talkVolume;
- uint16 _boxscale;
- byte _scalex, _scaley;
- byte _charset;
- byte _moving;
- bool _ignoreBoxes;
- byte _forceClip;
- uint16 _lastValidX, _lastValidY;
-
- byte _initFrame;
- byte _walkFrame;
- byte _standFrame;
- byte _talkStartFrame;
- byte _talkStopFrame;
-
- bool _needRedraw, _needBgReset, _visible;
- byte _shadowMode;
- bool _flip;
- byte _frame;
- byte _walkbox;
- int16 _talkPosX, _talkPosY;
- uint16 _talkScript, _walkScript;
- bool _ignoreTurns;
- bool _drawToBackBuf;
- int32 _layer;
- uint16 _sound[32];
+ byte _talkColor = 0;
+ int _talkFrequency = 0;
+ byte _talkPan = 0;
+ byte _talkVolume = 0;
+ uint16 _boxscale = 0;
+ byte _scalex = 0, _scaley = 0;
+ byte _charset = 0;
+ byte _moving = 0;
+ bool _ignoreBoxes = false;
+ byte _forceClip = 0;
+ uint16 _lastValidX = 0, _lastValidY = 0;
+
+ byte _initFrame = 0;
+ byte _walkFrame = 0;
+ byte _standFrame = 0;
+ byte _talkStartFrame = 0;
+ byte _talkStopFrame = 0;
+
+ bool _needRedraw = false, _needBgReset = false, _visible = false;
+ byte _shadowMode = 0;
+ bool _flip = false;
+ byte _frame = 0;
+ byte _walkbox = 0;
+ int16 _talkPosX = 0, _talkPosY = 0;
+ uint16 _talkScript = 0, _walkScript = 0;
+ bool _ignoreTurns = false;
+ bool _drawToBackBuf = false;
+ int32 _layer = 0;
+ uint16 _sound[32] = {};
CostumeData _cost;
/* HE specific */
- int _heOffsX, _heOffsY;
- bool _heSkipLimbs;
- uint32 _heCondMask;
- uint32 _hePaletteNum;
- uint32 _heShadow;
+ int _heOffsX = 0, _heOffsY = 0;
+ bool _heSkipLimbs = false;
+ uint32 _heCondMask = 0;
+ uint32 _hePaletteNum = 0;
+ uint32 _heShadow = 0;
protected:
struct ActorWalkData {
Common::Point dest; // Final destination point
- byte destbox; // Final destination box
- int16 destdir; // Final destination, direction to face at
+ byte destbox = 0; // Final destination box
+ int16 destdir = 0; // Final destination, direction to face at
Common::Point cur; // Last position
- byte curbox; // Last box
+ byte curbox = 0; // Last box
Common::Point next; // Next position on our way to the destination, i.e. our intermediate destination
Common::Point point3;
- int32 deltaXFactor, deltaYFactor;
- uint16 xfrac, yfrac;
- uint16 xAdd, yAdd;
- int16 facing;
+ int32 deltaXFactor = 0, deltaYFactor = 0;
+ uint16 xfrac = 0, yfrac = 0;
+ uint16 xAdd = 0, yAdd = 0;
+ int16 facing = 0;
void reset() {
dest.x = dest.y = 0;
@@ -186,15 +186,15 @@ protected:
};
- uint16 _palette[256];
- int _elevation;
- uint16 _facing;
- uint16 _targetFacing;
- uint _speedx, _speedy;
- byte _animProgress, _animSpeed;
- bool _costumeNeedsInit;
+ uint16 _palette[256] = {};
+ int _elevation = 0;
+ uint16 _facing = 0;
+ uint16 _targetFacing = 0;
+ uint _speedx = 0, _speedy = 0;
+ byte _animProgress = 0, _animSpeed = 0;
+ bool _costumeNeedsInit = false;
ActorWalkData _walkdata;
- int16 _animVariable[27];
+ int16 _animVariable[27] = {};
public:
@@ -417,38 +417,38 @@ public:
Common::Array<byte> _walkboxHistory;
- byte _walkboxQueue[0x10];
- byte _walkboxQueueIndex;
+ byte _walkboxQueue[0x10] = {};
+ byte _walkboxQueueIndex = 0;
- byte _costCommandNew;
- byte _costCommand;
- byte _miscflags;
- byte _speaking;
+ byte _costCommandNew = 0;
+ byte _costCommand = 0;
+ byte _miscflags = 0;
+ byte _speaking = 0;
- byte _walkCountModulo;
- bool _newWalkBoxEntered;
+ byte _walkCountModulo = 0;
+ bool _newWalkBoxEntered = false;
- byte _walkDirX;
- byte _walkDirY;
+ byte _walkDirX = 0;
+ byte _walkDirY = 0;
- byte _walkYCountGreaterThanXCount;
- byte _walkXCount;
- byte _walkXCountInc;
- byte _walkYCount;
- byte _walkYCountInc;
+ byte _walkYCountGreaterThanXCount = 0;
+ byte _walkXCount = 0;
+ byte _walkXCountInc = 0;
+ byte _walkYCount = 0;
+ byte _walkYCountInc = 0;
- byte _walkMaxXYCountInc;
+ byte _walkMaxXYCountInc = 0;
Common::Point _tmp_Pos;
Common::Point _tmp_NewPos;
- byte _tmp_WalkBox;
- bool _tmp_NewWalkBoxEntered;
+ byte _tmp_WalkBox = 0;
+ bool _tmp_NewWalkBoxEntered = false;
- int8 _animFrameRepeat;
- int8 _limbFrameRepeatNew[8];
- int8 _limbFrameRepeat[8];
+ int8 _animFrameRepeat = 0;
+ int8 _limbFrameRepeatNew[8] = {};
+ int8 _limbFrameRepeat[8] = {};
- bool _limb_flipped[8];
+ bool _limb_flipped[8] = {};
private:
diff --git a/engines/scumm/actor_he.h b/engines/scumm/actor_he.h
index c5b963e5a71..fc30416aaea 100644
--- a/engines/scumm/actor_he.h
+++ b/engines/scumm/actor_he.h
@@ -89,23 +89,23 @@ public:
/** This rect is used to clip actor drawing. */
Common::Rect _clipOverride;
- bool _heNoTalkAnimation;
- bool _heTalking;
- byte _generalFlags;
+ bool _heNoTalkAnimation = false;
+ bool _heTalking = false;
+ byte _generalFlags = 0;
- int _auxActor;
- int32 _auxEraseX1, _auxEraseY1, _auxEraseX2, _auxEraseY2;
+ int _auxActor = 0;
+ int32 _auxEraseX1 = 0, _auxEraseY1 = 0, _auxEraseX2 = 0, _auxEraseY2 = 0;
// 80 is the maximum number of strips that any hi-res HE game is going to have
- int _screenUpdateTableMin[80];
- int _screenUpdateTableMax[80];
+ int _screenUpdateTableMin[80] = {};
+ int _screenUpdateTableMax[80] = {};
struct {
int16 posX;
int16 posY;
int16 color;
byte sentence[128];
- } _heTalkQueue[16];
+ } _heTalkQueue[16] = {};
void prepareDrawActorCostume(BaseCostumeRenderer *bcr) override;
diff --git a/engines/scumm/akos.h b/engines/scumm/akos.h
index be130fb0dd6..14ec3053a9b 100644
--- a/engines/scumm/akos.h
+++ b/engines/scumm/akos.h
@@ -43,7 +43,7 @@ struct AkosOffset;
class AkosCostumeLoader : public BaseCostumeLoader {
protected:
- const byte *_akos;
+ const byte *_akos = nullptr;
public:
AkosCostumeLoader(ScummEngine *vm) : BaseCostumeLoader(vm) {}
@@ -64,10 +64,10 @@ protected:
class AkosRenderer : public BaseCostumeRenderer {
protected:
- uint16 _codec;
+ uint16 _codec = 0;
// actor _palette
- uint16 _palette[256];
+ uint16 _palette[256] = {};
bool _useBompPalette;
// pointer to various parts of the costume resource
@@ -111,9 +111,9 @@ public:
_actorHitMode = false;
}
- bool _actorHitMode;
- int16 _actorHitX, _actorHitY;
- bool _actorHitResult;
+ bool _actorHitMode = false;
+ int16 _actorHitX = 0, _actorHitY = 0;
+ bool _actorHitResult = false;
void setPalette(uint16 *_palette) override;
void setFacing(const Actor *a) override;
diff --git a/engines/scumm/base-costume.h b/engines/scumm/base-costume.h
index 5a6a9c4021c..e45d6c5c90c 100644
--- a/engines/scumm/base-costume.h
+++ b/engines/scumm/base-costume.h
@@ -142,6 +142,8 @@ public:
_width = _height = 0;
_skipLimbs = false;
_paletteNum = 0;
+ _actorDrawVirScr = false;
+ _numBlocks = 0;
}
virtual ~BaseCostumeRenderer() {}
diff --git a/engines/scumm/charset.h b/engines/scumm/charset.h
index 16c97dc1434..77742e15662 100644
--- a/engines/scumm/charset.h
+++ b/engines/scumm/charset.h
@@ -202,7 +202,7 @@ private:
class CharsetRendererNES : public CharsetRendererCommon {
protected:
- byte *_trTable;
+ byte *_trTable = nullptr;
void drawBits1(Graphics::Surface &dest, int x, int y, const byte *src, int drawTop, int width, int height);
@@ -223,7 +223,7 @@ protected:
virtual int getDrawHeightIntern(uint16 chr);
virtual void setDrawCharIntern(uint16 chr) {}
- const byte *_widthTable;
+ const byte *_widthTable = nullptr;
public:
CharsetRendererV3(ScummEngine *vm) : CharsetRendererPC(vm) {}
@@ -285,7 +285,7 @@ public:
class CharsetRendererMac : public CharsetRendererCommon {
protected:
- const Graphics::Font *_font;
+ const Graphics::Font *_font = nullptr;
bool _useCorrectFontSpacing;
bool _pad;
int _lastTop;
diff --git a/engines/scumm/dialogs.h b/engines/scumm/dialogs.h
index 763fa65fcba..9a50a6c4cfc 100644
--- a/engines/scumm/dialogs.h
+++ b/engines/scumm/dialogs.h
@@ -151,11 +151,11 @@ protected:
kDisplayDelay = 1500
};
Common::U32String _label;
- const int _min, _max;
- const uint16 _incKey, _decKey;
- int _percentBarWidth;
- int _value;
- uint32 _timer;
+ const int _min = 0, _max = 0;
+ const uint16 _incKey = 0, _decKey = 0;
+ int _percentBarWidth = 0;
+ int _value = 0;
+ uint32 _timer = 0;
};
/**
diff --git a/engines/scumm/file.h b/engines/scumm/file.h
index 1bbcca97f9a..d0d29d98f7b 100644
--- a/engines/scumm/file.h
+++ b/engines/scumm/file.h
@@ -88,20 +88,20 @@ public:
class ScummDiskImage : public BaseScummFile {
private:
Common::SeekableReadStream *_stream;
- byte _roomDisks[59], _roomTracks[59], _roomSectors[59];
+ byte _roomDisks[59] = {}, _roomTracks[59] = {}, _roomSectors[59] = {};
- byte *_buf;
+ byte *_buf = nullptr;
const GameSettings _game;
const Common::String _disk1, _disk2;
- int _openedDisk;
+ int _openedDisk = 0;
- int _numGlobalObjects;
- int _numRooms;
- int _numCostumes;
- int _numScripts;
- int _numSounds;
+ int _numGlobalObjects = 0;
+ int _numRooms = 0;
+ int _numCostumes = 0;
+ int _numScripts = 0;
+ int _numSounds = 0;
const int *_resourcesPerFile;
bool openDisk(char num);
diff --git a/engines/scumm/metaengine.cpp b/engines/scumm/metaengine.cpp
index 55cce19f762..86ddbea0e8d 100644
--- a/engines/scumm/metaengine.cpp
+++ b/engines/scumm/metaengine.cpp
@@ -86,7 +86,7 @@ Common::Path ScummEngine::generateFilename(const int room) const {
Common::Path ScummEngine_v60he::generateFilename(const int room) const {
Common::String result;
- char id = 0;
+ char id;
switch (_filenamePattern.genMethod) {
case kGenHEMac:
diff --git a/engines/scumm/scumm_v7.h b/engines/scumm/scumm_v7.h
index fa151860e95..c5ab2e5cf02 100644
--- a/engines/scumm/scumm_v7.h
+++ b/engines/scumm/scumm_v7.h
@@ -44,15 +44,15 @@ public:
protected:
- int _smushFrameRate;
+ int _smushFrameRate = 0;
/**
* Flag which signals that the SMUSH video playback should end now
* (e.g. because it was aborted by the user or it's simply finished).
*/
- bool _smushVideoShouldFinish;
+ bool _smushVideoShouldFinish = false;
- bool _smushActive;
+ bool _smushActive = false;
Insane *_insane;
@@ -70,15 +70,15 @@ protected:
TextRenderer_v7 *_textV7;
Common::Rect _defaultTextClipRect;
Common::Rect _wrappedTextClipRect;
- bool _newTextRenderStyle;
+ bool _newTextRenderStyle = false;
int _blastTextRectsQueue = 0;
- int _verbLineSpacing;
- bool _existLanguageFile;
- char *_languageBuffer;
+ int _verbLineSpacing = 0;
+ bool _existLanguageFile = false;
+ char *_languageBuffer = nullptr;
LangIndexNode *_languageIndex;
- int _languageIndexSize;
- char _lastStringTag[12+1];
+ int _languageIndexSize = 0;
+ char _lastStringTag[12+1] = {};
struct SubtitleText : TextObject {
void clear() {
diff --git a/engines/scumm/scumm_v8.h b/engines/scumm/scumm_v8.h
index 2d933cb2b1e..88c0db8c22e 100644
--- a/engines/scumm/scumm_v8.h
+++ b/engines/scumm/scumm_v8.h
@@ -176,8 +176,8 @@ protected:
char name[40];
int id;
};
- int _objectIDMapSize;
- ObjectNameId *_objectIDMap;
+ int _objectIDMapSize = 0;
+ ObjectNameId *_objectIDMap = nullptr;
struct StampShot {
int slot;
@@ -188,12 +188,12 @@ protected:
int brightness;
};
- int _savegameThumbnailV8Palette[256];
- byte _savegameThumbnailV8[160 * 120]; // One fourth of the nominal 640x480 resolution
- StampShot _stampShots[20];
+ int _savegameThumbnailV8Palette[256] = {};
+ byte _savegameThumbnailV8[160 * 120] = {}; // One fourth of the nominal 640x480 resolution
+ StampShot _stampShots[20] = {};
int _stampShotsInQueue = 0;
- int _keyScriptKey, _keyScriptNo;
+ int _keyScriptKey = 0, _keyScriptNo = 0;
public:
ScummEngine_v8(OSystem *syst, const DetectorResult &dr);
Commit: 57ba2399a44a9c286f9f88bd7f841554272277db
https://github.com/scummvm/scummvm/commit/57ba2399a44a9c286f9f88bd7f841554272277db
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2024-11-16T18:56:33+02:00
Commit Message:
DGDS: Raise debuglevel of all debug statements to at least 1
This reduces the chatty debug output, which isn't of any use to
regular users
Changed paths:
engines/dgds/ads.cpp
engines/dgds/dgds.cpp
engines/dgds/dialog.cpp
engines/dgds/dragon_native.cpp
engines/dgds/font.cpp
engines/dgds/globals.cpp
engines/dgds/image.cpp
engines/dgds/menu.cpp
engines/dgds/minigames/dragon_arcade.cpp
engines/dgds/minigames/dragon_arcade_ttm.cpp
engines/dgds/parser.cpp
engines/dgds/request.cpp
engines/dgds/resource.cpp
engines/dgds/scene.cpp
engines/dgds/sound.cpp
engines/dgds/sound/drivers/adlib.cpp
engines/dgds/sound/drivers/midipatch.cpp
engines/dgds/sound/midiparser_sci.cpp
engines/dgds/sound/music.cpp
engines/dgds/ttm.cpp
diff --git a/engines/dgds/ads.cpp b/engines/dgds/ads.cpp
index 2700c6b3995..6c27d8e9e77 100644
--- a/engines/dgds/ads.cpp
+++ b/engines/dgds/ads.cpp
@@ -78,7 +78,7 @@ bool ADSInterpreter::load(const Common::String &filename) {
if (!_vm->getResourceManager()->hasResource(detailfile))
detailfile = filename;
- debug("ADSInterpreter: load %s", detailfile.c_str());
+ debug(1, "ADSInterpreter: load %s", detailfile.c_str());
// Reset the state
_adsTexts.setVal(detailfile, ADSData());
@@ -91,7 +91,7 @@ bool ADSInterpreter::load(const Common::String &filename) {
if (file.empty())
continue;
_adsData->_scriptEnvs.resize(_adsData->_scriptEnvs.size() + 1);
- debug(" load TTM %s to env %d", file.c_str(), _adsData->_scriptEnvs.size());
+ debug(1, " load TTM %s to env %d", file.c_str(), _adsData->_scriptEnvs.size());
TTMEnviro &data = _adsData->_scriptEnvs.back();
data._enviro = _adsData->_scriptEnvs.size();
_ttmInterpreter->load(file, data);
diff --git a/engines/dgds/dgds.cpp b/engines/dgds/dgds.cpp
index 0714d8cb042..201e4e72636 100644
--- a/engines/dgds/dgds.cpp
+++ b/engines/dgds/dgds.cpp
@@ -168,7 +168,7 @@ void DgdsEngine::loadIcons() {
bool DgdsEngine::changeScene(int sceneNum) {
assert(_scene && _adsInterp);
- debug("CHANGE SCENE %d -> %d (clock %s)", _scene->getNum(), sceneNum, _clock.dump().c_str());
+ debug(1, "CHANGE SCENE %d -> %d (clock %s)", _scene->getNum(), sceneNum, _clock.dump().c_str());
if (sceneNum == _scene->getNum()) {
warning("Tried to change from scene %d to itself, doing nothing.", sceneNum);
@@ -235,7 +235,7 @@ bool DgdsEngine::changeScene(int sceneNum) {
else
_adsInterp->unload();
- debug("%s", _scene->dump("").c_str());
+ debug(1, "%s", _scene->dump("").c_str());
_scene->runEnterSceneOps();
_justChangedScene1 = true;
@@ -379,7 +379,7 @@ void DgdsEngine::loadGameFiles() {
_gdsScene->load("DRAGON.GDS", _resource, _decompressor);
_rstFileName = "DRAGON.RST";
- debug("%s", _gdsScene->dump("").c_str());
+ debug(1, "%s", _gdsScene->dump("").c_str());
loadCorners("DCORNERS.BMP");
reqParser.parse(&invRequestData, "DINV.REQ");
@@ -392,7 +392,7 @@ void DgdsEngine::loadGameFiles() {
_gdsScene->load("HOC.GDS", _resource, _decompressor);
_rstFileName = "HOC.RST";
- debug("%s", _gdsScene->dump("").c_str());
+ debug(1, "%s", _gdsScene->dump("").c_str());
loadCorners("HCORNERS.BMP");
reqParser.parse(&invRequestData, "HINV.REQ");
@@ -415,7 +415,7 @@ void DgdsEngine::loadGameFiles() {
loadCorners("SOWCORNERS.BMP");
}
- debug("%s", _gdsScene->dump("").c_str());
+ debug(1, "%s", _gdsScene->dump("").c_str());
reqParser.parse(&invRequestData, "WINV.REQ");
reqParser.parse(&vcrRequestData, "WVCR.REQ");
@@ -426,7 +426,7 @@ void DgdsEngine::loadGameFiles() {
_gamePals->loadPalette("MRALLY.PAL");
_gdsScene->load("MRALLY.GDS", _resource, _decompressor);
- debug("%s", _gdsScene->dump("").c_str());
+ debug(1, "%s", _gdsScene->dump("").c_str());
loadCorners("MCORNERS.BMP");
reqParser.parse(&invRequestData, "TOOLINFO.REQ");
@@ -462,8 +462,8 @@ void DgdsEngine::loadGameFiles() {
_inventory->setRequestData(invRequestData);
_menu->setRequestData(vcrRequestData);
- debug("Parsed Inv Request:\n%s", invRequestData.dump().c_str());
- debug("Parsed VCR Request:\n%s", vcrRequestData.dump().c_str());
+ debug(1, "Parsed Inv Request:\n%s", invRequestData.dump().c_str());
+ debug(1, "Parsed VCR Request:\n%s", vcrRequestData.dump().c_str());
}
void DgdsEngine::loadRestartFile() {
@@ -864,7 +864,7 @@ Common::Error DgdsEngine::syncGame(Common::Serializer &s) {
_storedAreaBuffer.fillRect(Common::Rect(SCREEN_WIDTH, SCREEN_HEIGHT), 0);
}
- debug("%s", _scene->dump("").c_str());
+ debug(1, "%s", _scene->dump("").c_str());
_scene->runEnterSceneOps();
return Common::kNoError;
diff --git a/engines/dgds/dialog.cpp b/engines/dgds/dialog.cpp
index e8610611e42..ee140fb056b 100644
--- a/engines/dgds/dialog.cpp
+++ b/engines/dgds/dialog.cpp
@@ -641,7 +641,7 @@ void Dialog::updateSelectedAction(int delta) {
}
if (_action.size() > 1 || !delta) {
- debug("Dialog %d: update mouse to %d, %d (mouseloc %d, selnum %d)", _num, mouseX, mouseY, _state->_strMouseLoc, _lastSelectedDialogItemNum);
+ debug(1, "Dialog %d: update mouse to %d, %d (mouseloc %d, selnum %d)", _num, mouseX, mouseY, _state->_strMouseLoc, _lastSelectedDialogItemNum);
g_system->warpMouse(mouseX, mouseY);
}
}
diff --git a/engines/dgds/dragon_native.cpp b/engines/dgds/dragon_native.cpp
index 126a89aebaa..ff294fd5949 100644
--- a/engines/dgds/dragon_native.cpp
+++ b/engines/dgds/dragon_native.cpp
@@ -64,7 +64,7 @@ static uint16 passcodeVal4 = 0;
if (globalval >= 30) {
// One of the keypad buttons
if (DRAGON_PASSCODE[passcodeVal4 + passcodeBlockNum * 15] == globalval - 30) {
- debug("sceneOpUpdatePasscodeGlobal CORRECT: variables %d %d %d %d block %d, curval %d",
+ debug(1, "sceneOpUpdatePasscodeGlobal CORRECT: variables %d %d %d %d block %d, curval %d",
passcodeVal1, passcodeVal2, passcodeVal3, passcodeVal4, passcodeBlockNum, globalval);
// Correct entry! Increment the expected button
@@ -79,7 +79,7 @@ static uint16 passcodeVal4 = 0;
}
} else {
// Mistake
- debug("sceneOpUpdatePasscodeGlobal WRONG: variables %d %d %d %d block %d, curval %d",
+ debug(1, "sceneOpUpdatePasscodeGlobal WRONG: variables %d %d %d %d block %d, curval %d",
passcodeVal1, passcodeVal2, passcodeVal3, passcodeVal4, passcodeBlockNum, globalval);
passcodeVal1 = 0;
passcodeVal2 = 5;
@@ -89,7 +89,7 @@ static uint16 passcodeVal4 = 0;
if (globalval > 4 || globalval == 0)
return;
- debug("sceneOpUpdatePasscodeGlobal OTHER: variables %d %d %d %d block %d, curval %d",
+ debug(1, "sceneOpUpdatePasscodeGlobal OTHER: variables %d %d %d %d block %d, curval %d",
passcodeVal1, passcodeVal2, passcodeVal3, passcodeVal4, passcodeBlockNum, globalval);
if (globalval < 4) {
diff --git a/engines/dgds/font.cpp b/engines/dgds/font.cpp
index 88eb4f493f9..bb20f03093e 100644
--- a/engines/dgds/font.cpp
+++ b/engines/dgds/font.cpp
@@ -52,7 +52,7 @@ DgdsFont *DgdsFont::load(const Common::String &filename, ResourceManager *resour
if (chunk.isSection(ID_FNT)) {
byte magic = stream->readByte();
stream->seek(-1, SEEK_CUR);
- debug(" magic: %u", magic);
+ debug(1, " magic: %u", magic);
if (magic != 0xFF)
font = FFont::load(*stream);
@@ -133,7 +133,7 @@ FFont *FFont::load(Common::SeekableReadStream &input) {
assert((4 + size) == input.size());
- debug("FFont w: %u, h: %u, start: 0x%x, count: %u", w, h, start, count);
+ debug(1, "FFont w: %u, h: %u, start: 0x%x, count: %u", w, h, start, count);
byte *data = new byte[size];
input.read(data, size);
@@ -178,7 +178,7 @@ PFont *PFont::load(Common::SeekableReadStream &input, Decompressor *decompressor
byte count = input.readByte();
int size = input.readUint16LE();
- debug("PFont magic: 0x%x, w: %u, h: %u, unk: %u, start: 0x%x, count: %u, size: %u",
+ debug(1, "PFont magic: 0x%x, w: %u, h: %u, unk: %u, start: 0x%x, count: %u, size: %u",
magic, w, h, unknown, start, count, size);
assert(magic == 0xFF);
diff --git a/engines/dgds/globals.cpp b/engines/dgds/globals.cpp
index f4141349c01..ced4d27ed6d 100644
--- a/engines/dgds/globals.cpp
+++ b/engines/dgds/globals.cpp
@@ -108,7 +108,7 @@ int16 Globals::getGlobal(uint16 num) {
}
int16 Globals::setGlobal(uint16 num, int16 val) {
- //debug("setGlobal %d -> %d", num, val);
+ //debug(1, "setGlobal %d -> %d", num, val);
for (auto &global : _globals) {
if (global->getNum() == num)
return global->set(val);
diff --git a/engines/dgds/image.cpp b/engines/dgds/image.cpp
index 535224dea59..c942ad7a47b 100644
--- a/engines/dgds/image.cpp
+++ b/engines/dgds/image.cpp
@@ -95,7 +95,7 @@ void Image::drawScreen(const Common::String &filename, Graphics::ManagedSurface
error("Trying to load SCR size %d x %d which is larger than screen %d x %d",
xsize, ysize, surface.w, surface.h);
}
- debug("screen file %s dims %d x %d into surface %d x %d",
+ debug(1, "screen file %s dims %d x %d into surface %d x %d",
filename.c_str(), xsize, ysize, surface.w, surface.h);
} else if (chunk.isSection(ID_VGA)) {
loadBitmap4(&surface, 0, stream, true, xsize, ysize);
@@ -187,7 +187,7 @@ void Image::loadBitmap(const Common::String &filename) {
_matrixY = stream->readUint16LE();
uint32 mcount = (uint32)_matrixX * _matrixY;
_tileMatrix.resize(mcount);
- debug(" %u x %u: mtx vals", _matrixX, _matrixY);
+ debug(1, " %u x %u: mtx vals", _matrixX, _matrixY);
for (uint32 k = 0; k < mcount; k++) {
uint16 tile;
diff --git a/engines/dgds/menu.cpp b/engines/dgds/menu.cpp
index 2c01ebe0e1d..dcbe8a9703d 100644
--- a/engines/dgds/menu.cpp
+++ b/engines/dgds/menu.cpp
@@ -564,7 +564,7 @@ void Menu::handleClick(const Common::Point &mouse) {
drawMenu(_curMenu);
break;
default:
- debug("Clicked ID %d", clickedMenuItem);
+ debug(1, "Clicked ID %d", clickedMenuItem);
break;
}
}
diff --git a/engines/dgds/minigames/dragon_arcade.cpp b/engines/dgds/minigames/dragon_arcade.cpp
index 7d1a5f7abd2..e30c8eccb41 100644
--- a/engines/dgds/minigames/dragon_arcade.cpp
+++ b/engines/dgds/minigames/dragon_arcade.cpp
@@ -361,7 +361,7 @@ void DragonArcade::checkEnemyFireStage0124() {
for (int j = 0; j < 4; j++) {
if (_npcState[i].x < 340 && -20 < _npcState[i].x &&
ENEMY_FIRE_ALLOWABLE_PAGES[j] == _npcState[i].ttmPage) {
- debug("enemy %d @ %d firing type %d on page %d", i, _npcState[i].x, j, _npcState[i].ttmPage);
+ debug(1, "enemy %d @ %d firing type %d on page %d", i, _npcState[i].x, j, _npcState[i].ttmPage);
ImageFlipMode flipMode = (_npcState[i].ttmPage < 29) ? kImageFlipNone : kImageFlipH;
createBullet(ENEMY_FIRE_X_OFFSETS[j] + _npcState[i].xx - _scrollXOffset * 8 - 0xa0,
ENEMY_FIRE_Y_OFFSETS[j] + _npcState[i].yy + 3, flipMode, 1);
@@ -1977,7 +1977,7 @@ void DragonArcade::handleMouseStates() {
// Not jumping left or right
_bladeState1 = 1;
_npcState[0].ttmPage = _bladePageOffset + 15;
- debug("Move: blade jump up -> ttm %d", _npcState[0].ttmPage);
+ debug(1, "Move: blade jump up -> ttm %d", _npcState[0].ttmPage);
} else {
// Jump to left or right
if ((_bladeMoveFlag & kBladeMoveLeft) == kBladeMoveNone) {
@@ -1988,7 +1988,7 @@ void DragonArcade::handleMouseStates() {
_isMovingStage = false;
_bladeState1 = 2;
_npcState[0].ttmPage = _bladePageOffset + 45;
- debug("Move: blade jump up -> ttm %d velocity %d", _npcState[0].ttmPage, _scrollVelocityX);
+ debug(1, "Move: blade jump up -> ttm %d velocity %d", _npcState[0].ttmPage, _scrollVelocityX);
}
if ((_bladeMoveFlagBeforeRButton & kBladeMoveDown) != kBladeMoveNone) {
@@ -1999,7 +1999,7 @@ void DragonArcade::handleMouseStates() {
} else {
_npcState[0].ttmPage = _bladePageOffset + 22;
}
- debug("Move: blade jump down -> ttm %d", _npcState[0].ttmPage);
+ debug(1, "Move: blade jump down -> ttm %d", _npcState[0].ttmPage);
_arcadeTTM._startYOffset++;
_uint0a17++;
_currentYOffset = _arcadeTTM._startYOffset;
diff --git a/engines/dgds/minigames/dragon_arcade_ttm.cpp b/engines/dgds/minigames/dragon_arcade_ttm.cpp
index 8147d5bd045..e4b7aea861b 100644
--- a/engines/dgds/minigames/dragon_arcade_ttm.cpp
+++ b/engines/dgds/minigames/dragon_arcade_ttm.cpp
@@ -55,7 +55,7 @@ int16 DragonArcadeTTM::load(const char *filename) {
for (envNum = 0; envNum < ARRAYSIZE(_ttmEnvs); envNum++) {
if (_ttmEnvs[envNum].scr == nullptr) {
env = &_ttmEnvs[envNum];
- debug("Arcade TTM load %s into env %d", filename, envNum);
+ debug(1, "Arcade TTM load %s into env %d", filename, envNum);
break;
}
}
@@ -134,7 +134,7 @@ int16 DragonArcadeTTM::handleOperation(TTMEnviro &env, int16 page, uint16 op, by
engine->adsInterpreter()->setScriptDelay((int)(ivals[0] * MS_PER_FRAME));
break;
case 0x1031: // SET BRUSH
- //debug("Set brush %d for slot %d", ivals[0], _currentTTMNum);
+ //debug(1, "Set brush %d for slot %d", ivals[0], _currentTTMNum);
if (!_shapes2[_currentTTMNum]) {
_brushes[_currentTTMNum].reset();
} else {
@@ -143,7 +143,7 @@ int16 DragonArcadeTTM::handleOperation(TTMEnviro &env, int16 page, uint16 op, by
break;
case 0x1051: // SET SHAPE
_shapes3[_currentTTMNum] = ivals[0];
- //debug("Set img %d into slot %d", ivals[0], _currentTTMNum);
+ //debug(1, "Set img %d into slot %d", ivals[0], _currentTTMNum);
_shapes[_currentTTMNum] = _allShapes[ivals[0] * 5 + _currentTTMNum];
_shapes2[_currentTTMNum] = _allShapes[ivals[0] * 5 + _currentTTMNum];
break;
@@ -203,7 +203,7 @@ int16 DragonArcadeTTM::handleOperation(TTMEnviro &env, int16 page, uint16 op, by
data.width = ivals[2];
data.yval = (byte)ivals[1];
data.flag = false;
- debug("Floor: %s", data.dump().c_str());
+ debug(1, "Floor: %s", data.dump().c_str());
_floorData.push_back(data);
} else {
const Common::Rect rect(Common::Point(ivals[0], ivals[1]), ivals[2], ivals[3]);
@@ -217,7 +217,7 @@ int16 DragonArcadeTTM::handleOperation(TTMEnviro &env, int16 page, uint16 op, by
data.width = ivals[2];
data.yval = (byte)ivals[1];
data.flag = true;
- debug("Floor: %s", data.dump().c_str());
+ debug(1, "Floor: %s", data.dump().c_str());
_floorData.push_back(data);
} else {
const Common::Rect r(Common::Point(ivals[0], ivals[1]), ivals[2] - 1, ivals[3] - 1);
@@ -273,7 +273,7 @@ int16 DragonArcadeTTM::handleOperation(TTMEnviro &env, int16 page, uint16 op, by
case 0xF02F: {
_shapes[_currentTTMNum].reset(new Image(engine->getResourceManager(), engine->getDecompressor()));
_shapes[_currentTTMNum]->loadBitmap(sval);
- debug("Load img %s into slot %d", sval.c_str(), _currentTTMNum);
+ debug(1, "Load img %s into slot %d", sval.c_str(), _currentTTMNum);
_shapes2[_currentTTMNum] = _shapes[_currentTTMNum];
_allShapes[_shapes3[_currentTTMNum] * 5 + _currentTTMNum] = _shapes[_currentTTMNum];
break;
diff --git a/engines/dgds/parser.cpp b/engines/dgds/parser.cpp
index e2c0f362cdf..cf29c344276 100644
--- a/engines/dgds/parser.cpp
+++ b/engines/dgds/parser.cpp
@@ -77,12 +77,12 @@ bool DgdsParser::parse(ParserData *data, const Common::String &filename) {
Common::HashMap<uint16, Common::String> DgdsParser::readTags(Common::SeekableReadStream *stream) {
Common::HashMap<uint16, Common::String> tags;
uint16 count = stream->readUint16LE();
- debug(" %u tags:", count);
+ debug(1, " %u tags:", count);
for (uint16 i = 0; i < count; i++) {
uint16 idx = stream->readUint16LE();
const Common::String tagVal = stream->readString();
- debug(" %2u: %2u, \"%s\"", i, idx, tagVal.c_str());
+ debug(1, " %2u: %2u, \"%s\"", i, idx, tagVal.c_str());
// TODO: How to handle when these IDs overlap? (eg, see
// BBEDROOM.TTM in RotD)
if (!tags.contains(idx))
diff --git a/engines/dgds/request.cpp b/engines/dgds/request.cpp
index 682d1d8a576..a345669b0cb 100644
--- a/engines/dgds/request.cpp
+++ b/engines/dgds/request.cpp
@@ -638,7 +638,7 @@ int16 SliderGadget::onClick(const Common::Point &mousePt) {
else
newVal--;
- debug("clicked on slider %d, move val from %d -> %d", _gadgetNo, val, newVal);
+ debug(1, "clicked on slider %d, move val from %d -> %d", _gadgetNo, val, newVal);
newVal = CLIP((int)newVal, 0, _steps - 1);
setValue(newVal);
diff --git a/engines/dgds/resource.cpp b/engines/dgds/resource.cpp
index 4d660b8be20..890dd8ceafe 100644
--- a/engines/dgds/resource.cpp
+++ b/engines/dgds/resource.cpp
@@ -332,7 +332,7 @@ Common::SeekableReadStream *DgdsChunkReader::readStream() {
output = new Common::SeekableSubReadStream(_sourceStream, _startPos, _startPos + _size, DisposeAfterUse::NO);
}
- //debug(" %s %u%c", _idStr, _size, (_container ? '+' : ' '));
+ //debug(1, " %s %u%c", _idStr, _size, (_container ? '+' : ' '));
return output;
}
diff --git a/engines/dgds/scene.cpp b/engines/dgds/scene.cpp
index 96359998ed7..02b325e7d31 100644
--- a/engines/dgds/scene.cpp
+++ b/engines/dgds/scene.cpp
@@ -1507,7 +1507,7 @@ bool SDSScene::checkDialogActive() {
if (action) {
// Take a copy of the dialog because the actions might change the scene
Dialog dlgCopy = dlg;
- debug("Dialog %d closing: run action (%d ops)", dlg._num, action->sceneOpList.size());
+ debug(1, "Dialog %d closing: run action (%d ops)", dlg._num, action->sceneOpList.size());
if (!runOps(action->sceneOpList)) {
// HACK: the scene changed, but we haven't yet drawn the foreground for the
// dialog, this is our last chance so do it now. The game does it in a
@@ -1723,10 +1723,10 @@ void SDSScene::mouseLUp(const Common::Point &pt) {
GDSScene *gds = engine->getGDSScene();
if (area->_num == 0) {
- debug("Mouseup on inventory.");
+ debug(1, "Mouseup on inventory.");
engine->getInventory()->open();
} else if (area->_num == 0xffff) {
- debug("Mouseup on swap characters.");
+ debug(1, "Mouseup on swap characters.");
bool haveInvBtn = _hotAreaList.size() && _hotAreaList.front()._num == 0;
if (haveInvBtn)
removeInvButtonFromHotAreaList();
@@ -1737,7 +1737,7 @@ void SDSScene::mouseLUp(const Common::Point &pt) {
addInvButtonToHotAreaList();
} else {
if (_rbuttonDown) {
- debug(" --> exec both-button click ops for area %d", area->_num);
+ debug(1, " --> exec both-button click ops for area %d", area->_num);
// A both-button-click event, find the interaction list.
const GameItem *activeItem = engine->getGDSScene()->getActiveItem();
if (activeItem) {
@@ -1752,13 +1752,13 @@ void SDSScene::mouseLUp(const Common::Point &pt) {
i = _findInteraction(_objInteractions2, activeItem->_num, area->_num);
}
if (i) {
- debug(" --> exec %d both-click ops for item combo %d", i->opList.size(), activeItem->_num);
+ debug(1, " --> exec %d both-click ops for item combo %d", i->opList.size(), activeItem->_num);
if (!runOps(i->opList, engine->getGameGlobals()->getGameMinsToAddOnObjInteraction()))
return;
}
}
} else {
- debug(" --> exec %d click ops for area %d", area->onLClickOps.size(), area->_num);
+ debug(1, " --> exec %d click ops for area %d", area->onLClickOps.size(), area->_num);
int16 addmins = engine->getGameGlobals()->getGameMinsToAddOnLClick();
runOps(area->onLClickOps, addmins);
}
@@ -1784,10 +1784,10 @@ void SDSScene::onDragFinish(const Common::Point &pt) {
for (const auto &item : gdsScene->getGameItems()) {
if (item._inSceneNum == _num && _isInRect(pt, item._rect)) {
- debug("Dragged item %d onto item %d @ (%d, %d)", dragItem->_num, item._num, pt.x, pt.y);
+ debug(1, "Dragged item %d onto item %d @ (%d, %d)", dragItem->_num, item._num, pt.x, pt.y);
const ObjectInteraction *i = _findInteraction(gdsScene->getObjInteractions1(), dragItem->_num, item._num);
if (i) {
- debug(" --> exec %d drag ops for item %d", i->opList.size(), item._num);
+ debug(1, " --> exec %d drag ops for item %d", i->opList.size(), item._num);
if (!runOps(i->opList, globals->getGameMinsToAddOnObjInteraction()))
return;
}
@@ -1800,34 +1800,34 @@ void SDSScene::onDragFinish(const Common::Point &pt) {
continue;
if (area._num == 0) {
- debug("Item %d dropped on inventory.", dragItem->_num);
+ debug(1, "Item %d dropped on inventory.", dragItem->_num);
dragItem->_inSceneNum = 2;
if (engine->getGameId() == GID_HOC)
dragItem->_quality = Inventory::HOC_CHARACTER_QUALS[gdsScene->getGlobal(0x33)];
const ObjectInteraction *i = _findInteraction(gdsScene->getObjInteractions1(), dragItem->_num, 0xffff);
if (i) {
- debug(" --> exec %d drag ops for area %d", i->opList.size(), 0xffff);
+ debug(1, " --> exec %d drag ops for area %d", i->opList.size(), 0xffff);
if (!runOps(i->opList, globals->getGameMinsToAddOnObjInteraction()))
return;
}
} else if (area._num == 0xffff) {
- debug("Item %d dropped on other character button.", dragItem->_num);
+ debug(1, "Item %d dropped on other character button.", dragItem->_num);
dragItem->_inSceneNum = 2;
if (engine->getGameId() == GID_HOC)
dragItem->_quality = Inventory::HOC_CHARACTER_QUALS[gdsScene->getGlobal(0x34)];
const ObjectInteraction *i = _findInteraction(gdsScene->getObjInteractions1(), dragItem->_num, 0xffff);
if (i) {
- debug(" --> exec %d drag ops for area %d", i->opList.size(), 0xffff);
+ debug(1, " --> exec %d drag ops for area %d", i->opList.size(), 0xffff);
if (!runOps(i->opList, globals->getGameMinsToAddOnObjInteraction()))
return;
}
} else {
- debug("Dragged item %d onto area %d @ (%d, %d)", dragItem->_num, area._num, pt.x, pt.y);
+ debug(1, "Dragged item %d onto area %d @ (%d, %d)", dragItem->_num, area._num, pt.x, pt.y);
const ObjectInteraction *i = _findInteraction(scene->getObjInteractions1(), dragItem->_num, area._num);
if (i) {
- debug(" --> exec %d drag ops for area %d", i->opList.size(), area._num);
+ debug(1, " --> exec %d drag ops for area %d", i->opList.size(), area._num);
if (!runOps(i->opList, globals->getGameMinsToAddOnObjInteraction()))
return;
}
@@ -1862,18 +1862,18 @@ void SDSScene::mouseRUp(const Common::Point &pt) {
DgdsEngine *engine = DgdsEngine::getInstance();
if (area->_num == 0) {
- debug("Mouse RUp on inventory.");
+ debug(1, "Mouse RUp on inventory.");
engine->getInventory()->setShowZoomBox(true);
engine->getInventory()->open();
} else if (area->_num == 0xffff) {
- debug("Mouse RUp on character swap.");
+ debug(1, "Mouse RUp on character swap.");
int16 swapDlgFile = engine->getGDSScene()->getGlobal(0x36);
int16 swapDlgNum = engine->getGDSScene()->getGlobal(0x35);
if (swapDlgFile && swapDlgNum)
showDialog(swapDlgFile, swapDlgNum);
} else {
int16 addmins = engine->getGameGlobals()->getGameMinsToAddOnLClick();
- debug("Mouse RUp on area %d, run %d ops (+%d mins)", area->_num, area->onRClickOps.size(), addmins);
+ debug(1, "Mouse RUp on area %d, run %d ops (+%d mins)", area->_num, area->onRClickOps.size(), addmins);
runOps(area->onRClickOps, addmins);
}
}
@@ -2391,7 +2391,7 @@ Common::Error GDSScene::syncState(Common::Serializer &s) {
if (s.getVersion() > 1)
s.syncAsUint16LE(item._flags);
s.syncAsUint16LE(item._quality);
- //debug("loaded item: %d %d %d %d", item._num, item._inSceneNum, item._flags, item._quality);
+ //debug(1, "loaded item: %d %d %d %d", item._num, item._inSceneNum, item._flags, item._quality);
}
uint16 nglobals = _perSceneGlobals.size();
diff --git a/engines/dgds/sound.cpp b/engines/dgds/sound.cpp
index 283c1e5db5b..baa9f9cecc2 100644
--- a/engines/dgds/sound.cpp
+++ b/engines/dgds/sound.cpp
@@ -55,7 +55,7 @@ static void _readHeader(const byte* &pos, uint32 &sci_header) {
pos += sci_header;
if (pos[0] == 0xF0) {
- debug("SysEx transfer = %d bytes", pos[1]);
+ debug(1, "SysEx transfer = %d bytes", pos[1]);
pos += 2;
pos += 6;
}
@@ -83,19 +83,19 @@ static uint32 _availableSndTracks(const byte *data, uint32 size) {
while (pos[0] != 0xFF) {
byte drv = *pos++;
- //debug("(%d)", drv);
+ //debug(1, "(%d)", drv);
while (pos[0] != 0xFF) {
uint16 off, siz;
_readPartHeader(pos, off, siz);
off += sci_header;
- //debug("%06d:%d ", off, siz);
+ //debug(1, "%06d:%d ", off, siz);
- //debug("Header bytes");
- //debug("[%06X] ", data[off]);
- //debug("[%02X] ", data[off+0]);
- //debug("[%02X] ", data[off+1]);
+ //debug(1, "Header bytes");
+ //debug(1, "[%06X] ", data[off]);
+ //debug(1, "[%02X] ", data[off+0]);
+ //debug(1, "[%02X] ", data[off+1]);
bool digital_pcm = false;
if (READ_LE_UINT16(&data[off]) == 0x00FE) {
@@ -104,35 +104,35 @@ static uint32 _availableSndTracks(const byte *data, uint32 size) {
switch (drv) {
case 0: if (digital_pcm) {
- //debug("- Soundblaster");
+ //debug(1, "- Soundblaster");
tracks |= DIGITAL_PCM;
} else {
- //debug("- Adlib");
+ //debug(1, "- Adlib");
tracks |= TRACK_ADLIB;
}
break;
case 7:
- //debug("- General MIDI");
+ //debug(1, "- General MIDI");
tracks |= TRACK_GM;
break;
case 9:
- //debug("- CMS");
+ //debug(1, "- CMS");
tracks |= TRACK_CMS;
break;
case 12:
- //debug("- MT-32");
+ //debug(1, "- MT-32");
tracks |= TRACK_MT32;
break;
case 18:
- //debug("- PC Speaker");
+ //debug(1, "- PC Speaker");
tracks |= TRACK_PCSPK;
break;
case 19:
- //debug("- Tandy 1000");
+ //debug(1, "- Tandy 1000");
tracks |= TRACK_TANDY;
break;
default:
- //debug("- Unknown %d", drv);
+ //debug(1, "- Unknown %d", drv);
warning("Unknown music type %d", drv);
break;
}
@@ -181,7 +181,7 @@ static byte _loadSndTrack(uint32 track, const byte** trackPtr, uint16* trackSiz,
trackSiz[part] = siz;
part++;
}
- debug("- (%d) Play parts = %d", drv, part);
+ debug(1, "- (%d) Play parts = %d", drv, part);
return part;
} else {
pos = ptr;
@@ -276,7 +276,7 @@ bool Sound::playPCM(const byte *data, uint32 size) {
ptr += 8;
ptr += first;
- debug(" - Digital PCM: %u Hz, [%u]=%u:%u",
+ debug(1, " - Digital PCM: %u Hz, [%u]=%u:%u",
rate, length, first, last);
trackPtr[part] = ptr;
trackSiz[part] = length;
@@ -292,13 +292,13 @@ bool Sound::playPCM(const byte *data, uint32 size) {
static void _readStrings(Common::SeekableReadStream *stream) {
uint16 count = stream->readUint16LE();
- debug(" %u strs:", count);
+ debug(1, " %u strs:", count);
for (uint16 k = 0; k < count; k++) {
uint16 idx = stream->readUint16LE();
Common::String str = stream->readString();
- debug(" %2u: %2u, \"%s\"", k, idx, str.c_str());
+ debug(1, " %2u: %2u, \"%s\"", k, idx, str.c_str());
}
}
@@ -327,10 +327,10 @@ bool Sound::loadSXSoundData(const Common::String &filename, Common::Array<SoundD
uint16 type = stream->readUint16LE();
uint16 count = stream->readUint16LE();
- debug(" SX INF %u [%u entries]: (%s)", type, count, filename.c_str());
+ debug(1, " SX INF %u [%u entries]: (%s)", type, count, filename.c_str());
for (uint16 k = 0; k < count; k++) {
uint16 idx = stream->readUint16LE();
- debug(" %2u: %u", k, idx);
+ debug(1, " %2u: %u", k, idx);
idMap[idx] = k;
}
} else if (chunk.isSection(ID_TAG) || chunk.isSection(ID_FNM)) {
@@ -364,7 +364,7 @@ bool Sound::loadMusic(const Common::String &filename) {
}
_currentMusic = filename;
- debug("Sound: Loaded music %s with %d entries", filename.c_str(), _musicData.size());
+ debug(1, "Sound: Loaded music %s with %d entries", filename.c_str(), _musicData.size());
return true;
}
@@ -379,7 +379,7 @@ void Sound::loadSFX(const Common::String &filename) {
error("Unhandled SFX file type: %s", filename.c_str());
}
- debug("Sound: Loaded sfx %s with %d entries", filename.c_str(), _sfxData.size());
+ debug(1, "Sound: Loaded sfx %s with %d entries", filename.c_str(), _sfxData.size());
}
void Sound::loadSNGSoundData(const Common::String &filename, Common::Array<SoundData> &dataArray) {
@@ -411,10 +411,10 @@ void Sound::loadSNGSoundData(const Common::String &filename, Common::Array<Sound
uint32 count = stream->size() / 2;
if (count > dataArray.size())
error("Sound: %s has more flags in INF than SNG entries.", filename.c_str());
- debug(" SNG INF [%u entries]", count);
+ debug(1, " SNG INF [%u entries]", count);
for (uint32 k = 0; k < count; k++) {
uint16 flags = stream->readUint16LE();
- debug(" %2u: 0x%04x", k, flags);
+ debug(1, " %2u: 0x%04x", k, flags);
dataArray[k]._flags = flags;
}
} else {
@@ -442,17 +442,17 @@ int Sound::mapMusicNum(int num) const {
void Sound::playSFX(int num) {
int mappedNum = mapSfxNum(num);
- debug("Sound: Play SFX %d (-> %d), have %d entries", num, mappedNum, _sfxData.size());
+ debug(1, "Sound: Play SFX %d (-> %d), have %d entries", num, mappedNum, _sfxData.size());
playPCSound(mappedNum, _sfxData, Audio::Mixer::kSFXSoundType);
}
void Sound::stopSfxByNum(int num) {
int mappedNum = mapSfxNum(num);
- debug("Sound: Stop SFX %d (-> %d)", num, mappedNum);
+ debug(1, "Sound: Stop SFX %d (-> %d)", num, mappedNum);
MusicEntry *musicSlot = _music->getSlot(mappedNum + SND_RESOURCE_OFFSET);
if (!musicSlot) {
- debug("stopSfxByNum: Slot for sfx num %d not found.", mappedNum);
+ debug(1, "stopSfxByNum: Slot for sfx num %d not found.", mappedNum);
return;
}
@@ -463,7 +463,7 @@ void Sound::stopSfxByNum(int num) {
void Sound::playMusic(int num) {
int mappedNum = mapMusicNum(num);
- debug("Sound: Play music %d (-> %d, %s), have %d entries", num, mappedNum, _currentMusic.c_str(), _musicData.size());
+ debug(1, "Sound: Play music %d (-> %d, %s), have %d entries", num, mappedNum, _currentMusic.c_str(), _musicData.size());
playPCSound(mappedNum, _musicData, Audio::Mixer::kMusicSoundType);
}
@@ -625,7 +625,7 @@ void Sound::playPCSound(int num, const Common::Array<SoundData> &dataArray, Audi
}
void Sound::stopMusic() {
- debug("Sound: Stop music.");
+ debug(1, "Sound: Stop music.");
_music->stopMusic();
}
diff --git a/engines/dgds/sound/drivers/adlib.cpp b/engines/dgds/sound/drivers/adlib.cpp
index d29b6913817..9f109101946 100644
--- a/engines/dgds/sound/drivers/adlib.cpp
+++ b/engines/dgds/sound/drivers/adlib.cpp
@@ -280,7 +280,7 @@ void MidiDriver_AdLib::send(uint32 b) {
byte op1 = (b >> 8) & 0xff;
byte op2 = (b >> 16) & 0xff;
- //debug("midi send %02x %x %02x %02x", command, channel, op1, op2);
+ //debug(1, "midi send %02x %x %02x %02x", command, channel, op1, op2);
switch (command) {
case 0x80:
diff --git a/engines/dgds/sound/drivers/midipatch.cpp b/engines/dgds/sound/drivers/midipatch.cpp
index 8c8d89838bb..1c090def8f8 100644
--- a/engines/dgds/sound/drivers/midipatch.cpp
+++ b/engines/dgds/sound/drivers/midipatch.cpp
@@ -85,7 +85,7 @@ SciResource *getMidiPatchData(int num) {
int dataLen = stream->size() - (strLen + 2);
byte *data = new byte[dataLen];
- debug("midi patch %s loading magic %d str '%s'", targetSection.c_str(), magic, buf);
+ debug(1, "midi patch %s loading magic %d str '%s'", targetSection.c_str(), magic, buf);
delete [] buf;
stream->read(data, dataLen);
return new SciResource(data, dataLen, num);
diff --git a/engines/dgds/sound/midiparser_sci.cpp b/engines/dgds/sound/midiparser_sci.cpp
index b0ea074a596..1ecf4eac30d 100644
--- a/engines/dgds/sound/midiparser_sci.cpp
+++ b/engines/dgds/sound/midiparser_sci.cpp
@@ -785,7 +785,7 @@ void MidiParser_SCI::remapChannel(int channel, int devChannel) {
if (devChannel == -1)
return;
-// debug(" restoring state: channel %d on devChannel %d", channel, devChannel);
+// debug(1, " restoring state: channel %d on devChannel %d", channel, devChannel);
// restore state
ChannelState &s = _channelState[channel];
diff --git a/engines/dgds/sound/music.cpp b/engines/dgds/sound/music.cpp
index 927aa65cbe9..420046343be 100644
--- a/engines/dgds/sound/music.cpp
+++ b/engines/dgds/sound/music.cpp
@@ -821,7 +821,7 @@ void SciMusic::printPlayList(Console *con) {
for (uint32 i = 0; i < _playList.size(); i++) {
MusicEntry *song = _playList[i];
- debug("%d: %08x (%s), resource id: %d, status: %s, %s type\n",
+ debug(1, "%d: %08x (%s), resource id: %d, status: %s, %s type\n",
i, song->soundObj,
"",//g_sci->getEngineState()->_segMan->getObjectName(song->soundObj),
song->resourceId, musicStatus[song->status],
@@ -838,28 +838,28 @@ void SciMusic::printSongInfo(uint32 obj, Console *con) {
for (MusicList::iterator i = _playList.begin(); i != end; ++i) {
MusicEntry *song = *i;
if (song->soundObj == obj) {
- debug("Resource id: %d, status: %s\n", song->resourceId, musicStatus[song->status]);
- debug("dataInc: %d, hold: %d, loop: %d\n", song->dataInc, song->hold, song->loop);
- debug("signal: %d, priority: %d\n", song->signal, song->priority);
- debug("ticker: %d, volume: %d\n", song->ticker, song->volume);
+ debug(1, "Resource id: %d, status: %s\n", song->resourceId, musicStatus[song->status]);
+ debug(1, "dataInc: %d, hold: %d, loop: %d\n", song->dataInc, song->hold, song->loop);
+ debug(1, "signal: %d, priority: %d\n", song->signal, song->priority);
+ debug(1, "ticker: %d, volume: %d\n", song->ticker, song->volume);
if (song->pMidiParser) {
- debug("Type: MIDI\n");
+ debug(1, "Type: MIDI\n");
if (song->soundRes) {
SoundResource::Track *track = song->soundRes->getTrackByType(_pMidiDrv->getPlayId());
if (track) {
- debug("Channels: %d\n", track->channelCount);
+ debug(1, "Channels: %d\n", track->channelCount);
}
}
} else if (song->pStreamAud || song->pLoopStream) {
- debug("Type: digital audio (%s), sound active: %s\n",
+ debug(1, "Type: digital audio (%s), sound active: %s\n",
song->pStreamAud ? "non looping" : "looping",
_pMixer->isSoundHandleActive(song->hCurrentAud) ? "yes" : "no");
if (song->soundRes) {
- debug("Sound resource information:\n");
+ debug(1, "Sound resource information:\n");
SoundResource::Track *track = song->soundRes->getTrackByType(_pMidiDrv->getPlayId());
if (track && track->digitalChannelNr != -1) {
- debug("Sample size: %d, sample rate: %d, channels: %d, digital channel number: %d\n",
+ debug(1, "Sample size: %d, sample rate: %d, channels: %d, digital channel number: %d\n",
track->digitalSampleSize, track->digitalSampleRate, track->channelCount, track->digitalChannelNr);
}
}
@@ -869,7 +869,7 @@ void SciMusic::printSongInfo(uint32 obj, Console *con) {
}
}
- debug("Song object not found in playlist");
+ debug(1, "Song object not found in playlist");
}
MusicEntry::MusicEntry() {
@@ -1041,7 +1041,7 @@ void SciMusic::remapChannels(bool mainThread) {
DeviceChannelUsage currentMap[16];
#ifdef DEBUG_REMAP
- debug("Remap results:");
+ debug(1, "Remap results:");
#endif
// Save current map, and then start from an empty map
@@ -1091,7 +1091,7 @@ void SciMusic::remapChannels(bool mainThread) {
if (mainThread) song->pMidiParser->mainThreadEnd();
#ifdef DEBUG_REMAP
if (channelUsed[j])
- debug(" Unmapping song %d, channel %d", songIndex, j);
+ debug(1, " Unmapping song %d, channel %d", songIndex, j);
#endif
(void)songIndex;
}
@@ -1119,7 +1119,7 @@ void SciMusic::remapChannels(bool mainThread) {
// If this channel was not yet mapped to the device, reset it
if (currentMap[i] != _channelMap[i]) {
#ifdef DEBUG_REMAP
- debug(" Mapping (dontRemap) song %d, channel %d to device channel %d", songIndex, _channelMap[i]._channel, i);
+ debug(1, " Mapping (dontRemap) song %d, channel %d to device channel %d", songIndex, _channelMap[i]._channel, i);
#endif
resetDeviceChannel(i, mainThread);
if (mainThread) _channelMap[i]._song->pMidiParser->mainThreadBegin();
@@ -1150,7 +1150,7 @@ void SciMusic::remapChannels(bool mainThread) {
_channelMap[j] = map->_map[i];
map->_map[i]._song = nullptr; // mark as done
#ifdef DEBUG_REMAP
- debug(" Keeping song %d, channel %d on device channel %d", songIndex, _channelMap[j]._channel, j);
+ debug(1, " Keeping song %d, channel %d on device channel %d", songIndex, _channelMap[j]._channel, j);
#endif
break;
}
@@ -1175,7 +1175,7 @@ void SciMusic::remapChannels(bool mainThread) {
_channelMap[j] = map->_map[i];
map->_map[i]._song = nullptr;
#ifdef DEBUG_REMAP
- debug(" Mapping song %d, channel %d to device channel %d", songIndex, _channelMap[j]._channel, j);
+ debug(1, " Mapping song %d, channel %d to device channel %d", songIndex, _channelMap[j]._channel, j);
#endif
if (mainThread) _channelMap[j]._song->pMidiParser->mainThreadBegin();
_channelMap[j]._song->pMidiParser->remapChannel(_channelMap[j]._channel, j);
@@ -1198,7 +1198,7 @@ void SciMusic::remapChannels(bool mainThread) {
ChannelRemapping *SciMusic::determineChannelMap() {
#ifdef DEBUG_REMAP
- debug("Remap: avail chans: %d-%d", _driverFirstChannel, _driverLastChannel);
+ debug(1, "Remap: avail chans: %d-%d", _driverFirstChannel, _driverLastChannel);
#endif
ChannelRemapping *map = new ChannelRemapping;
@@ -1226,7 +1226,7 @@ ChannelRemapping *SciMusic::determineChannelMap() {
// CHECKME: Is this condition correct?
if (!song->pMidiParser) {
#ifdef DEBUG_REMAP
- debug(" Song %d (%p), digital?", songIndex, (void*)song);
+ debug(1, " Song %d (%p), digital?", songIndex, (void*)song);
#endif
continue;
}
@@ -1234,7 +1234,7 @@ ChannelRemapping *SciMusic::determineChannelMap() {
#ifdef DEBUG_REMAP
const char* name = g_sci->getEngineState()->_segMan->getObjectName(song->soundObj);
- debug(" Song %d (%p) [%s], prio %d%s", songIndex, (void*)song, name, song->priority, song->playBed ? ", bed" : "");
+ debug(1, " Song %d (%p) [%s], prio %d%s", songIndex, (void*)song, name, song->priority, song->playBed ? ", bed" : "");
#endif
// Store backup. If we fail to map this song, we will revert to this.
@@ -1249,13 +1249,13 @@ ChannelRemapping *SciMusic::determineChannelMap() {
const MusicEntryChannel &channel = song->_chan[c];
if (channel._dontMap) {
#ifdef DEBUG_REMAP
- debug(" Channel %d dontMap, skipping", c);
+ debug(1, " Channel %d dontMap, skipping", c);
#endif
continue;
}
if (channel._mute) {
#ifdef DEBUG_REMAP
- debug(" Channel %d muted, skipping", c);
+ debug(1, " Channel %d muted, skipping", c);
#endif
continue;
}
@@ -1263,7 +1263,7 @@ ChannelRemapping *SciMusic::determineChannelMap() {
bool dontRemap = channel._dontRemap || song->playBed;
#ifdef DEBUG_REMAP
- debug(" Channel %d: prio %d, %d voice%s%s", c, channel._prio, channel._voices, channel._voices == 1 ? "" : "s", dontRemap ? ", dontRemap" : "" );
+ debug(1, " Channel %d: prio %d, %d voice%s%s", c, channel._prio, channel._voices, channel._voices == 1 ? "" : "s", dontRemap ? ", dontRemap" : "" );
#endif
DeviceChannelUsage dc = { song, c };
@@ -1302,7 +1302,7 @@ ChannelRemapping *SciMusic::determineChannelMap() {
// no empty channel, but this isn't an essential channel,
// so we just skip it.
#ifdef DEBUG_REMAP
- debug(" skipping non-essential");
+ debug(1, " skipping non-essential");
#endif
continue;
}
@@ -1317,7 +1317,7 @@ ChannelRemapping *SciMusic::determineChannelMap() {
if (devChannel == -1) {
// failed to map this song.
#ifdef DEBUG_REMAP
- debug(" no free (or lower priority) channel found");
+ debug(1, " no free (or lower priority) channel found");
#endif
songMapped = false;
break;
@@ -1338,7 +1338,7 @@ ChannelRemapping *SciMusic::determineChannelMap() {
// non-essential here for playBed songs.
if (prio > 0 || (song->playBed && DgdsEngine::getInstance()->getGameId() == GID_DRAGON)) {
#ifdef DEBUG_REMAP
- debug(" not enough voices; need %d, have %d. Skipping this channel.", neededVoices, map->_freeVoices);
+ debug(1, " not enough voices; need %d, have %d. Skipping this channel.", neededVoices, map->_freeVoices);
#endif
continue;
}
@@ -1346,14 +1346,14 @@ ChannelRemapping *SciMusic::determineChannelMap() {
int j = map->lowestPrio();
if (j == -1) {
#ifdef DEBUG_REMAP
- debug(" not enough voices; need %d, have %d", neededVoices, map->_freeVoices);
+ debug(1, " not enough voices; need %d, have %d", neededVoices, map->_freeVoices);
#endif
// failed to free enough voices.
songMapped = false;
break;
}
#ifdef DEBUG_REMAP
- debug(" creating room for voices; evict %d", j);
+ debug(1, " creating room for voices; evict %d", j);
#endif
map->evict(j);
} while (map->_freeVoices < neededVoices);
@@ -1366,7 +1366,7 @@ ChannelRemapping *SciMusic::determineChannelMap() {
// We have a channel and enough free voices now.
#ifdef DEBUG_REMAP
- debug(" trying to map to %d", devChannel);
+ debug(1, " trying to map to %d", devChannel);
#endif
map->_map[devChannel] = dc;
@@ -1378,7 +1378,7 @@ ChannelRemapping *SciMusic::determineChannelMap() {
if (!dontRemap || devChannel == c) {
// If this channel fits here, we're done.
#ifdef DEBUG_REMAP
- debug(" OK");
+ debug(1, " OK");
#endif
continue;
}
@@ -1391,7 +1391,7 @@ ChannelRemapping *SciMusic::determineChannelMap() {
continue;
}
#ifdef DEBUG_REMAP
- debug(" but %d is already dontRemap", c);
+ debug(1, " but %d is already dontRemap", c);
#endif
if (prio > 0) {
@@ -1419,7 +1419,7 @@ ChannelRemapping *SciMusic::determineChannelMap() {
if (!songMapped) {
// We failed to map this song, so unmap all its channels.
#ifdef DEBUG_REMAP
- debug(" Failed song");
+ debug(1, " Failed song");
#endif
*map = backupMap;
}
diff --git a/engines/dgds/ttm.cpp b/engines/dgds/ttm.cpp
index 9c11632b643..774b1580a3f 100644
--- a/engines/dgds/ttm.cpp
+++ b/engines/dgds/ttm.cpp
@@ -599,7 +599,7 @@ void TTMInterpreter::handleOperation(TTMEnviro &env, TTMSeq &seq, uint16 op, byt
// (although it may not make any difference)
if (seq._executed && DgdsEngine::getInstance()->getGameId() == GID_WILLY)
break;
- //debug("0x0080: Free from slot %d for seq %d env %d", seq._currentBmpId, seq._seqNum, env._enviro);
+ //debug(1, "0x0080: Free from slot %d for seq %d env %d", seq._currentBmpId, seq._seqNum, env._enviro);
env._scriptShapes[seq._currentBmpId].reset();
break;
case 0x0090: // FREE FONT
@@ -650,7 +650,7 @@ void TTMInterpreter::handleOperation(TTMEnviro &env, TTMSeq &seq, uint16 op, byt
seq._brushNum = ivals[0];
break;
case 0x1050: // SELECT BMP: id:int [0:n]
- //debug("0x1051: Select bmp %d for seq %d from env %d", ivals[0], seq._seqNum, env._enviro);
+ //debug(1, "0x1051: Select bmp %d for seq %d from env %d", ivals[0], seq._seqNum, env._enviro);
seq._currentBmpId = ivals[0];
break;
case 0x1060: // SELECT PAL: id:int [0]
@@ -842,7 +842,7 @@ void TTMInterpreter::handleOperation(TTMEnviro &env, TTMSeq &seq, uint16 op, byt
}
case 0x5000:
// This opcode does nothing in SQ5 demo
- debug("TTM: 0x5000: Implement opcode? (%d %d %d %d %d)",
+ debug(1, "TTM: 0x5000: Implement opcode? (%d %d %d %d %d)",
ivals[0], ivals[1], ivals[2], ivals[3], ivals[4]);
break;
case 0xa000: // DRAW PIXEL x,y:int
@@ -1099,7 +1099,7 @@ void TTMInterpreter::handleOperation(TTMEnviro &env, TTMSeq &seq, uint16 op, byt
case 0xf020: // LOAD BMP: filename:str
if (seq._executed) // this is a one-shot op
break;
- //debug("0xf020: Load bitmap %s to slot %d for env %d", sval.c_str(), env._enviro, seq._currentBmpId);
+ //debug(1, "0xf020: Load bitmap %s to slot %d for env %d", sval.c_str(), env._enviro, seq._currentBmpId);
env._scriptShapes[seq._currentBmpId].reset(new Image(_vm->getResourceManager(), _vm->getDecompressor()));
env._scriptShapes[seq._currentBmpId]->loadBitmap(sval);
break;
@@ -1262,10 +1262,10 @@ void TTMInterpreter::findAndAddSequences(TTMEnviro &env, Common::Array<Common::S
uint16 op = 0;
for (uint frame = 0; frame < env._totalFrames; frame++) {
env._frameOffsets[frame] = env.scr->pos();
- //debug("findAndAddSequences: frame %d at offset %d", frame, (int)env.scr->pos());
+ //debug(1, "findAndAddSequences: frame %d at offset %d", frame, (int)env.scr->pos());
op = env.scr->readUint16LE();
while (op != 0x0ff0 && env.scr->pos() < env.scr->size()) {
- //debug("findAndAddSequences: check ttm op %04x", op);
+ //debug(1, "findAndAddSequences: check ttm op %04x", op);
switch (op & 0xf) {
case 0:
break;
@@ -1277,7 +1277,7 @@ void TTMInterpreter::findAndAddSequences(TTMEnviro &env, Common::Array<Common::S
newseq->_startFrame = frame;
newseq->_currentFrame = frame;
newseq->_lastFrame = -1;
- //debug("findAndAddSequences: found env %d seq %d at %d", newseq._enviro, newseq._seqNum, (int)env.scr->pos());
+ //debug(1, "findAndAddSequences: found env %d seq %d at %d", newseq._enviro, newseq._seqNum, (int)env.scr->pos());
seqArray.push_back(newseq);
} else {
env.scr->skip(2);
More information about the Scummvm-git-logs
mailing list