[sldev] Texture caching

Jason Giglio gigstaggart at gmail.com
Tue Mar 20 14:40:56 PDT 2007


Guido wrote:
> On Tuesday 20 March 2007 21:59, Jason Giglio hit keys in the following order:
>> Dzonatas wrote:
>>> Also, in your patch:
>>>
>>> -    if (num_entries * (S32)sizeof(Entry) != filesize)
>>> +
>>> +    //make sure the file is a multiple of the Entry size
>>> +    if( filesize % (S32)sizeof(Entry) != 0)
>>>
>>> No need for your comment, as I can read the code just fine. However, I
>>> prefer the way you used the "%".
>> Considering the file has nearly no comments right now, I figured
>> anything was an improvement.  The way the code was written before made
>> it less obvious what it was doing anyway.
> 
> Multiplications are much faster than divisions, so I'd keep the code the way 
> it was and just add a little comment to explain what happens.

I realized that too, but the code is on a rare path, better be clear 
about it than put in some premature optimization.  Lots of discussion 
over a one-line nonfunctional change. :P

-Jason


More information about the SLDev mailing list