diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-12-11 15:47:35 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-12-11 15:47:35 +0000 |
commit | 8da32105732949b4b0273c718d118bcfae70a1c9 (patch) | |
tree | 0a354974d48268cfaafcdb1e06b498fa26a59c1e /src/resources/image.cpp | |
parent | f9ce4e302cb3ed203d89a7a18e10b7ad4f11519c (diff) | |
download | mana-client-8da32105732949b4b0273c718d118bcfae70a1c9.tar.gz mana-client-8da32105732949b4b0273c718d118bcfae70a1c9.tar.bz2 mana-client-8da32105732949b4b0273c718d118bcfae70a1c9.tar.xz mana-client-8da32105732949b4b0273c718d118bcfae70a1c9.zip |
Merged 0.0 changes from revision 2825 to 2898 to trunk.
Diffstat (limited to 'src/resources/image.cpp')
-rw-r--r-- | src/resources/image.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/resources/image.cpp b/src/resources/image.cpp index eb3a2409..48818f6f 100644 --- a/src/resources/image.cpp +++ b/src/resources/image.cpp @@ -68,9 +68,17 @@ Image* Image::load(void *buffer, unsigned int bufferSize, { // Load the raw file data from the buffer in an RWops structure SDL_RWops *rw = SDL_RWFromMem(buffer, bufferSize); + SDL_Surface *tmpImage; // Use SDL_Image to load the raw image data and have it free the data - SDL_Surface *tmpImage = IMG_Load_RW(rw, 1); + if (!idPath.compare(idPath.length() - 4, 4, ".tga")) + { + tmpImage = IMG_LoadTyped_RW(rw, 1, const_cast<char*>("TGA")); + } + else + { + tmpImage = IMG_Load_RW(rw, 1); + } if (tmpImage == NULL) { logger->log("Error, image load failed: %s", IMG_GetError()); |