… | |
… | |
328 | { |
328 | { |
329 | return b == LOS_BLOCKED ? b : min (b, l); |
329 | return b == LOS_BLOCKED ? b : min (b, l); |
330 | } |
330 | } |
331 | |
331 | |
332 | sint8 |
332 | sint8 |
333 | los_brighten_blocked (sint8 b, sint8 l) |
|
|
334 | { |
|
|
335 | return min (b, l); |
|
|
336 | } |
|
|
337 | |
|
|
338 | sint8 |
|
|
339 | los_darken (sint8 b, sint8 l) |
333 | los_darken (sint8 b, sint8 l) |
340 | { |
334 | { |
341 | return max (b, l); |
335 | return max (b, l); |
342 | } |
336 | } |
343 | |
337 | |
… | |
… | |
434 | /* grant some vision to the player, based on the darklevel */ |
428 | /* grant some vision to the player, based on the darklevel */ |
435 | /* for outdoor maps, ensure some mininum visibility radius */ |
429 | /* for outdoor maps, ensure some mininum visibility radius */ |
436 | { |
430 | { |
437 | int light = clamp (MAX_DARKNESS - darklevel, op->map->outdoor ? 2 : 0, MAX_LIGHT_RADIUS); |
431 | int light = clamp (MAX_DARKNESS - darklevel, op->map->outdoor ? 2 : 0, MAX_LIGHT_RADIUS); |
438 | |
432 | |
439 | apply_light<los_brighten_blocked> (op, half_x, half_y, light, darkness [light + MAX_LIGHT_RADIUS]); |
433 | apply_light<los_brighten> (op, half_x, half_y, light, darkness [light + MAX_LIGHT_RADIUS]); |
440 | } |
434 | } |
441 | } |
435 | } |
442 | |
436 | |
443 | // possibly do 2nd pass for rare negative glow radii |
437 | // possibly do 2nd pass for rare negative glow radii |
444 | // for effect, those are always considered to be stronger than anything else |
438 | // for effect, those are always considered to be stronger than anything else |