Mercurial > hg > Members > kono > Cerium
annotate Renderer/Engine/viewer.h @ 792:f2497e0ecd7c
add light switch
author | yutaka@localhost.localdomain |
---|---|
date | Sun, 02 May 2010 04:17:34 +0900 |
parents | 4455e7b0caf3 |
children | c260205d3185 |
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; | |
748 | 46 |
283 | 47 Uint32 video_flags; |
48 Uint32 *pixels; | |
49 | |
558 | 50 SceneGraphRoot *sgroot; |
51 | |
748 | 52 //Uint32 *video_init(TaskManager *manager, int bpp, int width, int height); |
283 | 53 void init(); |
54 | |
55 int get_ticks(); | |
56 bool quit_check(); | |
57 void quit(); | |
748 | 58 HTaskPtr initLoop(); |
283 | 59 |
748 | 60 void clean_pixels() {} |
61 | |
62 void run_init(TaskManager *manager, Application *app); | |
63 void run_loop(HTaskPtr task_next); | |
64 void run_draw(HTaskPtr task_next); | |
65 void run_finish(); | |
66 void run_move(HTaskPtr task_next); | |
67 void run_collision(); | |
68 void rendering(HTaskPtr task_next); | |
69 void common_draw(HTaskPtr task_next); | |
70 void common_rendering(HTaskPtr task_next, SceneGraphRoot *sgroot); | |
507 | 71 |
748 | 72 void spe_rendering(HTaskPtr task_next); |
73 void spe_draw(HTaskPtr task_next); | |
74 // void exchange_sgroot(TaskManager *manager); | |
507 | 75 |
792 | 76 HTaskPtr update_task_create(void *data, int size, |
77 int load_id, int spe_id, HTaskPtr wait); | |
78 | |
507 | 79 void getKey(); |
80 void get_send_controll(); | |
511 | 81 |
558 | 82 // void createFromXMLfile(const char *file); |
83 // SceneGraph *createSceneGraph(int id); | |
84 // SceneGraph *createSceneGraph(); | |
85 // void setSceneData(SceneGraph *g); | |
512 | 86 void mainLoop(); |
511 | 87 |
671
f42b303044f7
fix several Renderer/Test with (void*)sgroot.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
589
diff
changeset
|
88 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
|
89 { |
f42b303044f7
fix several Renderer/Test with (void*)sgroot.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
589
diff
changeset
|
90 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
|
91 } |
f42b303044f7
fix several Renderer/Test with (void*)sgroot.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
589
diff
changeset
|
92 |
558 | 93 void createFromXMLfile(const char *file) |
94 { | |
95 sgroot->createFromXMLfile(manager, file); | |
96 } | |
97 | |
98 SceneGraph * createSceneGraph(int id) | |
99 { | |
100 return sgroot->createSceneGraph(id); | |
101 } | |
102 | |
562 | 103 SceneGraph * createSceneGraph(const char *id) |
104 { | |
105 return sgroot->createSceneGraph(id); | |
106 } | |
107 | |
108 int getSgid(const char *id) | |
109 { | |
110 return sgroot->getSgid(id); | |
111 } | |
112 | |
558 | 113 SceneGraph * createSceneGraph() |
114 { | |
115 return sgroot->createSceneGraph(); | |
116 } | |
117 | |
118 void setSceneData(SceneGraph *g) | |
119 { | |
120 sgroot->setSceneData(g); | |
121 } | |
122 | |
589 | 123 int getLast() |
124 { | |
125 return sgroot->getLast(); | |
126 } | |
127 | |
283 | 128 }; |
129 | |
507 | 130 #define default_sdl_flag SDL_INIT_TIMER | SDL_INIT_JOYSTICK |
131 | |
132 | |
283 | 133 #endif |
134 |