… | |
… | |
32 | FLG_YI = 0x02, // we have an y-parent |
32 | FLG_YI = 0x02, // we have an y-parent |
33 | FLG_BLOCKED = 0x04, // this space blocks the view |
33 | FLG_BLOCKED = 0x04, // this space blocks the view |
34 | FLG_QUEUED = 0x80 // already queued in queue, or border |
34 | FLG_QUEUED = 0x80 // already queued in queue, or border |
35 | }; |
35 | }; |
36 | |
36 | |
|
|
37 | // it is important for performance reasons that this structure |
|
|
38 | // has a size easily computable by the cpu (*8 is perfect). |
|
|
39 | // it is possible to move culled and visible into flags, at |
|
|
40 | // some speed loss. |
37 | struct los_info |
41 | struct los_info |
38 | { |
42 | { |
39 | uint8 flags; // FLG_xxx |
43 | uint8 flags; // FLG_xxx |
40 | uint8 culled; // culled from "tree" |
44 | uint8 culled; // culled from "tree" |
41 | uint8 visible; |
45 | uint8 visible; |
… | |
… | |
81 | |
85 | |
82 | los_info &l = los[x][y]; |
86 | los_info &l = los[x][y]; |
83 | |
87 | |
84 | l.flags |= flags; |
88 | l.flags |= flags; |
85 | |
89 | |
86 | if (l.flags & FLG_QUEUED) |
90 | if (expect_false (l.flags & FLG_QUEUED)) |
87 | return; |
91 | return; |
88 | |
92 | |
89 | l.flags |= FLG_QUEUED; |
93 | l.flags |= FLG_QUEUED; |
90 | |
94 | |
91 | queue[q1].x = dx; |
95 | queue[q1].x = dx; |