# HG changeset patch # User nireco # Date 1228571891 0 # Node ID de56d9d167056f531f5a5fe17502e35374753c13 # Parent a384bf0634f0bd4f03a69c6259cf0fd2aca59df1 and yet better image drawing diff -r a384bf0634f0 -r de56d9d16705 src/Player.cc --- a/src/Player.cc Sat Dec 06 13:52:07 2008 +0000 +++ b/src/Player.cc Sat Dec 06 13:58:11 2008 +0000 @@ -147,9 +147,15 @@ int aim_img_idx = (int)((1 - (getAim()+KG_PI/2)/KG_PI)*img_num_aim); int img_height = 9; int img_width = 10; + + CL_Rectf destination(position.x-4, position.y-4, position.x+5, position.y+4); + if(!getFacing()) { + destination = CL_Rect(position.x+5, position.y-4, position.x-4, position.y+4); + } + player_image.draw_subpixel(CL_Rectf(1, aim_img_idx*img_height+1, 1+img_width, (aim_img_idx+1)*img_height+1), - CL_Rectf(position.x-4, position.y-4, position.x+5, position.y+4), gc); - + destination, gc); + const uint16_t chlen = 10; uint16_t x = position.x; uint16_t y = position.y;