light: add debug dump for lights

This commit is contained in:
Eric Wasylishen 2016-08-01 21:38:14 -06:00
parent 607706a684
commit 9f0f2cdf83
1 changed files with 32 additions and 0 deletions

View File

@ -1382,6 +1382,36 @@ static void CheckLitNeeded()
}
}
static void PrintLight(const light_t &light)
{
bool first = true;
auto settings = const_cast<light_t&>(light).settings();
for (const auto &setting : settings.allSettings()) {
if (!setting->isChanged())
continue; // don't spam default values
// print separator
if (!first) {
logprint("; ");
} else {
first = false;
}
logprint("%s=%s", setting->primaryName().c_str(), setting->stringValue().c_str());
}
logprint("\n");
}
static void PrintLights(void)
{
logprint("===PrintLights===\n");
for (const auto &light: GetLights()) {
PrintLight(light);
}
}
static void PrintUsage()
{
printf("usage: light [options] mapname.bsp\n"
@ -1769,6 +1799,8 @@ main(int argc, const char **argv)
SetupLights(bsp);
//PrintLights();
if (!onlyents)
{
CheckLitNeeded();