[ scummvm-Patches-1635584 ] Better (?) memory allocation in NUT font renderer

SourceForge.net noreply at sourceforge.net
Mon Jan 15 07:07:29 CET 2007


Patches item #1635584, was opened at 2007-01-15 07:07
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418822&aid=1635584&group_id=37116

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Torbjörn Andersson (eriktorbjorn)
Assigned to: Nobody/Anonymous (nobody)
Summary: Better (?) memory allocation in NUT font renderer

Initial Comment:
Recently, Fingolfin wrote a mail to scummvm-devel about ScummVM's memory footprint. One of the areas he speculated would be a good place to save memory was the NUT font renderer used by The Curse of Monkey Island, since it pre-decodes the entire font.

One possibility (suggested in the mail) would be to store the undecoded font file in memory and decode it on the fly when the font is actually rendered. Unfortunately, the total size of the decoded glyphs is, as far as I can tell, actually smaller than the entire undecoded font file.

Of course, the font file also contains the dimensions for each glyph (which we also read in advance), tags, etc.

So all this patch does is to change the memory allocation so that we'll allocate five larger memory chunks (one for each font) instead of 1280 smaller ones (one for each glyph). Surely that should save the memory allocator some bookkeeping information?

Another possible, and trivial, saving which I didn't want to mix up in this patch might be to 16-bit integers instead of plain int in NutRenderer's _chars[] array.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418822&aid=1635584&group_id=37116




More information about the Scummvm-tracker mailing list