[Scummvm-cvs-logs] SF.net SVN: scummvm:[50564] scummvm/trunk/engines/groovie
mthreepwood at users.sourceforge.net
mthreepwood at users.sourceforge.net
Thu Jul 1 20:47:28 CEST 2010
Revision: 50564
http://scummvm.svn.sourceforge.net/scummvm/?rev=50564&view=rev
Author: mthreepwood
Date: 2010-07-01 18:47:27 +0000 (Thu, 01 Jul 2010)
Log Message:
-----------
Add support for the 'fallback' MIDI in T7G's intro when the CD track cannot be found. The intro music in the Mac version now plays.
Modified Paths:
--------------
scummvm/trunk/engines/groovie/groovie.cpp
scummvm/trunk/engines/groovie/groovie.h
scummvm/trunk/engines/groovie/music.cpp
Modified: scummvm/trunk/engines/groovie/groovie.cpp
===================================================================
--- scummvm/trunk/engines/groovie/groovie.cpp 2010-07-01 18:34:14 UTC (rev 50563)
+++ scummvm/trunk/engines/groovie/groovie.cpp 2010-07-01 18:47:27 UTC (rev 50564)
@@ -110,7 +110,7 @@
// Prepare the font too
switch (_gameDescription->version) {
case kGroovieT7G:
- if (_gameDescription->desc.platform == Common::kPlatformMacintosh) {
+ if (getPlatform() == Common::kPlatformMacintosh) {
_macResFork = new Common::MacResManager();
if (!_macResFork->open(_gameDescription->desc.filesDescriptions[0].fileName))
error("Could not open %s as a resource fork", _gameDescription->desc.filesDescriptions[0].fileName);
@@ -141,7 +141,7 @@
}
// Create the music player
- if (_gameDescription->desc.platform == Common::kPlatformMacintosh)
+ if (getPlatform() == Common::kPlatformMacintosh)
_musicPlayer = new MusicPlayerMac(this);
else
_musicPlayer = new MusicPlayerXMI(this, _gameDescription->version == kGroovieT7G ? "fat" : "sample");
@@ -154,8 +154,8 @@
if (_gameDescription->version == kGroovieT7G) {
// Run The 7th Guest's demo if requested
if (ConfMan.hasKey("demo_mode") && ConfMan.getBool("demo_mode"))
- filename = Common::String("demo.grv");
- else if (_gameDescription->desc.platform == Common::kPlatformMacintosh)
+ filename = "demo.grv";
+ else if (getPlatform() == Common::kPlatformMacintosh)
filename = "script.grv"; // Stored inside the executable's resource fork
} else if (_gameDescription->version == kGroovieV2) {
// Open the disk index
@@ -307,6 +307,10 @@
return Common::kNoError;
}
+Common::Platform GroovieEngine::getPlatform() const {
+ return _gameDescription->desc.platform;
+}
+
bool GroovieEngine::hasFeature(EngineFeature f) const {
return
(f == kSupportsRTL) ||
Modified: scummvm/trunk/engines/groovie/groovie.h
===================================================================
--- scummvm/trunk/engines/groovie/groovie.h 2010-07-01 18:34:14 UTC (rev 50563)
+++ scummvm/trunk/engines/groovie/groovie.h 2010-07-01 18:47:27 UTC (rev 50564)
@@ -82,6 +82,8 @@
GroovieEngine(OSystem *syst, const GroovieGameDescription *gd);
~GroovieEngine();
+ Common::Platform getPlatform() const;
+
protected:
// Engine APIs
Modified: scummvm/trunk/engines/groovie/music.cpp
===================================================================
--- scummvm/trunk/engines/groovie/music.cpp 2010-07-01 18:34:14 UTC (rev 50563)
+++ scummvm/trunk/engines/groovie/music.cpp 2010-07-01 18:47:27 UTC (rev 50564)
@@ -111,6 +111,20 @@
// Play the track starting at the requested offset (1000ms = 75 frames)
AudioCD.play(track - 1, 1, startms * 75 / 1000, 0);
+
+ // If the audio is not playing from the CD, play the "fallback" MIDI.
+ // The Mac version has no CD tracks, so it will always use the MIDI.
+ if (!AudioCD.isPlaying()) {
+ if (track == 2) {
+ // Intro MIDI fallback
+ if (_vm->getPlatform() == Common::kPlatformMacintosh)
+ playSong(70);
+ else
+ playSong((19 << 10) | 36); // XMI.GJD, file 36
+ } else if (track == 3) {
+ // TODO: Credits MIDI fallback
+ }
+ }
}
void MusicPlayer::startBackground() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list