Mercurial > hg > Game > Cerium
changeset 1136:f326494ffdc7 draft
not work ieshoot. not check Cell
author | Yutaka_Kinjyo |
---|---|
date | Thu, 17 Feb 2011 10:50:40 +0900 |
parents | bb17a03bab60 |
children | 068c1af8c7a9 |
files | Renderer/Engine/Makefile.def Renderer/Engine/SceneGraph.cc Renderer/Engine/SceneGraph.h Renderer/Engine/SceneGraphRoot.cc Renderer/Engine/viewer.cc Renderer/Test/Makefile.def Renderer/Test/node.cc Renderer/Test/vacuum.cc TaskManager/Makefile.def |
diffstat | 9 files changed, 39 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/Renderer/Engine/Makefile.def Wed Feb 16 02:08:17 2011 +0900 +++ b/Renderer/Engine/Makefile.def Thu Feb 17 10:50:40 2011 +0900 @@ -5,7 +5,7 @@ ABIBIT = 64 ABI = -m$(ABIBIT) CC = g++ -OPT = -O9 +OPT = -g #-O9 CFLAGS = -Wall $(ABI) $(OPT) # -DDEBUG INCLUDE = -I$(CERIUM)/include/TaskManager -I.
--- a/Renderer/Engine/SceneGraph.cc Wed Feb 16 02:08:17 2011 +0900 +++ b/Renderer/Engine/SceneGraph.cc Thu Feb 17 10:50:40 2011 +0900 @@ -175,8 +175,13 @@ printf("vertex size is error. size %% 3 = %lld\n", size % 3); } - pp_num = (size/3 + MAX_SIZE_TRIANGLE - 1) / MAX_SIZE_TRIANGLE; - pp = (PolygonPack*)manager->allocate(sizeof(PolygonPack)*pp_num); + if (size > 0) { + pp_num = (size/3 + MAX_SIZE_TRIANGLE - 1) / MAX_SIZE_TRIANGLE; + pp = (PolygonPack*)manager->allocate(sizeof(PolygonPack)*pp_num); + } else { + pp_num = 0; + pp = NULL; + } get_data(manager, surface->children); @@ -653,8 +658,19 @@ * @return clone SceneGraph */ SceneGraphPtr -SceneGraph::clone() { +SceneGraph::clone(TaskManager *manager) { SceneGraphPtr p = new SceneGraph(this); + + p->matrix = (float*)manager->allocate(sizeof(float)*16); + p->real_matrix = (float*)manager->allocate(sizeof(float)*16); + //これはいらない? + //p->texture_info = (float*)sgroot->manager->allocate(sizeof(texrure_list)); + + for (int i = 0; i < 16; i++) { + p->matrix[i] = this->matrix[i]; + p->real_matrix[i] = this->real_matrix[i]; + } + return p; }
--- a/Renderer/Engine/SceneGraph.h Wed Feb 16 02:08:17 2011 +0900 +++ b/Renderer/Engine/SceneGraph.h Thu Feb 17 10:50:40 2011 +0900 @@ -89,7 +89,7 @@ void add_next(SceneGraphPtr next); SceneGraphPtr addChild(SceneGraphPtr child); SceneGraphPtr addBrother(SceneGraphPtr bro); - SceneGraphPtr clone(void); + SceneGraphPtr clone(TaskManager *manager); SceneGraphPtr clone(void *buf); SceneGraphPtr searchSceneGraph(const char *name); void set_move_collision(move_func new_move);
--- a/Renderer/Engine/SceneGraphRoot.cc Wed Feb 16 02:08:17 2011 +0900 +++ b/Renderer/Engine/SceneGraphRoot.cc Thu Feb 17 10:50:40 2011 +0900 @@ -210,7 +210,7 @@ src = sg_src[id]; /* ユーザーにはオリジナルの clone を返す */ - p = src->clone(); + p = src->clone(this->tmanager); /* move, collision に sgroot を渡したいのでここで sgroot を渡しておく*/ p->sgroot = (void *)this; @@ -239,7 +239,7 @@ src = sg_src[id]; /* ユーザーにはオリジナルの clone を返す */ - p = src->clone(); + p = src->clone(this->tmanager); /* move, collision に sgroot を渡したいのでここで sgroot を渡しておく*/ p->sgroot = (void *)this; @@ -374,7 +374,7 @@ while (t) { SceneGraphPtr c = NULL; if (!t->isRemoved()) { - c = t->clone(); + c = t->clone(this->tmanager); addNext(c); cur_parent->addChild(c); c->frame = t->frame;
--- a/Renderer/Engine/viewer.cc Wed Feb 16 02:08:17 2011 +0900 +++ b/Renderer/Engine/viewer.cc Thu Feb 17 10:50:40 2011 +0900 @@ -474,9 +474,12 @@ PolygonPackPtr out_pp = r[ppi].ppack; - SceneGraphPtr t = (SceneGraphPtr)manager->allocate(sizeof(SceneGraph)); //多分このsg_remove_listであってる?。チェック対象かも - for (t = sgroot->sg_remove_list; t != NULL; t = t->next) { + for (SceneGraphPtr t = sgroot->sg_remove_list; t != NULL; t = t->next) { + + printf("texture_info addr %d\n",t->texture_info->texture_id); + + if (t->next != NULL) { for (int i = 0; i < t->pp_num; i++) { HTaskPtr create_pp = manager->create_task(CreatePolygonFromSceneGraph); @@ -486,15 +489,15 @@ create_pp->add_inData(t->real_matrix, sizeof(float)*16); create_pp->add_inData(t->texture_info, sizeof(texture_list)); - if ( (unsigned long)t->matrix & 0xf) { + if ( (unsigned long)t->matrix % 16) { printf("marix not aligned\n"); } - if ((unsigned long)t->real_matrix & 0xf) { + if ((unsigned long)t->real_matrix % 16) { printf("real_matrix not aligned\n"); } - if ((unsigned long)t->texture_info & 0xf) { + if ((unsigned long)t->texture_info % 16) { printf("texture_info not aligned\n"); }
--- a/Renderer/Test/Makefile.def Wed Feb 16 02:08:17 2011 +0900 +++ b/Renderer/Test/Makefile.def Thu Feb 17 10:50:40 2011 +0900 @@ -4,7 +4,7 @@ ABIBIT = 64 ABI = -m$(ABIBIT) CC = g++ -CFLAGS = -g -Wall $(ABI) -O9 # -O -DDEBUG +CFLAGS = -g -Wall $(ABI) #-O9 # -O -DDEBUG INCLUDE = -I$(CERIUM)/include/TaskManager -I$(CERIUM)/Renderer/Engine -I. -I$(CERIUM)/include/Cerium LIBS = -L$(CERIUM)/TaskManager -L$(CERIUM)/Renderer/Engine $(ABI)
--- a/Renderer/Test/node.cc Wed Feb 16 02:08:17 2011 +0900 +++ b/Renderer/Test/node.cc Thu Feb 17 10:50:40 2011 +0900 @@ -31,6 +31,9 @@ static void cube_move(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h) { + + SceneGraphRootPtr sgroot = (SceneGraphRootPtr)sgroot_; + node->angle[1] += 1.0f; if (node->angle[1] > 360.0f) { node->angle[1] = 0.0f; @@ -48,7 +51,7 @@ // そうじゃなくて、やっちゃいけないことです。 // srandom(random()); - SceneGraphPtr p = node->clone(); + SceneGraphPtr p = node->clone(sgroot->tmanager); p->position_init(); node->addBrother(p); p->set_move_collision(cube_move2, cube_collision);
--- a/Renderer/Test/vacuum.cc Wed Feb 16 02:08:17 2011 +0900 +++ b/Renderer/Test/vacuum.cc Thu Feb 17 10:50:40 2011 +0900 @@ -150,7 +150,7 @@ SceneGraphPtr object; SceneGraphPtr common_move; - common_move = sgroot->createSceneGraph(); + //common_move = sgroot->createSceneGraph(); object = sgroot->createSceneGraph(id); object->xyz[0] = random()%w; object->xyz[1] = random()%h;