and yet better image drawing
authornireco
Sat, 06 Dec 2008 13:58:11 +0000
changeset 217 de56d9d16705
parent 216 a384bf0634f0
child 218 86d22fe82b30
and yet better image drawing
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;