aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/gc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/engine/gc.cpp')
-rw-r--r--engines/sci/engine/gc.cpp29
1 files changed, 19 insertions, 10 deletions
diff --git a/engines/sci/engine/gc.cpp b/engines/sci/engine/gc.cpp
index b229490570..6c1713bed9 100644
--- a/engines/sci/engine/gc.cpp
+++ b/engines/sci/engine/gc.cpp
@@ -143,22 +143,31 @@ AddrSet *findAllActiveReferences(EngineState *s) {
const Common::Array<SegmentObj *> &heap = s->_segMan->getSegments();
uint heapSize = heap.size();
- // Init: Explicitly loaded scripts
for (uint i = 1; i < heapSize; i++) {
- if (heap[i] && heap[i]->getType() == SEG_TYPE_SCRIPT) {
- Script *script = (Script *)heap[i];
+ if (heap[i]) {
+ // Init: Explicitly loaded scripts
+ if (heap[i]->getType() == SEG_TYPE_SCRIPT) {
+ Script *script = (Script *)heap[i];
- if (script->getLockers()) { // Explicitly loaded?
- wm.pushArray(script->listObjectReferences());
+ if (script->getLockers()) { // Explicitly loaded?
+ wm.pushArray(script->listObjectReferences());
+ }
}
- }
- }
#ifdef ENABLE_SCI32
- // Init: ScrollWindows
- if (g_sci->_gfxControls32)
- wm.pushArray(g_sci->_gfxControls32->listObjectReferences());
+ // Init: Explicitly opted-out bitmaps
+ else if (heap[i]->getType() == SEG_TYPE_BITMAP) {
+ BitmapTable *bt = static_cast<BitmapTable *>(heap[i]);
+
+ for (uint j = 0; j < bt->_table.size(); j++) {
+ if (bt->_table[j].data && bt->_table[j].data->getShouldGC() == false) {
+ wm.push(make_reg(i, j));
+ }
+ }
+ }
#endif
+ }
+ }
debugC(kDebugLevelGC, "[GC] -- Finished explicitly loaded scripts, done with root set");