Another stab at making textures work as they should

This commit is contained in:
Siana Gearz
2012-03-27 16:23:55 +02:00
parent ce1607cf17
commit 3acf6dc001
3 changed files with 18 additions and 13 deletions

View File

@@ -382,16 +382,16 @@ static S32 cald_data_size_help(S32 w, S32 h, S32 comp, S32 discard_level, F32 ra
//static
S32 LLImageJ2C::calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, F32 rate)
{
static const LLCachedControl<F32> exponent("SianaJ2CSizeExponent", 1.0f);
static const LLCachedControl<S32> offset("SianaJ2CSizeOffset", 0);
S32 size = cald_data_size_help(w, h, comp, discard_level, rate);
S32 size_d0 = cald_data_size_help(w, h, comp, 0, rate);
static const LLCachedControl<F32> exponent("SianaJ2CSizeExponent", 1.0f);
static const LLCachedControl<S32> offset("SianaJ2CSizeOffset", 0);
S32 size = cald_data_size_help(w, h, comp, discard_level, rate);
S32 size_d0 = cald_data_size_help(w, h, comp, 0, rate);
llassert_always(size_d0);
S32 bytes = pow(size/size_d0, exponent)*size_d0 + offset;
bytes = llmax (0, bytes - 600);
bytes = ((bytes + (1000 - 1))/1000)*1000 + 600;
return bytes;
llassert_always(size_d0);
S32 bytes = size_d0*pow((double)size/size_d0, (double)exponent) + offset;
bytes = llmax (0, bytes - 600);
bytes = ((bytes + (1000 - 1))/1000)*1000 + 600;
return bytes;
}
S32 LLImageJ2C::calcHeaderSize()