0
|
1 void
|
|
2 DataPackEngine::init(int width, int height, int bpp)
|
|
3 {
|
|
4 if(SDL_Init( SDL_INIT_VIDEO ) < 0)
|
|
5 {
|
|
6 cout << "Couldn't initialize SDL:" << SDL_GetError() << endl;
|
|
7 exit(1);
|
|
8 }
|
|
9
|
|
10 // etc...
|
|
11 }
|
|
12
|
|
13 TaskDepend
|
|
14 DataPackEngine::update_all(SceneGraph* next, SceneGraph* now, TaskDepend wait)
|
|
15 {
|
|
16 SceneGraph *t, *nt;
|
|
17 t = now;
|
|
18 nt = next;
|
|
19
|
|
20 SceneGraphPack *nt_pack = nt->data_pack();
|
|
21 SceneGraphPack *t_pack;
|
|
22 Task* t_task = now->get_task();
|
|
23
|
|
24 for (t_pack = now->data_pack(); t_pack < not->data_pack;) {
|
|
25 t_task->update(t_pack, nt_pack);
|
|
26 t_pack = t_pack->next();
|
|
27 nt_pack = nt_pack->next();
|
|
28 }
|
|
29 }
|
|
30
|
|
31 TaskDepend
|
|
32 DataPackEngin::draw_all(SceneGraph* now, TaskDepend wait)
|
|
33 {
|
|
34 SceneGraph *t, *nt;
|
|
35 t = now;
|
|
36 nt = next;
|
|
37
|
|
38 SceneGraphPack *t_pack;
|
|
39 Task* t_task = now->get_task();
|
|
40
|
|
41 for (t_pack = now->data_pack(); t_pack < now->data_pack;) {
|
|
42 t_task->draw(t_pack, nt_pack);
|
|
43 t_pack = t_pack->next();
|
|
44 }
|
|
45 }
|