Mercurial > hg > Members > tkaito > task_dandy
view stage_init.cc @ 4:ccc811ee5f55
property add.
author | tkaito |
---|---|
date | Mon, 21 Jun 2010 03:23:55 +0900 |
parents | 7b4c2cfeba45 |
children | bcbcee3c6729 |
line wrap: on
line source
#include "dandy.h" void stage_move(SceneGraphPtr node, void *sgroot_, int w, int h); void stage_coll(SceneGraphPtr node, void *sgroot_, int w, int h,SceneGraphPtr tree); void createSceneGraphFromProperty(SchedTask *s, void *charactor_, void *b) { ObjPropertyPtr charactor1 = (ObjPropertyPtr)charactor_; //printf("charactor.x = %d\n", charactor1[0].frame); } void create_title(void *sgroot_, int w, int h, ObjPropertyPtr charactor) { Viewer *sgroot = (Viewer *)sgroot_; SceneGraphPtr back1; //title; back1 = sgroot->createSceneGraph(); //back->set_move_collision(back_move, back_coll); sgroot->setSceneData(back1); /* createPropertyFromSceneGraph */ //charactor[0].x = back1->xyz[0]; charactor[0].x = w/2; //charactor[0].y = back1->xyz[1]; charactor[0].y = h/2; charactor[0].vx = back1->stack_xyz[0]; charactor[0].vy = back1->stack_xyz[1]; charactor[0].frame = back1->frame; charactor[0].root = (void*)back1; charactor[0].frame = 4; /* set_game_task(int id, ObjProperty property, int size, PostFunction post_func) */ HTask *back; back = sgroot->manager->create_task(TITLE_MOVE); back->set_cpu(SPE_ANY); back->add_inData(charactor, sizeof(ObjPropertyPtr)*16); back->add_outData(charactor, sizeof(ObjPropertyPtr)*16); back->add_param((memaddr)1); back->set_post(createSceneGraphFromProperty, (void*)charactor, 0); back->spawn(); } //title = sgroot->createSceneGraph("title001"); //title->xyz[0] = w/2; //title->xyz[1] = h/2; //back->addChild(title); //title->set_move_collision(title_move, title_coll); 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); } void stage_move(SceneGraphPtr node, void *sgroot_, int w, int h) { //stage_plan(node, sgroot_, w, h); node->frame += 1; } void stage_coll(SceneGraphPtr node, void *sgroot_, int w, int h,SceneGraphPtr tree) { }