… | |
… | |
174 | l.culled &= !xi->visible; |
174 | l.culled &= !xi->visible; |
175 | |
175 | |
176 | /* merge input space */ |
176 | /* merge input space */ |
177 | if (expect_false (xi->xo || xi->yo)) |
177 | if (expect_false (xi->xo || xi->yo)) |
178 | { |
178 | { |
179 | // The X input can provide two main pieces of information: |
179 | // The X input can provide two main pieces of information: |
180 | // 1. Progressive X obscurity. |
180 | // 1. Progressive X obscurity. |
181 | // 2. Recessive Y obscurity. |
181 | // 2. Recessive Y obscurity. |
182 | |
182 | |
183 | // Progressive X obscurity, favouring recessive input angle |
183 | // Progressive X obscurity, favouring recessive input angle |
184 | if (xi->xe > 0 && l.xo == 0) |
184 | if (xi->xe > 0 && l.xo == 0) |
… | |
… | |
209 | l.culled &= !yi->visible; |
209 | l.culled &= !yi->visible; |
210 | |
210 | |
211 | /* merge input space */ |
211 | /* merge input space */ |
212 | if (expect_false (yi->yo || yi->xo)) |
212 | if (expect_false (yi->yo || yi->xo)) |
213 | { |
213 | { |
214 | // The Y input can provide two main pieces of information: |
214 | // The Y input can provide two main pieces of information: |
215 | // 1. Progressive Y obscurity. |
215 | // 1. Progressive Y obscurity. |
216 | // 2. Recessive X obscurity. |
216 | // 2. Recessive X obscurity. |
217 | |
217 | |
218 | // Progressive Y obscurity, favouring recessive input angle |
218 | // Progressive Y obscurity, favouring recessive input angle |
219 | if (yi->ye > 0 && l.yo == 0) |
219 | if (yi->ye > 0 && l.yo == 0) |
… | |
… | |
260 | } |
260 | } |
261 | |
261 | |
262 | } |
262 | } |
263 | |
263 | |
264 | // Expands by the unit length in each component's current direction. |
264 | // Expands by the unit length in each component's current direction. |
265 | // If a component has no direction, then it is expanded in both of its |
265 | // If a component has no direction, then it is expanded in both of its |
266 | // positive and negative directions. |
266 | // positive and negative directions. |
267 | if (!l.culled) |
267 | if (!l.culled) |
268 | { |
268 | { |
269 | if (dx >= 0) enqueue (dx + 1, dy, FLG_XI); |
269 | if (dx >= 0) enqueue (dx + 1, dy, FLG_XI); |
270 | if (dx <= 0) enqueue (dx - 1, dy, FLG_XI); |
270 | if (dx <= 0) enqueue (dx - 1, dy, FLG_XI); |
… | |
… | |
351 | for (int ay = ay0; ay <= ay1; ay++) |
351 | for (int ay = ay0; ay <= ay1; ay++) |
352 | pl->los[ax][ay] = |
352 | pl->los[ax][ay] = |
353 | change_it (pl->los[ax][ay], atten_table [idistance (ax - dx, ay - dy)]); |
353 | change_it (pl->los[ax][ay], atten_table [idistance (ax - dx, ay - dy)]); |
354 | } |
354 | } |
355 | |
355 | |
356 | /* add light, by finding all (non-null) nearby light sources, then |
356 | /* add light, by finding all (non-null) nearby light sources, then |
357 | * mark those squares specially. |
357 | * mark those squares specially. |
358 | */ |
358 | */ |
359 | static void |
359 | static void |
360 | apply_lights (player *pl) |
360 | apply_lights (player *pl) |
361 | { |
361 | { |
… | |
… | |
448 | apply_light<los_darken> (pl, dx - pl->viewpoint->x, dy - pl->viewpoint->y, -light, light_atten [light + MAX_LIGHT_RADIUS]); |
448 | apply_light<los_darken> (pl, dx - pl->viewpoint->x, dy - pl->viewpoint->y, -light, light_atten [light + MAX_LIGHT_RADIUS]); |
449 | } |
449 | } |
450 | } |
450 | } |
451 | } |
451 | } |
452 | |
452 | |
453 | /* blinded_sight() - sets all viewable squares to blocked except |
453 | /* blinded_sight() - sets all viewable squares to blocked except |
454 | * for the one the central one that the player occupies. A little |
454 | * for the one the central one that the player occupies. A little |
455 | * odd that you can see yourself (and what your standing on), but |
455 | * odd that you can see yourself (and what your standing on), but |
456 | * really need for any reasonable game play. |
456 | * really need for any reasonable game play. |
457 | */ |
457 | */ |
458 | static void |
458 | static void |