aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2003-06-27 00:10:17 +0000
committerMax Horn2003-06-27 00:10:17 +0000
commitc10905b975a2bf929b1e053525907663879fdb7f (patch)
tree85c0301a0fced10338556736a43eed668fcd026b
parentaa19687a4c9affcdb03ae76e269766dd6237ca4c (diff)
downloadscummvm-rg350-c10905b975a2bf929b1e053525907663879fdb7f.tar.gz
scummvm-rg350-c10905b975a2bf929b1e053525907663879fdb7f.tar.bz2
scummvm-rg350-c10905b975a2bf929b1e053525907663879fdb7f.zip
cleanup
svn-id: r8662
-rw-r--r--scumm/bundle.cpp2
-rw-r--r--scumm/bundle.h1
-rw-r--r--scumm/imuse_digi.cpp8
-rw-r--r--scumm/player_v2.cpp16
-rw-r--r--scumm/player_v2.h9
-rw-r--r--scumm/sound.cpp10
6 files changed, 23 insertions, 23 deletions
diff --git a/scumm/bundle.cpp b/scumm/bundle.cpp
index ea973fdd0f..f79245b7e7 100644
--- a/scumm/bundle.cpp
+++ b/scumm/bundle.cpp
@@ -437,7 +437,7 @@ int32 Bundle::getNumberOfMusicSamplesByName(const char *name) {
bitsleft = 16; \
}
-int32 Bundle::compDecode(byte *src, byte *dst) {
+static int32 compDecode(byte *src, byte *dst) {
byte *result, *srcptr = src, *dstptr = dst;
int data, size, bit, bitsleft = 16, mask = READ_LE_UINT16(srcptr);
srcptr += 2;
diff --git a/scumm/bundle.h b/scumm/bundle.h
index 21cc4c0680..851e816c87 100644
--- a/scumm/bundle.h
+++ b/scumm/bundle.h
@@ -56,7 +56,6 @@ private:
void initializeImcTables();
- int32 compDecode(byte *src, byte *dst);
int32 decompressCodec(int32 codec, byte *comp_input, byte *comp_output, int32 size);
int32 decompressVoiceSampleByIndex(int32 index, byte **comp_final);
diff --git a/scumm/imuse_digi.cpp b/scumm/imuse_digi.cpp
index 68e0a71789..972e57109f 100644
--- a/scumm/imuse_digi.cpp
+++ b/scumm/imuse_digi.cpp
@@ -1136,7 +1136,7 @@ int32 IMuseDigital::doCommand(int a, int b, int c, int d, int e, int f, int g, i
debug(5, "Play imuse music: %s, %s, %s", _digStateMusicTable[music].name, _digStateMusicTable[music].title, _digStateMusicTable[music].filename);
if ((_digStateMusicTable[music].filename[0] != 0) &&
(strcmp(_digStateMusicTable[_digStateMusicTable[music].unk3].filename, _scumm->_sound->_nameBundleMusic) != 0) ) {
- _scumm->_sound->playBundleMusic((const char *)_digStateMusicTable[music].filename);
+ _scumm->_sound->playBundleMusic(_digStateMusicTable[music].filename);
}
return 0;
}
@@ -1155,7 +1155,7 @@ int32 IMuseDigital::doCommand(int a, int b, int c, int d, int e, int f, int g, i
if ((_comiStateMusicTable[l].id == b)) {
debug(5, "Play imuse music: %s, %s, %s", _comiStateMusicTable[l].name, _comiStateMusicTable[l].title, _comiStateMusicTable[l].filename);
if (_comiStateMusicTable[l].filename[0] != 0) {
- _scumm->_sound->playBundleMusic((const char *)_comiStateMusicTable[l].filename);
+ _scumm->_sound->playBundleMusic(_comiStateMusicTable[l].filename);
}
return 0;
}
@@ -1189,7 +1189,7 @@ int32 IMuseDigital::doCommand(int a, int b, int c, int d, int e, int f, int g, i
if ((_digSeqMusicTable[l].room == b)) {
debug(5, "Play imuse music: %s, %s, %s", _digSeqMusicTable[l].name, _digSeqMusicTable[l].title, _digSeqMusicTable[l].filename);
if (_digSeqMusicTable[l].filename[0] != 0) {
- _scumm->_sound->playBundleMusic((const char *)_digSeqMusicTable[l].filename);
+ _scumm->_sound->playBundleMusic(_digSeqMusicTable[l].filename);
}
return 0;
}
@@ -1202,7 +1202,7 @@ int32 IMuseDigital::doCommand(int a, int b, int c, int d, int e, int f, int g, i
if ((_comiSeqMusicTable[l].id == b)) {
debug(5, "Play imuse music: %s, %s, %s", _comiSeqMusicTable[l].name, _comiSeqMusicTable[l].title, _comiSeqMusicTable[l].filename);
if (_comiSeqMusicTable[l].filename[0] != 0) {
- _scumm->_sound->playBundleMusic((const char *)_comiSeqMusicTable[l].filename);
+ _scumm->_sound->playBundleMusic(_comiSeqMusicTable[l].filename);
}
return 0;
}
diff --git a/scumm/player_v2.cpp b/scumm/player_v2.cpp
index 4edb17293e..901302a0cc 100644
--- a/scumm/player_v2.cpp
+++ b/scumm/player_v2.cpp
@@ -327,13 +327,15 @@ static const uint16 pcjr_freq_table[12] = {
////////////////////////////////////////
-Player_V2::Player_V2(Scumm *scumm) : _scumm(scumm) {
+Player_V2::Player_V2(Scumm *scumm) {
int i;
// This simulates the pc speaker sound, which is driven
// by the 8253 (square wave generator) and a low-band filter.
+ _isV3Game = (scumm->_version == 3);
_system = scumm->_system;
+ _mixer = scumm->_mixer;
_sample_rate = _system->property(OSystem::PROP_GET_SAMPLE_RATE, 0);
_mutex = _system->create_mutex();
@@ -362,18 +364,18 @@ Player_V2::Player_V2(Scumm *scumm) : _scumm(scumm) {
set_pcjr(true);
set_master_volume(255);
- scumm->_mixer->setupPremix(this, premix_proc);
+ _mixer->setupPremix(this, premix_proc);
}
Player_V2::~Player_V2() {
mutex_up();
// Detach the premix callback handler
- _scumm->_mixer->setupPremix (0, 0);
+ _mixer->setupPremix(0, 0);
mutex_down();
_system->delete_mutex (_mutex);
}
-void Player_V2::set_pcjr (bool pcjr) {
+void Player_V2::set_pcjr(bool pcjr) {
mutex_up();
_pcjr = pcjr;
@@ -526,7 +528,7 @@ void Player_V2::restartSound() {
}
}
-int Player_V2::getSoundStatus(int nr) {
+bool Player_V2::getSoundStatus(int nr) const {
return current_nr == nr || next_nr == nr;
}
@@ -556,8 +558,8 @@ void Player_V2::clear_channel(int i) {
channel->d.freqmod_modulo = 0;
}
-int Player_V2::getMusicTimer() {
- if (_scumm->_version == 3)
+int Player_V2::getMusicTimer() const {
+ if (_isV3Game)
return _music_timer;
else
return channels[0].d.music_timer;
diff --git a/scumm/player_v2.h b/scumm/player_v2.h
index 32ec8345f9..7680754c82 100644
--- a/scumm/player_v2.h
+++ b/scumm/player_v2.h
@@ -80,13 +80,13 @@ public:
void startSound(int nr, byte *data);
void stopSound(int nr);
void stopAllSounds();
- int getSoundStatus(int nr);
- int getMusicTimer();
+ bool getSoundStatus(int nr) const;
+ int getMusicTimer() const;
private:
+ bool _isV3Game;
SoundMixer *_mixer;
- Scumm *_scumm;
-
+ OSystem *_system;
bool _pcjr;
int _header_len;
@@ -116,7 +116,6 @@ private:
byte *next_data;
byte *retaddr;
- OSystem *_system;
void *_mutex;
void mutex_up() { _system->lock_mutex (_mutex); }
void mutex_down() { _system->unlock_mutex (_mutex); }
diff --git a/scumm/sound.cpp b/scumm/sound.cpp
index e400911349..67406065bf 100644
--- a/scumm/sound.cpp
+++ b/scumm/sound.cpp
@@ -968,7 +968,7 @@ bool Sound::isSfxFinished() const {
uint32 Sound::decode12BitsSample(byte *src, byte **dst, uint32 size, bool stereo = false) {
uint32 s_size = (size / 3) * 4;
uint32 loop_size = s_size / 4;
- if (stereo == true) {
+ if (stereo) {
s_size *= 2;
}
byte *ptr = *dst = (byte *)malloc(s_size);
@@ -981,14 +981,14 @@ uint32 Sound::decode12BitsSample(byte *src, byte **dst, uint32 size, bool stereo
tmp = ((((v2 & 0x0f) << 8) | v1) << 4) - 0x8000;
*ptr++ = (byte)((tmp >> 8) & 0xff);
*ptr++ = (byte)(tmp & 0xff);
- if (stereo == true) {
+ if (stereo) {
*ptr++ = (byte)((tmp >> 8) & 0xff);
*ptr++ = (byte)(tmp & 0xff);
}
tmp = ((((v2 & 0xf0) << 4) | v3) << 4) - 0x8000;
*ptr++ = (byte)((tmp >> 8) & 0xff);
*ptr++ = (byte)(tmp & 0xff);
- if (stereo == true) {
+ if (stereo) {
*ptr++ = (byte)((tmp >> 8) & 0xff);
*ptr++ = (byte)(tmp & 0xff);
}
@@ -1001,7 +1001,7 @@ static void music_handler (void *engine) {
}
void Sound::playBundleMusic(const char *song) {
- if (_scumm->_silentDigitalImuse == true) {
+ if (_scumm->_silentDigitalImuse) {
return;
}
@@ -1083,7 +1083,7 @@ void Sound::bundleMusicHandler(Scumm *scumm) {
return;
}
- if (_musicBundleToBeChanged == true) {
+ if (_musicBundleToBeChanged) {
_nameBundleMusic = _newNameBundleMusic;
_numberSamplesBundleMusic = _bundle->getNumberOfMusicSamplesByName(_nameBundleMusic);
_currentSampleBundleMusic = 0;