diff options
Diffstat (limited to 'engines/teenagent/music.h')
-rw-r--r-- | engines/teenagent/music.h | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/engines/teenagent/music.h b/engines/teenagent/music.h index 5a8caba9d7..56f3db602e 100644 --- a/engines/teenagent/music.h +++ b/engines/teenagent/music.h @@ -54,18 +54,27 @@ protected: } channels[3]; }; - struct { - const byte *data; - uint32 size; + struct Sample { + byte *data; + uint size; + Sample(): data(0), size(0) {} + ~Sample() { delete[] data; } + + void resize(uint s) { + if (s != size) { + delete[] data; + data = new byte[s]; + size = s; + } + } + void clear() { + delete[] data; + data = 0; + size = 0; + } } _samples[256]; byte sampleCount; - struct { - byte volume; - const byte *data; - uint32 size; - } _channels[3]; - Common::Array<Row> _rows; uint _currRow; |