Mercurial > hg > Members > koba > t_dandy
changeset 55:2c33aa6a4a37
debug global_alloc.but new bugs appear
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 28 Jan 2011 19:05:00 +0900 |
parents | 3acdeb3dc3e8 |
children | a80422eb44a9 |
files | TaskDandy.cc collision_task.cc |
diffstat | 2 files changed, 21 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskDandy.cc Thu Jan 27 21:05:30 2011 +0900 +++ b/TaskDandy.cc Fri Jan 28 19:05:00 2011 +0900 @@ -350,9 +350,9 @@ asteroidi = 0; // timeprof_begin(timeprof_move); - //Move(); //enemy move outofwindow(); // timeprof_end(timeprof_move); + state_update(); HTaskPtr update = collision_update(); @@ -361,6 +361,7 @@ update->spawn(); reflect->spawn(); + //charpatern(); //bosguage();
--- a/collision_task.cc Thu Jan 27 21:05:30 2011 +0900 +++ b/collision_task.cc Fri Jan 28 19:05:00 2011 +0900 @@ -5,11 +5,13 @@ #include "TaskManager.h" #include "collision_task.h" #include "Character.h" +#include "Character_state.h" #include "count2.h" #include "tokuten.h" #include "object.h" #include "sgoex.h" +#include "StateList.h" #include "property.h" @@ -74,8 +76,20 @@ } void +collision_update(SchedTask *s, void *object, void *chara) +{ + CHARACTER *p = (CHARACTER*)chara; + + if (p->task == DELETE_CHARA) { + p->state = delete_chara; + p->collision = noaction; + } + free(object); +} + +void after_free(SchedTask *s, void *object, void *none) -{ +{ free(object); } @@ -158,12 +172,12 @@ collision_task->set_param(1,(memaddr)h); collision_task->set_param(2, (memaddr)COLLDATA); - collision_task->set_inData(0, p, sizeof(player)); + collision_task->set_inData(0, p, sizeof(CHARACTER)); - collision_task->set_outData(0, p, sizeof(player)); - collision_task->set_outData(1, obj, sizeof(ObjContainer)); + collision_task->set_outData(0, p, sizeof(CHARACTER)); + collision_task->set_outData(1, obj, obj_size); - collision_task->set_post(after_free, (void*)obj, NULL); + collision_task->set_post(collision_update, (void*)obj, (void*)p); collision_task->set_cpu(SPE_0); collision_task->wait_for(update_task);