mirror of
https://github.com/ZDoom/ZDRay.git
synced 2025-01-26 01:21:02 +00:00
- hook up lightmap builder
This commit is contained in:
parent
fe9368b048
commit
f9960ee12c
4 changed files with 14 additions and 15 deletions
|
@ -38,6 +38,8 @@ public:
|
||||||
|
|
||||||
void BuildNodes ();
|
void BuildNodes ();
|
||||||
|
|
||||||
|
FLevel Level;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void LoadUDMF();
|
void LoadUDMF();
|
||||||
void LoadThings ();
|
void LoadThings ();
|
||||||
|
@ -64,8 +66,6 @@ private:
|
||||||
void ParseMapProperties();
|
void ParseMapProperties();
|
||||||
void ParseTextMap(int lump);
|
void ParseTextMap(int lump);
|
||||||
|
|
||||||
FLevel Level;
|
|
||||||
|
|
||||||
TArray<FNodeBuilder::FPolyStart> PolyStarts;
|
TArray<FNodeBuilder::FPolyStart> PolyStarts;
|
||||||
TArray<FNodeBuilder::FPolyStart> PolyAnchors;
|
TArray<FNodeBuilder::FPolyStart> PolyAnchors;
|
||||||
|
|
||||||
|
|
|
@ -160,4 +160,3 @@ void Error(const char *error, ...);
|
||||||
char *Va(const char *str, ...);
|
char *Va(const char *str, ...);
|
||||||
void Delay(int ms);
|
void Delay(int ms);
|
||||||
const int64_t GetSeconds();
|
const int64_t GetSeconds();
|
||||||
const kexStr &FilePath();
|
|
||||||
|
|
|
@ -140,8 +140,6 @@ void kexWorker::RunThreads(const int count, void *data, jobFunc_t jobFunc)
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Stuff from old main.cpp
|
// Stuff from old main.cpp
|
||||||
|
|
||||||
static kexStr basePath;
|
|
||||||
|
|
||||||
void Error(const char *error, ...)
|
void Error(const char *error, ...)
|
||||||
{
|
{
|
||||||
va_list argptr;
|
va_list argptr;
|
||||||
|
@ -179,15 +177,6 @@ const int64_t GetSeconds()
|
||||||
return time(0);
|
return time(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// FilePath
|
|
||||||
//
|
|
||||||
|
|
||||||
const kexStr &FilePath()
|
|
||||||
{
|
|
||||||
return basePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Main
|
// Main
|
||||||
//
|
//
|
||||||
|
|
13
src/main.cpp
13
src/main.cpp
|
@ -7,11 +7,11 @@
|
||||||
#include "framework/zdray.h"
|
#include "framework/zdray.h"
|
||||||
#include "wad/wad.h"
|
#include "wad/wad.h"
|
||||||
#include "level/level.h"
|
#include "level/level.h"
|
||||||
|
#include "lightmap/lightmap.h"
|
||||||
|
|
||||||
static void ParseArgs(int argc, char **argv);
|
static void ParseArgs(int argc, char **argv);
|
||||||
static void ShowUsage();
|
static void ShowUsage();
|
||||||
static void ShowVersion();
|
static void ShowVersion();
|
||||||
static bool CheckInOutNames();
|
|
||||||
|
|
||||||
const char *Map = nullptr;
|
const char *Map = nullptr;
|
||||||
const char *InName = nullptr;
|
const char *InName = nullptr;
|
||||||
|
@ -71,6 +71,17 @@ int main(int argc, char **argv)
|
||||||
FLevelLoader loader(inwad, lump);
|
FLevelLoader loader(inwad, lump);
|
||||||
loader.BuildNodes();
|
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);
|
lump = inwad.LumpAfterMap(lump);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue