summaryrefslogtreecommitdiff
path: root/indra/llimage
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2011-04-13 14:05:31 -0700
committerMerov Linden <merov@lindenlab.com>2011-04-13 14:05:31 -0700
commit759d72a46c5d487e6881426f90c54c6ae2da4847 (patch)
treebcbf6f2c2294eaa4052c9c53c59a89f7a59852e1 /indra/llimage
parent505e5e403d6439f29d60861553656d01522cb241 (diff)
EXP-669 : Refactor code to use correct LLImageFormatted methods to load images of all formats, reviewed by richard
Diffstat (limited to 'indra/llimage')
-rw-r--r--indra/llimage/llimage.cpp23
1 files changed, 1 insertions, 22 deletions
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp
index 39211bf7fa..f0d15d9607 100644
--- a/indra/llimage/llimage.cpp
+++ b/indra/llimage/llimage.cpp
@@ -1254,28 +1254,7 @@ bool LLImageRaw::createFromFile(const std::string &filename, bool j2c_lowest_mip
return false;
}
- LLPointer<LLImageFormatted> image;
- switch(codec)
- {
- //case IMG_CODEC_RGB:
- case IMG_CODEC_BMP:
- image = new LLImageBMP();
- break;
- case IMG_CODEC_TGA:
- image = new LLImageTGA();
- break;
- case IMG_CODEC_JPEG:
- image = new LLImageJPEG();
- break;
- case IMG_CODEC_J2C:
- image = new LLImageJ2C();
- break;
- case IMG_CODEC_DXT:
- image = new LLImageDXT();
- break;
- default:
- return false;
- }
+ LLPointer<LLImageFormatted> image = LLImageFormatted::createFromType(codec);
llassert(image.notNull());
U8 *buffer = image->allocateData(length);