From 75bed710f74965d006dc67b60949312cb4ffb399 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Mon, 9 Apr 2012 20:25:40 +0200 Subject: [PATCH] fix shift direction and cleanup comments --- blitbuffer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/blitbuffer.c b/blitbuffer.c index 5d0a7b8b3..123b9cb55 100644 --- a/blitbuffer.c +++ b/blitbuffer.c @@ -443,7 +443,7 @@ static int dimRect(lua_State *L) { } if(x & 1) { - /* This will invert the leftmost column + /* This will dimm the leftmost column * in the case when x is odd. After this, * x will become even. */ dstptr = (uint8_t*)(dst->data + @@ -451,7 +451,7 @@ static int dimRect(lua_State *L) { x / 2); for(cy = 0; cy < h; cy++) { int px = *dstptr & 0x0F; - *dstptr &= 0xF0 | px << 1; + *dstptr &= 0xF0 | px >> 1; dstptr += dst->pitch; } x++; @@ -469,7 +469,7 @@ static int dimRect(lua_State *L) { dstptr += dst->pitch; } if(w & 1) { - /* This will invert the rightmost column + /* This will dimm the rightmost column * in the case when (w & 1) && !(x & 1) or * !(w & 1) && (x & 1). */ dstptr = (uint8_t*)(dst->data +