diff options
Diffstat (limited to 'plugins/adplug/adplug/u6m.h')
-rw-r--r-- | plugins/adplug/adplug/u6m.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/plugins/adplug/adplug/u6m.h b/plugins/adplug/adplug/u6m.h index 30e7f3b5..f09d0211 100644 --- a/plugins/adplug/adplug/u6m.h +++ b/plugins/adplug/adplug/u6m.h @@ -20,8 +20,7 @@ * This code extends the Adlib Winamp plug-in by Simon Peter <dn.tlp@gmx.net> */ -#include <stack> - +#include <string.h> #include "player.h" #define default_dict_size 4096 // because maximum codeword size == 12 bits @@ -32,7 +31,7 @@ class Cu6mPlayer: public CPlayer public: static CPlayer *factory(Copl *newopl); - Cu6mPlayer(Copl *newopl) : CPlayer(newopl), song_data(0) + Cu6mPlayer(Copl *newopl) : CPlayer(newopl), song_data(0), subsong_stack_sz(0) { }; @@ -42,14 +41,14 @@ class Cu6mPlayer: public CPlayer if(song_data) delete[] song_data; }; - bool load(const std::string &filename, const CFileProvider &fp); + bool load(const char *filename, const CFileProvider &fp); bool update(); void rewind(int subsong); float getrefresh(); - std::string gettype() + const char * gettype() { - return std::string("Ultima 6 Music"); + return "Ultima 6 Music"; }; protected: @@ -109,7 +108,9 @@ class Cu6mPlayer: public CPlayer int song_pos; // current offset within the song int loop_position; // position of the loop point int read_delay; // delay (in timer ticks) before further song data is read - std::stack<subsong_info> subsong_stack; + enum {MAX_SUBSONG_STACK = 100}; + subsong_info subsong_stack[MAX_SUBSONG_STACK]; + int subsong_stack_sz; int instrument_offsets[9]; // offsets of the adlib instrument data // vibrato ("vb") @@ -163,6 +164,7 @@ class Cu6mPlayer: public CPlayer bool lzw_decompress(data_block source, data_block dest); int get_next_codeword (long& bits_read, unsigned char *source, int codeword_size); void output_root(unsigned char root, unsigned char *destination, long& position); - void get_string(int codeword, MyDict& dictionary, std::stack<unsigned char>& root_stack); + //void get_string(int codeword, MyDict& dictionary, std::stack<unsigned char>& root_stack); + void get_string(int codeword, MyDict& dictionary, unsigned char *root_stack, int &root_stack_size); }; |