From a68979a57b2da55289443d693cd382e3137d1f3a Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Wed, 27 Jul 2016 02:00:11 -0600 Subject: [PATCH] light: add -nolights option --- include/light/light.hh | 1 + light/entities.cc | 5 +++++ light/light.cc | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/include/light/light.hh b/include/light/light.hh index 74c96380..37ca1b74 100644 --- a/include/light/light.hh +++ b/include/light/light.hh @@ -668,6 +668,7 @@ extern qboolean onlyents; extern qboolean scaledonly; extern uint32_t *extended_texinfo_flags; extern qboolean novis; +extern bool nolights; typedef enum { backend_bsp, diff --git a/light/entities.cc b/light/entities.cc index 3d19a9f3..3f266038 100644 --- a/light/entities.cc +++ b/light/entities.cc @@ -885,6 +885,11 @@ LoadEntities(const bsp2_t *bsp) SetGlobalSetting(epair.first, epair.second, false); } + assert(all_lights.size() == 0); + if (nolights) { + return; + } + /* go through all the entities */ for (const auto &entdict : entdicts) { diff --git a/light/light.cc b/light/light.cc index c4d2e54a..9952f14a 100644 --- a/light/light.cc +++ b/light/light.cc @@ -127,6 +127,7 @@ int write_litfile = 0; /* 0 for none, 1 for .lit, 2 for bspx, 3 for both */ int write_luxfile = 0; /* 0 for none, 1 for .lux, 2 for bspx, 3 for both */ qboolean onlyents = false; qboolean novis = false; /* if true, don't use vis data */ +bool nolights = false; backend_t rtbackend = backend_embree; debugmode_t debugmode = debugmode_none; @@ -1614,6 +1615,9 @@ main(int argc, const char **argv) } else if ( !strcmp( argv[ i ], "-novis" ) ) { novis = true; logprint( "Skipping use of vis data to optimize lighting\n" ); + } else if ( !strcmp( argv[ i ], "-nolights" ) ) { + nolights = true; + logprint( "Skipping all light entities (sunlight / minlight only)\n" ); } else if ( !strcmp( argv[ i ], "-backend" ) ) { const char *requested = ParseString(&i, argc, argv); if (!strcmp(requested, "bsp")) {