summaryrefslogtreecommitdiff
path: root/src/resources/resourcemanager.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2006-08-13 10:20:19 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2006-08-13 10:20:19 +0000
commitd3385829ca6f7d52e21706b25b14fe1083cfe984 (patch)
treeaea368b2434a49864b33183f95b6aae36abef3b7 /src/resources/resourcemanager.cpp
parent7d287027babe615e01ddcf20edc1057f7d778c58 (diff)
downloadmana-client-d3385829ca6f7d52e21706b25b14fe1083cfe984.tar.gz
mana-client-d3385829ca6f7d52e21706b25b14fe1083cfe984.tar.bz2
mana-client-d3385829ca6f7d52e21706b25b14fe1083cfe984.tar.xz
mana-client-d3385829ca6f7d52e21706b25b14fe1083cfe984.zip
Merged Guichan 0.5.0 support from guichan-0.5.0 branch, plus several updates
from the 0.1.0 branch.
Diffstat (limited to 'src/resources/resourcemanager.cpp')
-rw-r--r--src/resources/resourcemanager.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp
index 26899d77..1c1eb5db 100644
--- a/src/resources/resourcemanager.cpp
+++ b/src/resources/resourcemanager.cpp
@@ -26,6 +26,7 @@
#include <cassert>
#include <sstream>
#include <physfs.h>
+#include <SDL_image.h>
#include "image.h"
#include "music.h"
@@ -297,3 +298,19 @@ ResourceManager::loadTextFile(const std::string &fileName)
free(fileContents);
return lines;
}
+
+SDL_Surface*
+ResourceManager::loadSDLSurface(const std::string& filename)
+{
+ int fileSize;
+ void *buffer = loadFile(filename, fileSize);
+ SDL_Surface *tmp = NULL;
+
+ if (buffer) {
+ SDL_RWops *rw = SDL_RWFromMem(buffer, fileSize);
+ tmp = IMG_Load_RW(rw, 1);
+ ::free(buffer);
+ }
+
+ return tmp;
+}