diff options
author | Max Horn | 2007-01-27 00:11:15 +0000 |
---|---|---|
committer | Max Horn | 2007-01-27 00:11:15 +0000 |
commit | 8205cd9d3df142dca001294ca24af1c98c34bb5c (patch) | |
tree | d8a1279ed04d3ad665fe9a8bc382302056553f40 /sound | |
parent | 3be5b0cca2b44537895166c9b5218a0c55b82595 (diff) | |
download | scummvm-rg350-8205cd9d3df142dca001294ca24af1c98c34bb5c.tar.gz scummvm-rg350-8205cd9d3df142dca001294ca24af1c98c34bb5c.tar.bz2 scummvm-rg350-8205cd9d3df142dca001294ca24af1c98c34bb5c.zip |
Removing two FIXMEs, based on what madmoose told me on #scummvm
svn-id: r25216
Diffstat (limited to 'sound')
-rw-r--r-- | sound/mods/module.cpp | 13 | ||||
-rw-r--r-- | sound/mods/module.h | 16 |
2 files changed, 6 insertions, 23 deletions
diff --git a/sound/mods/module.cpp b/sound/mods/module.cpp index d6f1d3eb4d..9a518f482a 100644 --- a/sound/mods/module.cpp +++ b/sound/mods/module.cpp @@ -33,12 +33,7 @@ bool Module::load(Common::ReadStream &st) { st.read(songname, 20); songname[20] = '\0'; - // FIXME: We define sample to have 32 entries, - // yet we only setup 31 of these -- is this on - // purpose, or an off-by-one error? This should - // be clarified by either adding a comment explaining - // this odditiy, or by fixing the off-by-one-bug. - for (int i = 0; i < 31; ++i) { + for (int i = 0; i < NUM_SAMPLES; ++i) { st.read(sample[i].name, 22); sample[i].name[22] = '\0'; sample[i].len = 2 * st.readUint16BE(); @@ -79,7 +74,7 @@ bool Module::load(Common::ReadStream &st) { } } - for (int i = 0; i < 31; ++i) { + for (int i = 0; i < NUM_SAMPLES; ++i) { if (!sample[i].len) sample[i].data = 0; else { @@ -96,14 +91,14 @@ bool Module::load(Common::ReadStream &st) { Module::Module() { pattern = 0; - for (int i = 0; i < 31; ++i) { + for (int i = 0; i < NUM_SAMPLES; ++i) { sample[i].data = 0; } } Module::~Module() { delete[] pattern; - for (int i = 0; i < 31; ++i) { + for (int i = 0; i < NUM_SAMPLES; ++i) { delete[] sample[i].data; } } diff --git a/sound/mods/module.h b/sound/mods/module.h index f56e42767b..b62a8f47cb 100644 --- a/sound/mods/module.h +++ b/sound/mods/module.h @@ -28,19 +28,6 @@ namespace Modules { -/* - * FIXME: Is the following comment still valid? If so, - * it should be marked accordingly, and maybe added to our - * TODO list on the Wiki (conserving memory is always a big - * boon for our smaller targets). - * - * Storing notes and patterns like this - * wastes insane amounts of memory. - * - * They should be stored in memory - * like they are in the file. - */ - #include "common/pack-start.h" // START STRUCT PACKING struct note_t { @@ -67,7 +54,8 @@ class Module { public: byte songname[21]; - sample_t sample[32]; + static const int NUM_SAMPLES = 31; + sample_t sample[NUM_SAMPLES]; byte songlen; byte undef; |