Skip to content

Commit

Permalink
Update logging to be like resgen
Browse files Browse the repository at this point in the history
  • Loading branch information
seedee committed Jul 9, 2024
1 parent 8cb9fac commit 7d0536d
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions src/sdhlt/common/bspfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,7 @@ bool NoWadTextures ()
continue;
}
miptex_t *mt = (miptex_t *)&g_dtexdata[offset];
if (!mt->offsets[0])
if (!mt->offsets[0]) //Check for valid mip texture
{
return false;
}
Expand Down Expand Up @@ -1070,18 +1070,31 @@ void PrintBSPFileSizes()

Log("%i textures referenced\n", numtextures);

Log("=== Total BSP file data space used: %d bytes ===\n", totalmemory);
Log("=== Total BSP file data space used: %d bytes ===\n\n", totalmemory);
if (nowadtextures)
{
Log ("Wad files required to run the map: (None)\n");
Log ("No wad files required to run the map\n");
}
else if (wadvalue == NULL)
{
Log ("Wad files required to run the map: (Couldn't parse wad keyvalue from entity data)\n");
}
else
else //If we have any wads still required //seedee
{
Log ("Wad files required to run the map: \"%s\"\n", wadvalue);
Log("Wad files required to run the map\n");
Log("---------------------------------\n");
size_t length = strlen(wadvalue) + 1;
char* wadvalueNewline = new char[length]; //+1 for null terminator
safe_strncpy(wadvalueNewline, wadvalue, length); //Defensive copy

for (size_t i = 0; i < length; ++i) {
if (wadvalueNewline[i] == ';') {
wadvalueNewline[i] = '\n';
}
}
Log("%s", wadvalueNewline);
delete[] wadvalueNewline;
Log("---------------------------------\n\n");
}
if (wadvalue)
{
Expand Down

0 comments on commit 7d0536d

Please sign in to comment.