diff options
author | Steven Bennetts <steve@lindenlab.com> | 2008-06-26 00:39:00 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2008-06-26 00:39:00 +0000 |
commit | 25c10ed028da5c547b11f1f461916897272b0e6d (patch) | |
tree | 350a5858f8970b6e28b2dc395625d74d8bd597b2 /indra/newview/llfloaterimagepreview.cpp | |
parent | 6dd125d375b38455997a0c4b8747659f4c2351aa (diff) |
QAR-628 merge string-cleanup-5 -r 90476:90508 -> release
dataserver-is-deprecated
Diffstat (limited to 'indra/newview/llfloaterimagepreview.cpp')
-rw-r--r-- | indra/newview/llfloaterimagepreview.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index 830b38faf8..50b8b39bd0 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -68,13 +68,13 @@ const S32 PREVIEW_TEXTURE_HEIGHT = 300; //----------------------------------------------------------------------------- // LLFloaterImagePreview() //----------------------------------------------------------------------------- -LLFloaterImagePreview::LLFloaterImagePreview(const char* filename) : +LLFloaterImagePreview::LLFloaterImagePreview(const std::string& filename) : LLFloaterNameDesc(filename) { mLastMouseX = 0; mLastMouseY = 0; mGLName = 0; - loadImage(mFilenameAndPath.c_str()); + loadImage(mFilenameAndPath); } //----------------------------------------------------------------------------- @@ -314,28 +314,25 @@ void LLFloaterImagePreview::draw() //----------------------------------------------------------------------------- // loadImage() //----------------------------------------------------------------------------- -bool LLFloaterImagePreview::loadImage(const char *src_filename) +bool LLFloaterImagePreview::loadImage(const std::string& src_filename) { - // U32 length = strlen(src_filename); - const char* ext = strrchr(src_filename, '.'); - char error_message[MAX_STRING]; - error_message[0] = '\0'; - + std::string exten = gDirUtilp->getExtension(src_filename); + U32 codec = IMG_CODEC_INVALID; - LLString temp_str; - if( 0 == strnicmp(ext, ".bmp", 4) ) + std::string temp_str; + if( exten == "bmp") { codec = IMG_CODEC_BMP; } - else if( 0 == strnicmp(ext, ".tga", 4) ) + else if( exten == "tga") { codec = IMG_CODEC_TGA; } - else if( 0 == strnicmp(ext, ".jpg", 4) || 0 == strnicmp(ext, ".jpeg", 5)) + else if( exten == "jpg" || exten == "jpeg") { codec = IMG_CODEC_JPEG; } - else if( 0 == strnicmp(ext, ".png", 4) ) + else if( exten == "png" ) { codec = IMG_CODEC_PNG; } @@ -629,7 +626,7 @@ LLImagePreviewAvatar::~LLImagePreviewAvatar() } -void LLImagePreviewAvatar::setPreviewTarget(const char* joint_name, const char* mesh_name, LLImageRaw* imagep, F32 distance, BOOL male) +void LLImagePreviewAvatar::setPreviewTarget(const std::string& joint_name, const std::string& mesh_name, LLImageRaw* imagep, F32 distance, BOOL male) { mTargetJoint = mDummyAvatar->mRoot.findJoint(joint_name); // clear out existing test mesh |