diff options
author | Philipp Sehmisch <tmw@crushnet.org> | 2007-05-04 13:09:25 +0000 |
---|---|---|
committer | Philipp Sehmisch <tmw@crushnet.org> | 2007-05-04 13:09:25 +0000 |
commit | 00fb4bde7974a20aacfc1c52e48fff2faee2d385 (patch) | |
tree | 2097ef003495d7e6b4a8cf697ad7896039aac113 /src/graphics.cpp | |
parent | b3376bfe4e26591e1dc1066d8f2270baf4f9f759 (diff) | |
download | mana-00fb4bde7974a20aacfc1c52e48fff2faee2d385.tar.gz mana-00fb4bde7974a20aacfc1c52e48fff2faee2d385.tar.bz2 mana-00fb4bde7974a20aacfc1c52e48fff2faee2d385.tar.xz mana-00fb4bde7974a20aacfc1c52e48fff2faee2d385.zip |
Merged particle engine into main eAthena branch.
Diffstat (limited to 'src/graphics.cpp')
-rw-r--r-- | src/graphics.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/graphics.cpp b/src/graphics.cpp index f007470a..4ea75a93 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -148,6 +148,17 @@ bool Graphics::drawImage(Image *image, int srcX, int srcY, int dstX, int dstY, return !(SDL_BlitSurface(image->mImage, &srcRect, mScreen, &dstRect) < 0); } +bool Graphics::drawImageTransparent(Image *image, int x, int y, float opacity) +{ + if (!image) return false; + + float oldalpha = image->getAlpha(); + image->setAlpha(opacity * oldalpha); + bool retval = drawImage(image, x, y); + image->setAlpha(oldalpha); + return retval; +} + void Graphics::drawImagePattern(Image *image, int x, int y, int w, int h) { int iw = image->getWidth(); |