mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 05:38:56 +00:00
AGOS: Fix DOS PN and FF demo crash
The engine would try to initialize the MidiPlayer for all DOS games, even the ones that don't use MIDI (Personal Nightmare and Feeble Files demos). This caused a problem with the new MIDI code, which does not set up the necessary objects for these games and crashed on a null pointer. This is fixed by adding PN and FF as exceptions to the if condition guarding initialization of the MidiPlayer.
This commit is contained in:
parent
69662ee9a4
commit
03de0244ed
@ -612,9 +612,10 @@ Common::Error AGOSEngine::init() {
|
||||
_midi = new MidiPlayer(this);
|
||||
|
||||
if ((getGameType() == GType_SIMON2 && getPlatform() == Common::kPlatformWindows) ||
|
||||
(getGameType() == GType_SIMON1 && getPlatform() == Common::kPlatformWindows) ||
|
||||
((getFeatures() & GF_TALKIE) && getPlatform() == Common::kPlatformAcorn) ||
|
||||
(getPlatform() == Common::kPlatformDOS || getPlatform() == Common::kPlatformPC98)) {
|
||||
(getGameType() == GType_SIMON1 && getPlatform() == Common::kPlatformWindows) ||
|
||||
((getFeatures() & GF_TALKIE) && getPlatform() == Common::kPlatformAcorn) ||
|
||||
(getPlatform() == Common::kPlatformDOS && getGameType() != GType_PN && getGameType() != GType_FF) ||
|
||||
getPlatform() == Common::kPlatformPC98) {
|
||||
|
||||
int ret = _midi->open();
|
||||
if (ret)
|
||||
|
@ -533,7 +533,7 @@ bool MidiPlayer::isPlaying(bool checkQueued) {
|
||||
void MidiPlayer::stop(bool sfx) {
|
||||
Common::StackLock lock(_mutex);
|
||||
|
||||
if (!sfx) {
|
||||
if (!sfx) {
|
||||
// Clear the queued track to prevent it from starting when the current
|
||||
// track is stopped.
|
||||
_queuedTrack = 255;
|
||||
|
Loading…
Reference in New Issue
Block a user