diff options
author | lukaslw | 2014-05-28 05:13:25 +0200 |
---|---|---|
committer | lukaslw | 2014-06-22 20:08:17 +0200 |
commit | ada532cf2ead17e5e7e2483328a14d1907ad9e7b (patch) | |
tree | 0e9ab48fa49b1b8cec1b0e5c0fdc6477167e9d6b /engines/prince/graphics.cpp | |
parent | b92d7762df557ff03600035a5fbf862a05a47f13 (diff) | |
download | scummvm-rg350-ada532cf2ead17e5e7e2483328a14d1907ad9e7b.tar.gz scummvm-rg350-ada532cf2ead17e5e7e2483328a14d1907ad9e7b.tar.bz2 scummvm-rg350-ada532cf2ead17e5e7e2483328a14d1907ad9e7b.zip |
PRINCE: showSprite and drawTransparent update
Diffstat (limited to 'engines/prince/graphics.cpp')
-rw-r--r-- | engines/prince/graphics.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/engines/prince/graphics.cpp b/engines/prince/graphics.cpp index 5b66994b47..551ae70a34 100644 --- a/engines/prince/graphics.cpp +++ b/engines/prince/graphics.cpp @@ -73,12 +73,16 @@ void GraphicsMan::draw(uint16 posX, uint16 posY, const Graphics::Surface *s) { change(); } -void GraphicsMan::drawTransparent(uint16 posX, uint16 posY, const Graphics::Surface *s) { - for (uint y = 0; y < s->h; ++y) { - for (uint x = 0; x < s->w; ++x) { +void GraphicsMan::drawTransparent(int32 posX, int32 posY, const Graphics::Surface *s) { + for (int y = 0; y < s->h; y++) { + for (int x = 0; x < s->w; x++) { byte pixel = *((byte*)s->getBasePtr(x, y)); if (pixel != 255) { - *((byte*)_frontScreen->getBasePtr(x + posX, y + posY)) = pixel; + if (x + posX < _frontScreen->w && x + posX >= 0) { + if (y + posY < _frontScreen->h && y + posY >= 0) { + *((byte*)_frontScreen->getBasePtr(x + posX, y + posY)) = pixel; + } + } } } } |