Added toggle for lm_dynamic
This commit is contained in:
parent
2c45d9aa99
commit
57202305d6
6 changed files with 9 additions and 7 deletions
|
|
@ -1052,7 +1052,7 @@ void DoomLevelMesh::CreateWallSurface(side_t* side, HWWallDispatcher& disp, Mesh
|
|||
tile.Bounds = sinfo.Surface->Bounds;
|
||||
tile.Plane = sinfo.Surface->Plane;
|
||||
tile.SampleDimension = GetSampleDimension(sampleDimension);
|
||||
tile.AlwaysUpdate = true;
|
||||
tile.AlwaysUpdate = 2; // Ignore lm_dynamic
|
||||
|
||||
sinfo.Surface->LightmapTileIndex = Lightmap.Tiles.Size();
|
||||
Lightmap.Tiles.Push(tile);
|
||||
|
|
@ -1153,7 +1153,7 @@ void DoomLevelMesh::SortDrawLists()
|
|||
memcpy(Mesh.DrawIndexes.Data(), indexes.Data(), indexes.Size() * sizeof(uint32_t));
|
||||
}
|
||||
|
||||
int DoomLevelMesh::AddSurfaceToTile(const DoomSurfaceInfo& info, const LevelMeshSurface& surf, uint16_t sampleDimension, bool alwaysUpdate)
|
||||
int DoomLevelMesh::AddSurfaceToTile(const DoomSurfaceInfo& info, const LevelMeshSurface& surf, uint16_t sampleDimension, uint8_t alwaysUpdate)
|
||||
{
|
||||
if (surf.IsSky)
|
||||
return -1;
|
||||
|
|
@ -1177,7 +1177,7 @@ int DoomLevelMesh::AddSurfaceToTile(const DoomSurfaceInfo& info, const LevelMesh
|
|||
tile.Bounds.max.X = std::max(tile.Bounds.max.X, surf.Bounds.max.X);
|
||||
tile.Bounds.max.Y = std::max(tile.Bounds.max.Y, surf.Bounds.max.Y);
|
||||
tile.Bounds.max.Z = std::max(tile.Bounds.max.Z, surf.Bounds.max.Z);
|
||||
tile.AlwaysUpdate = tile.AlwaysUpdate || alwaysUpdate;
|
||||
tile.AlwaysUpdate = max<uint8_t>(tile.AlwaysUpdate, alwaysUpdate);
|
||||
}
|
||||
|
||||
return index;
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ private:
|
|||
|
||||
BBox GetBoundsFromSurface(const LevelMeshSurface& surface) const;
|
||||
|
||||
int AddSurfaceToTile(const DoomSurfaceInfo& info, const LevelMeshSurface& surf, uint16_t sampleDimension, bool alwaysUpdate);
|
||||
int AddSurfaceToTile(const DoomSurfaceInfo& info, const LevelMeshSurface& surf, uint16_t sampleDimension, uint8_t alwaysUpdate);
|
||||
int GetSampleDimension(uint16_t sampleDimension);
|
||||
|
||||
void CreatePortals(FLevelLocals& doomMap);
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
EXTERN_CVAR(Bool, lm_always_update);
|
||||
EXTERN_CVAR(Int, lm_max_updates);
|
||||
EXTERN_CVAR(Bool, lm_dynamic);
|
||||
|
||||
enum EDrawMode
|
||||
{
|
||||
|
|
@ -239,7 +240,7 @@ public:
|
|||
}
|
||||
|
||||
LightmapTile* tile = &Level->levelMesh->Lightmap.Tiles[tileIndex];
|
||||
if (lm_always_update || tile->AlwaysUpdate)
|
||||
if (lm_always_update || tile->AlwaysUpdate == 2 || (tile->AlwaysUpdate == 1 && lm_dynamic))
|
||||
{
|
||||
tile->NeedsUpdate = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class ActorTraceStaticLight
|
|||
public:
|
||||
ActorTraceStaticLight(AActor* actor) : Actor(actor)
|
||||
{
|
||||
if (Actor && (Actor->Pos() != Actor->StaticLightsTraceCache.Pos || (Actor->Sector && (Actor->Sector->Flags & SECF_LM_DYNAMIC))))
|
||||
if (Actor && (Actor->Pos() != Actor->StaticLightsTraceCache.Pos || (Actor->Sector && (Actor->Sector->Flags & SECF_LM_DYNAMIC) && lm_dynamic)))
|
||||
{
|
||||
Actor->StaticLightsTraceCache.Pos = Actor->Pos();
|
||||
Actor->StaticLightsTraceCache.Bits = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue