Mercurial > hg > Members > koba > t_dandy
changeset 8:e90c4a8f9dc8
fix.
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 16 Dec 2010 01:15:03 +0900 |
parents | 23d54565aa7b |
children | 8a614bb55d00 a1d02b5bcde3 |
files | collision_task.cc ppe/Atari.cc property.h |
diffstat | 3 files changed, 16 insertions(+), 16 deletions(-) [+] |
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));
--- a/ppe/Atari.cc Wed Dec 15 17:55:25 2010 +0900 +++ b/ppe/Atari.cc Thu Dec 16 01:15:03 2010 +0900 @@ -13,11 +13,11 @@ int tama_lv1_end = (int)smanager->get_param(4); int tama_lv2_end = (int)smanager->get_param(5); int laser_lv1_end = (int)smanager->get_param(6); - int infg_level = (int)smanager->get_param(7); CollisionPropertyPtr property = (CollisionPropertyPtr)smanager->get_input(rbuf, 0); + int infg_level = property->infg_level; player *jiki = &property->jiki; CHARACTER *p = &property->p; tama1 *tlv3 = &property->tlv3; @@ -51,6 +51,7 @@ if (infg_level < 0) infg_level = 0; + property->infg_level = infg_level; property->infg = infg; smanager->swap(); return 0;