Renamed AGOSEngine::midi to AGOSEngine::_midi
svn-id: r26468
This commit is contained in:
parent
98bd127504
commit
2d2b3d0ed2
9 changed files with 51 additions and 51 deletions
|
@ -73,7 +73,7 @@ static const GameSpecificSettings puzzlepack_settings = {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
AGOSEngine::AGOSEngine(OSystem *syst)
|
AGOSEngine::AGOSEngine(OSystem *syst)
|
||||||
: Engine(syst), midi() {
|
: Engine(syst) {
|
||||||
_vcPtr = 0;
|
_vcPtr = 0;
|
||||||
_vc_get_out_of_code = 0;
|
_vc_get_out_of_code = 0;
|
||||||
_gameOffsetsPtr = 0;
|
_gameOffsetsPtr = 0;
|
||||||
|
@ -517,16 +517,16 @@ int AGOSEngine::init() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
midi.mapMT32toGM (getGameType() != GType_SIMON2 && !_native_mt32);
|
_midi.mapMT32toGM (getGameType() != GType_SIMON2 && !_native_mt32);
|
||||||
|
|
||||||
midi.setDriver(driver);
|
_midi.setDriver(driver);
|
||||||
int ret = midi.open();
|
int ret = _midi.open();
|
||||||
if (ret)
|
if (ret)
|
||||||
warning("MIDI Player init failed: \"%s\"", midi.getErrorName (ret));
|
warning("MIDI Player init failed: \"%s\"", _midi.getErrorName (ret));
|
||||||
midi.setVolume(ConfMan.getInt("music_volume"));
|
_midi.setVolume(ConfMan.getInt("music_volume"));
|
||||||
|
|
||||||
if (ConfMan.hasKey("music_mute") && ConfMan.getBool("music_mute") == 1)
|
if (ConfMan.hasKey("music_mute") && ConfMan.getBool("music_mute") == 1)
|
||||||
midi.pause(_musicPaused ^= 1);
|
_midi.pause(_musicPaused ^= 1);
|
||||||
|
|
||||||
// allocate buffers
|
// allocate buffers
|
||||||
_backGroundBuf = (byte *)calloc(_screenWidth * _screenHeight, 1);
|
_backGroundBuf = (byte *)calloc(_screenWidth * _screenHeight, 1);
|
||||||
|
@ -544,7 +544,7 @@ int AGOSEngine::init() {
|
||||||
|
|
||||||
if (ConfMan.hasKey("sfx_mute") && ConfMan.getBool("sfx_mute") == 1) {
|
if (ConfMan.hasKey("sfx_mute") && ConfMan.getBool("sfx_mute") == 1) {
|
||||||
if (getGameId() == GID_SIMON1DOS)
|
if (getGameId() == GID_SIMON1DOS)
|
||||||
midi._enable_sfx ^= 1;
|
_midi._enable_sfx ^= 1;
|
||||||
else
|
else
|
||||||
_sound->effectsPause(_effectsPaused ^= 1);
|
_sound->effectsPause(_effectsPaused ^= 1);
|
||||||
}
|
}
|
||||||
|
@ -776,7 +776,7 @@ void AGOSEngine::setupGame() {
|
||||||
AGOSEngine::~AGOSEngine() {
|
AGOSEngine::~AGOSEngine() {
|
||||||
delete _gameFile;
|
delete _gameFile;
|
||||||
|
|
||||||
midi.close();
|
_midi.close();
|
||||||
|
|
||||||
free(_itemHeapPtr - _itemHeapCurPos);
|
free(_itemHeapPtr - _itemHeapCurPos);
|
||||||
free(_tablesHeapPtr - _tablesHeapCurPos);
|
free(_tablesHeapPtr - _tablesHeapCurPos);
|
||||||
|
@ -819,14 +819,14 @@ void AGOSEngine::pause() {
|
||||||
bool ambient_status = _ambientPaused;
|
bool ambient_status = _ambientPaused;
|
||||||
bool music_status = _musicPaused;
|
bool music_status = _musicPaused;
|
||||||
|
|
||||||
midi.pause(true);
|
_midi.pause(true);
|
||||||
_sound->ambientPause(true);
|
_sound->ambientPause(true);
|
||||||
while (_pause) {
|
while (_pause) {
|
||||||
delay(1);
|
delay(1);
|
||||||
if (_keyPressed == 'p')
|
if (_keyPressed == 'p')
|
||||||
_pause = 0;
|
_pause = 0;
|
||||||
}
|
}
|
||||||
midi.pause(music_status);
|
_midi.pause(music_status);
|
||||||
_sound->ambientPause(ambient_status);
|
_sound->ambientPause(ambient_status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -896,7 +896,7 @@ int AGOSEngine::go() {
|
||||||
void AGOSEngine::shutdown() {
|
void AGOSEngine::shutdown() {
|
||||||
delete _gameFile;
|
delete _gameFile;
|
||||||
|
|
||||||
midi.close();
|
_midi.close();
|
||||||
|
|
||||||
free(_stringTabPtr);
|
free(_stringTabPtr);
|
||||||
free(_itemArrayPtr);
|
free(_itemArrayPtr);
|
||||||
|
|
|
@ -488,7 +488,7 @@ protected:
|
||||||
|
|
||||||
byte _lettersToPrintBuf[80];
|
byte _lettersToPrintBuf[80];
|
||||||
|
|
||||||
MidiPlayer midi;
|
MidiPlayer _midi;
|
||||||
bool _native_mt32;
|
bool _native_mt32;
|
||||||
|
|
||||||
int _vgaTickCounter;
|
int _vgaTickCounter;
|
||||||
|
|
|
@ -48,12 +48,12 @@ Debugger::Debugger(AGOSEngine *vm)
|
||||||
|
|
||||||
|
|
||||||
void Debugger::preEnter() {
|
void Debugger::preEnter() {
|
||||||
//_vm->midi.pause(1);
|
//_vm->_midi.pause(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Debugger::postEnter() {
|
void Debugger::postEnter() {
|
||||||
//_vm->midi.pause(0);
|
//_vm->_midi.pause(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ bool Debugger::Cmd_PlayMusic(int argc, const char **argv) {
|
||||||
if (music <= range) {
|
if (music <= range) {
|
||||||
_vm->loadMusic(music);
|
_vm->loadMusic(music);
|
||||||
if (_vm->getGameType() == GType_SIMON2)
|
if (_vm->getGameType() == GType_SIMON2)
|
||||||
_vm->midi.startTrack(0);
|
_vm->_midi.startTrack(0);
|
||||||
} else
|
} else
|
||||||
DebugPrintf("Music out of range (0 - %d)\n", range);
|
DebugPrintf("Music out of range (0 - %d)\n", range);
|
||||||
} else
|
} else
|
||||||
|
|
|
@ -540,19 +540,19 @@ bool AGOSEngine::processSpecialKeys() {
|
||||||
_speech ^= 1;
|
_speech ^= 1;
|
||||||
}
|
}
|
||||||
case '+':
|
case '+':
|
||||||
midi.setVolume(midi.getVolume() + 16);
|
_midi.setVolume(_midi.getVolume() + 16);
|
||||||
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) + 16);
|
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) + 16);
|
||||||
break;
|
break;
|
||||||
case '-':
|
case '-':
|
||||||
midi.setVolume(midi.getVolume() - 16);
|
_midi.setVolume(_midi.getVolume() - 16);
|
||||||
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) - 16);
|
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) - 16);
|
||||||
break;
|
break;
|
||||||
case 'm':
|
case 'm':
|
||||||
midi.pause(_musicPaused ^= 1);
|
_midi.pause(_musicPaused ^= 1);
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
if (getGameId() == GID_SIMON1DOS)
|
if (getGameId() == GID_SIMON1DOS)
|
||||||
midi._enable_sfx ^= 1;
|
_midi._enable_sfx ^= 1;
|
||||||
else
|
else
|
||||||
_sound->effectsPause(_effectsPaused ^= 1);
|
_sound->effectsPause(_effectsPaused ^= 1);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -163,22 +163,22 @@ void AGOSEngine::loadMusic(uint music) {
|
||||||
char buf[4];
|
char buf[4];
|
||||||
|
|
||||||
if (getGameType() == GType_SIMON2) {
|
if (getGameType() == GType_SIMON2) {
|
||||||
midi.stop();
|
_midi.stop();
|
||||||
_gameFile->seek(_gameOffsetsPtr[_musicIndexBase + music - 1], SEEK_SET);
|
_gameFile->seek(_gameOffsetsPtr[_musicIndexBase + music - 1], SEEK_SET);
|
||||||
_gameFile->read(buf, 4);
|
_gameFile->read(buf, 4);
|
||||||
if (!memcmp(buf, "FORM", 4)) {
|
if (!memcmp(buf, "FORM", 4)) {
|
||||||
_gameFile->seek(_gameOffsetsPtr[_musicIndexBase + music - 1], SEEK_SET);
|
_gameFile->seek(_gameOffsetsPtr[_musicIndexBase + music - 1], SEEK_SET);
|
||||||
midi.loadXMIDI(_gameFile);
|
_midi.loadXMIDI(_gameFile);
|
||||||
} else {
|
} else {
|
||||||
_gameFile->seek(_gameOffsetsPtr[_musicIndexBase + music - 1], SEEK_SET);
|
_gameFile->seek(_gameOffsetsPtr[_musicIndexBase + music - 1], SEEK_SET);
|
||||||
midi.loadMultipleSMF(_gameFile);
|
_midi.loadMultipleSMF(_gameFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
_lastMusicPlayed = music;
|
_lastMusicPlayed = music;
|
||||||
_nextMusicToPlay = -1;
|
_nextMusicToPlay = -1;
|
||||||
} else if (getGameType() == GType_SIMON1) {
|
} else if (getGameType() == GType_SIMON1) {
|
||||||
midi.stop();
|
_midi.stop();
|
||||||
midi.setLoop(true); // Must do this BEFORE loading music. (GMF may have its own override.)
|
_midi.setLoop(true); // Must do this BEFORE loading music. (GMF may have its own override.)
|
||||||
|
|
||||||
// Support for compressed music from the ScummVM Music Enhancement Project
|
// Support for compressed music from the ScummVM Music Enhancement Project
|
||||||
AudioCD.stop();
|
AudioCD.stop();
|
||||||
|
@ -201,13 +201,13 @@ void AGOSEngine::loadMusic(uint music) {
|
||||||
_gameFile->read(buf, 4);
|
_gameFile->read(buf, 4);
|
||||||
if (!memcmp(buf, "GMF\x1", 4)) {
|
if (!memcmp(buf, "GMF\x1", 4)) {
|
||||||
_gameFile->seek(_gameOffsetsPtr[_musicIndexBase + music], SEEK_SET);
|
_gameFile->seek(_gameOffsetsPtr[_musicIndexBase + music], SEEK_SET);
|
||||||
midi.loadSMF(_gameFile, music);
|
_midi.loadSMF(_gameFile, music);
|
||||||
} else {
|
} else {
|
||||||
_gameFile->seek(_gameOffsetsPtr[_musicIndexBase + music], SEEK_SET);
|
_gameFile->seek(_gameOffsetsPtr[_musicIndexBase + music], SEEK_SET);
|
||||||
midi.loadMultipleSMF(_gameFile);
|
_midi.loadMultipleSMF(_gameFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
midi.startTrack(0);
|
_midi.startTrack(0);
|
||||||
} else {
|
} else {
|
||||||
char filename[15];
|
char filename[15];
|
||||||
File f;
|
File f;
|
||||||
|
@ -217,11 +217,11 @@ void AGOSEngine::loadMusic(uint music) {
|
||||||
error("loadMusic: Can't load music from '%s'", filename);
|
error("loadMusic: Can't load music from '%s'", filename);
|
||||||
|
|
||||||
if (getFeatures() & GF_DEMO)
|
if (getFeatures() & GF_DEMO)
|
||||||
midi.loadS1D(&f);
|
_midi.loadS1D(&f);
|
||||||
else
|
else
|
||||||
midi.loadSMF(&f, music);
|
_midi.loadSMF(&f, music);
|
||||||
|
|
||||||
midi.startTrack(0);
|
_midi.startTrack(0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (getPlatform() == Common::kPlatformAmiga) {
|
if (getPlatform() == Common::kPlatformAmiga) {
|
||||||
|
@ -229,8 +229,8 @@ void AGOSEngine::loadMusic(uint music) {
|
||||||
} else if (getPlatform() == Common::kPlatformAtariST) {
|
} else if (getPlatform() == Common::kPlatformAtariST) {
|
||||||
// TODO: Add support for music formats used
|
// TODO: Add support for music formats used
|
||||||
} else {
|
} else {
|
||||||
midi.stop();
|
_midi.stop();
|
||||||
midi.setLoop(true); // Must do this BEFORE loading music.
|
_midi.setLoop(true); // Must do this BEFORE loading music.
|
||||||
|
|
||||||
char filename[15];
|
char filename[15];
|
||||||
File f;
|
File f;
|
||||||
|
@ -239,14 +239,14 @@ void AGOSEngine::loadMusic(uint music) {
|
||||||
if (f.isOpen() == false)
|
if (f.isOpen() == false)
|
||||||
error("loadMusic: Can't load music from '%s'", filename);
|
error("loadMusic: Can't load music from '%s'", filename);
|
||||||
|
|
||||||
midi.loadS1D(&f);
|
_midi.loadS1D(&f);
|
||||||
midi.startTrack(0);
|
_midi.startTrack(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AGOSEngine::playSting(uint a) {
|
void AGOSEngine::playSting(uint a) {
|
||||||
if (!midi._enable_sfx)
|
if (!_midi._enable_sfx)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
char filename[15];
|
char filename[15];
|
||||||
|
@ -265,8 +265,8 @@ void AGOSEngine::playSting(uint a) {
|
||||||
error("playSting: Can't read sting %d offset", a);
|
error("playSting: Can't read sting %d offset", a);
|
||||||
|
|
||||||
mus_file.seek(mus_offset, SEEK_SET);
|
mus_file.seek(mus_offset, SEEK_SET);
|
||||||
midi.loadSMF(&mus_file, a, true);
|
_midi.loadSMF(&mus_file, a, true);
|
||||||
midi.startTrack(0);
|
_midi.startTrack(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const byte elvira1_soundTable[100] = {
|
static const byte elvira1_soundTable[100] = {
|
||||||
|
|
|
@ -623,10 +623,10 @@ void AGOSEngine::oe1_playTune() {
|
||||||
if (getPlatform() == Common::kPlatformAmiga)
|
if (getPlatform() == Common::kPlatformAmiga)
|
||||||
_mixer->stopHandle(_modHandle);
|
_mixer->stopHandle(_modHandle);
|
||||||
else
|
else
|
||||||
midi.stop();
|
_midi.stop();
|
||||||
} else {
|
} else {
|
||||||
loadMusic(music);
|
loadMusic(music);
|
||||||
midi.startTrack(track);
|
_midi.startTrack(track);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,7 +100,7 @@ void AGOSEngine::os1_playTune() {
|
||||||
if (music != _lastMusicPlayed) {
|
if (music != _lastMusicPlayed) {
|
||||||
_lastMusicPlayed = music;
|
_lastMusicPlayed = music;
|
||||||
loadMusic(music);
|
loadMusic(music);
|
||||||
midi.startTrack(track);
|
_midi.startTrack(track);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -124,11 +124,11 @@ void AGOSEngine::os2_playTune() {
|
||||||
// effectively preloaded so there's no latency when
|
// effectively preloaded so there's no latency when
|
||||||
// starting playback).
|
// starting playback).
|
||||||
|
|
||||||
midi.setLoop(loop != 0);
|
_midi.setLoop(loop != 0);
|
||||||
if (_lastMusicPlayed != music)
|
if (_lastMusicPlayed != music)
|
||||||
_nextMusicToPlay = music;
|
_nextMusicToPlay = music;
|
||||||
else
|
else
|
||||||
midi.startTrack(track);
|
_midi.startTrack(track);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AGOSEngine::os2_screenTextPObj() {
|
void AGOSEngine::os2_screenTextPObj() {
|
||||||
|
|
|
@ -145,8 +145,8 @@ void AGOSEngine::vc69_playSeq() {
|
||||||
// specifying a non-valid track number (999 or -1)
|
// specifying a non-valid track number (999 or -1)
|
||||||
// as a means of stopping what music is currently
|
// as a means of stopping what music is currently
|
||||||
// playing.
|
// playing.
|
||||||
midi.setLoop(loop != 0);
|
_midi.setLoop(loop != 0);
|
||||||
midi.startTrack(track);
|
_midi.startTrack(track);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AGOSEngine::vc70_joinSeq() {
|
void AGOSEngine::vc70_joinSeq() {
|
||||||
|
@ -160,9 +160,9 @@ void AGOSEngine::vc70_joinSeq() {
|
||||||
// track and, if not, whether to switch to
|
// track and, if not, whether to switch to
|
||||||
// a different track upon completion.
|
// a different track upon completion.
|
||||||
if (track != 0xFFFF && track != 999)
|
if (track != 0xFFFF && track != 999)
|
||||||
midi.queueTrack(track, loop != 0);
|
_midi.queueTrack(track, loop != 0);
|
||||||
else
|
else
|
||||||
midi.setLoop(loop != 0);
|
_midi.setLoop(loop != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AGOSEngine::vc71_ifSeqWaiting() {
|
void AGOSEngine::vc71_ifSeqWaiting() {
|
||||||
|
@ -170,7 +170,7 @@ void AGOSEngine::vc71_ifSeqWaiting() {
|
||||||
// This command skips the next instruction
|
// This command skips the next instruction
|
||||||
// unless (1) there is a track playing, AND
|
// unless (1) there is a track playing, AND
|
||||||
// (2) there is a track queued to play after it.
|
// (2) there is a track queued to play after it.
|
||||||
if (!midi.isPlaying(true))
|
if (!_midi.isPlaying(true))
|
||||||
vcSkipNextInstruction();
|
vcSkipNextInstruction();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,10 +192,10 @@ void AGOSEngine::vc72_segue() {
|
||||||
int16 loop = vcReadNextWord();
|
int16 loop = vcReadNextWord();
|
||||||
|
|
||||||
if (track == -1 || track == 999) {
|
if (track == -1 || track == 999) {
|
||||||
midi.stop();
|
_midi.stop();
|
||||||
} else {
|
} else {
|
||||||
midi.setLoop(loop != 0);
|
_midi.setLoop(loop != 0);
|
||||||
midi.startTrack(track);
|
_midi.startTrack(track);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue