From 86441fda9c561dd264039edc68ddabbf7cb54ce2 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Thu, 18 Oct 2007 18:39:48 +0000 Subject: 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. --- src/graphics.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/graphics.cpp') 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 +#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(); -- cgit v1.2.3-70-g09d2