Mercurial > hg > Members > kono > Cerium
annotate Renderer/Engine/viewer.h @ 909:2683838396c6
fix..
author | Yutaka_Kinjyo |
---|---|
date | Tue, 20 Jul 2010 04:45:36 +0900 |
parents | 62838c1cd4b0 |
children | 05696567d1d2 |
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 | |
558 | 53 SceneGraphRoot *sgroot; |
54 | |
748 | 55 //Uint32 *video_init(TaskManager *manager, int bpp, int width, int height); |
283 | 56 void init(); |
57 | |
58 int get_ticks(); | |
59 bool quit_check(); | |
60 void quit(); | |
748 | 61 HTaskPtr initLoop(); |
283 | 62 |
748 | 63 void clean_pixels() {} |
869 | 64 |
748 | 65 void run_init(TaskManager *manager, Application *app); |
66 void run_loop(HTaskPtr task_next); | |
67 void run_draw(HTaskPtr task_next); | |
68 void run_finish(); | |
69 void run_move(HTaskPtr task_next); | |
70 void run_collision(); | |
71 void rendering(HTaskPtr task_next); | |
72 void common_draw(HTaskPtr task_next); | |
73 void common_rendering(HTaskPtr task_next, SceneGraphRoot *sgroot); | |
507 | 74 |
909 | 75 void create_pp_task(SceneGraphPtr sg, TaskManager *manager, int spe_num, HTaskPtr task_next, |
76 MatrixListInfo *matrix_info); | |
77 void check_matrix(MatrixListInfo *matrix_info,SceneGraphPtr sg); | |
78 | |
748 | 79 void spe_rendering(HTaskPtr task_next); |
80 void spe_draw(HTaskPtr task_next); | |
81 // void exchange_sgroot(TaskManager *manager); | |
507 | 82 |
792 | 83 HTaskPtr update_task_create(void *data, int size, |
84 int load_id, int spe_id, HTaskPtr wait); | |
85 | |
507 | 86 void getKey(); |
87 void get_send_controll(); | |
511 | 88 |
558 | 89 // void createFromXMLfile(const char *file); |
90 // SceneGraph *createSceneGraph(int id); | |
91 // SceneGraph *createSceneGraph(); | |
92 // void setSceneData(SceneGraph *g); | |
512 | 93 void mainLoop(); |
511 | 94 |
886 | 95 void set_move_task(SceneGraphPtr node, int move_id, void *titlep, int size, PostFunction post_func) |
96 { | |
97 sgroot->set_move_task(node, move_id, titlep, size, post_func); | |
98 } | |
869 | 99 void set_game_task(int id, void *property, int size, PostFunction post_func) |
100 { | |
101 sgroot->set_game_task(id, property, size, post_func); | |
102 } | |
103 | |
671
f42b303044f7
fix several Renderer/Test with (void*)sgroot.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
589
diff
changeset
|
104 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
|
105 { |
f42b303044f7
fix several Renderer/Test with (void*)sgroot.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
589
diff
changeset
|
106 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
|
107 } |
f42b303044f7
fix several Renderer/Test with (void*)sgroot.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
589
diff
changeset
|
108 |
558 | 109 void createFromXMLfile(const char *file) |
110 { | |
111 sgroot->createFromXMLfile(manager, file); | |
112 } | |
113 | |
114 SceneGraph * createSceneGraph(int id) | |
115 { | |
116 return sgroot->createSceneGraph(id); | |
117 } | |
118 | |
562 | 119 SceneGraph * createSceneGraph(const char *id) |
120 { | |
121 return sgroot->createSceneGraph(id); | |
122 } | |
123 | |
124 int getSgid(const char *id) | |
125 { | |
126 return sgroot->getSgid(id); | |
127 } | |
128 | |
558 | 129 SceneGraph * createSceneGraph() |
130 { | |
131 return sgroot->createSceneGraph(); | |
132 } | |
133 | |
134 void setSceneData(SceneGraph *g) | |
135 { | |
136 sgroot->setSceneData(g); | |
137 } | |
138 | |
589 | 139 int getLast() |
140 { | |
141 return sgroot->getLast(); | |
142 } | |
143 | |
793 | 144 SceneGraphPtr getLight(int id) |
145 { | |
146 return sgroot->getLight(id); | |
147 } | |
148 | |
149 void OnLightSwitch(int id) | |
150 { | |
151 sgroot->OnLightSwitch(id); | |
152 } | |
153 | |
154 void OffLightSwitch(int id) | |
155 { | |
156 sgroot->OffLightSwitch(id); | |
157 } | |
158 | |
159 void OnLightSysSwitch() | |
160 { | |
161 sgroot->OnLightSysSwitch(); | |
162 } | |
163 | |
164 void OffLightSysSwitch() | |
165 { | |
166 sgroot->OffLightSysSwitch(); | |
167 } | |
168 | |
283 | 169 }; |
170 | |
507 | 171 #define default_sdl_flag SDL_INIT_TIMER | SDL_INIT_JOYSTICK |
172 | |
173 | |
283 | 174 #endif |
175 |