From 512e8b527ea914615cdac47e4fcd38decce51d5d Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Tue, 14 Oct 2008 21:59:48 +0000 Subject: [PATCH] newmap fullbright fix git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@3024 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/editing.cpp | 2 +- source/src/protos.h | 2 +- source/src/world.cpp | 2 +- source/src/worldlight.cpp | 5 +++++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/source/src/editing.cpp b/source/src/editing.cpp index 8241c157..742df7af 100644 --- a/source/src/editing.cpp +++ b/source/src/editing.cpp @@ -465,7 +465,7 @@ VARF(fullbright, 0, 0, 1, if(fullbright) { if(noteditmode()) return; - fullbrightlight(176); + fullbrightlight(); } else calclight(); ); diff --git a/source/src/protos.h b/source/src/protos.h index 225da527..0d09254d 100644 --- a/source/src/protos.h +++ b/source/src/protos.h @@ -384,7 +384,7 @@ extern entity *newentity(int x, int y, int z, char *what, int v1, int v2, int v3 // worldlight extern int lastcalclight; -extern void fullbrightlight(int level); +extern void fullbrightlight(int level = -1); extern void calclight(); extern void adddynlight(physent *owner, const vec &o, int reach, int expire, int fade, uchar r, uchar g = 0, uchar b = 0); extern void dodynlights(); diff --git a/source/src/world.cpp b/source/src/world.cpp index 20dacac8..8434311c 100644 --- a/source/src/world.cpp +++ b/source/src/world.cpp @@ -352,7 +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, true); + fullbrightlight(); } } if(factor>=0) diff --git a/source/src/worldlight.cpp b/source/src/worldlight.cpp index 099933c0..142deedb 100644 --- a/source/src/worldlight.cpp +++ b/source/src/worldlight.cpp @@ -142,8 +142,13 @@ void postlightarea(const block &a) // median filter, smooths out random noise int lastcalclight = 0; +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; }