AuroraSim: non-power-of-two support.

This commit is contained in:
Lirusaito
2013-01-20 22:35:21 -05:00
parent 415bcd2b6c
commit fa8e1f033b
2 changed files with 8 additions and 18 deletions

View File

@@ -566,7 +566,7 @@ void LLImageGL::setSize(S32 width, S32 height, S32 ncomponents, S32 discard_leve
// Check if dimensions are a power of two!
if (!checkSize(width,height))
{
llerrs << llformat("Texture has non power of two dimension: %dx%d",width,height) << llendl;
llwarns << llformat("Texture has non power of two dimension: %dx%d",width,height) << " Unless on Aurora-Sim, beware." << llendl;
}
if (mTexName)

View File

@@ -82,7 +82,8 @@ void LLPatchVertexArray::create(U32 surface_width, U32 patch_width, F32 meters_p
surface_order += 1;
}
if (power_of_two == (surface_width-1))
if (power_of_two != (surface_width-1))
surface_width = power_of_two + 1;
{
mSurfaceWidth = surface_width;
@@ -99,16 +100,11 @@ void LLPatchVertexArray::create(U32 surface_width, U32 patch_width, F32 meters_p
power_of_two *= 2;
patch_order += 1;
}
if (power_of_two == patch_width)
{
mPatchWidth = patch_width;
mPatchOrder = patch_order;
}
else // patch_width is not a power of two...
{
mPatchWidth = 0;
mPatchOrder = 0;
}
if (power_of_two != patch_width)
patch_width = power_of_two;
mPatchWidth = patch_width;
mPatchOrder = patch_order;
}
else // patch_width is not a factor of (surface_width - 1)...
{
@@ -116,12 +112,6 @@ void LLPatchVertexArray::create(U32 surface_width, U32 patch_width, F32 meters_p
mPatchOrder = 0;
}
}
else // surface_width is not a power of two...
{
mSurfaceWidth = 0;
mPatchWidth = 0;
mPatchOrder = 0;
}
// PART 2 -- Allocate memory for the render level table
if (mPatchWidth > 0)