Mercurial > hg > Members > kono > Cerium
diff TaskManager/Test/test_render/task/update_sgp.cpp @ 264:a59868d37093
merge 151 263
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 03 Jun 2009 23:57:38 +0900 |
parents | 3fd24be89d02 a802b19ab9ae |
children | 7f2b30acf311 |
line wrap: on
line diff
--- a/TaskManager/Test/test_render/task/update_sgp.cpp Tue Dec 02 19:14:52 2008 +0900 +++ b/TaskManager/Test/test_render/task/update_sgp.cpp Wed Jun 03 23:57:38 2009 +0900 @@ -8,6 +8,108 @@ SchedDefineTask(Update_SGP); +<<<<<<< local +======= +typedef void (*moveFunc)(SceneGraphNodePtr, int, int); +typedef void (*collFunc)(SceneGraphNodePtr, int, int); + +static moveFunc moveList[3]; +static collFunc collList[3]; + +static void +move0(SceneGraphNodePtr node, int w, int h) +{ + static float dest_x = 0.3f; + static float dest_y = 0.5f; + + node->angle[1] += 1.0f; + if (node->angle[1] > 360.0f) { + node->angle[1] = 0.0f; + } + + node->obj_pos[0] += dest_x; + if ((int)node->obj_pos[0] > w || (int)node->obj_pos[0] < 0) { + dest_x = -dest_x; + } + + node->obj_pos[1] += dest_y; + if ((int)node->obj_pos[1] > h || (int)node->obj_pos[1] < 0) { + dest_y = -dest_y; + } +} + +static void +move1(SceneGraphNodePtr node, int w, int h) +{ + node->angle[1] += 1.0f; + if (node->angle[1] > 360.0f) { + node->angle[1] = 0.0f; + } + + static float dest_x = 0.5f; + static float dest_y = 1.3f; + + node->obj_pos[0] += dest_x; + if ((int)node->obj_pos[0] > w || (int)node->obj_pos[0] < 0) { + dest_x = -dest_x; + } + + node->obj_pos[1] += dest_y; + if ((int)node->obj_pos[1] > h || (int)node->obj_pos[1] < 0) { + dest_y = -dest_y; + } +} + +static void +move2(SceneGraphNodePtr node, int w, int h) +{ + node->angle[1] += 1.0f; + if (node->angle[1] > 360.0f) { + node->angle[1] = 0.0f; + } + + static float dest_x = 1.0f; + static float dest_y = 0.8f; + + node->obj_pos[0] += dest_x; + if ((int)node->obj_pos[0] > w || (int)node->obj_pos[0] < 0) { + dest_x = -dest_x; + } + + node->obj_pos[1] += dest_y; + if ((int)node->obj_pos[1] > h || (int)node->obj_pos[1] < 0) { + dest_y = -dest_y; + } +} + +static void +move4(SceneGraphNodePtr node, int w, int h) +{ + node->angle[1] += 1.0f; + if (node->angle[1] > 360.0f) { + node->angle[1] = 0.0f; + } +} + + +static void +coll(SceneGraphNodePtr node, int w, int h) +{ +} + +static void +init(void) +{ + moveList[0] = move0; + moveList[1] = move4; + moveList[2] = move2; + + collList[0] = coll; + collList[1] = coll; + collList[2] = coll; +} + +>>>>>>> other int Update_SGP::run(void *rbuf, void *wbuf) {