MOHAWK: Don't use a fixed-size array for cue lists.

svn-id: r55335
This commit is contained in:
Alyssa Milburn 2011-01-19 22:41:12 +00:00
parent a3e9197805
commit d68c8547c5
2 changed files with 7 additions and 5 deletions

View File

@ -404,6 +404,7 @@ Audio::AudioStream *Sound::makeMohawkWaveStream(Common::SeekableReadStream *stre
else
debug(2, "Cue# chunk found with %d point(s)!", cueList->pointCount);
cueList->points.resize(cueList->pointCount);
for (uint16 i = 0; i < cueList->pointCount; i++) {
cueList->points[i].sampleFrame = stream->readUint32BE();

View File

@ -41,7 +41,6 @@
namespace Mohawk {
#define MAX_CHANNELS 2 // Can there be more than 2?
#define CUE_MAX 256
struct SLSTRecord {
uint16 index;
@ -85,13 +84,15 @@ struct ADPCMStatus { // Holds ADPCM status data, but is irrelevant for us.
} *statusItems;
};
struct CueListPoint {
uint32 sampleFrame;
Common::String name;
};
struct CueList {
uint32 size;
uint16 pointCount;
struct {
uint32 sampleFrame;
Common::String name;
} points[CUE_MAX];
Common::Array<CueListPoint> points;
};
enum {