diff options
author | Max Horn | 2009-05-18 12:35:42 +0000 |
---|---|---|
committer | Max Horn | 2009-05-18 12:35:42 +0000 |
commit | a0b6f21a1a6d9e102bc30df963d011b988e1aae6 (patch) | |
tree | 22910bf622a9543a7d03004d41a36dcb607ef63d /engines | |
parent | 62876a5ad5bd03c227188dd8bf297fb4e2096b6e (diff) | |
download | scummvm-rg350-a0b6f21a1a6d9e102bc30df963d011b988e1aae6.tar.gz scummvm-rg350-a0b6f21a1a6d9e102bc30df963d011b988e1aae6.tar.bz2 scummvm-rg350-a0b6f21a1a6d9e102bc30df963d011b988e1aae6.zip |
SCI: Fixed Table::initTable to invoke _table.clear()
svn-id: r40687
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/seg_manager.cpp | 25 | ||||
-rw-r--r-- | engines/sci/engine/vm.h | 4 |
2 files changed, 11 insertions, 18 deletions
diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp index b9ec613fb8..d56f51ce8e 100644 --- a/engines/sci/engine/seg_manager.cpp +++ b/engines/sci/engine/seg_manager.cpp @@ -906,7 +906,6 @@ Clone *SegManager::alloc_Clone(reg_t *addr) { if (!Clones_seg_id) { table = (CloneTable *)allocNonscriptSegment(MEM_OBJ_CLONES, &(Clones_seg_id)); - table->initTable(); } else table = (CloneTable *)_heap[Clones_seg_id]; @@ -920,11 +919,9 @@ List *SegManager::alloc_List(reg_t *addr) { ListTable *table; int offset; - if (!Lists_seg_id) { - table = (ListTable *)allocNonscriptSegment(MEM_OBJ_LISTS, &(Lists_seg_id)); - table->initTable(); - } else - table = (ListTable *)_heap[Lists_seg_id]; + if (!Lists_seg_id) + allocNonscriptSegment(MEM_OBJ_LISTS, &(Lists_seg_id)); + table = (ListTable *)_heap[Lists_seg_id]; offset = table->allocEntry(); @@ -936,11 +933,9 @@ Node *SegManager::alloc_Node(reg_t *addr) { NodeTable *table; int offset; - if (!Nodes_seg_id) { - table = (NodeTable *)allocNonscriptSegment(MEM_OBJ_NODES, &(Nodes_seg_id)); - table->initTable(); - } else - table = (NodeTable *)_heap[Nodes_seg_id]; + if (!Nodes_seg_id) + allocNonscriptSegment(MEM_OBJ_NODES, &(Nodes_seg_id)); + table = (NodeTable *)_heap[Nodes_seg_id]; offset = table->allocEntry(); @@ -952,11 +947,9 @@ Hunk *SegManager::alloc_Hunk(reg_t *addr) { HunkTable *table; int offset; - if (!Hunks_seg_id) { - table = (HunkTable *)allocNonscriptSegment(MEM_OBJ_HUNK, &(Hunks_seg_id)); - table->initTable(); - } else - table = (HunkTable *)_heap[Hunks_seg_id]; + if (!Hunks_seg_id) + allocNonscriptSegment(MEM_OBJ_HUNK, &(Hunks_seg_id)); + table = (HunkTable *)_heap[Hunks_seg_id]; offset = table->allocEntry(); diff --git a/engines/sci/engine/vm.h b/engines/sci/engine/vm.h index e8c4ed8090..97ad7a758c 100644 --- a/engines/sci/engine/vm.h +++ b/engines/sci/engine/vm.h @@ -521,13 +521,13 @@ struct Table : public MemObject { public: Table() { - entries_used = 0; - first_free = HEAPENTRY_INVALID; + initTable(); } void initTable() { entries_used = 0; first_free = HEAPENTRY_INVALID; + _table.clear(); } int allocEntry() { |