summaryrefslogtreecommitdiff
path: root/src/graphics.cpp
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-08-25 16:56:52 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-08-25 16:56:52 +0000
commit14c82e5b5d5547bcf9c3b06c68cf20a100600d0b (patch)
treea46770e8dc29a541eff9480c0e5c132336666b48 /src/graphics.cpp
parent06ea0c8cf1986460d3c74cddd02a714fb6c26bca (diff)
downloadmana-client-14c82e5b5d5547bcf9c3b06c68cf20a100600d0b.tar.gz
mana-client-14c82e5b5d5547bcf9c3b06c68cf20a100600d0b.tar.bz2
mana-client-14c82e5b5d5547bcf9c3b06c68cf20a100600d0b.tar.xz
mana-client-14c82e5b5d5547bcf9c3b06c68cf20a100600d0b.zip
Removed dependency on Guichan's OpenGL library. Taken over image loading and handling. Reduced memory usage when using OpenGL. (Up to 95% reduction for some textures.)
Diffstat (limited to 'src/graphics.cpp')
-rw-r--r--src/graphics.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/graphics.cpp b/src/graphics.cpp
index 1e31f903..5ece979d 100644
--- a/src/graphics.cpp
+++ b/src/graphics.cpp
@@ -21,11 +21,13 @@
* $Id$
*/
+#include <cassert>
+
#include "graphics.h"
#include "log.h"
-
#include "resources/image.h"
+#include "resources/imageloader.h"
Graphics::Graphics():
mScreen(0)
@@ -146,6 +148,15 @@ bool Graphics::drawImage(Image *image, int srcX, int srcY, int dstX, int dstY,
return !(SDL_BlitSurface(image->mImage, &srcRect, mScreen, &dstRect) < 0);
}
+void Graphics::drawImage(gcn::Image const *image, int srcX, int srcY,
+ int dstX, int dstY, int width, int height)
+{
+ ProxyImage const *srcImage =
+ dynamic_cast< ProxyImage const * >(image);
+ assert(srcImage);
+ drawImage(srcImage->getImage(), srcX, srcY, dstX, dstY, width, height);
+}
+
void Graphics::drawImagePattern(Image *image, int x, int y, int w, int h)
{
int iw = image->getWidth();