- hook up lightmap builder

This commit is contained in:
Magnus Norddahl 2018-10-26 13:16:44 +02:00
parent fe9368b048
commit f9960ee12c
4 changed files with 14 additions and 15 deletions

View file

@ -38,6 +38,8 @@ public:
void BuildNodes ();
FLevel Level;
private:
void LoadUDMF();
void LoadThings ();
@ -64,8 +66,6 @@ private:
void ParseMapProperties();
void ParseTextMap(int lump);
FLevel Level;
TArray<FNodeBuilder::FPolyStart> PolyStarts;
TArray<FNodeBuilder::FPolyStart> PolyAnchors;

View file

@ -160,4 +160,3 @@ void Error(const char *error, ...);
char *Va(const char *str, ...);
void Delay(int ms);
const int64_t GetSeconds();
const kexStr &FilePath();

View file

@ -140,8 +140,6 @@ void kexWorker::RunThreads(const int count, void *data, jobFunc_t jobFunc)
/////////////////////////////////////////////////////////////////////////////
// Stuff from old main.cpp
static kexStr basePath;
void Error(const char *error, ...)
{
va_list argptr;
@ -179,15 +177,6 @@ const int64_t GetSeconds()
return time(0);
}
//
// FilePath
//
const kexStr &FilePath()
{
return basePath;
}
//
// Main
//

View file

@ -7,11 +7,11 @@
#include "framework/zdray.h"
#include "wad/wad.h"
#include "level/level.h"
#include "lightmap/lightmap.h"
static void ParseArgs(int argc, char **argv);
static void ShowUsage();
static void ShowVersion();
static bool CheckInOutNames();
const char *Map = nullptr;
const char *InName = nullptr;
@ -71,6 +71,17 @@ int main(int argc, char **argv)
FLevelLoader loader(inwad, lump);
loader.BuildNodes();
loader.Level.ParseConfigFile("lightconfig.txt");
loader.Level.SetupDlight();
Surface_AllocateFromMap(loader.Level);
loader.Level.CreateLights();
kexLightmapBuilder builder;
builder.CreateLightmaps(loader.Level);
builder.WriteTexturesToTGA();
loader.Level.CleanupThingLights();
lump = inwad.LumpAfterMap(lump);
}
else