Mercurial > hg > Members > kono > Cerium
annotate Renderer/Engine/viewer.h @ 914:05696567d1d2
0 is filled on the spe side.
author | yutaka@localhost.localdomain |
---|---|
date | Thu, 22 Jul 2010 00:23:37 +0900 |
parents | 2683838396c6 |
children | ad10d6d39ca6 |
rev | line source |
---|---|
283 | 1 #ifndef INCLUDED_VIEWER |
2 #define INCLUDED_VIEWER | |
3 | |
4 #include <SDL.h> | |
5 | |
507 | 6 #include "viewer_types.h" |
7 #include "TaskManager.h" | |
8 #include "KeyStat.h" | |
510 | 9 #include "MainLoop.h" |
507 | 10 #include "Application.h" |
558 | 11 #include "SceneGraphRoot.h" |
748 | 12 #include "ViewerDevice.h" |
909 | 13 #include "matrix.h" |
507 | 14 |
562 | 15 class SceneGraphRoot; |
16 | |
511 | 17 class Application; |
283 | 18 |
511 | 19 class Viewer : public MainLoop { |
510 | 20 |
283 | 21 public: |
510 | 22 |
748 | 23 Viewer(TaskManager *manager, ViewerDevice *dev, int bpp, int width, int height, int spenum); |
283 | 24 |
510 | 25 virtual ~Viewer() {} |
748 | 26 BASE_NEW_DELETE(Viewer); |
283 | 27 |
748 | 28 ViewerDevice *dev; |
507 | 29 Application *app; |
30 | |
31 TaskManager *manager; | |
32 key_stat *keyPtr; | |
33 HTaskPtr draw_dummy; | |
34 | |
283 | 35 /* screen info */ |
36 int bpp; | |
37 | |
748 | 38 int rgb_size[3]; |
283 | 39 int spe_num; |
748 | 40 int width; |
41 int height; | |
283 | 42 |
748 | 43 float *light_xyz; |
44 float *light_xyz_stock; | |
792 | 45 int *light_switch; |
46 int *light_switch_stock; | |
793 | 47 int *light_sysswitch; |
48 int light_sysswitch_stock; | |
748 | 49 |
283 | 50 Uint32 video_flags; |
51 Uint32 *pixels; | |
52 | |
914 | 53 int mem_flag; |
54 | |
558 | 55 SceneGraphRoot *sgroot; |
56 | |
748 | 57 //Uint32 *video_init(TaskManager *manager, int bpp, int width, int height); |
283 | 58 void init(); |
59 | |
60 int get_ticks(); | |
61 bool quit_check(); | |
62 void quit(); | |
748 | 63 HTaskPtr initLoop(); |
283 | 64 |
748 | 65 void clean_pixels() {} |
869 | 66 |
748 | 67 void run_init(TaskManager *manager, Application *app); |
68 void run_loop(HTaskPtr task_next); | |
69 void run_draw(HTaskPtr task_next); | |
70 void run_finish(); | |
71 void run_move(HTaskPtr task_next); | |
72 void run_collision(); | |
73 void rendering(HTaskPtr task_next); | |
74 void common_draw(HTaskPtr task_next); | |
75 void common_rendering(HTaskPtr task_next, SceneGraphRoot *sgroot); | |
507 | 76 |
909 | 77 void create_pp_task(SceneGraphPtr sg, TaskManager *manager, int spe_num, HTaskPtr task_next, |
78 MatrixListInfo *matrix_info); | |
79 void check_matrix(MatrixListInfo *matrix_info,SceneGraphPtr sg); | |
80 | |
748 | 81 void spe_rendering(HTaskPtr task_next); |
82 void spe_draw(HTaskPtr task_next); | |
83 // void exchange_sgroot(TaskManager *manager); | |
507 | 84 |
792 | 85 HTaskPtr update_task_create(void *data, int size, |
86 int load_id, int spe_id, HTaskPtr wait); | |
87 | |
507 | 88 void getKey(); |
89 void get_send_controll(); | |
511 | 90 |
558 | 91 // void createFromXMLfile(const char *file); |
92 // SceneGraph *createSceneGraph(int id); | |
93 // SceneGraph *createSceneGraph(); | |
94 // void setSceneData(SceneGraph *g); | |
512 | 95 void mainLoop(); |
511 | 96 |
886 | 97 void set_move_task(SceneGraphPtr node, int move_id, void *titlep, int size, PostFunction post_func) |
98 { | |
99 sgroot->set_move_task(node, move_id, titlep, size, post_func); | |
100 } | |
869 | 101 void set_game_task(int id, void *property, int size, PostFunction post_func) |
102 { | |
103 sgroot->set_game_task(id, property, size, post_func); | |
104 } | |
105 | |
671
f42b303044f7
fix several Renderer/Test with (void*)sgroot.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
589
diff
changeset
|
106 void createFromXMLmemory(SceneGraph * node, char *data, int len) |
f42b303044f7
fix several Renderer/Test with (void*)sgroot.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
589
diff
changeset
|
107 { |
f42b303044f7
fix several Renderer/Test with (void*)sgroot.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
589
diff
changeset
|
108 sgroot->createFromXMLmemory(manager, node, data, len); |
f42b303044f7
fix several Renderer/Test with (void*)sgroot.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
589
diff
changeset
|
109 } |
f42b303044f7
fix several Renderer/Test with (void*)sgroot.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
589
diff
changeset
|
110 |
558 | 111 void createFromXMLfile(const char *file) |
112 { | |
113 sgroot->createFromXMLfile(manager, file); | |
114 } | |
115 | |
116 SceneGraph * createSceneGraph(int id) | |
117 { | |
118 return sgroot->createSceneGraph(id); | |
119 } | |
120 | |
562 | 121 SceneGraph * createSceneGraph(const char *id) |
122 { | |
123 return sgroot->createSceneGraph(id); | |
124 } | |
125 | |
126 int getSgid(const char *id) | |
127 { | |
128 return sgroot->getSgid(id); | |
129 } | |
130 | |
558 | 131 SceneGraph * createSceneGraph() |
132 { | |
133 return sgroot->createSceneGraph(); | |
134 } | |
135 | |
136 void setSceneData(SceneGraph *g) | |
137 { | |
138 sgroot->setSceneData(g); | |
139 } | |
140 | |
589 | 141 int getLast() |
142 { | |
143 return sgroot->getLast(); | |
144 } | |
145 | |
793 | 146 SceneGraphPtr getLight(int id) |
147 { | |
148 return sgroot->getLight(id); | |
149 } | |
150 | |
151 void OnLightSwitch(int id) | |
152 { | |
153 sgroot->OnLightSwitch(id); | |
154 } | |
155 | |
156 void OffLightSwitch(int id) | |
157 { | |
158 sgroot->OffLightSwitch(id); | |
159 } | |
160 | |
161 void OnLightSysSwitch() | |
162 { | |
163 sgroot->OnLightSysSwitch(); | |
164 } | |
165 | |
166 void OffLightSysSwitch() | |
167 { | |
168 sgroot->OffLightSysSwitch(); | |
169 } | |
170 | |
283 | 171 }; |
172 | |
507 | 173 #define default_sdl_flag SDL_INIT_TIMER | SDL_INIT_JOYSTICK |
174 | |
175 | |
283 | 176 #endif |
177 |