-Sanity checks from snowglobe. ...

-Null terminated a string buffer.
-Mutex locks are expensive.
-Realloc is my friend.
-But leaks are not.
-Nor are unused variables.
-And buffer overruns should get lost.
-bindManual shouldnt return failure if texture's already bound.
-Pulled windlight and classic clouds apart into unique rendertypes.
-'Client or Account' savedsettings stuff is now moar bettar. (and efficient)
-Replaced LLSavedSettingsGlue with something that supports gSavedSettings, gSavedPerAccountSettings, and gCOASavedSettings

-Added 'Enable Classic Clouds' checkbox to ascet performance settings panel
-New cards added to gpu table.
-General cleaning...
-How2spell 'dimensions'?
This commit is contained in:
unknown
2010-10-01 00:35:39 -05:00
parent 7b409eb7ab
commit 3e8a7172db
36 changed files with 361 additions and 244 deletions

View File

@@ -42,17 +42,12 @@
// LLImagePNG
// ---------------------------------------------------------------------------
LLImagePNG::LLImagePNG()
: LLImageFormatted(IMG_CODEC_PNG),
mTmpWriteBuffer(NULL)
: LLImageFormatted(IMG_CODEC_PNG)
{
}
LLImagePNG::~LLImagePNG()
{
if (mTmpWriteBuffer)
{
delete[] mTmpWriteBuffer;
}
}
// Virtual
@@ -121,14 +116,34 @@ BOOL LLImagePNG::encode(const LLImageRaw* raw_image, F32 encode_time)
// Image logical size
setSize(raw_image->getWidth(), raw_image->getHeight(), raw_image->getComponents());
// Temporary buffer to hold the encoded image. Note: the final image
// size should be much smaller due to compression.
if (mTmpWriteBuffer)
{
delete[] mTmpWriteBuffer;
}
U32 bufferSize = getWidth() * getHeight() * getComponents() + 1024;
U8* mTmpWriteBuffer = new U8[ bufferSize ];
//New implementation
allocateData(bufferSize); //Set to largest possible size.
if(isBufferInvalid()) //Checking
{
setLastError("LLImagePNG::encode failed allocateData");
return FALSE;
}
// Delegate actual encoding work to wrapper
LLPngWrapper pngWrapper;
if (! pngWrapper.writePng(raw_image, getData()))
{
setLastError(pngWrapper.getErrorMessage());
return FALSE;
}
// Resize internal buffer.
if(!reallocateData(pngWrapper.getFinalSize())) //Shrink. Returns NULL on failure.
{
setLastError("LLImagePNG::encode failed reallocateData");
return FALSE;
}
return TRUE;
/*U8* mTmpWriteBuffer = new U8[ bufferSize ];
// Delegate actual encoding work to wrapper
LLPngWrapper pngWrapper;
@@ -146,6 +161,6 @@ BOOL LLImagePNG::encode(const LLImageRaw* raw_image, F32 encode_time)
delete[] mTmpWriteBuffer;
return TRUE;
return TRUE;*/
}