|
From: Jose' C. <cru...@ce...> - 2004-12-18 08:41:39
|
Il giorno 17/dic/04, alle 23:31, James W. Walker ha scritto:
> In ir_texture_convert_mipmap, we have:
>
> // Work out how many images are contained in the mipmap
> if (theMipmap.useMipmapping)
> {
> numImages = 0;
> n = E3Num_Min(theMipmap.mipmaps[0].width,
> theMipmap.mipmaps[1].height);
> while (n > 1)
> {
> n /= 2;
> numImages += 1;
> }
> }
> else
> numImages = 1;
>
> This caught my attention because the subscript [1] for the height
> seemed out of place. But even if the width were the limiting factor,
> the formula seems wrong. For instance suppose we start with n = 5.
> The first time through the loop, n becomes 2 and numImages becomes 1.
> The second pass makes n become 1 and numImages become 2, and then we
> exit the loop. But numImages should be 3: sizes 5, 2, and 1.
yes, one of two is wrong
or we init numImages to 1 or test for (n >= 1)
but why we have to go down to a 1*1 texture?
Pax et Bonum
# dott. Jose' Cruanyes Aguilar - C.E. Soft srl
# Pzza. Firenze,4 MILANO - XX Settembre 10, CREMONA
# 02,33603122 0372,460602
|