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