[Scummvm-devel] TOON memory usage

Marcus Comstedt marcus at mc.pp.se
Mon Jul 18 14:28:01 CEST 2011


Hi all.

I've been looking a little bit on the memory usage in TOON, and why it
fails to run on the Dreamcast, which has 16MB.

The main memory hog seems to be the path-finding heap, which is 6MB.

I've read the comment about why it is allocated for a 1280x400 screen
instead of a 640x400 screen, but what I don't find any explanation of
is why the heap is allocated with twice as many nodes as the maximum
number of pixels.

In PathFindingHeap::init(int32 size):

	_data = new HeapDataGrid[size * 2];

Why *2?  I don't see any evidence in the code for two nodes being used
for a single pixel, so *1 should be enough, no?  (It's possible that a
+1 is needed though, because the code seems to start using the array
at index 1 instead of 0...)

Would someone care to explain, please?  :-)


  // Marcus






More information about the Scummvm-devel mailing list