diff collision_task.cc @ 8:e90c4a8f9dc8

fix.
author koba <koba@cr.ie.u-ryukyu.ac.jp>
date Thu, 16 Dec 2010 01:15:03 +0900
parents 23d54565aa7b
children 00c3272a801f
line wrap: on
line diff
--- a/collision_task.cc	Wed Dec 15 17:55:25 2010 +0900
+++ b/collision_task.cc	Thu Dec 16 01:15:03 2010 +0900
@@ -20,8 +20,9 @@
 CollisionPropertyPtr
 get_property(CHARACTER *p)
 {
-    CollisionPropertyPtr property = new(CollisionProperty);
+    CollisionPropertyPtr property = (CollisionPropertyPtr)tmanager->allocate(sizeof(CollisionProperty));
     
+    property->bomend = bomend;
     property->infg_level = infg_level;
     property->enemycount = 0;
 
@@ -32,7 +33,7 @@
     property->infg = infg;
 
 
-    memcpy(property->tama_lv1, &tama_lv1, sizeof(tama1)*20);    
+    memcpy(property->tama_lv1, &tama_lv1, sizeof(tama1)*20); 
     memcpy(property->tama_lv2, &tama_lv2, sizeof(tama2)*20);
     memcpy(property->laser_lv1, &laser_lv1, sizeof(laser)*20);
     memcpy(property->laser_lv2, &laser_lv2, sizeof(laser)*20);
@@ -48,29 +49,28 @@
     CollisionPropertyPtr property = (CollisionPropertyPtr)prop;
     CHARACTER *character = (CHARACTER *)chara;
 
-    if(infg_level <= property->infg_level||infg_level != 0) {
-	infg_level--;
+    if(bomend > property->bomend) {
+	bomend = property->bomend;
     }
-    if(lg.stg <= property->lg.stg) {
+    if(lg.stg > property->lg.stg) {
 	lg.stg -= 26;
     }
+    infg_level = property->infg_level;
     enemycount += property->enemycount;
 
     jiki.bf = property->jiki.bf;
     jiki.zanki = property->jiki.zanki;
     jiki.muteki = property->jiki.muteki;
+
     *character = property->p;
-    tlv3[0] = property->tlv3;
     infg = property->infg;
 
     memcpy(tama_lv1, property->tama_lv1, sizeof(tama1)*20);    
     memcpy(tama_lv2, property->tama_lv2, sizeof(tama2)*20);
     memcpy(laser_lv1, property->laser_lv1, sizeof(laser)*20);
-    memcpy(laser_lv2, property->laser_lv2, sizeof(laser)*20);
-    memcpy(laser_lv3, property->laser_lv3, sizeof(laser)*128);
     memcpy(bchar, property->bchar, sizeof(bomchar)*100);
 
-    delete property;
+    free(prop);
 }
 
 
@@ -88,11 +88,9 @@
     collision_task->set_param(0,(memaddr)w);
     collision_task->set_param(1,(memaddr)h);
     collision_task->set_param(2,(memaddr)enemycount);
-    collision_task->set_param(3,(memaddr)bomend);
-    collision_task->set_param(4,(memaddr)tama_lv1_end);
-    collision_task->set_param(5,(memaddr)tama_lv2_end);
-    collision_task->set_param(6,(memaddr)laser_lv1_end);
-    collision_task->set_param(7,(memaddr)infg_level);
+    collision_task->set_param(3,(memaddr)tama_lv1_end);
+    collision_task->set_param(4,(memaddr)tama_lv2_end);
+    collision_task->set_param(5,(memaddr)laser_lv1_end);
 
     collision_task->add_inData(property, sizeof(CollisionProperty));
     collision_task->add_outData(property, sizeof(CollisionProperty));