Re: [TuxKart-devel] Slowness - really related with Karts?
Status: Alpha
Brought to you by:
sjbaker
|
From: James G. <j....@vi...> - 2004-09-05 21:05:05
|
On Sun, 2004-09-05 at 22:00, Ricardo Cruz wrote:
> About the cache of textures, that is not practicable, since text is different
> all the time. You'd need tons of memory to cache all different combinations
> of texts.
> What I currently do is to cache TTF_Font, which already helps speeding it up.
> Though, I dunno if TTF_OpenFont() is all that expensive.
It is possible to cache text textures. For numbers you have to do it in
parts - rather than having "9", "99" and "999", you just cache textures
for the numbers 0-9 for each font you want to draw numbers with, and
then put the textures together to create numbers, timers, etc. You also
need an individual texture for a colon (":") and "mph".
You then have textures for "Wrong Way!", "Ready!", "Set!", "Go!",
"Congratulations!", "1st", "2nd", "3rd", etc, etc.
I've started work but it's very boring.
James
|