glob2-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[glob2-devel] Some potential optimization in libgag


From: Stéphane Magnenat
Subject: [glob2-devel] Some potential optimization in libgag
Date: Mon, 10 Sep 2007 20:43:06 +0200
User-agent: KMail/1.9.7

Hi everybody,

As we are talking about speed in graphics layer, let me share with you some 
bit of sad true I was holding for myself ;-)
As you know, color-rotated sprites are rendered on demand and cached for later 
use. As your also know the colors of rotation depend on the number of player 
in the game (player_i.yue = (i * 2 * M_PI) / playerCount). This is fine for a 
single game. But if you start several games with number of players that are 
not multiples, for instance prime numbers such as 3, 5, 7, 11... new versions 
of sprite are constantly generated. This is not a too big problem, because :
- this is bounded by the maximum number of players,
- proportion of prime numbers goes low as numbers go high,
- in virtual memory/texture allocation we trust.

Nevertheless, it would be good to clear color caches if the new game has a 
different number of players than the previous one.

Have a nice day,

Steph

-- 
http://stephane.magnenat.net




reply via email to

[Prev in Thread] Current Thread [Next in Thread]