Mercurial > hg > Members > tkaito > task_dandy
view stage_init.cc @ 10:27d3291a7c82
fix
author | tkaito |
---|---|
date | Tue, 13 Jul 2010 18:09:25 +0900 |
parents | dea6d34c8e91 |
children | 8c7a2e7cb9e0 |
line wrap: on
line source
#include "dandy.h" void create_title(SchedTask *s, void *charactor_, void *b) { ObjPropertyPtr charactor = (ObjPropertyPtr)charactor_; SceneGraphPtr back1, title; back1 = (SceneGraphPtr)charactor[0].parent; title = (SceneGraphPtr)charactor[0].root; title->xyz[0] = charactor[0].x; title->xyz[1] = charactor[0].y; back1->addChild(title); } /* void title_move(SceneGraphPtr node, void *sgroot_, int w, int h) { sgroot->set_move_task(obj, TITLE_MOVE, (void*)property, size, create_title); } void title_coll(SceneGraphPtr node, void *sgroot_, int w, int h, SceneGraphPtr tree) { } */ ObjProperty back_property; void create_title_back(void *sgroot_, int w, int h) { Viewer *sgroot = (Viewer *)sgroot_; SceneGraphPtr back; back_property.flag = 0; back = sgroot->createSceneGraph(); //back->set_move_collision(back_move, back_coll); sgroot->setSceneData(back); SceneGraphPtr title = (SceneGraphPtr)charactor[0].root; ObjPropertyPtr titlep; titlep->x = w/2; titlep->y = h/2; titlep->root = (void*)title; titlep->parent = (void*)back; int size = sizeof(ObjProperty)*16; //sgroot->set_move_property(title, title_move, (void*)property, size); sgroot->set_move_task(title, TITLE_MOVE, (void*)titlep, size, create_title); } void create_stage(void *sgroot_, int w, int h, ObjPropertyPtr charactor) { SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_; SceneGraphPtr stage = sgroot->createSceneGraph(); SceneGraphPtr mydandy = sgroot->createSceneGraph("mydandy"); //mydandy->set_move_collision(dandy_move, dandy_coll); //stage->set_move_collision(stage_move, stage_coll); mydandy->xyz[0] = w/2; mydandy->xyz[1] = h*0.9; mydandy->xyz[2] = 0.0f; stage->addChild(mydandy); sgroot->setSceneData(stage); }