[Scummvm-cvs-logs] SF.net SVN: scummvm: [25216] scummvm/trunk/sound/mods
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Sat Jan 27 01:11:16 CET 2007
Revision: 25216
http://scummvm.svn.sourceforge.net/scummvm/?rev=25216&view=rev
Author: fingolfin
Date: 2007-01-26 16:11:15 -0800 (Fri, 26 Jan 2007)
Log Message:
-----------
Removing two FIXMEs, based on what madmoose told me on #scummvm
Modified Paths:
--------------
scummvm/trunk/sound/mods/module.cpp
scummvm/trunk/sound/mods/module.h
Modified: scummvm/trunk/sound/mods/module.cpp
===================================================================
--- scummvm/trunk/sound/mods/module.cpp 2007-01-26 23:26:28 UTC (rev 25215)
+++ scummvm/trunk/sound/mods/module.cpp 2007-01-27 00:11:15 UTC (rev 25216)
@@ -33,12 +33,7 @@
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 @@
}
}
- 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 @@
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;
}
}
Modified: scummvm/trunk/sound/mods/module.h
===================================================================
--- scummvm/trunk/sound/mods/module.h 2007-01-26 23:26:28 UTC (rev 25215)
+++ scummvm/trunk/sound/mods/module.h 2007-01-27 00:11:15 UTC (rev 25216)
@@ -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 @@
public:
byte songname[21];
- sample_t sample[32];
+ static const int NUM_SAMPLES = 31;
+ sample_t sample[NUM_SAMPLES];
byte songlen;
byte undef;
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