From b635a2fb842ab4d5d9a048dfe52b731469e0c28d Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 22 Oct 2006 16:04:14 +0000 Subject: Only instantiate ProtrackerPlayer if it is actually needed svn-id: r24445 --- engines/agos/agos.cpp | 8 ++++++-- engines/agos/res_snd.cpp | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp index e9d748458b..d85819ba56 100644 --- a/engines/agos/agos.cpp +++ b/engines/agos/agos.cpp @@ -524,10 +524,14 @@ int AGOSEngine::init() { setupGame(); _debugger = new Debugger(this); - _modPlayer = new Modules::ProtrackerPlayer(); _sound = new Sound(this, gss, _mixer); - _modPlayer->init(_system); + if (getPlatform() == Common::kPlatformAmiga) { + _modPlayer = new Modules::ProtrackerPlayer(); + _modPlayer->init(_system); + } else { + _modPlayer = 0; + } _moviePlay = new MoviePlayer(this, _mixer); if (ConfMan.hasKey("sfx_mute") && ConfMan.getBool("sfx_mute") == 1) { diff --git a/engines/agos/res_snd.cpp b/engines/agos/res_snd.cpp index 37b34c2269..56d88351f0 100644 --- a/engines/agos/res_snd.cpp +++ b/engines/agos/res_snd.cpp @@ -118,6 +118,7 @@ void AGOSEngine::loadMusic(uint music) { if (getPlatform() == Common::kPlatformAtariST) { // TODO: Add support for music format used by Elvira 2 } else if (getPlatform() == Common::kPlatformAmiga) { + assert(_modPlayer); _modPlayer->stop(); char filename[15]; -- cgit v1.2.3