diff options
author | Filippos Karapetis | 2007-08-26 15:57:30 +0000 |
---|---|---|
committer | Filippos Karapetis | 2007-08-26 15:57:30 +0000 |
commit | 3ce737eb2a1f8477b389f68b81eb01f6a7280a57 (patch) | |
tree | 2180e73755721427d8850716e26e9396da6c1000 | |
parent | d282f32604b563ae51cccd2f49f135753f4dfc62 (diff) | |
download | scummvm-rg350-3ce737eb2a1f8477b389f68b81eb01f6a7280a57.tar.gz scummvm-rg350-3ce737eb2a1f8477b389f68b81eb01f6a7280a57.tar.bz2 scummvm-rg350-3ce737eb2a1f8477b389f68b81eb01f6a7280a57.zip |
Cleanup
svn-id: r28748
-rw-r--r-- | engines/saga/detection.cpp | 14 | ||||
-rw-r--r-- | engines/saga/detection_tables.h | 25 | ||||
-rw-r--r-- | engines/saga/interface.cpp | 7 | ||||
-rw-r--r-- | engines/saga/saga.h | 5 | ||||
-rw-r--r-- | engines/saga/saveload.cpp | 3 |
5 files changed, 25 insertions, 29 deletions
diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp index d5e12a66f3..29ca0e8bbe 100644 --- a/engines/saga/detection.cpp +++ b/engines/saga/detection.cpp @@ -49,7 +49,6 @@ struct SAGAGameDescription { const GameFontDescription *fontDescriptions; const GameSoundInfo *voiceInfo; const GameSoundInfo *sfxInfo; - const GameSoundInfo *musicInfo; int patchesCount; const GamePatchDescription *patchDescriptions; }; @@ -59,7 +58,18 @@ const bool SagaEngine::isMacResources() const { return (getPlatform() == Common: const GameResourceDescription *SagaEngine::getResourceDescription() { return _gameDescription->resourceDescription; } const GameSoundInfo *SagaEngine::getVoiceInfo() const { return _gameDescription->voiceInfo; } const GameSoundInfo *SagaEngine::getSfxInfo() const { return _gameDescription->sfxInfo; } -const GameSoundInfo *SagaEngine::getMusicInfo() const { return _gameDescription->musicInfo; } +const GameSoundInfo *SagaEngine::getMusicInfo() const { + static GameSoundInfo musicInfo; + musicInfo.resourceType = kSoundPCM; + musicInfo.frequency = 11025; + musicInfo.sampleBits = 16; + // The digital music in the ITE Mac demo version is not stereo + musicInfo.stereo = _gameDescription->gameType == GID_ITE_MACDEMO2 ? false : true; + musicInfo.isBigEndian = false; + musicInfo.isSigned = true; + + return &musicInfo; +} const GameFontDescription *SagaEngine::getFontDescription(int index) { assert(index < _gameDescription->fontsCount); diff --git a/engines/saga/detection_tables.h b/engines/saga/detection_tables.h index c215883c72..bd0c4eef25 100644 --- a/engines/saga/detection_tables.h +++ b/engines/saga/detection_tables.h @@ -105,12 +105,10 @@ static const GameFontDescription IHNMCD_GameFonts[] = { {2}, {3}, {4}, {5}, // frequency, sampleBits, stereo, isBigEndian, isSigned static const GameSoundInfo ITEPC_GameSound = { kSoundPCM, 22050, 16, false, false, true }; static const GameSoundInfo ITEMAC_GameSound = { kSoundPCM, 22050, 16, false, true, true }; -static const GameSoundInfo ITEMACCD_G_GameSound = { kSoundMacPCM, 22050, 8, false, false, false }; static const GameSoundInfo ITEWINDEMO1_GameSound = { kSoundPCM, 22050, 8, false, false, false }; +static const GameSoundInfo ITEMACCD_G_GameSound = { kSoundMacPCM, 22050, 8, false, false, false }; static const GameSoundInfo ITEDISK_GameSound = { kSoundVOC, -1, -1, false, false, true }; static const GameSoundInfo ITEDEMO_GameVoice = { kSoundVOX, 22050, 16, false, false, true }; -static const GameSoundInfo ITEMACDEMO_GameMusic = { kSoundPCM, 11025, 16, false, false, true }; -static const GameSoundInfo ITEMACCD_GameMusic = { kSoundPCM, 11025, 16, true, false, true }; static const GameSoundInfo IHNM_GameSound = { kSoundWAV, -1, -1, false, false, true }; // Patch files. Files not found will be ignored @@ -201,7 +199,6 @@ static const SAGAGameDescription gameDescriptions[] = { ITEDEMO_GameFonts, &ITEDISK_GameSound, &ITEDISK_GameSound, - &ITEMACCD_GameMusic, // note: this version did not originally have digital music 0, NULL, }, @@ -233,7 +230,6 @@ static const SAGAGameDescription gameDescriptions[] = { ITEWINDEMO_GameFonts, &ITEDEMO_GameVoice, &ITEMAC_GameSound, - &ITEMACDEMO_GameMusic, ARRAYSIZE(ITEMacPatch_Files), ITEMacPatch_Files, }, @@ -268,7 +264,6 @@ static const SAGAGameDescription gameDescriptions[] = { ITEWINDEMO_GameFonts, &ITEDEMO_GameVoice, &ITEMAC_GameSound, - &ITEMACCD_GameMusic, ARRAYSIZE(ITEMacPatch_Files), ITEMacPatch_Files, }, @@ -301,7 +296,6 @@ static const SAGAGameDescription gameDescriptions[] = { ITEWINDEMO_GameFonts, &ITEDEMO_GameVoice, &ITEPC_GameSound, - &ITEMACCD_GameMusic, ARRAYSIZE(ITEPatch_Files), ITEPatch_Files, }, @@ -335,7 +329,6 @@ static const SAGAGameDescription gameDescriptions[] = { ITEWINDEMO_GameFonts, &ITEWINDEMO1_GameSound, &ITEWINDEMO1_GameSound, - &ITEMACCD_GameMusic, // note: this version did not originally have digital music ARRAYSIZE(ITEPatch_Files), ITEPatch_Files, }, @@ -372,7 +365,6 @@ static const SAGAGameDescription gameDescriptions[] = { ITEWINDEMO_GameFonts, &ITEMACCD_G_GameSound, &ITEMACCD_G_GameSound, - &ITEMACCD_GameMusic, // note: this version did not originally have digital music 0, NULL, }, @@ -403,7 +395,6 @@ static const SAGAGameDescription gameDescriptions[] = { ITEWINDEMO_GameFonts, &ITEMAC_GameSound, &ITEMAC_GameSound, - &ITEMACCD_GameMusic, ARRAYSIZE(ITEMacPatch_Files), ITEMacPatch_Files, }, @@ -442,7 +433,6 @@ static const SAGAGameDescription gameDescriptions[] = { ITE_GameFonts, &ITEMAC_GameSound, &ITEPC_GameSound, - &ITEMACCD_GameMusic, 0, NULL, }, @@ -473,7 +463,6 @@ static const SAGAGameDescription gameDescriptions[] = { ITE_GameFonts, &ITEPC_GameSound, &ITEPC_GameSound, - &ITEMACCD_GameMusic, ARRAYSIZE(ITEPatch_Files), ITEPatch_Files, }, @@ -503,7 +492,6 @@ static const SAGAGameDescription gameDescriptions[] = { ITE_GameFonts, &ITEPC_GameSound, &ITEPC_GameSound, - &ITEMACCD_GameMusic, // note: this version did not originally have digital music ARRAYSIZE(ITEPatch_Files), ITEPatch_Files, }, @@ -534,7 +522,6 @@ static const SAGAGameDescription gameDescriptions[] = { ITE_GameFonts, &ITEPC_GameSound, &ITEPC_GameSound, - &ITEMACCD_GameMusic, // note: this version did not originally have digital music 0, NULL, }, @@ -566,7 +553,6 @@ static const SAGAGameDescription gameDescriptions[] = { ITE_GameFonts, &ITEDISK_GameSound, &ITEDISK_GameSound, - &ITEMACCD_GameMusic, // note: this version did not originally have digital music 0, NULL, }, @@ -595,7 +581,6 @@ static const SAGAGameDescription gameDescriptions[] = { ITE_GameFonts, &ITEDISK_GameSound, &ITEDISK_GameSound, - &ITEMACCD_GameMusic, // note: this version did not originally have digital music ARRAYSIZE(ITEPatch_Files), ITEPatch_Files, }, @@ -634,7 +619,6 @@ static const SAGAGameDescription gameDescriptions[] = { IHNMDEMO_GameFonts, &IHNM_GameSound, &IHNM_GameSound, - NULL, 0, NULL, }, @@ -673,7 +657,6 @@ static const SAGAGameDescription gameDescriptions[] = { IHNMCD_GameFonts, &IHNM_GameSound, &IHNM_GameSound, - NULL, 0, NULL, }, @@ -713,7 +696,6 @@ static const SAGAGameDescription gameDescriptions[] = { IHNMCD_GameFonts, &IHNM_GameSound, &IHNM_GameSound, - NULL, 0, NULL, }, @@ -752,7 +734,6 @@ static const SAGAGameDescription gameDescriptions[] = { IHNMCD_GameFonts, &IHNM_GameSound, &IHNM_GameSound, - NULL, 0, NULL, }, @@ -791,7 +772,6 @@ static const SAGAGameDescription gameDescriptions[] = { IHNMCD_GameFonts, &IHNM_GameSound, &IHNM_GameSound, - NULL, 0, NULL, }, @@ -830,11 +810,10 @@ static const SAGAGameDescription gameDescriptions[] = { IHNMCD_GameFonts, &IHNM_GameSound, &IHNM_GameSound, - NULL, 0, NULL, }, - { AD_TABLE_END_MARKER, 0, 0, 0, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL } + { AD_TABLE_END_MARKER, 0, 0, 0, 0, NULL, 0, NULL, NULL, NULL, 0, NULL } }; } // End of namespace Saga diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp index 00e76680fd..c73741347d 100644 --- a/engines/saga/interface.cpp +++ b/engines/saga/interface.cpp @@ -1154,10 +1154,9 @@ bool Interface::processTextInput(uint16 ascii) { uint tempWidth; memset(tempString, 0, SAVE_TITLE_SIZE); ch[1] = 0; - // ITE has a maximum save title size of SAVE_TITLE_SIZE (28), but IHNM has a slightly smaller - // save title size (21). We only limit the save title size during text input, to preserve - // backwards compatibility with older save games - uint save_title_size = _vm->getGameType() == GType_ITE ? SAVE_TITLE_SIZE : SAVE_TITLE_SIZE - 6; + // IHNM has a smaller save title size than ITE. We only limit the save title size during text input + // in IHNM, to preserve backwards compatibility with older save games + uint save_title_size = _vm->getGameType() == GType_ITE ? SAVE_TITLE_SIZE : IHNM_SAVE_TITLE_SIZE; switch (ascii) { case 13: diff --git a/engines/saga/saga.h b/engines/saga/saga.h index 4f59e729bd..fc74702143 100644 --- a/engines/saga/saga.h +++ b/engines/saga/saga.h @@ -69,7 +69,12 @@ struct StringList; #define MAXPATH 512 //TODO: remove +// Note that IHNM has a smaller save title size than ITE +// We allocate the ITE save title size in savegames, to +// preserve savegame backwards compatibility. We only check +// for IHNM's save title during text input #define SAVE_TITLE_SIZE 28 +#define IHNM_SAVE_TITLE_SIZE 22 #define MAX_SAVES 96 #define MAX_FILE_NAME 256 diff --git a/engines/saga/saveload.cpp b/engines/saga/saveload.cpp index f3b6c3947a..3179095705 100644 --- a/engines/saga/saveload.cpp +++ b/engines/saga/saveload.cpp @@ -169,6 +169,9 @@ void SagaEngine::save(const char *fileName, const char *saveName) { _saveHeader.type = MKID_BE('SAGA'); _saveHeader.size = 0; _saveHeader.version = CURRENT_SAGA_VER; + // Note that IHNM has a smaller save title size than ITE + // We allocate the ITE save title size here, to preserve + // savegame backwards compatibility strncpy(_saveHeader.name, saveName, SAVE_TITLE_SIZE); out->writeUint32BE(_saveHeader.type); |