diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-11-26 21:51:01 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-11-26 21:51:01 +0000 |
commit | a8a90f2df98e13971566af63567e31da4666b1c9 (patch) | |
tree | dfabbaf186faeb262f72948aea94b1ad160420a4 /src/resources/image.cpp | |
parent | 42f18ad42f3b908d6af849a74273a58840fa67a1 (diff) | |
download | mana-client-a8a90f2df98e13971566af63567e31da4666b1c9.tar.gz mana-client-a8a90f2df98e13971566af63567e31da4666b1c9.tar.bz2 mana-client-a8a90f2df98e13971566af63567e31da4666b1c9.tar.xz mana-client-a8a90f2df98e13971566af63567e31da4666b1c9.zip |
Higher precision log timestamps, some more logging and support for TGA images.
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()); |