mirror of
https://github.com/ZDoom/ZDRay.git
synced 2024-11-22 03:51:26 +00:00
- simplify outer interface slightly
This commit is contained in:
parent
ce7074f646
commit
2555eec131
5 changed files with 21 additions and 31 deletions
|
@ -320,24 +320,20 @@ struct FLevel
|
|||
|
||||
TArray<UDMFKey> props;
|
||||
|
||||
TArray<ThingLight> ThingLights;
|
||||
TArray<SurfaceLightDef> SurfaceLights;
|
||||
|
||||
void FindMapBounds ();
|
||||
void RemoveExtraLines ();
|
||||
void RemoveExtraSides ();
|
||||
void RemoveExtraSectors ();
|
||||
void SetupLights();
|
||||
|
||||
int NumSides() const { return Sides.Size(); }
|
||||
int NumLines() const { return Lines.Size(); }
|
||||
int NumSectors() const { return Sectors.Size(); }
|
||||
int NumThings() const { return Things.Size(); }
|
||||
|
||||
// Dlight helpers
|
||||
|
||||
TArray<ThingLight> ThingLights;
|
||||
TArray<SurfaceLightDef> SurfaceLights;
|
||||
|
||||
void SetupDlight();
|
||||
void CreateLights();
|
||||
|
||||
const Vec3 &GetSunColor() const;
|
||||
const Vec3 &GetSunDirection() const;
|
||||
IntSector *GetFrontSector(const IntSideDef *side);
|
||||
|
@ -348,6 +344,7 @@ struct FLevel
|
|||
|
||||
private:
|
||||
void CheckSkySectors();
|
||||
void CreateLights();
|
||||
};
|
||||
|
||||
const int BLOCKSIZE = 128;
|
||||
|
|
|
@ -615,19 +615,8 @@ void FProcessor::BuildNodes()
|
|||
|
||||
void FProcessor::BuildLightmaps()
|
||||
{
|
||||
LMBuilder.ambience = 0.0f;
|
||||
LMBuilder.samples = Samples;
|
||||
LMBuilder.textureWidth = LMDims;
|
||||
LMBuilder.textureHeight = LMDims;
|
||||
|
||||
Level.SetupDlight();
|
||||
Level.CreateLights();
|
||||
|
||||
LMBuilder.CreateLightmaps(Level);
|
||||
|
||||
//LMBuilder.WriteTexturesToTGA();
|
||||
//LMBuilder.WriteMeshToOBJ();
|
||||
|
||||
Level.SetupLights();
|
||||
LMBuilder.CreateLightmaps(Level, Samples, LMDims);
|
||||
LightmapsBuilt = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
static const Vec3 defaultSunColor(1, 1, 1);
|
||||
static const Vec3 defaultSunDirection(0.45f, 0.3f, 0.9f);
|
||||
|
||||
void FLevel::SetupDlight()
|
||||
void FLevel::SetupLights()
|
||||
{
|
||||
CheckSkySectors();
|
||||
|
||||
|
@ -79,6 +79,8 @@ void FLevel::SetupDlight()
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
CreateLights();
|
||||
}
|
||||
|
||||
void FLevel::CheckSkySectors()
|
||||
|
|
|
@ -719,9 +719,13 @@ void LightmapBuilder::CreateSurfaceLights()
|
|||
}
|
||||
}
|
||||
|
||||
void LightmapBuilder::CreateLightmaps(FLevel &doomMap)
|
||||
void LightmapBuilder::CreateLightmaps(FLevel &doomMap, int sampleDistance, int textureSize)
|
||||
{
|
||||
map = &doomMap;
|
||||
samples = sampleDistance;
|
||||
textureWidth = textureSize;
|
||||
textureHeight = textureSize;
|
||||
|
||||
mesh = std::make_unique<LevelMesh>(doomMap);
|
||||
|
||||
CreateSurfaceLights();
|
||||
|
|
|
@ -61,15 +61,9 @@ public:
|
|||
LightmapBuilder();
|
||||
~LightmapBuilder();
|
||||
|
||||
void CreateLightmaps(FLevel &doomMap);
|
||||
//void WriteTexturesToTGA();
|
||||
void CreateLightmaps(FLevel &doomMap, int sampleDistance, int textureSize);
|
||||
void AddLightmapLump(FWadWriter &wadFile);
|
||||
|
||||
int samples = 16;
|
||||
float ambience = 0.0f;
|
||||
int textureWidth = 128;
|
||||
int textureHeight = 128;
|
||||
|
||||
private:
|
||||
void NewTexture();
|
||||
bool MakeRoomForBlock(const int width, const int height, int *x, int *y, int *num);
|
||||
|
@ -87,8 +81,12 @@ private:
|
|||
|
||||
void CreateSurfaceLights();
|
||||
|
||||
std::unique_ptr<LevelMesh> mesh;
|
||||
FLevel *map;
|
||||
int samples = 16;
|
||||
int textureWidth = 128;
|
||||
int textureHeight = 128;
|
||||
|
||||
std::unique_ptr<LevelMesh> mesh;
|
||||
std::vector<std::unique_ptr<SurfaceLight>> surfaceLights;
|
||||
std::vector<std::vector<uint16_t>> textures;
|
||||
std::vector<uint16_t> indirectoutput;
|
||||
|
|
Loading…
Reference in a new issue