diff spe/chara_state500.cc @ 60:cfd42ee2ad28

change makefile, spe/task. adjust scale api. worked on ps3-ppe.
author yutaka@localhost.localdomain
date Sun, 06 Feb 2011 17:16:43 +0900
parents f4140672ef9f
children
line wrap: on
line diff
--- a/spe/chara_state500.cc	Mon Feb 07 03:31:18 2011 +0900
+++ b/spe/chara_state500.cc	Sun Feb 06 17:16:43 2011 +0900
@@ -29,29 +29,32 @@
     DefSpriteEx(100, 16, 16, &sprite->data[0]);
     PutSpriteEx(100, p->x + 16, p->y + 16, 2, 2, p->dt1, &sprite->data[1]);
     
-    if (p->dt1 % (5 + p->dt2 / 8) == 1) {
-	sprite->length = 3;
-
-	if (rand % 2 == 1)
-	    Putenemy(24, p->x, p->y,
-		     (rand % 5 + 0.5) * (rand % 2 ==
-					   1 ? -1 : 1),
-		     (rand % 5 + 0.5) * (rand % 2 ==
-					   1 ? -1 : 1), STATE501, &sprite->data[2]);
-	else
-	    Putenemy(rand % 2 + 1, p->x,
-		     p->y,
-		     (int) Mycos(p->dt1 / 4) * 4 /
-		     SANKAKU,
-		     (int) -Mysin(p->dt1 / 4) * 4 /
-		     SANKAKU, STATE501, &sprite->data[2]);
-    }
-    if (p->dt1 == 50) {
-	/*Putenemy(44,0,0,1,1,411); */
+    int num = 5 +  p->dt2 / 8;
+    if (num != 0) {
+	if (p->dt1 % num == 1) {
+	    sprite->length = 3;
+	    
+	    if (rand % 2 == 1)
+		Putenemy(24, p->x, p->y,
+			 (rand % 5 + 0.5) * (rand % 2 ==
+					     1 ? -1 : 1),
+			 (rand % 5 + 0.5) * (rand % 2 ==
+					     1 ? -1 : 1), STATE501, &sprite->data[2]);
+	    else
+		Putenemy(rand % 2 + 1, p->x,
+			 p->y,
+			 (int) Mycos(p->dt1 / 4) * 4 /
+			 SANKAKU,
+			 (int) -Mysin(p->dt1 / 4) * 4 /
+			 SANKAKU, STATE501, &sprite->data[2]);
+	}
+	if (p->dt1 == 50) {
+	    /*Putenemy(44,0,0,1,1,411); */
+	}
     }
     CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0);
     int *w_count = (int*)smanager->get_output(wbuf, 1);
-
+    
     *q = *p;
     *w_count = count;
     return 0;