[sldev] Texture caching

Strife Onizuka blindwanderer at gmail.com
Tue Mar 20 15:34:51 PDT 2007


The patch does something different then what it is replacing. The orig is
checking that the filesize contains the expected number of entries. The new
version just checks to make sure it contains complete entries.

On 3/20/07, Jason Giglio <gigstaggart at gmail.com> wrote:
>
> 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
> _______________________________________________
> Click here to unsubscribe or manage your list subscription:
> /index.html
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.secondlife.com/pipermail/sldev/attachments/20070320/c9c5acdf/attachment.htm


More information about the SLDev mailing list