comparison Renderer/Engine/SceneGraphRoot.cc @ 969:52c4353308e7 draft

add new function for dandy.
author koba <koba@cr.ie.u-ryukyu.ac.jp>
date Thu, 26 Aug 2010 03:20:42 +0900
parents 564096e53d8a
children ceca625af064
comparison
equal deleted inserted replaced
968:122b1fddfa94 969:52c4353308e7
4 #include "SceneGraphRoot.h" 4 #include "SceneGraphRoot.h"
5 #include "xml.h" 5 #include "xml.h"
6 #include "sys.h" 6 #include "sys.h"
7 #include "TextureHash.h" 7 #include "TextureHash.h"
8 #include "texture.h" 8 #include "texture.h"
9 //#include "SGList.h"
10 #include "Application.h" 9 #include "Application.h"
11 10
12 static int cnt = 0; 11 static int cnt = 0;
13 static const int SGLIST_LENGTH = 138; 12 static const int SGLIST_LENGTH = 138;
14 static int sg_src_size = SGLIST_LENGTH ; 13 static int sg_src_size = SGLIST_LENGTH ;
705 task->set_cpu(SPE_ANY); 704 task->set_cpu(SPE_ANY);
706 task->add_inData(property, size); 705 task->add_inData(property, size);
707 task->add_outData(property, size); 706 task->add_outData(property, size);
708 task->add_param((memaddr)1); 707 task->add_param((memaddr)1);
709 task->set_post(post_func, (void*)property, 0); 708 task->set_post(post_func, (void*)property, 0);
709 wait_game_task->wait_for(task);
710 task->spawn();
711 }
712
713 void
714 SceneGraphRoot::set_game_task(int id, void *property, void *pad, int size, PostFunction post_func)
715 {
716 HTask *task = sgroot->tmanager->create_task(id);
717 task->set_cpu(SPE_ANY);
718 task->add_inData(property, size);
719 task->add_inData(pad, sizeof(Pad));
720 task->add_outData(property, size);
721 task->set_post(post_func, (void*)property, 0);
722 wait_game_task->wait_for(task);
710 task->spawn(); 723 task->spawn();
711 } 724 }
712 725
713 void 726 void
714 main_task_move(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h) 727 main_task_move(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h)
715 { 728 {
716 int size = node->property_size; 729 int size = node->property_size;
717 void *e = node->propertyptr; 730 void *e = node->propertyptr;
718 int move = node->move_id; 731 int move = node->move_id;
719 PostFunction post_func = node->post_func; 732 PostFunction post_func = node->post_func;
733
720 SceneGraphRoot *sgroottmp = (SceneGraphRoot*)sgroot_; 734 SceneGraphRoot *sgroottmp = (SceneGraphRoot*)sgroot_;
721 sgroottmp->set_game_task(move, (void*)e, size, post_func); 735 sgroottmp->set_game_task(move, (void*)e, size, post_func);
736 }
737
738 void
739 pad_task_move(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h)
740 {
741 int size = node->property_size;
742 void *e = node->propertyptr;
743 int move = node->move_id;
744 PostFunction post_func = node->post_func;
745
746 SceneGraphRoot *sgroottmp = (SceneGraphRoot*)sgroot_;
747 void *pad = (void*)sgroottmp->getController();
748
749 sgroottmp->set_game_task(move, (void*)e, pad, size, post_func);
722 } 750 }
723 751
724 void 752 void
725 SceneGraphRoot::set_move_task(SceneGraphPtr node, int move, void *property, int size, 753 SceneGraphRoot::set_move_task(SceneGraphPtr node, int move, void *property, int size,
726 PostFunction post_func) 754 PostFunction post_func)
730 node->move_id = move; 758 node->move_id = move;
731 node->propertyptr = property; 759 node->propertyptr = property;
732 node->property_size = size; 760 node->property_size = size;
733 } 761 }
734 762
763 void
764 SceneGraphRoot::set_pad_task(SceneGraphPtr node, int move, void *property, int size,
765 PostFunction post_func)
766 {
767 node->move = pad_task_move;
768 node->post_func = post_func;
769 node->move_id = move;
770 node->propertyptr = property;
771 node->property_size = size;
772 }
773
735 /* end */ 774 /* end */