Testing changes for GZDoom 4.11/5.0.

This commit is contained in:
Mari the Deer 2023-01-08 14:58:06 +01:00
commit d0fddbf8a3
24 changed files with 104 additions and 331 deletions

View file

@ -274,7 +274,7 @@ Class SWWMHandler : EventHandler
{
if ( !lastlock || (gametic > lastlock+20) )
{
if ( SWWMUtility.IsValidLockNum(locknum) )
if ( Key.IsLockDefined(locknum) )
lastlock = AddOneliner("locked",2);
else lastlock = AddOneliner("jammed",2);
}

View file

@ -146,70 +146,6 @@ extend Class SWWMHandler
SWWMUtility.MarkAchievement("hurry",players[consoleplayer]);
}
private void SetupLockdefsCache( SWWMCachedLockInfo cli )
{
for ( int i=0; i<Wads.GetNumLumps(); i++ )
{
String lname = Wads.GetLumpName(i);
if ( !(lname ~== "LOCKDEFS") ) continue;
String data = Wads.ReadLump(i);
Array<String> lines;
lines.Clear();
data.Split(lines,"\n");
bool valid = false;
for ( int j=0; j<lines.Size(); j++ )
{
// strip leading whitespace
while ( (lines[j].Left(1) == " ") || (lines[j].Left(1) == "\t") )
lines[j] = lines[j].Mid(1);
if ( lines[j].Left(10) ~== "CLEARLOCKS" )
{
for ( int k=0; k<cli.ent.Size(); k++ )
cli.ent[k].Destroy();
cli.ent.Clear();
}
else if ( Lines[j].Left(5) ~== "LOCK " )
{
Array<String> spl;
spl.Clear();
lines[j].Split(spl," ",TOK_SKIPEMPTY);
// check game string (if any)
if ( spl.Size() > 2 )
{
if ( (spl[2] ~== "DOOM") && !(gameinfo.gametype&GAME_Doom) ) continue;
else if ( (spl[2] ~== "HERETIC") && !(gameinfo.gametype&GAME_Heretic) ) continue;
else if ( (spl[2] ~== "HEXEN") && !(gameinfo.gametype&GAME_Hexen) ) continue;
else if ( (spl[2] ~== "STRIFE") && !(gameinfo.gametype&GAME_Strife) ) continue;
else if ( (spl[2] ~== "CHEX") && !(gameinfo.gametype&GAME_Chex) ) continue;
}
// valid lock, prepare it
let li = new("LIEntry");
li.locknumber = spl[1].ToInt();
li.hascolor = false;
// see if there's a Mapcolor defined
int k = j+1;
for ( int k=j+2; k<lines.Size(); k++ )
{
// strip leading whitespace
while ( (lines[k].Left(1) == " ") || (lines[k].Left(1) == "\t") )
lines[k] = lines[k].Mid(1);
if ( lines[k].Left(5) ~== "LOCK " )
break; // we reached the next lock
if ( !(lines[k].Left(9) ~== "MAPCOLOR ") )
continue;
// here it is
spl.Clear();
lines[k].Split(spl," ",TOK_SKIPEMPTY);
if ( spl.Size() < 4 ) break;
li.hascolor = true;
li.mapcolor = Color(spl[1].ToInt(),spl[2].ToInt(),spl[3].ToInt());
}
cli.ent.Push(li);
}
}
}
}
private void MapStartDialogues()
{
int whichboss = WhichVanillaBossMap();
@ -388,9 +324,6 @@ extend Class SWWMHandler
}
break;
}
// setup cached lockdefs data
let cli = SWWMCachedLockInfo.GetInstance();
if ( cli.ent.Size() == 0 ) SetupLockdefsCache(cli);
// for skipping over merged exit lines (sharing vertices)
Array<Line> skipme;
skipme.Clear();

View file

@ -89,7 +89,8 @@ Class SWWMStaticHandler : StaticEventHandler
for ( int i=0; i<MAXPLAYERS; i++ )
{
if ( !playeringame[i] || !(players[i].mo is 'Demolitionist') ) continue;
Demolitionist(players[i].mo).CheckUnderwaterAmb(true);
let demo = Demolitionist(players[i].mo);
demo.CheckUnderwaterAmb(true);
}
}
SWWMHandler.ClearAllShaders();
@ -210,7 +211,7 @@ Class SWWMStaticHandler : StaticEventHandler
if ( (gamestate != GS_LEVEL) || !swwm_showmaptitle ) return;
StatusBar.AttachMessage(new("DSMapTitle").Init(),-7777);
}
else if ( e.Name ~== "swwmflushud" )
else if ( e.Name ~== "swwmflushhud" )
{
if ( !(StatusBar is 'SWWMStatusBar') ) return;
SWWMStatusBar(StatusBar).Flush();