From 2317e3fa58f02b6b482b124d6a63639fb73d2a85 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 15 May 2016 16:13:25 +0200 Subject: KYRA: Simplify Kyra1 audio track filename handling --- engines/kyra/resource.h | 1 - engines/kyra/staticres.cpp | 22 +++------------------- 2 files changed, 3 insertions(+), 20 deletions(-) (limited to 'engines') diff --git a/engines/kyra/resource.h b/engines/kyra/resource.h index 3ab08a4c7c..c3ebf6e5fe 100644 --- a/engines/kyra/resource.h +++ b/engines/kyra/resource.h @@ -203,7 +203,6 @@ enum KyraResources { k1ConfigStrings, k1AudioTracks, - k1AudioTracks2, k1AudioTracksIntro, k1CreditsStrings, diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp index da8eec1c60..e99321ddcb 100644 --- a/engines/kyra/staticres.cpp +++ b/engines/kyra/staticres.cpp @@ -39,7 +39,7 @@ namespace Kyra { -#define RESFILE_VERSION 87 +#define RESFILE_VERSION 88 namespace { bool checkKyraDat(Common::SeekableReadStream *file) { @@ -805,19 +805,11 @@ void KyraEngine_LoK::initStaticResource() { } // audio resource assignment - int size1, size2; - const char *const *soundfiles1 = _staticres->loadStrings(k1AudioTracks, size1); - const char *const *soundfiles2 = _staticres->loadStrings(k1AudioTracks2, size2); - int soundFilesSize = size1 + size2; + int soundFilesSize; + const char *const *soundFiles = _staticres->loadStrings(k1AudioTracks, soundFilesSize); int soundFilesIntroSize = 0; int cdaTableSize = 0; - const char **soundFiles = 0; - if (soundFilesSize) { - soundFiles = new const char*[soundFilesSize]; - for (int i = 0; i < soundFilesSize; i++) - soundFiles[i] = (i < size1) ? soundfiles1[i] : soundfiles2[i - size1]; - } const char *const *soundFilesIntro = _staticres->loadStrings(k1AudioTracksIntro, soundFilesIntroSize); const int32 *cdaTable = (const int32 *)_staticres->loadRawData(k1TownsCDATable, cdaTableSize); @@ -838,14 +830,6 @@ void KyraEngine_LoK::initStaticResource() { SoundResourceInfo_PC98 resInfoIngame("KYRAM%d.DAT"); _sound->initAudioResourceInfo(kMusicIntro, &resInfoIntro); _sound->initAudioResourceInfo(kMusicIngame, &resInfoIngame); - - // This should never happen, but we add this to silence static - // analysis tools which complain about memory leaks. - delete[] soundFiles; - } else { - // This should never happen, but we add this to silence static - // analysis tools which complain about memory leaks. - delete[] soundFiles; } } -- cgit v1.2.3