mirror of
https://github.com/ZDoom/gzdoom-last-svn.git
synced 2025-06-04 03:00:47 +00:00
* Updated to ZDoom r3198:
- Fixed: P_CheckPosition() should checks all lines contacted by the actor. Stopping once it finds one blocking line will prevent any further lines with specials from activating their specials. - Add the wad a map is defined in to the output of listmaps. - Fixed: DDrawFB::Lock() should only act on NeedResRecreate when going from LockCount 0 -> 1. - Fixed: When DDrawFB::Lock() has to recreate resources, it left the LockCount at 0. This causes problems if something else locks it before it is unlocked, because the second locker will think it is the first. This happens in R_RenderViewToCanvas(). See DDrawFB::PaletteChanged() for the most common reason why Lock() would need to recreate resources. - Fixed: DDrawFB::CreateSurfacesComplex() had debugging cruft left in that skipped all but the last attempts. - Fixed logging of video debug info to a file to not multiply define dbg. - Fixed: Building with NOASM defined no longer worked, because the DrawSlab routines in a.asm conflicted with the ones in r_draw.cpp. - Colorize missing texture messages. - Place a limit on the number of reports per missing texture. On maps with many lines and many sides of missing textures, this can take a very long time, because each missing textures causes a scan of every single line (for the sake of packed sidedefs), and each output line also requires an update of the hidden RichEdit logging control. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1212 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
parent
3a68b80933
commit
84ef9ea80c
13 changed files with 152 additions and 65 deletions
104
src/p_setup.cpp
104
src/p_setup.cpp
|
@ -71,6 +71,8 @@
|
|||
|
||||
#include "fragglescript/t_fs.h"
|
||||
|
||||
#define MISSING_TEXTURE_WARN_LIMIT 20
|
||||
|
||||
void P_SpawnSlopeMakers (FMapThing *firstmt, FMapThing *lastmt);
|
||||
void P_SetSlopes ();
|
||||
void P_CopySlopes();
|
||||
|
@ -82,7 +84,7 @@ extern bool P_LoadBuildMap (BYTE *mapdata, size_t len, FMapThing **things, int *
|
|||
|
||||
extern void P_TranslateTeleportThings (void);
|
||||
|
||||
void P_ParseTextMap(MapData *map);
|
||||
void P_ParseTextMap(MapData *map, FMissingTextureTracker &);
|
||||
|
||||
extern int numinterpolations;
|
||||
extern unsigned int R_OldBlend;
|
||||
|
@ -562,7 +564,7 @@ void MapData::GetChecksum(BYTE cksum[16])
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
static void SetTexture (side_t *side, int position, const char *name8)
|
||||
static void SetTexture (side_t *side, int position, const char *name8, FMissingTextureTracker &track)
|
||||
{
|
||||
static const char *positionnames[] = { "top", "middle", "bottom" };
|
||||
static const char *sidenames[] = { "first", "second" };
|
||||
|
@ -574,16 +576,21 @@ static void SetTexture (side_t *side, int position, const char *name8)
|
|||
|
||||
if (!texture.Exists())
|
||||
{
|
||||
// Print an error that lists all references to this sidedef.
|
||||
// We must scan the linedefs manually for all references to this sidedef.
|
||||
for(int i = 0; i < numlines; i++)
|
||||
if (++track[name].Count <= MISSING_TEXTURE_WARN_LIMIT)
|
||||
{
|
||||
for(int j = 0; j < 2; j++)
|
||||
// Print an error that lists all references to this sidedef.
|
||||
// We must scan the linedefs manually for all references to this sidedef.
|
||||
for(int i = 0; i < numlines; i++)
|
||||
{
|
||||
if (lines[i].sidedef[j] == side)
|
||||
for(int j = 0; j < 2; j++)
|
||||
{
|
||||
Printf("Unknown %s texture '%s' on %s side of linedef %d\n",
|
||||
positionnames[position], name, sidenames[j], i);
|
||||
if (lines[i].sidedef[j] == side)
|
||||
{
|
||||
Printf(TEXTCOLOR_RED"Unknown %s texture '"
|
||||
TEXTCOLOR_ORANGE "%s" TEXTCOLOR_RED
|
||||
"' on %s side of linedef %d\n",
|
||||
positionnames[position], name, sidenames[j], i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -599,7 +606,7 @@ static void SetTexture (side_t *side, int position, const char *name8)
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
void SetTexture (sector_t *sector, int index, int position, const char *name8)
|
||||
void SetTexture (sector_t *sector, int index, int position, const char *name8, FMissingTextureTracker &track)
|
||||
{
|
||||
static const char *positionnames[] = { "floor", "ceiling" };
|
||||
char name[9];
|
||||
|
@ -610,13 +617,44 @@ void SetTexture (sector_t *sector, int index, int position, const char *name8)
|
|||
|
||||
if (!texture.Exists())
|
||||
{
|
||||
Printf("Unknown %s texture '%s' in sector %d\n",
|
||||
positionnames[position], name, index);
|
||||
if (++track[name].Count <= MISSING_TEXTURE_WARN_LIMIT)
|
||||
{
|
||||
Printf(TEXTCOLOR_RED"Unknown %s texture '"
|
||||
TEXTCOLOR_ORANGE "%s" TEXTCOLOR_RED
|
||||
"' in sector %d\n",
|
||||
positionnames[position], name, index);
|
||||
}
|
||||
texture = TexMan.GetDefaultTexture();
|
||||
}
|
||||
sector->SetTexture(position, texture);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// SummarizeMissingTextures
|
||||
//
|
||||
// Lists textures that were missing more than MISSING_TEXTURE_WARN_LIMIT
|
||||
// times.
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
static void SummarizeMissingTextures(const FMissingTextureTracker &missing)
|
||||
{
|
||||
FMissingTextureTracker::ConstIterator it(missing);
|
||||
FMissingTextureTracker::ConstPair *pair;
|
||||
|
||||
while (it.NextPair(pair))
|
||||
{
|
||||
if (pair->Value.Count > MISSING_TEXTURE_WARN_LIMIT)
|
||||
{
|
||||
Printf(TEXTCOLOR_RED "Missing texture '"
|
||||
TEXTCOLOR_ORANGE "%s" TEXTCOLOR_RED
|
||||
"' is used %d more times\n",
|
||||
pair->Key.GetChars(), pair->Value.Count - MISSING_TEXTURE_WARN_LIMIT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// [RH] Figure out blends for deep water sectors
|
||||
|
@ -1402,7 +1440,7 @@ void P_LoadSubsectors (MapData * map)
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
void P_LoadSectors (MapData * map)
|
||||
void P_LoadSectors (MapData *map, FMissingTextureTracker &missingtex)
|
||||
{
|
||||
char fname[9];
|
||||
int i;
|
||||
|
@ -1445,8 +1483,8 @@ void P_LoadSectors (MapData * map)
|
|||
ss->ceilingplane.d = ss->GetPlaneTexZ(sector_t::ceiling);
|
||||
ss->ceilingplane.c = -FRACUNIT;
|
||||
ss->ceilingplane.ic = -FRACUNIT;
|
||||
SetTexture(ss, i, sector_t::floor, ms->floorpic);
|
||||
SetTexture(ss, i, sector_t::ceiling, ms->ceilingpic);
|
||||
SetTexture(ss, i, sector_t::floor, ms->floorpic, missingtex);
|
||||
SetTexture(ss, i, sector_t::ceiling, ms->ceilingpic, missingtex);
|
||||
ss->lightlevel = (BYTE)clamp (LittleShort(ms->lightlevel), (short)0, (short)255);
|
||||
if (map->HasBehavior)
|
||||
ss->special = LittleShort(ms->special);
|
||||
|
@ -2346,7 +2384,7 @@ int P_DetermineTranslucency (int lumpnum)
|
|||
return newcolor.r;
|
||||
}
|
||||
|
||||
void P_ProcessSideTextures(bool checktranmap, side_t *sd, sector_t *sec, mapsidedef_t *msd, int special, int tag, short *alpha)
|
||||
void P_ProcessSideTextures(bool checktranmap, side_t *sd, sector_t *sec, mapsidedef_t *msd, int special, int tag, short *alpha, FMissingTextureTracker &missingtex)
|
||||
{
|
||||
char name[9];
|
||||
name[8] = 0;
|
||||
|
@ -2377,7 +2415,7 @@ void P_ProcessSideTextures(bool checktranmap, side_t *sd, sector_t *sec, mapside
|
|||
SetTextureNoErr (sd, side_t::bottom, &fog, msd->bottomtexture, &foggood, true);
|
||||
SetTextureNoErr (sd, side_t::top, &color, msd->toptexture, &colorgood, false);
|
||||
strncpy (name, msd->midtexture, 8);
|
||||
SetTexture(sd, side_t::mid, msd->midtexture);
|
||||
SetTexture(sd, side_t::mid, msd->midtexture, missingtex);
|
||||
|
||||
if (colorgood | foggood)
|
||||
{
|
||||
|
@ -2413,11 +2451,11 @@ void P_ProcessSideTextures(bool checktranmap, side_t *sd, sector_t *sec, mapside
|
|||
}
|
||||
else
|
||||
{
|
||||
SetTexture(sd, side_t::top, msd->toptexture);
|
||||
SetTexture(sd, side_t::top, msd->toptexture, missingtex);
|
||||
}
|
||||
|
||||
SetTexture(sd, side_t::mid, msd->midtexture);
|
||||
SetTexture(sd, side_t::bottom, msd->bottomtexture);
|
||||
SetTexture(sd, side_t::mid, msd->midtexture, missingtex);
|
||||
SetTexture(sd, side_t::bottom, msd->bottomtexture, missingtex);
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
@ -2439,20 +2477,20 @@ void P_ProcessSideTextures(bool checktranmap, side_t *sd, sector_t *sec, mapside
|
|||
}
|
||||
else
|
||||
{
|
||||
SetTexture(sd, side_t::mid, msd->midtexture);
|
||||
SetTexture(sd, side_t::mid, msd->midtexture, missingtex);
|
||||
}
|
||||
|
||||
SetTexture(sd, side_t::top, msd->toptexture);
|
||||
SetTexture(sd, side_t::bottom, msd->bottomtexture);
|
||||
SetTexture(sd, side_t::top, msd->toptexture, missingtex);
|
||||
SetTexture(sd, side_t::bottom, msd->bottomtexture, missingtex);
|
||||
break;
|
||||
}
|
||||
// Fallthrough for Hexen maps is intentional
|
||||
|
||||
default: // normal cases
|
||||
|
||||
SetTexture(sd, side_t::mid, msd->midtexture);
|
||||
SetTexture(sd, side_t::top, msd->toptexture);
|
||||
SetTexture(sd, side_t::bottom, msd->bottomtexture);
|
||||
SetTexture(sd, side_t::mid, msd->midtexture, missingtex);
|
||||
SetTexture(sd, side_t::top, msd->toptexture, missingtex);
|
||||
SetTexture(sd, side_t::bottom, msd->bottomtexture, missingtex);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -2461,7 +2499,7 @@ void P_ProcessSideTextures(bool checktranmap, side_t *sd, sector_t *sec, mapside
|
|||
// after linedefs are loaded, to allow overloading.
|
||||
// killough 5/3/98: reformatted, cleaned up
|
||||
|
||||
void P_LoadSideDefs2 (MapData * map)
|
||||
void P_LoadSideDefs2 (MapData *map, FMissingTextureTracker &missingtex)
|
||||
{
|
||||
int i;
|
||||
char * msdf = new char[map->Size(ML_SIDEDEFS)];
|
||||
|
@ -2503,7 +2541,7 @@ void P_LoadSideDefs2 (MapData * map)
|
|||
sd->sector = sec = §ors[LittleShort(msd->sector)];
|
||||
}
|
||||
P_ProcessSideTextures(!map->HasBehavior, sd, sec, msd,
|
||||
sidetemp[i].a.special, sidetemp[i].a.tag, &sidetemp[i].a.alpha);
|
||||
sidetemp[i].a.special, sidetemp[i].a.tag, &sidetemp[i].a.alpha, missingtex);
|
||||
}
|
||||
delete[] msdf;
|
||||
}
|
||||
|
@ -3554,6 +3592,8 @@ void P_SetupLevel (char *lumpname, int position)
|
|||
|
||||
P_LoadStrifeConversations (map, lumpname);
|
||||
|
||||
FMissingTextureTracker missingtex;
|
||||
|
||||
if (!map->isText)
|
||||
{
|
||||
times[0].Clock();
|
||||
|
@ -3562,7 +3602,7 @@ void P_SetupLevel (char *lumpname, int position)
|
|||
|
||||
// Check for maps without any BSP data at all (e.g. SLIGE)
|
||||
times[1].Clock();
|
||||
P_LoadSectors (map);
|
||||
P_LoadSectors (map, missingtex);
|
||||
times[1].Unclock();
|
||||
|
||||
times[2].Clock();
|
||||
|
@ -3577,7 +3617,7 @@ void P_SetupLevel (char *lumpname, int position)
|
|||
times[3].Unclock();
|
||||
|
||||
times[4].Clock();
|
||||
P_LoadSideDefs2 (map);
|
||||
P_LoadSideDefs2 (map, missingtex);
|
||||
times[4].Unclock();
|
||||
|
||||
times[5].Clock();
|
||||
|
@ -3593,7 +3633,7 @@ void P_SetupLevel (char *lumpname, int position)
|
|||
}
|
||||
else
|
||||
{
|
||||
P_ParseTextMap(map);
|
||||
P_ParseTextMap(map, missingtex);
|
||||
}
|
||||
|
||||
times[6].Clock();
|
||||
|
@ -3602,6 +3642,8 @@ void P_SetupLevel (char *lumpname, int position)
|
|||
|
||||
linemap.Clear();
|
||||
linemap.ShrinkToFit();
|
||||
|
||||
SummarizeMissingTextures(missingtex);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue