Skip to content

Commit

Permalink
Update Gui.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Karaulov committed Dec 18, 2022
1 parent 0803b4b commit 97d852c
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/editor/Gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2579,7 +2579,7 @@ void Gui::drawDebugWidget()

}

if (ImGui::Button("PRESS ME TO DECAL"))
if (map && ImGui::Button("PRESS ME TO DECAL"))
{
for (auto& ent : map->ents)
{
Expand All @@ -2591,7 +2591,7 @@ void Gui::drawDebugWidget()
}
}

if (renderer->needReloadDebugTextures)
if (renderer && map && renderer->needReloadDebugTextures)
{
renderer->needReloadDebugTextures = false;
lastupdate = app->curTime;
Expand Down Expand Up @@ -2635,6 +2635,19 @@ void Gui::drawDebugWidget()
}
}

for (size_t i = 0; i < map->ents.size(); i++)
{
if (map->ents[i]->hasKey("classname") && map->ents[i]->keyvalues["classname"] == "infodecal")
{
if (map->ents[i]->hasKey("texture"))
{
std::string texture = map->ents[i]->keyvalues["texture"];
if (!mapTexsUsage["decals.wad"].count(texture))
mapTexsUsage["decals.wad"].insert(texture);
}
}
}

if (mapTexsUsage.size())
logf("Debug: Used %d wad files(include map file)\n", (int)mapTexsUsage.size());
}
Expand Down

0 comments on commit 97d852c

Please sign in to comment.