ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/los.C
(Generate patch)

Comparing deliantra/server/common/los.C (file contents):
Revision 1.65 by root, Wed Nov 4 18:17:57 2009 UTC vs.
Revision 1.66 by root, Fri Nov 6 13:03:34 2009 UTC

301 for (int distance = 0; distance <= MAX_VISION * 3 / 2; ++distance) 301 for (int distance = 0; distance <= MAX_VISION * 3 / 2; ++distance)
302 vision_atten [radius][distance] = distance <= radius ? clamp (lerp (radius, 0, MAX_DARKNESS, 3, 0), 0, 3) : 4; 302 vision_atten [radius][distance] = distance <= radius ? clamp (lerp (radius, 0, MAX_DARKNESS, 3, 0), 0, 3) : 4;
303 } 303 }
304} los_init; 304} los_init;
305 305
306// the following functions cannot be static, due to c++ stupidity :/
307namespace {
306// brighten area, ignore los 308 // brighten area, ignore los
307sint8 309 sint8
308los_brighten_nolos (sint8 b, sint8 l) 310 los_brighten_nolos (sint8 b, sint8 l)
309{ 311 {
310 return min (b, l); 312 return min (b, l);
311} 313 }
312 314
313// brighten area, but respect los 315 // brighten area, but respect los
314sint8 316 sint8
315los_brighten (sint8 b, sint8 l) 317 los_brighten (sint8 b, sint8 l)
316{ 318 {
317 return b == LOS_BLOCKED ? b : min (b, l); 319 return b == LOS_BLOCKED ? b : min (b, l);
318} 320 }
319 321
320// darken area, respect los 322 // darken area, respect los
321sint8 323 sint8
322los_darken (sint8 b, sint8 l) 324 los_darken (sint8 b, sint8 l)
323{ 325 {
324 return max (b, l); 326 return max (b, l);
325} 327 }
328};
326 329
327template<sint8 change_it (sint8, sint8)> 330template<sint8 change_it (sint8, sint8)>
328static void 331static void
329apply_light (player *pl, int dx, int dy, int light, const sint8 *atten_table) 332apply_light (player *pl, int dx, int dy, int light, const sint8 *atten_table)
330{ 333{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines