[Scummvm-cvs-logs] SF.net SVN: scummvm:[33736] scummvm/trunk/engines/kyra
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Sun Aug 10 02:36:47 CEST 2008
Revision: 33736
http://scummvm.svn.sourceforge.net/scummvm/?rev=33736&view=rev
Author: lordhoto
Date: 2008-08-10 00:36:46 +0000 (Sun, 10 Aug 2008)
Log Message:
-----------
Fixed kyra to support properly support restarting of engine (for GSoC RTL, based on a patch from Chris Page).
Modified Paths:
--------------
scummvm/trunk/engines/kyra/kyra_hof.h
scummvm/trunk/engines/kyra/kyra_lok.cpp
scummvm/trunk/engines/kyra/kyra_lok.h
scummvm/trunk/engines/kyra/kyra_v1.h
scummvm/trunk/engines/kyra/staticres.cpp
Modified: scummvm/trunk/engines/kyra/kyra_hof.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_hof.h 2008-08-10 00:28:08 UTC (rev 33735)
+++ scummvm/trunk/engines/kyra/kyra_hof.h 2008-08-10 00:36:46 UTC (rev 33736)
@@ -302,8 +302,7 @@
static const int8 _dosTrackMap[];
static const int _dosTrackMapSize;
- const AudioDataStruct *_soundData;
-
+ AudioDataStruct _soundData[3];
protected:
// game initialization
void startup();
Modified: scummvm/trunk/engines/kyra/kyra_lok.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_lok.cpp 2008-08-10 00:28:08 UTC (rev 33735)
+++ scummvm/trunk/engines/kyra/kyra_lok.cpp 2008-08-10 00:36:46 UTC (rev 33736)
@@ -174,8 +174,7 @@
initStaticResource();
- if (_soundData)
- _sound->setSoundList(&_soundData[kMusicIntro]);
+ _sound->setSoundList(&_soundData[kMusicIntro]);
_trackMap = _dosTrackMap;
_trackMapSize = _dosTrackMapSize;
@@ -318,8 +317,7 @@
debugC(9, kDebugLevelMain, "KyraEngine_LoK::startup()");
static const uint8 colorMap[] = { 0, 0, 0, 0, 12, 12, 12, 0, 0, 0, 0, 0 };
_screen->setTextColorMap(colorMap);
- if (_soundData)
- _sound->setSoundList(&_soundData[kMusicIngame]);
+ _sound->setSoundList(&_soundData[kMusicIngame]);
_sound->loadSoundFile(0);
// _screen->setFont(Screen::FID_6_FNT);
_screen->setAnimBlockPtr(3750);
Modified: scummvm/trunk/engines/kyra/kyra_lok.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_lok.h 2008-08-10 00:28:08 UTC (rev 33735)
+++ scummvm/trunk/engines/kyra/kyra_lok.h 2008-08-10 00:36:46 UTC (rev 33736)
@@ -633,7 +633,7 @@
int _soundFilesIntroSize;
const int32 *_cdaTrackTable;
int _cdaTrackTableSize;
- const AudioDataStruct * _soundData;
+ AudioDataStruct _soundData[3];
// positions of the inventory
static const uint16 _itemPosX[];
Modified: scummvm/trunk/engines/kyra/kyra_v1.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v1.h 2008-08-10 00:28:08 UTC (rev 33735)
+++ scummvm/trunk/engines/kyra/kyra_v1.h 2008-08-10 00:36:46 UTC (rev 33736)
@@ -70,9 +70,9 @@
struct AudioDataStruct {
const char * const *_fileList;
- const int _fileListLen;
- const void * const _cdaTracks;
- const int _cdaNumTracks;
+ int _fileListLen;
+ const void * _cdaTracks;
+ int _cdaNumTracks;
};
// TODO: this is just the start of makeing the debug output of the kyra engine a bit more useable
Modified: scummvm/trunk/engines/kyra/staticres.cpp
===================================================================
--- scummvm/trunk/engines/kyra/staticres.cpp 2008-08-10 00:28:08 UTC (rev 33735)
+++ scummvm/trunk/engines/kyra/staticres.cpp 2008-08-10 00:36:46 UTC (rev 33736)
@@ -1055,32 +1055,48 @@
static const char *tIntro98[] = { "intro%d.dat" };
static const char *tIngame98[] = { "kyram%d.dat" };
- static const AudioDataStruct soundData_PC[] = {
- { _soundFilesIntro, _soundFilesIntroSize, 0, 0 },
- { _soundFiles, _soundFilesSize, 0, 0 },
- { 0, 0, 0, 0}
- };
-
- static const AudioDataStruct soundData_TOWNS[] = {
- { _soundFiles, _soundFilesSize, _cdaTrackTable, _cdaTrackTableSize },
- { _soundFiles, _soundFilesSize, _cdaTrackTable, _cdaTrackTableSize },
- { 0, 0, 0, 0}
- };
-
- static const AudioDataStruct soundData_PC98[] = {
- { tIntro98, 1, 0, 0 },
- { tIngame98, 1, 0, 0 },
- { 0, 0, 0, 0}
- };
-
- if (_flags.platform == Common::kPlatformPC)
- _soundData = soundData_PC;
- else if (_flags.platform == Common::kPlatformFMTowns)
- _soundData = soundData_TOWNS;
- else if (_flags.platform == Common::kPlatformPC98)
- _soundData = soundData_PC98;
- else
- _soundData = 0;
+ if (_flags.platform == Common::kPlatformPC) {
+ _soundData[0]._fileList = _soundFilesIntro;
+ _soundData[0]._fileListLen = _soundFilesIntroSize;
+ _soundData[0]._cdaTracks = 0;
+ _soundData[0]._cdaNumTracks = 0;
+ _soundData[1]._fileList = _soundFiles;
+ _soundData[1]._fileListLen = _soundFilesSize;
+ _soundData[1]._cdaTracks = 0;
+ _soundData[1]._cdaNumTracks = 0;
+ _soundData[2]._fileList = 0;
+ _soundData[2]._fileListLen = 0;
+ _soundData[2]._cdaTracks = 0;
+ _soundData[2]._cdaNumTracks = 0;
+ } else if (_flags.platform == Common::kPlatformFMTowns) {
+ _soundData[0]._fileList = _soundFiles;
+ _soundData[0]._fileListLen = _soundFilesSize;
+ _soundData[0]._cdaTracks = _cdaTrackTable;
+ _soundData[0]._cdaNumTracks = _cdaTrackTableSize;
+ _soundData[1]._fileList = _soundFiles;
+ _soundData[1]._fileListLen = _soundFilesSize;
+ _soundData[1]._cdaTracks = _cdaTrackTable;
+ _soundData[1]._cdaNumTracks = _cdaTrackTableSize;
+ _soundData[2]._fileList = 0;
+ _soundData[2]._fileListLen = 0;
+ _soundData[2]._cdaTracks = 0;
+ _soundData[2]._cdaNumTracks = 0;
+ } else if (_flags.platform == Common::kPlatformPC98) {
+ _soundData[0]._fileList = tIntro98;
+ _soundData[0]._fileListLen = 1;
+ _soundData[0]._cdaTracks = 0;
+ _soundData[0]._cdaNumTracks = 0;
+ _soundData[1]._fileList = tIngame98;
+ _soundData[1]._fileListLen = 1;
+ _soundData[1]._cdaTracks = 0;
+ _soundData[1]._cdaNumTracks = 0;
+ _soundData[2]._fileList = 0;
+ _soundData[2]._fileListLen = 0;
+ _soundData[2]._cdaTracks = 0;
+ _soundData[2]._cdaNumTracks = 0;
+ } else {
+ memset(_soundData, 0, sizeof(_soundData));
+ }
}
void KyraEngine_LoK::loadMouseShapes() {
@@ -1282,31 +1298,47 @@
static const char *pc98MusicFileListFinale[] = { "finale%d.86" };
static const char *pc98MusicFileListIngame[] = { "km%02d.86" };
- static const AudioDataStruct soundData_PC[] = {
- { _musicFileListIntro, _musicFileListIntroSize, 0, 0 },
- { _musicFileListIngame, _musicFileListIngameSize, 0, 0},
- { _musicFileListFinale, _musicFileListIntroSize, 0, 0 }
- };
+ if (_flags.platform == Common::kPlatformPC) {
+ _soundData[0]._fileList = _musicFileListIntro;
+ _soundData[0]._fileListLen = _musicFileListIntroSize;
+ _soundData[0]._cdaTracks = 0;
+ _soundData[0]._cdaNumTracks = 0;
+ _soundData[1]._fileList = _musicFileListIngame;
+ _soundData[1]._fileListLen = _musicFileListIngameSize;
+ _soundData[1]._cdaTracks = 0;
+ _soundData[1]._cdaNumTracks = 0;
+ _soundData[2]._fileList = _musicFileListFinale;
+ _soundData[2]._fileListLen = _musicFileListIntroSize;
+ _soundData[2]._cdaTracks = 0;
+ _soundData[2]._cdaNumTracks = 0;
+ } else if (_flags.platform == Common::kPlatformFMTowns) {
+ _soundData[0]._fileList = fmtMusicFileListIntro;
+ _soundData[0]._fileListLen = 1;
+ _soundData[0]._cdaTracks = _cdaTrackTableIntro;
+ _soundData[0]._cdaNumTracks = _cdaTrackTableIntroSize >> 1;
+ _soundData[1]._fileList = fmtMusicFileListIngame;
+ _soundData[1]._fileListLen = 1;
+ _soundData[1]._cdaTracks = _cdaTrackTableIngame;
+ _soundData[1]._cdaNumTracks = _cdaTrackTableIngameSize >> 1;
+ _soundData[2]._fileList = fmtMusicFileListFinale;
+ _soundData[2]._fileListLen = 1;
+ _soundData[2]._cdaTracks = _cdaTrackTableFinale;
+ _soundData[2]._cdaNumTracks = _cdaTrackTableFinaleSize >> 1;
+ } else if (_flags.platform == Common::kPlatformPC98) {
+ _soundData[0]._fileList = pc98MusicFileListIntro;
+ _soundData[0]._fileListLen = 1;
+ _soundData[0]._cdaTracks = 0;
+ _soundData[0]._cdaNumTracks = 0;
+ _soundData[1]._fileList = pc98MusicFileListIngame;
+ _soundData[1]._fileListLen = 1;
+ _soundData[1]._cdaTracks = 0;
+ _soundData[1]._cdaNumTracks = 0;
+ _soundData[2]._fileList = pc98MusicFileListFinale;
+ _soundData[2]._fileListLen = 1;
+ _soundData[2]._cdaTracks = 0;
+ _soundData[2]._cdaNumTracks = 0;
+ }
- static const AudioDataStruct soundData_TOWNS[] = {
- { fmtMusicFileListIntro, 1, _cdaTrackTableIntro, _cdaTrackTableIntroSize >> 1 },
- { fmtMusicFileListIngame, 1, _cdaTrackTableIngame, _cdaTrackTableIngameSize >> 1 },
- { fmtMusicFileListFinale, 1, _cdaTrackTableFinale, _cdaTrackTableFinaleSize >> 1 }
- };
-
- static const AudioDataStruct soundData_PC98[] = {
- { pc98MusicFileListIntro, 1, 0, 0 },
- { pc98MusicFileListIngame, 1, 0, 0 },
- { pc98MusicFileListFinale, 1, 0, 0 }
- };
-
- if (_flags.platform == Common::kPlatformPC)
- _soundData = soundData_PC;
- else if (_flags.platform == Common::kPlatformFMTowns)
- _soundData = soundData_TOWNS;
- else if (_flags.platform == Common::kPlatformPC98)
- _soundData = soundData_PC98;
-
// setup sequence data
_sequences = _staticres->loadHofSequenceData(k2SeqplaySeqData, tmpSize);
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