aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/staticres.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2016-05-15 16:13:25 +0200
committerJohannes Schickel2016-05-15 16:13:25 +0200
commit2317e3fa58f02b6b482b124d6a63639fb73d2a85 (patch)
tree2a334a5737850b85058fa5381b5683a21824f4b4 /engines/kyra/staticres.cpp
parent18193d170e37e0744ad0a9dfe6beed0e2238f9bd (diff)
downloadscummvm-rg350-2317e3fa58f02b6b482b124d6a63639fb73d2a85.tar.gz
scummvm-rg350-2317e3fa58f02b6b482b124d6a63639fb73d2a85.tar.bz2
scummvm-rg350-2317e3fa58f02b6b482b124d6a63639fb73d2a85.zip
KYRA: Simplify Kyra1 audio track filename handling
Diffstat (limited to 'engines/kyra/staticres.cpp')
-rw-r--r--engines/kyra/staticres.cpp22
1 files changed, 3 insertions, 19 deletions
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;
}
}