mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-19 00:15:30 +00:00
Implemented pauseEngineIntern() for the SAGA engine
svn-id: r35007
This commit is contained in:
parent
b7c9958e82
commit
113a83c0da
@ -366,6 +366,7 @@ Music::Music(SagaEngine *vm, Audio::Mixer *mixer, MidiDriver *driver) : _vm(vm),
|
||||
_songTable = 0;
|
||||
|
||||
_midiMusicData = NULL;
|
||||
_digitalMusic = false;
|
||||
}
|
||||
|
||||
Music::~Music() {
|
||||
@ -474,6 +475,7 @@ void Music::play(uint32 resourceId, MusicFlags flags) {
|
||||
stream = Audio::AudioStream::openStreamFile(trackName[i], 0, 10000 * 40 / 3, (flags == MUSIC_LOOP) ? 0 : 1);
|
||||
if (stream) {
|
||||
_mixer->playInputStream(Audio::Mixer::kMusicSoundType, &_musicHandle, stream);
|
||||
_digitalMusic = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -497,6 +499,7 @@ void Music::play(uint32 resourceId, MusicFlags flags) {
|
||||
if (audioStream) {
|
||||
debug(2, "Playing digitized music");
|
||||
_mixer->playInputStream(Audio::Mixer::kMusicSoundType, &_musicHandle, audioStream);
|
||||
_digitalMusic = true;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -113,6 +113,7 @@ public:
|
||||
bool hasAdlib() { return _adlib; }
|
||||
void setPassThrough(bool b) { _player->setPassThrough(b); }
|
||||
bool isPlaying(void);
|
||||
bool hasDigitalMusic() { return _digitalMusic; }
|
||||
|
||||
void play(uint32 resourceId, MusicFlags flags = MUSIC_DEFAULT);
|
||||
void pause(void);
|
||||
@ -138,6 +139,7 @@ private:
|
||||
int _targetVolume;
|
||||
int _currentVolume;
|
||||
int _currentVolumePercent;
|
||||
bool _digitalMusic;
|
||||
|
||||
ResourceContext *_digitalMusicContext;
|
||||
MidiParser *xmidiParser;
|
||||
|
@ -42,7 +42,8 @@
|
||||
namespace Saga {
|
||||
|
||||
const char *test_txt = "The quick brown fox jumped over the lazy dog. She sells sea shells down by the sea shore.";
|
||||
const char *pauseString = "PAWS GAME";
|
||||
const char *pauseStringITE = "PAWS GAME";
|
||||
const char *pauseStringIHNM = "Game Paused";
|
||||
|
||||
Render::Render(SagaEngine *vm, OSystem *system) {
|
||||
_vm = vm;
|
||||
@ -153,10 +154,17 @@ void Render::drawScene() {
|
||||
|
||||
// Display "paused game" message, if applicable
|
||||
if (_flags & RF_RENDERPAUSE) {
|
||||
textPoint.x = (backBufferSurface->w - _vm->_font->getStringWidth(kKnownFontPause, pauseString, 0, kFontOutline)) / 2;
|
||||
textPoint.y = 90;
|
||||
if (_vm->getGameType() == GType_ITE) {
|
||||
textPoint.x = (backBufferSurface->w - _vm->_font->getStringWidth(kKnownFontPause, pauseStringITE, 0, kFontOutline)) / 2;
|
||||
textPoint.y = 90;
|
||||
|
||||
_vm->_font->textDraw(kKnownFontPause, backBufferSurface, pauseString, textPoint, kITEColorBrightWhite, kITEColorBlack, kFontOutline);
|
||||
_vm->_font->textDraw(kKnownFontPause, backBufferSurface, pauseStringITE, textPoint, _vm->KnownColor2ColorId(kKnownColorBrightWhite), _vm->KnownColor2ColorId(kKnownColorBlack), kFontOutline);
|
||||
} else {
|
||||
textPoint.x = (backBufferSurface->w - _vm->_font->getStringWidth(kKnownFontPause, pauseStringIHNM, 0, kFontOutline)) / 2;
|
||||
textPoint.y = 90;
|
||||
|
||||
_vm->_font->textDraw(kKnownFontPause, backBufferSurface, pauseStringIHNM, textPoint, _vm->KnownColor2ColorId(kKnownColorBrightWhite), _vm->KnownColor2ColorId(kKnownColorBlack), kFontOutline);
|
||||
}
|
||||
}
|
||||
|
||||
// Update user interface
|
||||
|
@ -532,4 +532,22 @@ void SagaEngine::syncSoundSettings() {
|
||||
_sound->setVolume();
|
||||
}
|
||||
|
||||
void SagaEngine::pauseEngineIntern(bool pause) {
|
||||
bool isPaused = (_render->getFlags() & RF_RENDERPAUSE);
|
||||
if (isPaused == pause)
|
||||
return;
|
||||
|
||||
if (pause) {
|
||||
_render->setFlag(RF_RENDERPAUSE);
|
||||
if (!_music->hasDigitalMusic())
|
||||
_music->pause();
|
||||
} else {
|
||||
_render->clearFlag(RF_RENDERPAUSE);
|
||||
if (!_music->hasDigitalMusic())
|
||||
_music->resume();
|
||||
}
|
||||
|
||||
_mixer->pauseAll(pause);
|
||||
}
|
||||
|
||||
} // End of namespace Saga
|
||||
|
@ -493,6 +493,7 @@ public:
|
||||
virtual Common::Error go();
|
||||
virtual bool hasFeature(EngineFeature f) const;
|
||||
virtual void syncSoundSettings();
|
||||
virtual void pauseEngineIntern(bool pause);
|
||||
|
||||
public:
|
||||
SagaEngine(OSystem *syst, const SAGAGameDescription *gameDesc);
|
||||
|
Loading…
x
Reference in New Issue
Block a user