view stage_init.cc @ 3:7b4c2cfeba45

task not move 2%
author tkaito
date Thu, 17 Jun 2010 06:31:01 +0900
parents 6e1afe1016dc
children ccc811ee5f55
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 = %f\n", charactor1[0].x);
}


void
create_title(void *sgroot_, int w, int h) 
{
  TaskManager *manager;
  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].y  = back1->xyz[1];
  charactor[0].vx = back1->stack_xyz[0];
  charactor[0].vy = back1->stack_xyz[1];
  charactor[0].frame = back1->frame;

  /* set_game_task */
  HTask *back;
  back = manager->create_task(TITLE_MOVE);
  back->set_cpu(SPE_ANY);
  back->add_inData((char*)charactor, sizeof(ObjProperty));
  back->add_outData(charactor, sizeof(ObjProperty));
  back->add_param((memaddr)1);
  back->set_post(createSceneGraphFromProperty, (void*)charactor, 0);
  //back->set_post(test, (void*)charactor, 0);
  back->spawn();
}

  //createSceneGraphFromProperty(ObjProperty charactor);


  //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) 
{
  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) 
{
}