Mercurial > hg > Game > Cerium
changeset 378:bdeb7a73285b draft
test_nogl not working
author | kazz@kazzone.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Fri, 31 Jul 2009 19:10:53 +0900 |
parents | 82f7205da9ad |
children | 39fbac49bf60 |
files | TaskManager/Test/test_render/chain.cpp TaskManager/Test/test_render/task/Load_Texture.cpp TaskManager/Test/test_render/vacuum.cpp TaskManager/Test/test_render/viewer.cpp |
diffstat | 4 files changed, 19 insertions(+), 186 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Test/test_render/chain.cpp Fri Jul 31 18:22:46 2009 +0900 +++ b/TaskManager/Test/test_render/chain.cpp Fri Jul 31 19:10:53 2009 +0900 @@ -1,4 +1,3 @@ -#include <iostream.h> #include <math.h> #include "SceneGraphRoot.h" #include "SGList.h"
--- a/TaskManager/Test/test_render/task/Load_Texture.cpp Fri Jul 31 18:22:46 2009 +0900 +++ b/TaskManager/Test/test_render/task/Load_Texture.cpp Fri Jul 31 19:10:53 2009 +0900 @@ -25,7 +25,7 @@ new(hash_tmp) TileHash; #if USE_MEMLIST - MemList *ml = smanager->createMemList(sizeof(Tile), MAX_TILE); + MemList *ml = smanager->createMemList(sizeof(uint32) * TEXTURE_BLOCK_SIZE, MAX_TILE); smanager->global_set(GLOBAL_TILE_LIST, (void *)ml); #else
--- a/TaskManager/Test/test_render/vacuum.cpp Fri Jul 31 18:22:46 2009 +0900 +++ b/TaskManager/Test/test_render/vacuum.cpp Fri Jul 31 19:10:53 2009 +0900 @@ -5,16 +5,7 @@ #define ENCOUNT 55 using namespace std; -<<<<<<< local -static void cube_move_left(SceneGraphPtr node, int screen_w, int screen_h); -static void cube_move_right(SceneGraphPtr node, int screen_w, int screen_h); -static void cube_move_idle(SceneGraphPtr node, int screen_w, int screen_h); -static void cube_collision(SceneGraphPtr node, int screen_w, int screen_h, - SceneGraphPtr tree); -static void cube_split(SceneGraphPtr root); -======= static float vacuum_speed = 10.0f; ->>>>>>> other /*オブジェクト毎にファイルを分けてみた @@ -28,58 +19,12 @@ no_move_idle(SceneGraphPtr node, int screen_w, int screen_h) { -<<<<<<< local - if (node->xyz[0] < 0) { - node->set_move_collision(cube_move_right, cube_collision); - } - - if (node->xyz[1] < 0 || node->xyz[1] > screen_h) { - node->stack_xyz[1] = -node->stack_xyz[1]; - } - - //node->angle[0] += 2.0f; - //node->angle[1] += 2.0f * node->stack_xyz[1]; - //node->angle[2] += 2.0f * node->stack_xyz[2]; - - if (++node->frame > 60) { - cube_split(node); - } -======= ->>>>>>> other } void no_collision_idle(SceneGraphPtr node, int screen_w, int screen_h,SceneGraphPtr tree) { -<<<<<<< local - node->xyz[0] += node->stack_xyz[0]; -#if 0 - node->xyz[1] -= node->stack_xyz[0] * node->stack_xyz[1]; - node->xyz[2] -= node->stack_xyz[0] * node->stack_xyz[2]; -#else - node->xyz[1] += node->stack_xyz[1]; -#endif - if (node->xyz[0] > screen_w) { - node->set_move_collision(cube_move_left, cube_collision); - } -======= ->>>>>>> other - -<<<<<<< local - if (node->xyz[1] < 0 || node->xyz[1] > screen_h) { - node->stack_xyz[1] = -node->stack_xyz[1]; - } - - //node->angle[0] += 2.0f; - //node->angle[1] += 2.0f * node->stack_xyz[1]; - //node->angle[2] += 2.0f * node->stack_xyz[2]; - - if (++node->frame > 60) { - cube_split(node); - } -======= ->>>>>>> other } void @@ -88,10 +33,6 @@ { Pad *pad = sgroot->getController(); -<<<<<<< local - if (pad->circle.isPush()) { - cube_split(node); -======= if(node->frame%ENCOUNT == ENCOUNT-1) { if(random()%2) { add_cubecollision_object(REDCUBE,node,screen_w,screen_h); @@ -99,7 +40,6 @@ else { add_cubecollision_object(ENEMY,node,screen_w,screen_h); } ->>>>>>> other } if (pad->cross.isHold()) { @@ -116,14 +56,8 @@ } -<<<<<<< local -static void -cube_collision(SceneGraphPtr node, int screen_w, int screen_h, - SceneGraphPtr tree) -======= void lock_attack(SceneGraphPtr node,SceneGraphIteratorPtr it) ->>>>>>> other { SceneGraphPtr enemy; @@ -159,79 +93,20 @@ } -<<<<<<< local -static void -vacuum_coll(SceneGraphPtr node, int screen_w, int screen_h, - SceneGraphPtr tree) -{ - SceneGraphIteratorPtr it = sgroot->getIterator(); - SceneGraphPtr bigm; - Pad *pad = sgroot->getController(); - float dx, dy, r; - float q = 0; -======= void lockon_collision(SceneGraphPtr node,int w,int h,SceneGraphPtr tree) { ->>>>>>> other -<<<<<<< local - if (pad->cross.isRelease()) { - return; - } -======= Pad *pad = sgroot->getController(); SceneGraphPtr lockon_enemy = node->parent; ->>>>>>> other /* node->angle[0] = -lockon_enemy->angle[0]; node->angle[1] = -lockon_enemy->angle[1]; node->angle[2] = -lockon_enemy->angle[2];*/ -<<<<<<< local - for (; it->hasNext(MCUBE);) { - it->next(MCUBE); - SceneGraphPtr mcube = it->get(); -======= if(pad->circle.isRelease()) { lockon_enemy->remove(); } ->>>>>>> other -<<<<<<< local - dx = node->xyz[0] - mcube->xyz[0]; - dy = node->xyz[1] - mcube->xyz[1]; - - r = sqrt(dx*dx + dy*dy); - - if (r >= 1) q = 300/r; - - if (r < 50.0f) { - mcube->remove(); - continue; - } - - if (dx == 0) { - if(mcube->xyz[1] > node->xyz[1]) { - mcube->xyz[1] -= q; - } else if(mcube->xyz[1] < node->xyz[1]) { - mcube->xyz[1] += q; - } - } else { - if(mcube->xyz[0] > node->xyz[0]) { - mcube->xyz[0] -= q*cos(atan(dy/dx)); - mcube->xyz[1] -= q*sin(atan(dy/dx)); - mcube->stack_xyz[0] = -q*cos(atan(dy/dx)); - mcube->stack_xyz[1] = -q*sin(atan(dy/dx)); - } else if(mcube->xyz[0] < mcube->xyz[0]) { - mcube->xyz[0] += q*cos(atan(dy/dx)); - mcube->xyz[1] += q*sin(atan(dy/dx)); - mcube->stack_xyz[0] = -q*cos(atan(dy/dx)); - mcube->stack_xyz[1] = -q*sin(atan(dy/dx)); - } - } - } -======= ->>>>>>> other } @@ -240,44 +115,25 @@ { Pad *pad = sgroot->getController(); -<<<<<<< local - if (pad->right.isHold()) { - node->xyz[0] += vacuum_speed; - } else if (pad->left.isHold()) { - node->xyz[0] -= vacuum_speed; -======= if (pad->right.isHold() && w > node->xyz[0]) { node->xyz[0] += vacuum_speed; node->angle[0] += 2; } else if (pad->left.isHold() && 0 < node->xyz[0]) { node->xyz[0] -= vacuum_speed; node->angle[0] -= 2; ->>>>>>> other } -<<<<<<< local - if (pad->up.isHold()) { - node->xyz[1] -= vacuum_speed; - } else if (pad->down.isHold()) { - node->xyz[1] += vacuum_speed; -======= if (pad->up.isHold() && 0 < node->xyz[1]) { node->xyz[1] -= vacuum_speed; node->angle[1] -= 2; } else if (pad->down.isHold() && h > node->xyz[1]) { node->xyz[1] += vacuum_speed; node->angle[1] += 2; ->>>>>>> other } if (pad->start.isPush()) { -<<<<<<< local - node->xyz[0] = w/2; - node->xyz[1] = h*0.8; -======= node->xyz[0] = w/2; node->xyz[1] = h*0.8; ->>>>>>> other } }
--- a/TaskManager/Test/test_render/viewer.cpp Fri Jul 31 18:22:46 2009 +0900 +++ b/TaskManager/Test/test_render/viewer.cpp Fri Jul 31 19:10:53 2009 +0900 @@ -94,14 +94,11 @@ extern void init_position(int, int); //extern void vacuum_init(int w, int h); extern void untitled_init(void); -<<<<<<< local extern void chain_init(int w, int h); -======= extern void boss1_init(int w, int h); extern void init_gaplant(int w, int h); extern void vacuum_init2(int w, int h); ->>>>>>> other void Viewer::run_init(const char *xml, int sg_number) { @@ -144,30 +141,23 @@ init_position(this->width, this->height); break; case 11: -<<<<<<< local - vacuum_init(this->width, this->height); + // vacuum_init(this->width, this->height); break; -======= - //vacuum_init(this->width, this->height); - break; ->>>>>>> other case 12: untitled_init(); break; case 13: -<<<<<<< local + boss1_init(this->width, this->height); + break; + case 14: + init_gaplant(this->width, this->height); + break; + case 15: + vacuum_init2(this->width, this->height); + break; + case 16: chain_init(this->width, this-> height); break; -======= - boss1_init(this->width, this->height); - break; - case 14: - init_gaplant(this->width, this->height); - break; - case 15: - vacuum_init2(this->width, this->height); - break; ->>>>>>> other default: node_init(); break; @@ -218,26 +208,18 @@ #endif for (int i = 0; i < spe_num; i++) { -<<<<<<< local task_tex = manager->create_task(TASK_INIT_TEXTURE); - /* ここはもう少しわかりやすい使い方がいいかもしれぬ。こんなもん? */ + /* + * ここはもう少しわかりやすい使い方がいいかもしれぬ。こんなもん? + */ task_tex->set_cpu((CPU_TYPE)((int)SPE_0 + i)); task_next->wait_for(task_tex); task_tex->spawn(); -======= - task_tex = manager->create_task(TASK_INIT_TEXTURE); - /* - * ここはもう少しわかりやすい使い方がいいかもしれぬ。こんなもん? - */ - task_tex->set_cpu((CPU_TYPE)((int)SPE_0 + i)); - task_next->wait_for(task_tex); - task_tex->spawn(); ->>>>>>> other } task_next->set_post(&post2runLoop, NULL); // set_post(function(this->run_loop()), NULL) - task_next->spawn(); - // TASK_INIT_TEXTURE が全て終わったら DUMMY_TASK が Viewer::run_loop() を呼ぶ + task_next->spawn(); + // TASK_INIT_TEXTURE が全て終わったら DUMMY_TASK が Viewer::run_loop() を呼ぶ } void @@ -331,11 +313,11 @@ } task_create_pp->spawn(); - + // Barrier 同期 task_next->set_post(post2runDraw, NULL); // set_post(function(this->run_draw()), NULL) task_next->spawn(); - // TASK_CREATE_SPAN が全て終わったら DUMMY_TASK が Viewer::run_draw() を呼ぶ + // TASK_CREATE_SPAN が全て終わったら DUMMY_TASK が Viewer::run_draw() を呼ぶ } void @@ -345,12 +327,8 @@ HTaskPtr task_draw; task_next = manager->create_task(TASK_DUMMY); -<<<<<<< local task_next->set_post(post2runLoop, NULL); -======= - ->>>>>>> other ppack->clear(); for (int i = 0; i < spackList_length; i++) { SpanPack *spack = &spackList[i]; @@ -410,7 +388,7 @@ task_next->set_post(post2runLoop, NULL); // set_post(function(this->run_loop()), NULL) task_next->spawn(); - // TASK_DRAW_SPAN が全て終わったら DUMMY_TASK が Viewer::run_loop() を呼ぶ + // TASK_DRAW_SPAN が全て終わったら DUMMY_TASK が Viewer::run_loop() を呼ぶ frames++; }