diff options
author | Nicola Mettifogo | 2007-09-17 18:22:52 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-09-17 18:22:52 +0000 |
commit | ef0df159f14ffae39860801db1c6c7f5c7872137 (patch) | |
tree | 3d013309447f10ec0958c9be2ac636575cbde0f6 /engines/parallaction/parallaction.cpp | |
parent | c4aa4fe644a13d381a9140db6c7b93db7eb1f30c (diff) | |
download | scummvm-rg350-ef0df159f14ffae39860801db1c6c7f5c7872137.tar.gz scummvm-rg350-ef0df159f14ffae39860801db1c6c7f5c7872137.tar.bz2 scummvm-rg350-ef0df159f14ffae39860801db1c6c7f5c7872137.zip |
* moved Table handling to objects.cpp
* added helper functions to load tables from files
* fixed occasional lock-ups on location change because of broken Table deallocation
svn-id: r28933
Diffstat (limited to 'engines/parallaction/parallaction.cpp')
-rw-r--r-- | engines/parallaction/parallaction.cpp | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 9b2ac2a6a1..7b641bf838 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -752,62 +752,6 @@ void Parallaction::runJobs() { } -Table::Table(uint32 size) : _size(size), _used(0), _disposeMemory(true) { - _data = (char**)malloc(sizeof(char*)*size); -} - -Table::Table(uint32 size, const char **data) : _size(size), _used(size), _disposeMemory(false) { - _data = const_cast<char**>(data); -} - -Table::~Table() { - - if (!_disposeMemory) return; - - clear(); - - free(_data); - -} - -void Table::addData(const char* s) { - - if (!(_used < _size)) - error("Table overflow"); - - _data[_used++] = strdup(s); - -} - -uint16 Table::lookup(const char* s) { - - for (uint16 i = 0; i < _used; i++) { - if (!scumm_stricmp(_data[i], s)) return i + 1; - } - - return notFound; -} - -void Table::clear() { - for (uint32 i = 0; i < _used; i++) - free(_data[i]); - - _used = 0; -} - -FixedTable::FixedTable(uint32 size, uint32 fixed) : Table(size), _numFixed(fixed) { -} - -FixedTable::~FixedTable() { - _numFixed = 0; -} - -void FixedTable::clear() { - for (uint32 i = _numFixed; i < _used; i++) { - free(_data[i]); - _used--; - } -} void Parallaction::pushParserTables(OpcodeSet *opcodes, Table *statements) { |