[Scummvm-cvs-logs] scummvm master -> fe44939eba096bad083254b1c5152ef070ac4dc8
DrMcCoy
drmccoy at drmccoy.de
Mon Jun 11 06:21:21 CEST 2012
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
fe44939eba GOB: Play the music on the title screen of Gob1 EGA
Commit: fe44939eba096bad083254b1c5152ef070ac4dc8
https://github.com/scummvm/scummvm/commit/fe44939eba096bad083254b1c5152ef070ac4dc8
Author: Sven Hesse (drmccoy at users.sourceforge.net)
Date: 2012-06-10T21:20:34-07:00
Commit Message:
GOB: Play the music on the title screen of Gob1 EGA
The EGA version of Gobliiins comes with an MDY track.
While the original doesn't play it, we thought it might
be a nice idea to play it nevertheless.
Changed paths:
engines/gob/detection_tables.h
engines/gob/inter_v1.cpp
engines/gob/sound/adlib.h
engines/gob/sound/sound.cpp
engines/gob/sound/sound.h
diff --git a/engines/gob/detection_tables.h b/engines/gob/detection_tables.h
index 7aa58b9..77b54a1 100644
--- a/engines/gob/detection_tables.h
+++ b/engines/gob/detection_tables.h
@@ -34,7 +34,7 @@ static const GOBGameDescription gameDescriptions[] = {
GUIO2(GUIO_NOSUBTITLES, GUIO_NOSPEECH)
},
kGameTypeGob1,
- kFeaturesEGA,
+ kFeaturesEGA | kFeaturesAdLib,
0, 0, 0
},
{
@@ -48,7 +48,7 @@ static const GOBGameDescription gameDescriptions[] = {
GUIO2(GUIO_NOSUBTITLES, GUIO_NOSPEECH)
},
kGameTypeGob1,
- kFeaturesEGA,
+ kFeaturesEGA | kFeaturesAdLib,
0, 0, 0
},
{ // Supplied by Theruler76 in bug report #1201233
diff --git a/engines/gob/inter_v1.cpp b/engines/gob/inter_v1.cpp
index 4aa54f7..6fc472a 100644
--- a/engines/gob/inter_v1.cpp
+++ b/engines/gob/inter_v1.cpp
@@ -286,10 +286,40 @@ void Inter_v1::o1_loadMult() {
}
void Inter_v1::o1_playMult() {
- int16 checkEscape;
+ // NOTE: The EGA version of Gobliiins has an MDY tune.
+ // While the original doesn't play it, we do.
+ bool isGob1EGAIntro = _vm->getGameType() == kGameTypeGob1 &&
+ _vm->isEGA() &&
+ _vm->_game->_script->pos() == 1010 &&
+ _vm->isCurrentTot("intro.tot") &&
+ VAR(57) != 0xFFFFFFFF &&
+ _vm->_dataIO->hasFile("goblins.mdy") &&
+ _vm->_dataIO->hasFile("goblins.tbr");
+
+ int16 checkEscape = _vm->_game->_script->readInt16();
+
+ if (isGob1EGAIntro) {
+ _vm->_sound->adlibLoadTBR("goblins.tbr");
+ _vm->_sound->adlibLoadMDY("goblins.mdy");
+ _vm->_sound->adlibSetRepeating(-1);
+
+ _vm->_sound->adlibPlay();
+ }
- checkEscape = _vm->_game->_script->readInt16();
_vm->_mult->playMult(VAR(57), -1, checkEscape, 0);
+
+ if (isGob1EGAIntro) {
+
+ // User didn't escape the intro mult, wait for an escape here
+ if (VAR(57) != 0xFFFFFFFF) {
+ while (_vm->_util->getKey() != kKeyEscape) {
+ _vm->_util->processInput();
+ _vm->_util->longDelay(1);
+ }
+ }
+
+ _vm->_sound->adlibUnload();
+ }
}
void Inter_v1::o1_freeMultKeys() {
diff --git a/engines/gob/sound/adlib.h b/engines/gob/sound/adlib.h
index df1b77f..17ab950 100644
--- a/engines/gob/sound/adlib.h
+++ b/engines/gob/sound/adlib.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef GOB_SOUND_NEWADLIB_H
-#define GOB_SOUND_NEWADLIB_H
+#ifndef GOB_SOUND_ADLIB_H
+#define GOB_SOUND_ADLIB_H
#include "common/mutex.h"
@@ -303,4 +303,4 @@ private:
} // End of namespace Gob
-#endif // GOB_SOUND_NEWADLIB_H
+#endif // GOB_SOUND_ADLIB_H
diff --git a/engines/gob/sound/sound.cpp b/engines/gob/sound/sound.cpp
index f14e9b1..9f72d1a 100644
--- a/engines/gob/sound/sound.cpp
+++ b/engines/gob/sound/sound.cpp
@@ -51,6 +51,8 @@ Sound::Sound(GobEngine *vm) : _vm(vm) {
_hasAdLib = (!_vm->_noMusic && _vm->hasAdLib());
+ _hasAdLibBg = _hasAdLib;
+
if (!_vm->_noMusic && (_vm->getPlatform() == Common::kPlatformAmiga)) {
_infogrames = new Infogrames(*_vm->_mixer);
_protracker = new Protracker(*_vm->_mixer);
@@ -274,8 +276,7 @@ bool Sound::adlibLoadMDY(const char *fileName) {
if (!_hasAdLib)
return false;
- if (!_mdyPlayer)
- _mdyPlayer = new MUSPlayer(*_vm->_mixer);
+ createMDYPlayer();
debugC(1, kDebugSound, "AdLib: Loading MDY data (\"%s\")", fileName);
@@ -296,8 +297,7 @@ bool Sound::adlibLoadTBR(const char *fileName) {
if (!_hasAdLib)
return false;
- if (!_mdyPlayer)
- _mdyPlayer = new MUSPlayer(*_vm->_mixer);
+ createMDYPlayer();
Common::SeekableReadStream *stream = _vm->_dataIO->getFile(fileName);
if (!stream) {
@@ -318,8 +318,7 @@ void Sound::adlibPlayTrack(const char *trackname) {
if (!_hasAdLib)
return;
- if (!_adlPlayer)
- _adlPlayer = new ADLPlayer(*_vm->_mixer);
+ createADLPlayer();
if (_adlPlayer->isPlaying())
return;
@@ -329,11 +328,10 @@ void Sound::adlibPlayTrack(const char *trackname) {
}
void Sound::adlibPlayBgMusic() {
- if (!_hasAdLib)
+ if (!_hasAdLib || _hasAdLibBg)
return;
- if (!_adlPlayer)
- _adlPlayer = new ADLPlayer(*_vm->_mixer);
+ createADLPlayer();
static const char *const tracksMac[] = {
// "musmac1.adl", // This track seems to be missing instruments...
@@ -352,13 +350,18 @@ void Sound::adlibPlayBgMusic() {
"musmac5.mid"
};
- if (_vm->getPlatform() == Common::kPlatformWindows) {
- int track = _vm->_util->getRandom(ARRAYSIZE(tracksWin));
- adlibPlayTrack(tracksWin[track]);
- } else {
- int track = _vm->_util->getRandom(ARRAYSIZE(tracksMac));
- adlibPlayTrack(tracksMac[track]);
+ const char *track = 0;
+ if (_vm->getPlatform() == Common::kPlatformWindows)
+ track = tracksWin[ARRAYSIZE(tracksWin)];
+ else
+ track = tracksMac[_vm->_util->getRandom(ARRAYSIZE(tracksMac))];
+
+ if (!track || !_vm->_dataIO->hasFile(track)) {
+ _hasAdLibBg = false;
+ return;
}
+
+ adlibPlayTrack(track);
}
void Sound::adlibPlay() {
@@ -722,4 +725,24 @@ void Sound::bgUnshade() {
_bgatmos->unshade();
}
+void Sound::createMDYPlayer() {
+ if (_mdyPlayer)
+ return;
+
+ delete _adlPlayer;
+ _adlPlayer = 0;
+
+ _mdyPlayer = new MUSPlayer(*_vm->_mixer);
+}
+
+void Sound::createADLPlayer() {
+ if (_adlPlayer)
+ return;
+
+ delete _mdyPlayer;
+ _mdyPlayer= 0;
+
+ _adlPlayer = new ADLPlayer(*_vm->_mixer);
+}
+
} // End of namespace Gob
diff --git a/engines/gob/sound/sound.h b/engines/gob/sound/sound.h
index ea7d639..064a249 100644
--- a/engines/gob/sound/sound.h
+++ b/engines/gob/sound/sound.h
@@ -142,6 +142,7 @@ private:
GobEngine *_vm;
bool _hasAdLib;
+ bool _hasAdLibBg;
SoundDesc _sounds[kSoundsCount];
@@ -162,6 +163,9 @@ private:
// Audio CD
CDROM *_cdrom;
+
+ void createMDYPlayer();
+ void createADLPlayer();
};
} // End of namespace Gob
More information about the Scummvm-git-logs
mailing list