diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-10-18 18:39:48 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-10-18 18:39:48 +0000 |
commit | 86441fda9c561dd264039edc68ddabbf7cb54ce2 (patch) | |
tree | f9d15edf9587bc149a42399369bfcf3b9d5c5b27 /src/graphics.cpp | |
parent | d3ab0ef7be4c1f0098acc08748c308091e75dfff (diff) | |
download | mana-86441fda9c561dd264039edc68ddabbf7cb54ce2.tar.gz mana-86441fda9c561dd264039edc68ddabbf7cb54ce2.tar.bz2 mana-86441fda9c561dd264039edc68ddabbf7cb54ce2.tar.xz mana-86441fda9c561dd264039edc68ddabbf7cb54ce2.zip |
Merged removal of dependency on Guichan OpenGL from trunk to 0.0 branch,
including optimization of OpenGL memory usage on modern OpenGL drivers.
Patches by Guillaume Melquiond.
Diffstat (limited to 'src/graphics.cpp')
-rw-r--r-- | src/graphics.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/graphics.cpp b/src/graphics.cpp index 1e31f903..586f9f49 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -21,11 +21,13 @@ * $Id$ */ -#include "graphics.h" +#include <cassert> +#include "graphics.h" #include "log.h" #include "resources/image.h" +#include "resources/imageloader.h" Graphics::Graphics(): mScreen(0) @@ -125,7 +127,7 @@ bool Graphics::drawImage(Image *image, int x, int y) } bool Graphics::drawImage(Image *image, int srcX, int srcY, int dstX, int dstY, - int width, int height) + int width, int height, bool) { // Check that preconditions for blitting are met. if (!mScreen || !image || !image->mImage) return false; @@ -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, true); +} + void Graphics::drawImagePattern(Image *image, int x, int y, int w, int h) { int iw = image->getWidth(); |