diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-10-09 03:34:45 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-10-09 03:34:45 +0000 |
commit | 8bde9095c5840b8d62ebafe11beaed98877d6ac2 (patch) | |
tree | 537f717a339d1247cae222eb7a354ea5dbe8babf /src/graphics.cpp | |
parent | a246c08cef5e4d598fc07a681eb971bfbcf01519 (diff) | |
download | mana-8bde9095c5840b8d62ebafe11beaed98877d6ac2.tar.gz mana-8bde9095c5840b8d62ebafe11beaed98877d6ac2.tar.bz2 mana-8bde9095c5840b8d62ebafe11beaed98877d6ac2.tar.xz mana-8bde9095c5840b8d62ebafe11beaed98877d6ac2.zip |
* Made Sprite into an interface implemented by both FloorItem and Being, which
hook themselves into the map on construction. The improved fringe layer is
working as expected now.
* Made sure TMW compiles without warnings even when using "-Wconversion
-Wshadow -Wcast-qual -Wwrite-strings -ansi -pedantic", lots of cleanups.
* Added two new small tilesets that contain the desert tiles that are twice and
three times the height of a normal tile. One well in new_3-1 has been
converted to use the new double tiles for testing purposes.
Diffstat (limited to 'src/graphics.cpp')
-rw-r--r-- | src/graphics.cpp | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/src/graphics.cpp b/src/graphics.cpp index 74b71888..0a66bb66 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -135,7 +135,7 @@ bool Graphics::drawImage(Image *image, int srcX, int srcY, int dstX, int dstY, srcY += image->bounds.y; // Check that preconditions for blitting are met. - if (!mScreen || !image->image) return false; + if (!mScreen || !image->mImage) return false; SDL_Rect dstRect; SDL_Rect srcRect; @@ -144,11 +144,7 @@ bool Graphics::drawImage(Image *image, int srcX, int srcY, int dstX, int dstY, srcRect.w = width; srcRect.h = height; - if (SDL_BlitSurface(image->image, &srcRect, mScreen, &dstRect) < 0) { - return false; - } - - return true; + return !(SDL_BlitSurface(image->mImage, &srcRect, mScreen, &dstRect) < 0); } void Graphics::drawImagePattern(Image *image, int x, int y, int w, int h) @@ -172,13 +168,13 @@ void Graphics::drawImagePattern(Image *image, int x, int y, int w, int h) } } -void Graphics::drawImageRect( - int x, int y, int w, int h, - Image *topLeft, Image *topRight, - Image *bottomLeft, Image *bottomRight, - Image *top, Image *right, - Image *bottom, Image *left, - Image *center) +void +Graphics::drawImageRect(int x, int y, int w, int h, + Image *topLeft, Image *topRight, + Image *bottomLeft, Image *bottomRight, + Image *top, Image *right, + Image *bottom, Image *left, + Image *center) { pushClipArea(gcn::Rectangle(x, y, w, h)); @@ -216,9 +212,9 @@ void Graphics::drawImageRect( popClipArea(); } -void Graphics::drawImageRect( - int x, int y, int w, int h, - const ImageRect &imgRect) +void +Graphics::drawImageRect(int x, int y, int w, int h, + const ImageRect &imgRect) { drawImageRect(x, y, w, h, imgRect.grid[0], imgRect.grid[2], imgRect.grid[6], imgRect.grid[8], |