… | |
… | |
6 | |
6 | |
7 | using namespace std; |
7 | using namespace std; |
8 | |
8 | |
9 | #include "util.h" |
9 | #include "util.h" |
10 | |
10 | |
|
|
11 | struct visibility_state { |
|
|
12 | unsigned int generation; |
|
|
13 | enum { UNKNOWN, OCCLUDED, PARTIAL, FULL } visibility; |
|
|
14 | |
|
|
15 | visibility_state () : generation(0), visibility(UNKNOWN) { }; |
|
|
16 | }; |
|
|
17 | |
11 | struct view { |
18 | struct view { |
12 | sector orig; |
19 | sector orig; |
13 | point p; |
20 | point p; |
14 | vec3 d, u; |
21 | vec3 d, u; |
15 | float fov; |
22 | float fov; |
16 | int w, h; |
23 | int w, h; |
17 | |
24 | |
18 | void draw (draw_context &ctx); |
25 | void draw (); |
19 | }; |
|
|
20 | |
26 | |
21 | struct visibility_state { |
27 | // only to be used by friends TODO |
22 | unsigned int generation; |
|
|
23 | enum { UNKNOWN, OCCLUDED, PARTIAL, FULL } visibility; |
|
|
24 | |
|
|
25 | visibility_state () : generation(0), visibility(UNKNOWN) { }; |
|
|
26 | }; |
|
|
27 | |
|
|
28 | struct draw_context { |
|
|
29 | view &v; |
|
|
30 | |
28 | |
31 | matrix projection; |
29 | matrix projection; |
32 | |
30 | |
33 | void transform (const matrix &m); |
31 | void transform (const matrix &m); |
34 | |
32 | |
… | |
… | |
44 | vector<octant *> vislist; // octants partially or fully visible |
42 | vector<octant *> vislist; // octants partially or fully visible |
45 | vector<octant *> checklist; // octants possibly visible |
43 | vector<octant *> checklist; // octants possibly visible |
46 | |
44 | |
47 | bool may_draw (entity_base *e); |
45 | bool may_draw (entity_base *e); |
48 | |
46 | |
49 | draw_context (view &v); |
47 | view (); |
50 | ~draw_context (); |
48 | ~view (); |
51 | }; |
49 | }; |
52 | |
50 | |
53 | #endif |
51 | #endif |
54 | |
52 | |