Skip to content

Commit 6ba2cff

Browse files
committed
Replace the savelightmap and deletelightmap ccmds with vktool
1 parent 5879c0d commit 6ba2cff

File tree

2 files changed

+30
-16
lines changed

2 files changed

+30
-16
lines changed

src/commandlets/lightmapcmd.cpp

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,36 @@ LightmapDeleteCmdlet::LightmapDeleteCmdlet()
110110

111111
void LightmapDeleteCmdlet::OnCommand(FArgs args)
112112
{
113-
RunInGame([]() {
114-
Printf("Deleting LIGHTMAP lump!\n");
113+
// Pretty lame that we have to load the map here, but cba to figure out how to deal with map loading outside the engine...
114+
115+
RunInGame([&]() {
116+
FString mapname;
117+
if (args.NumArgs() > 0 && args.GetArg(0)[0] != '-')
118+
mapname = args.GetArg(0);
119+
else
120+
mapname = "map01";
121+
122+
G_SetMap(mapname.GetChars(), 0);
123+
for (int i = 0; i < 100; i++)
124+
{
125+
D_SingleTick();
126+
if (gameaction == ga_nothing)
127+
break;
128+
}
129+
130+
if (!level.levelMesh)
131+
{
132+
Printf("No level mesh. Perhaps your level has no lightmap loaded?\n");
133+
return;
134+
}
135+
136+
if (!level.lightmaps)
137+
{
138+
Printf("Lightmap is not enabled in this level.\n");
139+
}
140+
141+
level.levelMesh->DeleteLightmapLump(level);
142+
115143
});
116144
}
117145

src/rendering/hwrenderer/doom_levelmesh.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -127,20 +127,6 @@ CCMD(invalidatelightmap)
127127
Printf("Marked %d out of %d tiles for update.\n", count, level.levelMesh->Lightmap.Tiles.Size());
128128
}
129129

130-
CCMD(savelightmap)
131-
{
132-
if (!RequireLightmap()) return;
133-
134-
level.levelMesh->SaveLightmapLump(level);
135-
}
136-
137-
CCMD(deletelightmap)
138-
{
139-
if (!RequireLightmap()) return;
140-
141-
level.levelMesh->DeleteLightmapLump(level);
142-
}
143-
144130
CCMD(cpublasinfo)
145131
{
146132
if (!level.levelMesh || !level.levelMesh->Collision)

0 commit comments

Comments
 (0)