From 2f53b27d847cc99d716cf384bc327f2099b0ef7b Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Tue, 14 Oct 2008 22:43:09 +0000 Subject: [PATCH] fullbright/dynlight fixes git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@3025 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/world.cpp | 1 + source/src/worldlight.cpp | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/src/world.cpp b/source/src/world.cpp index 8434311c..ce9509ac 100644 --- a/source/src/world.cpp +++ b/source/src/world.cpp @@ -352,6 +352,7 @@ bool empty_world(int factor, bool force) // main empty world creation routine execfile("config/default_map_settings.cfg"); persistidents = true; popscontext(); + setvar("fullbright", 1); fullbrightlight(); } } diff --git a/source/src/worldlight.cpp b/source/src/worldlight.cpp index 142deedb..702eebf4 100644 --- a/source/src/worldlight.cpp +++ b/source/src/worldlight.cpp @@ -7,8 +7,8 @@ VAR(lightscale,1,4,100); void lightray(float bx, float by, const persistent_entity &light, float fade = 1, bool flicker = false) // done in realtime, needs to be fast { - float lx = light.x+(rnd(21)-10)*0.1f; - float ly = light.y+(rnd(21)-10)*0.1f; + float lx = light.x+(flicker ? (rnd(21)-10)*0.1f : 0); + float ly = light.y+(flicker ? (rnd(21)-10)*0.1f : 0); float dx = bx-lx; float dy = by-ly; float dist = (float)sqrt(dx*dx+dy*dy); @@ -147,7 +147,6 @@ VARP(fullbrightlevel, 0, 176, 255); void fullbrightlight(int level) { if(level < 0) level = fullbrightlevel; - else level = min(level, 255); loopi(mipsize) world[i].r = world[i].g = world[i].b = level; lastcalclight = totalmillis;