summaryrefslogtreecommitdiff
path: root/src/graphics
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2013-03-09 21:50:36 (GMT)
committer jacob1 <jfu614@gmail.com>2013-03-09 21:50:36 (GMT)
commite6f6eedd1364fd3792d6ca7aa3ac2d0c97911f70 (patch)
tree52dfba69783bc6538cb11550b14684801b476952 /src/graphics
parentc66d4c72f5470a46564174ebf7a75c597b275731 (diff)
downloadpowder-e6f6eedd1364fd3792d6ca7aa3ac2d0c97911f70.zip
powder-e6f6eedd1364fd3792d6ca7aa3ac2d0c97911f70.tar.gz
fix empty signs being created when shifting them out of bounds, draw parts of images when it goes partway off the top of the screen.
Diffstat (limited to 'src/graphics')
-rw-r--r--src/graphics/RasterDrawMethods.inl6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/graphics/RasterDrawMethods.inl b/src/graphics/RasterDrawMethods.inl
index dec15f1..07b8257 100644
--- a/src/graphics/RasterDrawMethods.inl
+++ b/src/graphics/RasterDrawMethods.inl
@@ -362,6 +362,12 @@ void PIXELMETHODS_CLASS::draw_image(pixel *img, int x, int y, int w, int h, int
int i, j, r, g, b;
if (!img) return;
if(y + h > VIDYRES) h = ((VIDYRES)-y)-1; //Adjust height to prevent drawing off the bottom
+ if (y < 0 && -y < h)
+ {
+ img += -y*w;
+ h += y;
+ y = 0;
+ }
if(!h || y < 0) return;
if(a >= 255)
for (j=0; j<h; j++)