mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-25 13:31:37 +00:00
- Fixed: Doom's fullscreen HUD was limited to 6 keys.
- Made 'next endgame' work again for cases where it is supposed to be the same as 'next endgame4'. - GCC nitpick fix: Classes being used as template parameters may not be defined locally in a function. Fixed FWadFile::SetNamespace for that. - Improved error reporting for incorrect textures in maps. - Fixed: When music was stopped this was not set in the global music state. - Fixed: Friendly monsters did not target enemy players in deathmatch. SVN r1567 (trunk)
This commit is contained in:
parent
b37d0ba2ea
commit
4d5692bf80
10 changed files with 140 additions and 48 deletions
|
@ -1,4 +1,14 @@
|
|||
April 30, 2009 (Changes by Graf Zahl)
|
||||
May 2, 2009 (Changes by Graf Zahl)
|
||||
- Fixed: Doom's fullscreen HUD was limited to 6 keys.
|
||||
- Made 'next endgame' work again for cases where it is supposed to be
|
||||
the same as 'next endgame4'.
|
||||
- GCC nitpick fix: Classes being used as template parameters may not be
|
||||
defined locally in a function. Fixed FWadFile::SetNamespace for that.
|
||||
- Improved error reporting for incorrect textures in maps.
|
||||
- Fixed: When music was stopped this was not set in the global music state.
|
||||
- Fixed: Friendly monsters did not target enemy players in deathmatch.
|
||||
|
||||
April 30, 2009 (Changes by Graf Zahl)
|
||||
- Fixed: Completely empty patches (8 0-bytes) could not be handled by the
|
||||
texture manager. They now get assigned a new FEmptyTexture object
|
||||
that is just a 1x1 pixel transparent texture.
|
||||
|
|
|
@ -760,15 +760,20 @@ void FMapInfoParser::ParseNextMap(char *mapname)
|
|||
}
|
||||
else
|
||||
{
|
||||
sc.MustGetString();
|
||||
|
||||
sc.MustGetString();
|
||||
if (sc.Compare("endgame"))
|
||||
{
|
||||
if (!sc.CheckString("{"))
|
||||
{
|
||||
// Make Demon Eclipse work again
|
||||
sc.UnGet();
|
||||
goto standard_endgame;
|
||||
}
|
||||
newSeq.Advanced = true;
|
||||
newSeq.EndType = END_Pic1;
|
||||
newSeq.PlayTheEnd = false;
|
||||
newSeq.MusicLooping = true;
|
||||
sc.MustGetStringName("{");
|
||||
while (!sc.CheckString("}"))
|
||||
{
|
||||
sc.MustGetString();
|
||||
|
@ -843,6 +848,7 @@ void FMapInfoParser::ParseNextMap(char *mapname)
|
|||
case 'C': type = END_Cast; break;
|
||||
case 'W': type = END_Underwater; break;
|
||||
case 'S': type = END_Strife; break;
|
||||
standard_endgame:
|
||||
default: type = END_Pic3; break;
|
||||
}
|
||||
newSeq.EndType = type;
|
||||
|
|
|
@ -1407,8 +1407,11 @@ bool P_LookForPlayers (AActor *actor, INTBOOL allaround)
|
|||
}
|
||||
else if (actor->flags & MF_FRIENDLY)
|
||||
{
|
||||
return P_LookForEnemies (actor, allaround);
|
||||
}
|
||||
if (!deathmatch) // [SP] If you don't see any enemies in deathmatch, look for players.
|
||||
return P_LookForEnemies (actor, allaround);
|
||||
else if ( P_LookForEnemies (actor, allaround) )
|
||||
return true;
|
||||
} // [SP] if false, and in deathmatch, intentional fall-through
|
||||
|
||||
if (!(gameinfo.gametype & (GAME_DoomStrifeChex)) &&
|
||||
!multiplayer &&
|
||||
|
@ -1482,6 +1485,16 @@ bool P_LookForPlayers (AActor *actor, INTBOOL allaround)
|
|||
if (!P_CheckSight (actor, player->mo, 2))
|
||||
continue; // out of sight
|
||||
|
||||
// [SP] Deathmatch fixes - if we have MF_FRIENDLY we're definitely in deathmatch
|
||||
// We're going to ignore our master, but go after his enemies.
|
||||
if ( actor->flags & MF_FRIENDLY )
|
||||
{
|
||||
if ( actor->FriendPlayer == 0 )
|
||||
continue; // I have no friends, I will ignore players.
|
||||
if ( actor->FriendPlayer == player->mo->FriendPlayer )
|
||||
continue; // This is my master.
|
||||
}
|
||||
|
||||
if (!allaround)
|
||||
{
|
||||
an = R_PointToAngle2 (actor->x,
|
||||
|
|
|
@ -543,8 +543,11 @@ bool P_NewLookPlayers (AActor *actor, angle_t fov, fixed_t mindist, fixed_t maxd
|
|||
}
|
||||
else if (actor->flags & MF_FRIENDLY)
|
||||
{
|
||||
return P_NewLookEnemies (actor, fov, mindist, maxdist, chasegoal);
|
||||
}
|
||||
if (!deathmatch) // [SP] If you don't see any enemies in deathmatch, look for players.
|
||||
return P_NewLookEnemies (actor, fov, mindist, maxdist, chasegoal);
|
||||
else if ( P_NewLookEnemies (actor, fov, mindist, maxdist, chasegoal) )
|
||||
return true;
|
||||
} // [SP] if false, and in deathmatch, intentional fall-through
|
||||
|
||||
if (!(gameinfo.gametype & (GAME_DoomStrifeChex)) &&
|
||||
!multiplayer &&
|
||||
|
@ -628,6 +631,16 @@ bool P_NewLookPlayers (AActor *actor, angle_t fov, fixed_t mindist, fixed_t maxd
|
|||
if (mindist && dist < mindist)
|
||||
continue; // [KS] too close
|
||||
|
||||
// [SP] Deathmatch fixes - if we have MF_FRIENDLY we're definitely in deathmatch
|
||||
// We're going to ignore our master, but go after his enemies.
|
||||
if ( actor->flags & MF_FRIENDLY )
|
||||
{
|
||||
if ( actor->FriendPlayer == 0 )
|
||||
continue; // I have no friends, I will ignore players.
|
||||
if ( actor->FriendPlayer == player->mo->FriendPlayer )
|
||||
continue; // This is my master.
|
||||
}
|
||||
|
||||
if (fov)
|
||||
{
|
||||
an = R_PointToAngle2 (actor->x,
|
||||
|
|
105
src/p_setup.cpp
105
src/p_setup.cpp
|
@ -557,6 +557,68 @@ void MapData::GetChecksum(BYTE cksum[16])
|
|||
md5.Final(cksum);
|
||||
}
|
||||
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// Sets a sidedef's texture and prints a message if it's not present.
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
static void SetTexture (side_t *side, int position, const char *name8)
|
||||
{
|
||||
static const char *positionnames[] = { "top", "middle", "bottom" };
|
||||
static const char *sidenames[] = { "first", "second" };
|
||||
char name[9];
|
||||
strncpy (name, name8, 8);
|
||||
name[8] = 0;
|
||||
FTextureID texture = TexMan.CheckForTexture (name, FTexture::TEX_Wall,
|
||||
FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_TryAny);
|
||||
|
||||
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++)
|
||||
{
|
||||
for(int j = 0; j < 2; j++)
|
||||
{
|
||||
if (lines[i].sidenum[j] == side - sides)
|
||||
{
|
||||
Printf("Unknown %s texture '%s' on %s side of linedef %d\n",
|
||||
positionnames[position], name, sidenames[j], i);
|
||||
}
|
||||
}
|
||||
}
|
||||
texture = TexMan.GetDefaultTexture();
|
||||
}
|
||||
side->SetTexture(position, texture);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// Sets a sidedef's texture and prints a message if it's not present.
|
||||
// (Passing index separately is for UDMF which does not have sectors allocated yet)
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
void SetTexture (sector_t *sector, int index, int position, const char *name8)
|
||||
{
|
||||
static const char *positionnames[] = { "floor", "ceiling" };
|
||||
char name[9];
|
||||
strncpy (name, name8, 8);
|
||||
name[8] = 0;
|
||||
FTextureID texture = TexMan.CheckForTexture (name, FTexture::TEX_Flat,
|
||||
FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_TryAny);
|
||||
|
||||
if (!texture.Exists())
|
||||
{
|
||||
Printf("Unknown %s texture '%s' in sector %d\n",
|
||||
positionnames[position], name, index);
|
||||
texture = TexMan.GetDefaultTexture();
|
||||
}
|
||||
sector->SetTexture(position, texture);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// [RH] Figure out blends for deep water sectors
|
||||
|
@ -1253,10 +1315,8 @@ void P_LoadSectors (MapData * map)
|
|||
ss->ceilingplane.d = ss->GetPlaneTexZ(sector_t::ceiling);
|
||||
ss->ceilingplane.c = -FRACUNIT;
|
||||
ss->ceilingplane.ic = -FRACUNIT;
|
||||
strncpy (fname, ms->floorpic, 8);
|
||||
ss->SetTexture(sector_t::floor, TexMan.GetTexture (fname, FTexture::TEX_Flat, FTextureManager::TEXMAN_Overridable));
|
||||
strncpy (fname, ms->ceilingpic, 8);
|
||||
ss->SetTexture(sector_t::ceiling, TexMan.GetTexture (fname, FTexture::TEX_Flat, FTextureManager::TEXMAN_Overridable));
|
||||
SetTexture(ss, i, sector_t::floor, ms->floorpic);
|
||||
SetTexture(ss, i, sector_t::ceiling, ms->ceilingpic);
|
||||
ss->lightlevel = clamp (LittleShort(ms->lightlevel), (short)0, (short)255);
|
||||
if (map->HasBehavior)
|
||||
ss->special = LittleShort(ms->special);
|
||||
|
@ -2163,8 +2223,7 @@ void P_ProcessSideTextures(bool checktranmap, side_t *sd, sector_t *sec, mapside
|
|||
SetTextureNoErr (sd, side_t::bottom, &fog, msd->bottomtexture, &foggood);
|
||||
SetTextureNoErr (sd, side_t::top, &color, msd->toptexture, &colorgood);
|
||||
strncpy (name, msd->midtexture, 8);
|
||||
sd->SetTexture(side_t::mid,
|
||||
TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable));
|
||||
SetTexture(sd, side_t::mid, msd->midtexture);
|
||||
|
||||
if (colorgood | foggood)
|
||||
{
|
||||
|
@ -2200,15 +2259,11 @@ void P_ProcessSideTextures(bool checktranmap, side_t *sd, sector_t *sec, mapside
|
|||
}
|
||||
else
|
||||
{
|
||||
strncpy (name, msd->toptexture, 8);
|
||||
sd->SetTexture(side_t::top, TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable));
|
||||
SetTexture(sd, side_t::top, msd->toptexture);
|
||||
}
|
||||
|
||||
strncpy (name, msd->midtexture, 8);
|
||||
sd->SetTexture(side_t::mid, TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable));
|
||||
|
||||
strncpy (name, msd->bottomtexture, 8);
|
||||
sd->SetTexture(side_t::bottom, TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable));
|
||||
SetTexture(sd, side_t::mid, msd->midtexture);
|
||||
SetTexture(sd, side_t::bottom, msd->bottomtexture);
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
@ -2230,32 +2285,20 @@ void P_ProcessSideTextures(bool checktranmap, side_t *sd, sector_t *sec, mapside
|
|||
}
|
||||
else
|
||||
{
|
||||
strncpy (name, msd->midtexture, 8);
|
||||
sd->SetTexture(side_t::mid,
|
||||
TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable));
|
||||
SetTexture(sd, side_t::mid, msd->midtexture);
|
||||
}
|
||||
|
||||
strncpy (name, msd->toptexture, 8);
|
||||
sd->SetTexture(side_t::top, TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable));
|
||||
|
||||
strncpy (name, msd->bottomtexture, 8);
|
||||
sd->SetTexture(side_t::bottom, TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable));
|
||||
SetTexture(sd, side_t::top, msd->toptexture);
|
||||
SetTexture(sd, side_t::bottom, msd->bottomtexture);
|
||||
break;
|
||||
}
|
||||
// Fallthrough for Hexen maps is intentional
|
||||
|
||||
default: // normal cases
|
||||
strncpy (name, msd->midtexture, 8);
|
||||
sd->SetTexture(side_t::mid,
|
||||
TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable));
|
||||
|
||||
strncpy (name, msd->toptexture, 8);
|
||||
sd->SetTexture(side_t::top,
|
||||
TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable));
|
||||
|
||||
strncpy (name, msd->bottomtexture, 8);
|
||||
sd->SetTexture(side_t::bottom,
|
||||
TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable));
|
||||
SetTexture(sd, side_t::mid, msd->midtexture);
|
||||
SetTexture(sd, side_t::top, msd->toptexture);
|
||||
SetTexture(sd, side_t::bottom, msd->bottomtexture);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -111,6 +111,7 @@ enum
|
|||
};
|
||||
|
||||
|
||||
void SetTexture (sector_t *sector, int index, int position, const char *name8);
|
||||
void P_ProcessSideTextures(bool checktranmap, side_t *sd, sector_t *sec, mapsidedef_t *msd, int special, int tag, short *alpha);
|
||||
void P_AdjustLine (line_t *ld);
|
||||
void P_FinishLoadingLineDef(line_t *ld, int alpha);
|
||||
|
@ -780,7 +781,7 @@ struct UDMFParser
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
void ParseSector(sector_t *sec)
|
||||
void ParseSector(sector_t *sec, int index)
|
||||
{
|
||||
int lightcolor = -1;
|
||||
int fadecolor = -1;
|
||||
|
@ -824,11 +825,11 @@ struct UDMFParser
|
|||
break;
|
||||
|
||||
case NAME_Texturefloor:
|
||||
sec->SetTexture(sector_t::floor, TexMan.GetTexture (CheckString(key), FTexture::TEX_Flat, FTextureManager::TEXMAN_Overridable));
|
||||
SetTexture(sec, index, sector_t::floor, CheckString(key));
|
||||
break;
|
||||
|
||||
case NAME_Textureceiling:
|
||||
sec->SetTexture(sector_t::ceiling, TexMan.GetTexture (CheckString(key), FTexture::TEX_Flat, FTextureManager::TEXMAN_Overridable));
|
||||
SetTexture(sec, index, sector_t::ceiling, CheckString(key));
|
||||
break;
|
||||
|
||||
case NAME_Lightlevel:
|
||||
|
@ -1209,7 +1210,7 @@ struct UDMFParser
|
|||
else if (sc.Compare("sector"))
|
||||
{
|
||||
sector_t sec;
|
||||
ParseSector(&sec);
|
||||
ParseSector(&sec, ParsedSectors.Size());
|
||||
ParsedSectors.Push(sec);
|
||||
}
|
||||
else if (sc.Compare("vertex"))
|
||||
|
|
|
@ -145,16 +145,19 @@ inline bool FWadFile::IsMarker(int lump, const char *marker)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
// This class was supposed to be local in the function but GCC
|
||||
// does not like that.
|
||||
struct Marker
|
||||
{
|
||||
int markertype;
|
||||
int index;
|
||||
};
|
||||
|
||||
void FWadFile::SetNamespace(const char *startmarker, const char *endmarker, namespace_t space, bool flathack)
|
||||
{
|
||||
bool warned = false;
|
||||
int numstartmarkers = 0, numendmarkers = 0;
|
||||
int i;
|
||||
struct Marker
|
||||
{
|
||||
int markertype;
|
||||
int index;
|
||||
};
|
||||
TArray<Marker> markers;
|
||||
|
||||
for(i = 0; i < (int)NumLumps; i++)
|
||||
|
|
|
@ -2202,6 +2202,7 @@ bool S_ChangeMusic (const char *musicname, int order, bool looping, bool force)
|
|||
{
|
||||
// Don't choke if the map doesn't have a song attached
|
||||
S_StopMusic (true);
|
||||
mus_playing.name = "";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -310,6 +310,7 @@ public:
|
|||
|
||||
FTextureID CreateTexture (int lumpnum, int usetype=FTexture::TEX_Any); // Also calls AddTexture
|
||||
FTextureID AddTexture (FTexture *texture);
|
||||
FTextureID GetDefaultTexture() const { return DefaultTexture; }
|
||||
|
||||
void LoadTextureX(int wadnum);
|
||||
void AddTexturesForWad(int wadnum);
|
||||
|
|
|
@ -63,7 +63,8 @@ statusbar fullscreen, fullscreenoffsets // ZDoom HUD
|
|||
}
|
||||
gamemode singleplayer, cooperative, teamgame
|
||||
{
|
||||
drawkeybar 6, vertical, reverserows, auto, -10, 2, 0, 3, auto;
|
||||
// let's hope no mod ever uses 100 keys...
|
||||
drawkeybar 100, vertical, reverserows, auto, -10, 2, 0, 3, auto;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue