- renamed the level variables.

currentUILevel is now primaryLevel.
For ZScript, currentVMLevel was added. This is also exported as 'level' and will change as needed.
This also means that no breaking deprecations will be needed in the future, because in order to sandbox a level only 4 variables need to be handled: level, players, playeringame and consoleplayer.
The remaining global variables are not relevant for the level state.

The static 'level' has been mostly removed from the code except some places that still need work.
This commit is contained in:
Christoph Oelckers 2019-02-02 00:24:43 +01:00
parent 6c006a5fbd
commit 45dc9a7b47
44 changed files with 266 additions and 264 deletions

View file

@ -130,8 +130,8 @@ CVAR(Int, am_showsubsector, -1, 0);
CUSTOM_CVAR(Int, am_showalllines, -1, CVAR_NOINITCALL) // This is a cheat so don't save it.
{
if (currentUILevel && currentUILevel->automap)
currentUILevel->automap->UpdateShowAllLines();
if (primaryLevel && primaryLevel->automap)
primaryLevel->automap->UpdateShowAllLines();
}
EXTERN_CVAR(Bool, sv_cheats)
@ -171,9 +171,9 @@ CUSTOM_CVAR(Int, am_emptyspacemargin, 0, CVAR_ARCHIVE)
self = 90;
}
if (nullptr != StatusBar && currentUILevel && currentUILevel->automap)
if (nullptr != StatusBar && primaryLevel && primaryLevel->automap)
{
currentUILevel->automap->NewResolution();
primaryLevel->automap->NewResolution();
}
}
@ -191,8 +191,8 @@ CVAR(Float, am_zoomdir, 0, CVAR_ARCHIVE)
CCMD(am_togglefollow)
{
am_followplayer = !am_followplayer;
if (currentUILevel && currentUILevel->automap)
currentUILevel->automap->ResetFollowLocation();
if (primaryLevel && primaryLevel->automap)
primaryLevel->automap->ResetFollowLocation();
Printf("%s\n", GStrings(am_followplayer ? "AMSTR_FOLLOWON" : "AMSTR_FOLLOWOFF"));
}
@ -210,9 +210,9 @@ CCMD(am_toggletexture)
CCMD(am_setmark)
{
if (currentUILevel && currentUILevel->automap)
if (primaryLevel && primaryLevel->automap)
{
int m = currentUILevel->automap->addMark();
int m = primaryLevel->automap->addMark();
if (m >= 0)
{
Printf("%s %d\n", GStrings("AMSTR_MARKEDSPOT"), m);
@ -222,7 +222,7 @@ CCMD(am_setmark)
CCMD(am_clearmarks)
{
if (currentUILevel && currentUILevel->automap && currentUILevel->automap->clearMarks())
if (primaryLevel && primaryLevel->automap && primaryLevel->automap->clearMarks())
{
Printf("%s\n", GStrings("AMSTR_MARKSCLEARED"));
}
@ -230,8 +230,8 @@ CCMD(am_clearmarks)
CCMD(am_gobig)
{
if (currentUILevel && currentUILevel->automap)
currentUILevel->automap->GoBig();
if (primaryLevel && primaryLevel->automap)
primaryLevel->automap->GoBig();
}
CCMD(togglemap)
@ -3300,7 +3300,7 @@ void AM_ToggleMap()
return;
// ... or if there is no automap.
if (!currentUILevel || !currentUILevel->automap)
if (!primaryLevel || !primaryLevel->automap)
return;
if (!automapactive)
@ -3313,7 +3313,7 @@ void AM_ToggleMap()
Button_AM_ZoomIn.Reset();
Button_AM_ZoomOut.Reset();
currentUILevel->automap->startDisplay();
primaryLevel->automap->startDisplay();
automapactive = true;
viewactive = (am_overlay != 0.f);
}

View file

@ -173,9 +173,9 @@ CCMD (addbot)
}
if (argv.argc() > 1)
currentUILevel->BotInfo.SpawnBot (argv[1]);
primaryLevel->BotInfo.SpawnBot (argv[1]);
else
currentUILevel->BotInfo.SpawnBot (nullptr);
primaryLevel->BotInfo.SpawnBot (nullptr);
}
void FCajunMaster::ClearPlayer (int i, bool keepTeam)
@ -232,7 +232,7 @@ CCMD (freeze)
CCMD (listbots)
{
botinfo_t *thebot = currentUILevel->BotInfo.botinfo;
botinfo_t *thebot = primaryLevel->BotInfo.botinfo;
int count = 0;
while (thebot)

View file

@ -182,9 +182,9 @@ static FRandom pr_bbannounce ("BBAnnounce");
void DoVoiceAnnounce (const char *sound)
{
// Don't play announcements too close together
if (LastAnnounceTime == 0 || LastAnnounceTime <= currentUILevel->time-5)
if (LastAnnounceTime == 0 || LastAnnounceTime <= primaryLevel->time-5)
{
LastAnnounceTime = currentUILevel->time;
LastAnnounceTime = primaryLevel->time;
S_Sound (CHAN_VOICE, sound, 1, ATTN_NONE);
}
}

View file

@ -366,7 +366,7 @@ CCMD (changemap)
if (argv.argc() > 1)
{
const char *mapname = argv[1];
if (!strcmp(mapname, "*")) mapname = currentUILevel->MapName.GetChars();
if (!strcmp(mapname, "*")) mapname = primaryLevel->MapName.GetChars();
try
{
@ -946,7 +946,7 @@ static void PrintFilteredActorList(const ActorTypeChecker IsActorType, const cha
}
}
// This only works on the primary level.
auto it = currentUILevel->GetThinkerIterator<AActor>();
auto it = primaryLevel->GetThinkerIterator<AActor>();
while ( (mo = it.Next()) )
{
@ -1063,14 +1063,14 @@ CCMD(changesky)
FTextureID newsky = TexMan.GetTextureID(sky1name, ETextureType::Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_ReturnFirst);
if (newsky.Exists())
{
currentUILevel->skytexture1 = newsky;
primaryLevel->skytexture1 = newsky;
}
else
{
Printf("changesky: Texture '%s' not found\n", sky1name);
}
}
InitSkyMap (currentUILevel);
InitSkyMap (primaryLevel);
}
//-----------------------------------------------------------------------------
@ -1101,9 +1101,9 @@ CCMD(nextmap)
return;
}
if (currentUILevel->NextMap.Len() > 0 && currentUILevel->NextMap.Compare("enDSeQ", 6))
if (primaryLevel->NextMap.Len() > 0 && primaryLevel->NextMap.Compare("enDSeQ", 6))
{
G_DeferedInitNew(currentUILevel->NextMap);
G_DeferedInitNew(primaryLevel->NextMap);
}
else
{
@ -1125,9 +1125,9 @@ CCMD(nextsecret)
return;
}
if (currentUILevel->NextSecretMap.Len() > 0 && currentUILevel->NextSecretMap.Compare("enDSeQ", 6))
if (primaryLevel->NextSecretMap.Len() > 0 && primaryLevel->NextSecretMap.Compare("enDSeQ", 6))
{
G_DeferedInitNew(currentUILevel->NextSecretMap);
G_DeferedInitNew(primaryLevel->NextSecretMap);
}
else
{
@ -1172,10 +1172,10 @@ static void PrintSecretString(const char *string, bool thislevel)
{
auto secnum = (unsigned)strtoull(string+2, (char**)&string, 10);
if (*string == ';') string++;
if (thislevel && secnum < currentUILevel->sectors.Size())
if (thislevel && secnum < primaryLevel->sectors.Size())
{
if (currentUILevel->sectors[secnum].isSecret()) colstr = TEXTCOLOR_RED;
else if (currentUILevel->sectors[secnum].wasSecret()) colstr = TEXTCOLOR_GREEN;
if (primaryLevel->sectors[secnum].isSecret()) colstr = TEXTCOLOR_RED;
else if (primaryLevel->sectors[secnum].wasSecret()) colstr = TEXTCOLOR_GREEN;
else colstr = TEXTCOLOR_ORANGE;
}
}
@ -1183,7 +1183,7 @@ static void PrintSecretString(const char *string, bool thislevel)
{
long tid = (long)strtoll(string+2, (char**)&string, 10);
if (*string == ';') string++;
auto it = currentUILevel->GetActorIterator(tid);
auto it = primaryLevel->GetActorIterator(tid);
AActor *actor;
bool foundone = false;
if (thislevel)
@ -1216,8 +1216,8 @@ static void PrintSecretString(const char *string, bool thislevel)
CCMD(secret)
{
const char *mapname = argv.argc() < 2? currentUILevel->MapName.GetChars() : argv[1];
bool thislevel = !stricmp(mapname, currentUILevel->MapName);
const char *mapname = argv.argc() < 2? primaryLevel->MapName.GetChars() : argv[1];
bool thislevel = !stricmp(mapname, primaryLevel->MapName);
bool foundsome = false;
int lumpno=Wads.CheckNumForName("SECRETS");

View file

@ -1243,7 +1243,7 @@ void C_FullConsole ()
if (gamestate != GS_STARTUP)
{
gamestate = GS_FULLCONSOLE;
currentUILevel->Music = "";
primaryLevel->Music = "";
S_Start ();
P_FreeLevelData ();
V_SetBlend (0,0,0,0);

View file

@ -172,7 +172,7 @@ CUSTOM_CVAR (Int, fraglimit, 0, CVAR_SERVERINFO)
if (playeringame[i] && self <= D_GetFragCount(&players[i]))
{
Printf ("%s\n", GStrings("TXT_FRAGLIMIT"));
level.ExitLevel (0, false);
primaryLevel->ExitLevel (0, false);
break;
}
}
@ -789,7 +789,7 @@ void D_Display ()
screen->DrawBlend(viewsec);
if (automapactive)
{
currentUILevel->automap->Drawer (hud_althud? viewheight : StatusBar->GetTopOfStatusbar());
primaryLevel->automap->Drawer (hud_althud? viewheight : StatusBar->GetTopOfStatusbar());
}
// for timing the statusbar code.
@ -959,7 +959,7 @@ void D_Display ()
void D_ErrorCleanup ()
{
savegamerestore = false;
level.BotInfo.RemoveAllBots (&level, true);
primaryLevel->BotInfo.RemoveAllBots (primaryLevel, true);
D_QuitNetGame ();
if (demorecording || demoplayback)
G_CheckDemoStatus ();
@ -2555,14 +2555,14 @@ void D_DoomMain (void)
PClassActor::StaticSetActorNums();
//Added by MC:
level.BotInfo.getspawned.Clear();
primaryLevel->BotInfo.getspawned.Clear();
argcount = Args->CheckParmList("-bots", &args);
for (p = 0; p < argcount; ++p)
{
level.BotInfo.getspawned.Push(args[p]);
primaryLevel->BotInfo.getspawned.Push(args[p]);
}
level.BotInfo.spawn_tries = 0;
level.BotInfo.wanted_botnum = level.BotInfo.getspawned.Size();
primaryLevel->BotInfo.spawn_tries = 0;
primaryLevel->BotInfo.wanted_botnum = primaryLevel->BotInfo.getspawned.Size();
if (!batchrun) Printf ("P_Init: Init Playloop state.\n");
StartScreen->LoadingStatus ("Init game engine", 0x3f);

View file

@ -2222,8 +2222,8 @@ void Net_DoCommand (int type, uint8_t **stream, int player)
s = ReadString (stream);
// Using LEVEL_NOINTERMISSION tends to throw the game out of sync.
// That was a long time ago. Maybe it works now?
level.flags |= LEVEL_CHANGEMAPCHEAT;
level.ChangeLevel(s, pos, 0);
primaryLevel->flags |= LEVEL_CHANGEMAPCHEAT;
primaryLevel->ChangeLevel(s, pos, 0);
break;
case DEM_SUICIDE:
@ -2231,11 +2231,11 @@ void Net_DoCommand (int type, uint8_t **stream, int player)
break;
case DEM_ADDBOT:
level.BotInfo.TryAddBot (&level, stream, player);
primaryLevel->BotInfo.TryAddBot (primaryLevel, stream, player);
break;
case DEM_KILLBOTS:
level.BotInfo.RemoveAllBots (&level, true);
primaryLevel->BotInfo.RemoveAllBots (primaryLevel, true);
Printf ("Removed all bots\n");
break;
@ -2330,14 +2330,14 @@ void Net_DoCommand (int type, uint8_t **stream, int player)
const AActor *def = GetDefaultByType (typeinfo);
DVector3 spawnpos = source->Vec3Angle(def->radius * 2 + source->radius, source->Angles.Yaw, 8.);
AActor *spawned = Spawn (&level, typeinfo, spawnpos, ALLOW_REPLACE);
AActor *spawned = Spawn (primaryLevel, typeinfo, spawnpos, ALLOW_REPLACE);
if (spawned != NULL)
{
if (type == DEM_SUMMONFRIEND || type == DEM_SUMMONFRIEND2 || type == DEM_SUMMONMBF)
{
if (spawned->CountsAsKill())
{
level.total_monsters--;
primaryLevel->total_monsters--;
}
spawned->FriendPlayer = player + 1;
spawned->flags |= MF_FRIENDLY;
@ -2507,7 +2507,7 @@ void Net_DoCommand (int type, uint8_t **stream, int player)
}
if (!CheckCheatmode(player == consoleplayer))
{
P_ExecuteSpecial(&level, snum, NULL, players[player].mo, false, arg[0], arg[1], arg[2], arg[3], arg[4]);
P_ExecuteSpecial(primaryLevel, snum, NULL, players[player].mo, false, arg[0], arg[1], arg[2], arg[3], arg[4]);
}
}
break;
@ -2560,11 +2560,11 @@ void Net_DoCommand (int type, uint8_t **stream, int player)
if (cls != NULL)
{
killcount = currentUILevel->Massacre(false, cls->TypeName);
killcount = primaryLevel->Massacre(false, cls->TypeName);
PClassActor *cls_rep = cls->GetReplacement();
if (cls != cls_rep)
{
killcount += currentUILevel->Massacre(false, cls_rep->TypeName);
killcount += primaryLevel->Massacre(false, cls_rep->TypeName);
}
Printf ("Killed %d monsters of type %s.\n",killcount, s);
}
@ -2582,11 +2582,11 @@ void Net_DoCommand (int type, uint8_t **stream, int player)
PClassActor *cls = PClass::FindActor(s);
if (cls != NULL && cls->IsDescendantOf(RUNTIME_CLASS(AActor)))
{
removecount = RemoveClass(&level, cls);
removecount = RemoveClass(primaryLevel, cls);
const PClass *cls_rep = cls->GetReplacement();
if (cls != cls_rep)
{
removecount += RemoveClass(&level, cls_rep);
removecount += RemoveClass(primaryLevel, cls_rep);
}
Printf("Removed %d actors of type %s.\n", removecount, s);
}
@ -2660,7 +2660,7 @@ void Net_DoCommand (int type, uint8_t **stream, int player)
case DEM_FINISHGAME:
// Simulate an end-of-game action
level.ChangeLevel(NULL, 0, 0);
primaryLevel->ChangeLevel(NULL, 0, 0);
break;
case DEM_NETEVENT:
@ -2698,7 +2698,7 @@ static void RunScript(uint8_t **stream, AActor *pawn, int snum, int argn, int al
arg[i] = argval;
}
}
P_StartScript(pawn->Level, pawn, NULL, snum, level.MapName, arg, MIN<int>(countof(arg), argn), ACS_NET | always);
P_StartScript(pawn->Level, pawn, NULL, snum, primaryLevel->MapName, arg, MIN<int>(countof(arg), argn), ACS_NET | always);
}
void Net_SkipCommand (int type, uint8_t **stream)

View file

@ -259,12 +259,12 @@ CCMD(dump3df)
// Print 3D floor info for a single sector.
// This only checks the primary level.
int sec = (int)strtoll(argv[1], NULL, 10);
if ((unsigned)sec >= currentUILevel->sectors.Size())
if ((unsigned)sec >= primaryLevel->sectors.Size())
{
Printf("Sector %d does not exist.\n", sec);
return;
}
sector_t *sector = &currentUILevel->sectors[sec];
sector_t *sector = &primaryLevel->sectors[sec];
TArray<F3DFloor*> & ffloors = sector->e->XFloor.ffloors;
for (unsigned int i = 0; i < ffloors.Size(); i++)

View file

@ -773,7 +773,7 @@ void G_AddViewPitch (int look, bool mouse)
return;
}
look = LookAdjust(look);
if (!currentUILevel->IsFreelookAllowed())
if (!primaryLevel->IsFreelookAllowed())
{
LocalViewPitch = 0;
}
@ -959,7 +959,7 @@ bool G_Responder (event_t *ev)
{
if (ST_Responder (ev))
return true; // status window ate it
if (!viewactive && currentUILevel->automap->Responder (ev, false))
if (!viewactive && primaryLevel->automap->Responder (ev, false))
return true; // automap ate it
}
else if (gamestate == GS_FINALE)
@ -990,7 +990,7 @@ bool G_Responder (event_t *ev)
// the events *last* so that any bound keys get precedence.
if (gamestate == GS_LEVEL && viewactive)
return currentUILevel->automap->Responder (ev, true);
return primaryLevel->automap->Responder (ev, true);
return (ev->type == EV_KeyDown ||
ev->type == EV_Mouse);
@ -1018,7 +1018,7 @@ void G_Ticker ()
}
if (players[i].playerstate == PST_REBORN || players[i].playerstate == PST_ENTER)
{
level.DoReborn(i, false);
primaryLevel->DoReborn(i, false);
}
}
}
@ -1114,7 +1114,7 @@ void G_Ticker ()
uint32_t rngsum = FRandom::StaticSumSeeds ();
//Added by MC: For some of that bot stuff. The main bot function.
level.BotInfo.Main (&level);
primaryLevel->BotInfo.Main (primaryLevel);
for (i = 0; i < MAXPLAYERS; i++)
{
@ -1181,7 +1181,7 @@ void G_Ticker ()
{
case GS_LEVEL:
P_Ticker ();
currentUILevel->automap->Ticker ();
primaryLevel->automap->Ticker ();
break;
case GS_TITLELEVEL:
@ -1897,7 +1897,7 @@ void G_DoLoadGame ()
// Read intermission data for hubs
G_SerializeHub(arc);
level.BotInfo.RemoveAllBots(&level, true);
primaryLevel->BotInfo.RemoveAllBots(primaryLevel, true);
FString cvar;
arc("importantcvars", cvar);
@ -2039,14 +2039,14 @@ void G_DoAutoSave ()
file = G_BuildSaveName ("auto", nextautosave);
// The hint flag is only relevant on the primary level.
if (!(currentUILevel->flags2 & LEVEL2_NOAUTOSAVEHINT))
if (!(primaryLevel->flags2 & LEVEL2_NOAUTOSAVEHINT))
{
nextautosave = (nextautosave + 1) % count;
}
else
{
// This flag can only be used once per level
currentUILevel->flags2 &= ~LEVEL2_NOAUTOSAVEHINT;
primaryLevel->flags2 &= ~LEVEL2_NOAUTOSAVEHINT;
}
readableTime = myasctime ();
@ -2064,9 +2064,9 @@ static void PutSaveWads (FSerializer &arc)
arc.AddString("Game WAD", name);
// Name of wad the map resides in
if (Wads.GetLumpFile (level.lumpnum) > Wads.GetIwadNum())
if (Wads.GetLumpFile (primaryLevel->lumpnum) > Wads.GetIwadNum())
{
name = Wads.GetWadName (Wads.GetLumpFile (level.lumpnum));
name = Wads.GetWadName (Wads.GetLumpFile (primaryLevel->lumpnum));
arc.AddString("Map WAD", name);
}
}
@ -2085,12 +2085,11 @@ static void PutSaveComment (FSerializer &arc)
arc.AddString("Creation Time", comment);
// Get level name
//strcpy (comment, level.level_name);
comment.Format("%s - %s\n", level.MapName.GetChars(), level.LevelName.GetChars());
comment.Format("%s - %s\n", primaryLevel->MapName.GetChars(), primaryLevel->LevelName.GetChars());
// Append elapsed time
const char *const time = GStrings("SAVECOMMENT_TIME");
levelTime = level.time / TICRATE;
levelTime = primaryLevel->time / TICRATE;
comment.AppendFormat("%s: %02d:%02d:%02d", time, levelTime/3600, (levelTime%3600)/60, levelTime%60);
// Write out the comment
@ -2121,7 +2120,7 @@ void G_DoSaveGame (bool okForQuicksave, FString filename, const char *descriptio
// Do not even try, if we're not in a level. (Can happen after
// a demo finishes playback.)
if (level.lines.Size() == 0 || level.sectors.Size() == 0 || gamestate != GS_LEVEL)
if (primaryLevel->lines.Size() == 0 || primaryLevel->sectors.Size() == 0 || gamestate != GS_LEVEL)
{
return;
}
@ -2172,7 +2171,7 @@ void G_DoSaveGame (bool okForQuicksave, FString filename, const char *descriptio
// put some basic info into the PNG so that this isn't lost when the image gets extracted.
M_AppendPNGText(&savepic, "Software", buf);
M_AppendPNGText(&savepic, "Title", description);
M_AppendPNGText(&savepic, "Current Map", level.MapName);
M_AppendPNGText(&savepic, "Current Map", primaryLevel->MapName);
M_FinishPNG(&savepic);
int ver = SAVEVER;
@ -2180,7 +2179,7 @@ void G_DoSaveGame (bool okForQuicksave, FString filename, const char *descriptio
.AddString("Engine", GAMESIG)
("Save Version", ver)
.AddString("Title", description)
.AddString("Current Map", level.MapName);
.AddString("Current Map", primaryLevel->MapName);
PutSaveWads (savegameinfo);
@ -2390,7 +2389,7 @@ void G_BeginRecording (const char *startmap)
if (startmap == NULL)
{
startmap = level.MapName;
startmap = primaryLevel->MapName;
}
demo_p = demobuffer;
@ -2715,7 +2714,7 @@ void G_DoPlayDemo (void)
{
G_InitNew (mapname, false);
}
else if (level.sectors.Size() == 0)
else if (primaryLevel->sectors.Size() == 0)
{
I_Error("Cannot play demo without its savegame\n");
}
@ -2886,6 +2885,7 @@ DEFINE_GLOBAL_NAMED(Skins, PlayerSkins)
DEFINE_GLOBAL(consoleplayer)
DEFINE_GLOBAL_NAMED(PClass::AllClasses, AllClasses)
DEFINE_GLOBAL_NAMED(PClassActor::AllActorClasses, AllActorClasses)
DEFINE_GLOBAL_NAMED(primaryLevel, Level)
DEFINE_GLOBAL(validcount)
DEFINE_GLOBAL(multiplayer)
DEFINE_GLOBAL(gameaction)

View file

@ -167,7 +167,7 @@ extern bool sendpause, sendsave, sendturn180, SendLand;
void *statcopy; // for statistics driver
FLevelLocals level; // info about current level
FLevelLocals *currentUILevel = &level; // level for which to display the user interface.
FLevelLocals *primaryLevel = &level; // level for which to display the user interface.
FLevelLocals *currentVMLevel = &level; // level which currently ticks. Used as global input to the VM and some functions called by it.
@ -216,7 +216,7 @@ CCMD (map)
if (argv.argc() > 1)
{
const char *mapname = argv[1];
if (!strcmp(mapname, "*")) mapname = currentUILevel->MapName.GetChars();
if (!strcmp(mapname, "*")) mapname = primaryLevel->MapName.GetChars();
try
{
@ -266,7 +266,7 @@ UNSAFE_CCMD(recordmap)
if (argv.argc() > 2)
{
const char *mapname = argv[2];
if (!strcmp(mapname, "*")) mapname = currentUILevel->MapName.GetChars();
if (!strcmp(mapname, "*")) mapname = primaryLevel->MapName.GetChars();
try
{
@ -357,7 +357,7 @@ void G_NewInit ()
int i;
// Destory all old player refrences that may still exist
TThinkerIterator<AActor> it(&level, NAME_PlayerPawn, STAT_TRAVELLING);
TThinkerIterator<AActor> it(primaryLevel, NAME_PlayerPawn, STAT_TRAVELLING);
AActor *pawn, *next;
next = it.Next();
@ -453,7 +453,7 @@ void G_InitNew (const char *mapname, bool bTitleLevel)
int i;
// did we have any level before?
if (level.info != nullptr)
if (primaryLevel->info != nullptr)
E_WorldUnloadedUnsafe();
if (!savegamerestore)
@ -470,7 +470,10 @@ void G_InitNew (const char *mapname, bool bTitleLevel)
UnlatchCVars ();
G_VerifySkill();
UnlatchCVars ();
level.Thinkers.DestroyThinkersInList(STAT_STATIC);
for (auto Level : AllLevels())
{
Level->Thinkers.DestroyThinkersInList(STAT_STATIC);
}
if (paused)
{
@ -510,10 +513,10 @@ void G_InitNew (const char *mapname, bool bTitleLevel)
}
FRandom::StaticClearRandom ();
P_ClearACSVars(true);
level.time = 0;
level.maptime = 0;
level.totaltime = 0;
level.spawnindex = 0;
primaryLevel->time = 0;
primaryLevel->maptime = 0;
primaryLevel->totaltime = 0;
primaryLevel->spawnindex = 0;
if (!multiplayer || !deathmatch)
{
@ -536,7 +539,7 @@ void G_InitNew (const char *mapname, bool bTitleLevel)
//Added by MC: Initialize bots.
if (!deathmatch)
{
level.BotInfo.Init ();
primaryLevel->BotInfo.Init ();
}
if (bTitleLevel)
@ -772,7 +775,7 @@ void G_DoCompleted (void)
// Close the conversation menu if open.
P_FreeStrifeConversations ();
if (level.DoCompleted(nextlevel, wminfo))
if (primaryLevel->DoCompleted(nextlevel, wminfo))
{
gamestate = GS_INTERMISSION;
viewactive = false;
@ -954,7 +957,7 @@ void G_DoLoadLevel(const FString &nextmapname, int position, bool autosave, bool
gamestate_t oldgs = gamestate;
// Here the new level needs to be allocated.
level.DoLoadLevel(nextmapname, position, autosave, newGame);
primaryLevel->DoLoadLevel(nextmapname, position, autosave, newGame);
// Reset the global state for the new level.
if (wipegamestate == GS_LEVEL)
@ -1274,7 +1277,7 @@ void FLevelLocals::WorldDone (void)
DEFINE_ACTION_FUNCTION(FLevelLocals, WorldDone)
{
currentUILevel->WorldDone();
primaryLevel->WorldDone();
return 0;
}
@ -1290,9 +1293,9 @@ void G_DoWorldDone (void)
{
// Don't crash if no next map is given. Just repeat the current one.
Printf ("No next map specified.\n");
nextlevel = level.MapName;
nextlevel = primaryLevel->MapName;
}
level.StartTravel ();
primaryLevel->StartTravel ();
G_DoLoadLevel (nextlevel, startpos, true, false);
startpos = 0;
gameaction = ga_nothing;
@ -2282,7 +2285,7 @@ CCMD(skyfog)
if (argv.argc()>1)
{
// Do this only on the primary level.
currentUILevel->skyfog = MAX(0, (int)strtoull(argv[1], NULL, 0));
primaryLevel->skyfog = MAX(0, (int)strtoull(argv[1], NULL, 0));
}
}

View file

@ -672,7 +672,7 @@ public:
extern FLevelLocals level;
extern FLevelLocals *currentUILevel; // level for which to display the user interface. This will always be the one the current consoleplayer is in.
extern FLevelLocals *primaryLevel; // level for which to display the user interface. This will always be the one the current consoleplayer is in.
extern FLevelLocals *currentVMLevel;
inline FSectorPortal *line_t::GetTransferredPortal()
@ -774,5 +774,5 @@ inline bool line_t::hitSkyWall(AActor* mo) const
// It is meant for code that needs to iterate over all levels to make some global changes, e.g. configuation CCMDs.
inline TArrayView<FLevelLocals *> AllLevels()
{
return TArrayView<FLevelLocals *>(&currentUILevel, 1);
return TArrayView<FLevelLocals *>(&primaryLevel, 1);
}

View file

@ -1076,7 +1076,7 @@ public:
lastHud = hud;
// Handle inventory bar drawing
if(CPlayer->inventorytics > 0 && !(currentUILevel->flags & LEVEL_NOINVENTORYBAR) && (state == HUD_StatusBar || state == HUD_Fullscreen))
if(CPlayer->inventorytics > 0 && !(primaryLevel->flags & LEVEL_NOINVENTORYBAR) && (state == HUD_StatusBar || state == HUD_Fullscreen))
{
SBarInfoMainBlock *inventoryBar = state == HUD_StatusBar ? script->huds[STBAR_INVENTORY] : script->huds[STBAR_INVENTORYFULLSCREEN];
if(inventoryBar != lastInventoryBar)

View file

@ -850,26 +850,26 @@ class CommandDrawString : public SBarInfoCommand
switch(strValue)
{
case LEVELNAME:
if(currentUILevel->lumpnum != cache)
if(primaryLevel->lumpnum != cache)
{
cache = currentUILevel->lumpnum;
str = currentUILevel->LevelName;
cache = primaryLevel->lumpnum;
str = primaryLevel->LevelName;
RealignString();
}
break;
case LEVELLUMP:
if(currentUILevel->lumpnum != cache)
if(primaryLevel->lumpnum != cache)
{
cache = currentUILevel->lumpnum;
str = currentUILevel->MapName;
cache = primaryLevel->lumpnum;
str = primaryLevel->MapName;
str.ToUpper();
RealignString();
}
break;
case SKILLNAME:
if(currentUILevel->lumpnum != cache) // Can only change skill between currentUILevel->
if(primaryLevel->lumpnum != cache) // Can only change skill between primaryLevel->
{
cache = currentUILevel->lumpnum;
cache = primaryLevel->lumpnum;
str = G_SkillName();
RealignString();
}
@ -904,7 +904,7 @@ class CommandDrawString : public SBarInfoCommand
if(ACS_GlobalVars[valueArgument] != cache)
{
cache = ACS_GlobalVars[valueArgument];
str = currentUILevel->Behaviors.LookupString(ACS_GlobalVars[valueArgument]);
str = primaryLevel->Behaviors.LookupString(ACS_GlobalVars[valueArgument]);
RealignString();
}
break;
@ -912,13 +912,13 @@ class CommandDrawString : public SBarInfoCommand
if(ACS_GlobalArrays[valueArgument][consoleplayer] != cache)
{
cache = ACS_GlobalArrays[valueArgument][consoleplayer];
str = currentUILevel->Behaviors.LookupString(ACS_GlobalArrays[valueArgument][consoleplayer]);
str = primaryLevel->Behaviors.LookupString(ACS_GlobalArrays[valueArgument][consoleplayer]);
RealignString();
}
break;
case TIME:
{
int sec = Tics2Seconds(currentUILevel->time);
int sec = Tics2Seconds(primaryLevel->time);
str.Format("%02d:%02d:%02d", sec / 3600, (sec % 3600) / 60, sec % 60);
break;
}
@ -1389,25 +1389,25 @@ class CommandDrawNumber : public CommandDrawString
num = statusBar->CPlayer->fragcount;
break;
case KILLS:
num = currentUILevel->killed_monsters;
num = primaryLevel->killed_monsters;
break;
case MONSTERS:
num = currentUILevel->total_monsters;
num = primaryLevel->total_monsters;
break;
case ITEMS:
num = currentUILevel->found_items;
num = primaryLevel->found_items;
break;
case TOTALITEMS:
num = currentUILevel->total_items;
num = primaryLevel->total_items;
break;
case SECRETS:
num = currentUILevel->found_secrets;
num = primaryLevel->found_secrets;
break;
case SCORE:
num = statusBar->CPlayer->mo->Score;
break;
case TOTALSECRETS:
num = currentUILevel->total_secrets;
num = primaryLevel->total_secrets;
break;
case ARMORCLASS:
case SAVEPERCENT:
@ -1459,9 +1459,9 @@ class CommandDrawNumber : public CommandDrawString
case AIRTIME:
{
if(statusBar->CPlayer->mo->waterlevel < 3)
num = currentUILevel->airsupply/TICRATE;
num = primaryLevel->airsupply/TICRATE;
else
num = clamp<int>((statusBar->CPlayer->air_finished - currentUILevel->time + (TICRATE-1))/TICRATE, 0, INT_MAX);
num = clamp<int>((statusBar->CPlayer->air_finished - primaryLevel->time + (TICRATE-1))/TICRATE, 0, INT_MAX);
break;
}
case SELECTEDINVENTORY:
@ -1502,7 +1502,7 @@ class CommandDrawNumber : public CommandDrawString
}
default: break;
}
if(interpolationSpeed != 0 && (!hudChanged || currentUILevel->time == 1))
if(interpolationSpeed != 0 && (!hudChanged || primaryLevel->time == 1))
{
if(num < drawValue)
drawValue -= clamp<int>((drawValue - num) >> 2, 1, interpolationSpeed);
@ -1691,7 +1691,7 @@ class CommandDrawSelectedInventory : public CommandDrawImage, private CommandDra
if(alternateOnEmpty)
SBarInfoCommandFlowControl::Draw(block, statusBar);
if(statusBar->CPlayer->mo->PointerVar<AActor>(NAME_InvSel) != NULL && !(currentUILevel->flags & LEVEL_NOINVENTORYBAR))
if(statusBar->CPlayer->mo->PointerVar<AActor>(NAME_InvSel) != NULL && !(primaryLevel->flags & LEVEL_NOINVENTORYBAR))
{
if(artiflash && statusBar->wrapper->artiflashTick)
{
@ -1791,7 +1791,7 @@ class CommandDrawSelectedInventory : public CommandDrawImage, private CommandDra
{
SBarInfoCommandFlowControl::Tick(block, statusBar, hudChanged);
SetTruth(statusBar->CPlayer->mo->PointerVar<AActor>(NAME_InvSel) == NULL || (currentUILevel->flags & LEVEL_NOINVENTORYBAR), block, statusBar);
SetTruth(statusBar->CPlayer->mo->PointerVar<AActor>(NAME_InvSel) == NULL || (primaryLevel->flags & LEVEL_NOINVENTORYBAR), block, statusBar);
CommandDrawImage::Tick(block, statusBar, hudChanged);
CommandDrawNumber::Tick(block, statusBar, hudChanged);
@ -1910,7 +1910,7 @@ class CommandInventoryBarNotVisible : public SBarInfoCommandFlowControl
{
SBarInfoCommandFlowControl::Tick(block, statusBar, hudChanged);
SetTruth(statusBar->CPlayer->inventorytics <= 0 || (currentUILevel->flags & LEVEL_NOINVENTORYBAR), block, statusBar);
SetTruth(statusBar->CPlayer->inventorytics <= 0 || (primaryLevel->flags & LEVEL_NOINVENTORYBAR), block, statusBar);
}
};
@ -2727,16 +2727,16 @@ class CommandDrawBar : public SBarInfoCommand
max = fraglimit;
break;
case KILLS:
value = currentUILevel->killed_monsters;
max = currentUILevel->total_monsters;
value = primaryLevel->killed_monsters;
max = primaryLevel->total_monsters;
break;
case ITEMS:
value = currentUILevel->found_items;
max = currentUILevel->total_items;
value = primaryLevel->found_items;
max = primaryLevel->total_items;
break;
case SECRETS:
value = currentUILevel->found_secrets;
max = currentUILevel->total_secrets;
value = primaryLevel->found_secrets;
max = primaryLevel->total_secrets;
break;
case INVENTORY:
{
@ -2751,8 +2751,8 @@ class CommandDrawBar : public SBarInfoCommand
break;
}
case AIRTIME:
value = clamp<int>(statusBar->CPlayer->air_finished - currentUILevel->time, 0, INT_MAX);
max = currentUILevel->airsupply;
value = clamp<int>(statusBar->CPlayer->air_finished - primaryLevel->time, 0, INT_MAX);
max = primaryLevel->airsupply;
break;
case POWERUPTIME:
{
@ -2798,7 +2798,7 @@ class CommandDrawBar : public SBarInfoCommand
}
else
value = 0;
if(interpolationSpeed != 0 && (!hudChanged || currentUILevel->time == 1))
if(interpolationSpeed != 0 && (!hudChanged || primaryLevel->time == 1))
{
// [BL] Since we used a percentage (in order to get the most fluid animation)
// we need to establish a cut off point so the last pixel won't hang as the animation slows
@ -3192,7 +3192,7 @@ class CommandDrawGem : public SBarInfoCommand
goalValue = reverse ? 100 - goalValue : goalValue;
if(interpolationSpeed != 0 && (!hudChanged || currentUILevel->time == 1)) // At the start force an animation
if(interpolationSpeed != 0 && (!hudChanged || primaryLevel->time == 1)) // At the start force an animation
{
if(goalValue < drawValue)
drawValue -= clamp<int>((drawValue - goalValue) >> 2, 1, interpolationSpeed);
@ -3202,7 +3202,7 @@ class CommandDrawGem : public SBarInfoCommand
else
drawValue = goalValue;
if(wiggle && currentUILevel->time & 1)
if(wiggle && primaryLevel->time & 1)
chainWiggle = pr_chainwiggle() & 1;
}
protected:

View file

@ -789,7 +789,7 @@ void DBaseStatusBar::RefreshViewBorder ()
{
return;
}
auto tex = GetBorderTexture(currentUILevel);
auto tex = GetBorderTexture(primaryLevel);
screen->DrawBorder (tex, 0, 0, Width, viewwindowy);
screen->DrawBorder (tex, 0, viewwindowy, viewwindowx, viewheight + viewwindowy);
screen->DrawBorder (tex, viewwindowx + viewwidth, viewwindowy, Width, viewheight + viewwindowy);
@ -815,7 +815,7 @@ void DBaseStatusBar::RefreshBackground () const
if (x == 0 && y == SCREENHEIGHT) return;
auto tex = GetBorderTexture(currentUILevel);
auto tex = GetBorderTexture(primaryLevel);
if(!CompleteBorder)
{

View file

@ -2285,8 +2285,8 @@ static void ClearMapinfo()
AllSkills.Clear();
DefaultSkill = -1;
DeinitIntermissions();
level.info = NULL;
level.F1Pic = "";
primaryLevel->info = nullptr;
primaryLevel->F1Pic = "";
}
//==========================================================================

View file

@ -369,7 +369,7 @@ static void HU_DrawTimeRemaining (int y)
if (deathmatch && timelimit && gamestate == GS_LEVEL)
{
char str[80];
int timeleft = (int)(timelimit * TICRATE * 60) - currentUILevel->maptime;
int timeleft = (int)(timelimit * TICRATE * 60) - primaryLevel->maptime;
int hours, minutes, seconds;
if (timeleft < 0)

View file

@ -787,7 +787,7 @@ void DIntermissionController::Ticker ()
switch (mGameState)
{
case FSTATE_InLevel:
currentUILevel->SetMusic();
primaryLevel->SetMusic();
gamestate = GS_LEVEL;
wipegamestate = GS_LEVEL;
P_ResumeConversation ();

View file

@ -324,7 +324,7 @@ void cht_DoCheat (player_t *player, int cheat)
case CHT_MASSACRE:
case CHT_MASSACRE2:
{
int killcount = currentUILevel->Massacre (cheat == CHT_MASSACRE2);
int killcount = primaryLevel->Massacre (cheat == CHT_MASSACRE2);
// killough 3/22/98: make more intelligent about plural
// Ty 03/27/98 - string(s) *not* externalized
mysnprintf (msgbuild, countof(msgbuild), "%d %s%s Killed", killcount,

View file

@ -823,7 +823,7 @@ void CopyPlayer(player_t *dst, player_t *src, const char *name)
if (dst->Bot != nullptr)
{
botinfo_t *thebot = level.BotInfo.botinfo;
botinfo_t *thebot = src->mo->Level->BotInfo.botinfo;
while (thebot && stricmp(name, thebot->name))
{
thebot = thebot->next;
@ -832,7 +832,7 @@ void CopyPlayer(player_t *dst, player_t *src, const char *name)
{
thebot->inuse = BOTINUSE_Yes;
}
level.BotInfo.botnum++;
src->mo->Level->BotInfo.botnum++;
dst->userinfo.TransferFrom(uibackup2);
}
else

View file

@ -353,7 +353,11 @@ void P_FreeLevelData ()
E_Shutdown(true);
R_FreePastViewers();
level.ClearLevelData();
for (auto Level : AllLevels())
{
Level->ClearLevelData();
}
// primaryLevel->FreeSecondaryLevels();
}
//===========================================================================
@ -577,7 +581,10 @@ void P_Init ()
static void P_Shutdown ()
{
level.Thinkers.DestroyThinkersInList(STAT_STATIC);
for (auto Level : AllLevels())
{
Level->Thinkers.DestroyThinkersInList(STAT_STATIC);
}
P_FreeLevelData ();
// [ZZ] delete global event handlers
E_Shutdown(false);

View file

@ -65,7 +65,7 @@ bool P_CheckTickerPaused ()
&& wipegamestate == gamestate)
{
// Only the current UI level's settings are relevant for sound.
S_PauseSound (!(currentUILevel->flags2 & LEVEL2_PAUSE_MUSIC_IN_MENUS), false);
S_PauseSound (!(primaryLevel->flags2 & LEVEL2_PAUSE_MUSIC_IN_MENUS), false);
return true;
}
return false;
@ -99,7 +99,7 @@ void P_Ticker (void)
// [RH] Frozen mode is only changed every 4 tics, to make it work with A_Tracer().
// This may not be perfect but it is not really relevant for sublevels that tracer homing behavior is preserved.
if ((currentUILevel->maptime & 3) == 0)
if ((primaryLevel->maptime & 3) == 0)
{
if (globalchangefreeze)
{
@ -151,18 +151,22 @@ void P_Ticker (void)
// [ZZ] call the WorldTick hook
E_WorldTick();
StatusBar->CallTick (); // [RH] moved this here
level.Tick (); // [RH] let the level tick
level.Thinkers.RunThinkers(&level);
for (auto Level : AllLevels())
{
// todo: set up a sandbox for secondary levels here.
Level->Tick(); // [RH] let the level tick
Level->Thinkers.RunThinkers(Level);
//if added by MC: Freeze mode.
if (!level.isFrozen())
if (!Level->isFrozen())
{
P_UpdateSpecials (&level);
P_RunEffects(&level); // [RH] Run particle effects
P_UpdateSpecials(Level);
P_RunEffects(Level); // [RH] Run particle effects
}
// for par times
level.time++;
level.maptime++;
level.totaltime++;
Level->time++;
Level->maptime++;
Level->totaltime++;
}
}

View file

@ -956,8 +956,8 @@ void P_CheckPlayerSprite(AActor *actor, int &spritenum, DVector2 &scale)
CUSTOM_CVAR (Float, sv_aircontrol, 0.00390625f, CVAR_SERVERINFO|CVAR_NOSAVE)
{
currentUILevel->aircontrol = self;
currentUILevel->AirControlChanged ();
primaryLevel->aircontrol = self;
primaryLevel->AirControlChanged ();
}
//==========================================================================

View file

@ -165,7 +165,7 @@ static int DoomSpecificInfo (char *buffer, char *end)
}
else
{
p += snprintf (buffer+p, size-p, "\n\nCurrent map: %s", currentUILevel->MapName.GetChars());
p += snprintf (buffer+p, size-p, "\n\nCurrent map: %s", primaryLevel->MapName.GetChars());
if (!viewactive)
{

View file

@ -112,9 +112,10 @@ void IShadowMap::CollectLights()
{
if (mLights.Size() != 1024 * 4) mLights.Resize(1024 * 4);
int lightindex = 0;
auto Level = &level;
// Todo: this should go through the blockmap in a spiral pattern around the player so that closer lights are preferred.
for (auto light = level.lights; light; light = light->next)
for (auto light = Level->lights; light; light = light->next)
{
LightsProcessed++;
if (light->shadowmapped && light->IsActive() && lightindex < 1024 * 4)

View file

@ -403,16 +403,16 @@ void S_Start ()
FString LocalSndSeq;
// To be certain better check whether level is valid!
if (currentUILevel->info)
if (primaryLevel->info)
{
LocalSndInfo = currentUILevel->info->SoundInfo;
LocalSndSeq = currentUILevel->info->SndSeq;
LocalSndInfo = primaryLevel->info->SoundInfo;
LocalSndSeq = primaryLevel->info->SndSeq;
}
bool parse_ss = false;
// This level uses a different local SNDINFO
if (LastLocalSndInfo.CompareNoCase(LocalSndInfo) != 0 || !currentUILevel->info)
if (LastLocalSndInfo.CompareNoCase(LocalSndInfo) != 0 || !primaryLevel->info)
{
// First delete the old sound list
for(unsigned i = 1; i < S_sfx.Size(); i++)
@ -457,9 +457,9 @@ void S_Start ()
// Don't start the music if loading a savegame, because the music is stored there.
// Don't start the music if revisiting a level in a hub for the same reason.
if (!currentUILevel->IsReentering())
if (!primaryLevel->IsReentering())
{
currentUILevel->SetMusic();
primaryLevel->SetMusic();
}
}
@ -475,7 +475,7 @@ void S_PrecacheLevel (FLevelLocals *Level)
{
unsigned int i;
if (GSnd && Level == currentUILevel)
if (GSnd && Level == primaryLevel)
{
for (i = 0; i < S_sfx.Size(); ++i)
{
@ -499,7 +499,7 @@ void S_PrecacheLevel (FLevelLocals *Level)
FSoundID(snd).MarkUsed();
}
// Precache all extra sounds requested by this map.
for (auto snd : currentUILevel->info->PrecacheSounds)
for (auto snd : primaryLevel->info->PrecacheSounds)
{
FSoundID(snd).MarkUsed();
}
@ -705,8 +705,8 @@ static void CalcPosVel(int type, const AActor *actor, const sector_t *sector,
// on static analysis.
if(type == SOURCE_Unattached)
{
sector_t *sec = currentUILevel->PointInSector(pt[0], pt[2]);
DVector2 disp = currentUILevel->Displacements.getOffset(pgroup, sec->PortalGroup);
sector_t *sec = primaryLevel->PointInSector(pt[0], pt[2]);
DVector2 disp = primaryLevel->Displacements.getOffset(pgroup, sec->PortalGroup);
pos->X = pt[0] - (float)disp.X;
pos->Y = !(chanflags & CHAN_LISTENERZ) ? pt[1] : (float)listenpos.Z;
pos->Z = pt[2] - (float)disp.Y;
@ -723,7 +723,7 @@ static void CalcPosVel(int type, const AActor *actor, const sector_t *sector,
//assert(actor != NULL);
if (actor != NULL)
{
DVector2 disp = currentUILevel->Displacements.getOffset(pgroup, actor->Sector->PortalGroup);
DVector2 disp = primaryLevel->Displacements.getOffset(pgroup, actor->Sector->PortalGroup);
DVector3 posi = actor->Pos() - disp;
*pos = { (float)posi.X, (float)posi.Z, (float)posi.Y };
}
@ -733,7 +733,7 @@ static void CalcPosVel(int type, const AActor *actor, const sector_t *sector,
assert(sector != NULL);
if (sector != NULL)
{
DVector2 disp = currentUILevel->Displacements.getOffset(pgroup, sector->PortalGroup);
DVector2 disp = primaryLevel->Displacements.getOffset(pgroup, sector->PortalGroup);
if (chanflags & CHAN_AREA)
{
// listener must be reversely offset to calculate the proper sound origin.
@ -755,7 +755,7 @@ static void CalcPosVel(int type, const AActor *actor, const sector_t *sector,
assert(poly != NULL);
if (poly != NULL)
{
DVector2 disp = currentUILevel->Displacements.getOffset(pgroup, poly->CenterSubsector->sector->PortalGroup);
DVector2 disp = primaryLevel->Displacements.getOffset(pgroup, poly->CenterSubsector->sector->PortalGroup);
CalcPolyobjSoundOrg(listenpos + disp, poly, *pos);
pos->X -= (float)disp.X;
pos->Z -= (float)disp.Y;
@ -852,7 +852,7 @@ static void CalcSectorSoundOrg(const DVector3 &listenpos, const sector_t *sec, i
if (!(sec->Level->i_compatflags & COMPATF_SECTORSOUNDS))
{
// Are we inside the sector? If yes, the closest point is the one we're on.
if (currentUILevel->PointInSector(listenpos.X, listenpos.Y) == sec)
if (primaryLevel->PointInSector(listenpos.X, listenpos.Y) == sec)
{
pos.X = (float)listenpos.X;
pos.Z = (float)listenpos.Y;
@ -916,7 +916,7 @@ static void CalcPolyobjSoundOrg(const DVector3 &listenpos, const FPolyObj *poly,
//
// S_StartSound
//
// 0 attenuation means full volume over whole currentUILevel->
// 0 attenuation means full volume over whole primaryLevel->
// 0 < attenuation means to scale the distance by that amount when
// calculating volume.
//
@ -1337,7 +1337,7 @@ DEFINE_ACTION_FUNCTION(DObject, S_Sound)
void S_Sound (AActor *ent, int channel, FSoundID sound_id, float volume, float attenuation)
{
if (ent == nullptr || ent->Sector->Flags & SECF_SILENT || ent->Level != currentUILevel)
if (ent == nullptr || ent->Sector->Flags & SECF_SILENT || ent->Level != primaryLevel)
return;
S_StartSound (ent, nullptr, nullptr, nullptr, channel, sound_id, volume, attenuation);
}
@ -1352,7 +1352,7 @@ void S_Sound (AActor *ent, int channel, FSoundID sound_id, float volume, float a
void S_SoundMinMaxDist(AActor *ent, int channel, FSoundID sound_id, float volume, float mindist, float maxdist)
{
if (ent == nullptr || ent->Sector->Flags & SECF_SILENT || ent->Level != currentUILevel)
if (ent == nullptr || ent->Sector->Flags & SECF_SILENT || ent->Level != primaryLevel)
return;
FRolloffInfo rolloff;
@ -1371,7 +1371,7 @@ void S_SoundMinMaxDist(AActor *ent, int channel, FSoundID sound_id, float volume
void S_Sound (const FPolyObj *poly, int channel, FSoundID sound_id, float volume, float attenuation)
{
if (poly->Level != currentUILevel) return;
if (poly->Level != primaryLevel) return;
S_StartSound (nullptr, nullptr, poly, nullptr, channel, sound_id, volume, attenuation);
}
@ -1383,7 +1383,7 @@ void S_Sound (const FPolyObj *poly, int channel, FSoundID sound_id, float volume
void S_Sound(FLevelLocals *Level, const DVector3 &pos, int channel, FSoundID sound_id, float volume, float attenuation)
{
if (Level != currentUILevel) return;
if (Level != primaryLevel) return;
// The sound system switches Y and Z around.
FVector3 p((float)pos.X, (float)pos.Z, (float)pos.Y);
S_StartSound (nullptr, nullptr, nullptr, &p, channel, sound_id, volume, attenuation);
@ -1397,7 +1397,7 @@ void S_Sound(FLevelLocals *Level, const DVector3 &pos, int channel, FSoundID sou
void S_Sound (const sector_t *sec, int channel, FSoundID sfxid, float volume, float attenuation)
{
if (sec->Level != currentUILevel) return;
if (sec->Level != primaryLevel) return;
S_StartSound (nullptr, sec, nullptr, nullptr, channel, sfxid, volume, attenuation);
}
@ -1411,7 +1411,7 @@ void S_Sound (const sector_t *sec, int channel, FSoundID sfxid, float volume, fl
void S_PlaySound(AActor *a, int chan, FSoundID sid, float vol, float atten, bool local)
{
if (a == nullptr || a->Sector->Flags & SECF_SILENT || a->Level != currentUILevel)
if (a == nullptr || a->Sector->Flags & SECF_SILENT || a->Level != primaryLevel)
return;
if (!local)
@ -2190,7 +2190,7 @@ void S_UpdateSounds (AActor *listenactor)
GSnd->UpdateListener(&listener);
GSnd->UpdateSounds();
if (currentUILevel->time >= RestartEvictionsAt)
if (primaryLevel->time >= RestartEvictionsAt)
{
RestartEvictionsAt = 0;
S_RestoreEvictedChannels();
@ -2216,8 +2216,8 @@ static void S_SetListener(SoundListener &listener, AActor *listenactor)
listener.velocity.Zero();
listener.position = listenactor->SoundPos();
listener.underwater = listenactor->waterlevel == 3;
assert(currentUILevel->Zones.Size() > listenactor->Sector->ZoneNumber);
listener.Environment = currentUILevel->Zones[listenactor->Sector->ZoneNumber].Environment;
assert(primaryLevel->Zones.Size() > listenactor->Sector->ZoneNumber);
listener.Environment = primaryLevel->Zones[listenactor->Sector->ZoneNumber].Environment;
listener.valid = true;
}
else
@ -2495,7 +2495,7 @@ void S_SerializeSounds(FSerializer &arc)
// playing before the wipe, and depending on the synchronization
// between the main thread and the mixer thread at the time, the
// sounds might be heard briefly before pausing for the wipe.
RestartEvictionsAt = currentUILevel->time + 2;
RestartEvictionsAt = primaryLevel->time + 2;
}
GSnd->Sync(false);
GSnd->UpdateSounds();
@ -2585,8 +2585,8 @@ bool S_ChangeMusic (const char *musicname, int order, bool looping, bool force)
{
if (gamestate == GS_LEVEL || gamestate == GS_TITLELEVEL)
{
musicname = currentUILevel->Music;
order = currentUILevel->musicorder;
musicname = primaryLevel->Music;
order = primaryLevel->musicorder;
}
else
{
@ -2866,7 +2866,7 @@ CCMD (loopsound)
}
else
{
AActor *icon = Spawn(&level, "SpeakerIcon", players[consoleplayer].mo->PosPlusZ(32.), ALLOW_REPLACE);
AActor *icon = Spawn(primaryLevel, "SpeakerIcon", players[consoleplayer].mo->PosPlusZ(32.), ALLOW_REPLACE);
if (icon != NULL)
{
S_Sound(icon, CHAN_BODY | CHAN_LOOP, id, 1.f, ATTN_IDLE);

View file

@ -2359,7 +2359,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(DBaseStatusBar, SetClipRect, SBar_SetClipRect)
static void GetGlobalACSString(int index, FString *result)
{
*result = currentUILevel->Behaviors.LookupString(ACS_GlobalVars[index]);
*result = primaryLevel->Behaviors.LookupString(ACS_GlobalVars[index]);
}
DEFINE_ACTION_FUNCTION_NATIVE(DBaseStatusBar, GetGlobalACSString, GetGlobalACSString)
@ -2373,7 +2373,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(DBaseStatusBar, GetGlobalACSString, GetGlobalACSSt
static void GetGlobalACSArrayString(int arrayno, int index, FString *result)
{
*result = currentUILevel->Behaviors.LookupString(ACS_GlobalVars[index]);
*result = primaryLevel->Behaviors.LookupString(ACS_GlobalVars[index]);
}
DEFINE_ACTION_FUNCTION_NATIVE(DBaseStatusBar, GetGlobalACSArrayString, GetGlobalACSArrayString)
@ -2846,8 +2846,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_AltHUD, GetLatency, Net_GetLatency)
//
//
//==========================================================================
DEFINE_GLOBAL(level);
DEFINE_GLOBAL(currentUILevel);
DEFINE_GLOBAL(currentVMLevel, level);
DEFINE_FIELD(FLevelLocals, sectors)
DEFINE_FIELD(FLevelLocals, lines)
DEFINE_FIELD(FLevelLocals, sides)

View file

@ -489,7 +489,7 @@ static bool Cht_ChangeStartSpot (cheatseq_t *cheat)
{
char cmd[64];
mysnprintf (cmd, countof(cmd), "changemap %s %c", currentUILevel->MapName.GetChars(), cheat->Args[0]);
mysnprintf (cmd, countof(cmd), "changemap %s %c", primaryLevel->MapName.GetChars(), cheat->Args[0]);
C_DoCommand (cmd);
return true;
}

View file

@ -577,7 +577,7 @@ FString GetStatString()
CCMD(printstats)
{
StoreLevelStats(currentUILevel); // Refresh the current level's results.
StoreLevelStats(primaryLevel); // Refresh the current level's results.
Printf("%s", GetStatString().GetChars());
}
@ -596,6 +596,6 @@ CCMD(finishgame)
ADD_STAT(statistics)
{
StoreLevelStats(currentUILevel); // Refresh the current level's results.
StoreLevelStats(primaryLevel); // Refresh the current level's results.
return GetStatString();
}

View file

@ -428,7 +428,7 @@ void F2DDrawer::AddPoly(FTexture *texture, FVector2 *points, int npoints,
// is necessary in order to best reproduce Doom's original lighting.
double fadelevel;
if (vid_rendermode != 4 || currentUILevel->lightMode == ELightMode::Doom || currentUILevel->lightMode == ELightMode::ZDoomSoftware || currentUILevel->lightMode == ELightMode::DoomSoftware)
if (vid_rendermode != 4 || primaryLevel->lightMode == ELightMode::Doom || primaryLevel->lightMode == ELightMode::ZDoomSoftware || primaryLevel->lightMode == ELightMode::DoomSoftware)
{
double map = (NUMCOLORMAPS * 2.) - ((lightlevel + 12) * (NUMCOLORMAPS / 128.));
fadelevel = clamp((map - 12) / NUMCOLORMAPS, 0.0, 1.0);

View file

@ -595,8 +595,8 @@ void V_OutputResized (int width, int height)
C_NewModeAdjust();
// Reload crosshair if transitioned to a different size
ST_LoadCrosshair(true);
if (currentUILevel && currentUILevel->automap)
currentUILevel->automap->NewResolution();
if (primaryLevel && primaryLevel->automap)
primaryLevel->automap->NewResolution();
}
void V_CalcCleanFacs (int designwidth, int designheight, int realwidth, int realheight, int *cleanx, int *cleany, int *_cx1, int *_cx2)

View file

@ -1105,7 +1105,7 @@ void DoomSpecificInfo (char *buffer, size_t bufflen)
}
else
{
buffer += mysnprintf (buffer, buffend - buffer, "\r\n\r\nCurrent map: %s", currentUILevel->MapName.GetChars());
buffer += mysnprintf (buffer, buffend - buffer, "\r\n\r\nCurrent map: %s", primaryLevel->MapName.GetChars());
if (!viewactive)
{

View file

@ -1,3 +1,4 @@
struct _ native // These are the global variables, the struct is only here to avoid extending the parser for this.
{
native readonly Array<class> AllClasses;
@ -7,20 +8,16 @@ struct _ native // These are the global variables, the struct is only here to av
native readonly Array<@Team> Teams;
native int validcount;
native readonly bool multiplayer;
deprecated("3.8") native play @LevelLocals level;
native @KeyBindings Bindings;
native @KeyBindings AutomapBindings;
native play @DehInfo deh;
native readonly @GameInfoStruct gameinfo;
native play @PlayerInfo players[MAXPLAYERS];
native readonly bool playeringame[MAXPLAYERS];
native readonly ui bool netgame;
native readonly bool automapactive;
native play uint gameaction;
native readonly int gamestate;
native readonly TextureID skyflatnum;
native readonly int consoleplayer;
native readonly Font smallfont;
native readonly Font smallfont2;
native readonly Font bigfont;
@ -43,9 +40,15 @@ struct _ native // These are the global variables, the struct is only here to av
native readonly int Net_Arbitrator;
native ui BaseStatusBar StatusBar;
native readonly Weapon WP_NOCHANGE;
native int LocalViewPitch;
native ui readonly LevelLocals currentUILevel;
deprecated("3.8") native readonly bool globalfreeze;
native int LocalViewPitch;
// sandbox state in multi-level setups:
native play @PlayerInfo players[MAXPLAYERS];
native readonly bool playeringame[MAXPLAYERS];
native readonly int consoleplayer;
native play LevelLocals Level;
}

View file

@ -97,15 +97,15 @@ struct Side native play
int GetUDMFInt(Name nm)
{
return sector.Level.GetUDMFInt(LevelLocals.UDMF_Side, Index(), nm);
return Level.GetUDMFInt(LevelLocals.UDMF_Side, Index(), nm);
}
double GetUDMFFloat(Name nm)
{
return sector.Level.GetUDMFFloat(LevelLocals.UDMF_Side, Index(), nm);
return Level.GetUDMFFloat(LevelLocals.UDMF_Side, Index(), nm);
}
String GetUDMFString(Name nm)
{
return sector.Level.GetUDMFString(LevelLocals.UDMF_Side, Index(), nm);
return Level.GetUDMFString(LevelLocals.UDMF_Side, Index(), nm);
}
};
@ -180,15 +180,15 @@ struct Line native play
int GetUDMFInt(Name nm)
{
return frontsector.Level.GetUDMFInt(LevelLocals.UDMF_Line, Index(), nm);
return Level.GetUDMFInt(LevelLocals.UDMF_Line, Index(), nm);
}
double GetUDMFFloat(Name nm)
{
return frontsector.Level.GetUDMFFloat(LevelLocals.UDMF_Line, Index(), nm);
return Level.GetUDMFFloat(LevelLocals.UDMF_Line, Index(), nm);
}
String GetUDMFString(Name nm)
{
return frontsector.Level.GetUDMFString(LevelLocals.UDMF_Line, Index(), nm);
return Level.GetUDMFString(LevelLocals.UDMF_Line, Index(), nm);
}
native clearscope int GetHealth();
@ -259,7 +259,6 @@ struct Sector native play
native SectorEffect floordata;
native SectorEffect ceilingdata;
native SectorEffect lightingdata;
native readonly LevelLocals Level;
enum EPlane
{

View file

@ -509,7 +509,7 @@ class ConversationMenu : Menu
override void Ticker()
{
// [CW] Freeze the game depending on MAPINFO options.
if (ConversationPauseTic < gametic && !multiplayer && !currentUILevel.no_dlg_freeze)
if (ConversationPauseTic < gametic && !multiplayer && !Level.no_dlg_freeze)
{
menuactive = Menu.On;
}

View file

@ -57,9 +57,9 @@ class ReadThisMenu : GenericMenu
TextureID tex, prevpic;
// Did the mapper choose a custom help page via MAPINFO?
if (currentUILevel.F1Pic.Length() != 0)
if (Level.F1Pic.Length() != 0)
{
tex = TexMan.CheckForTexture(currentUILevel.F1Pic, TexMan.Type_MiscPatch);
tex = TexMan.CheckForTexture(Level.F1Pic, TexMan.Type_MiscPatch);
mScreen = 1;
}
@ -98,7 +98,7 @@ class ReadThisMenu : GenericMenu
MenuSound("menu/choose");
mScreen++;
mInfoTic = gametic;
if (currentUILevel.F1Pic.Length() != 0 || mScreen > gameinfo.infoPages.Size())
if (Level.F1Pic.Length() != 0 || mScreen > gameinfo.infoPages.Size())
{
Close();
}

View file

@ -334,13 +334,6 @@ class PlayerPawn : Actor
{
let player = self.player;
// [SO] 9/2/02: People were able to do an awful lot of damage
// when they were observers...
if (player.Bot == null && bot_observer)
{
return;
}
let weapn = player.ReadyWeapon;
if (weapn == null || !weapn.CheckAmmo (Weapon.PrimaryFire, true))
{
@ -369,13 +362,6 @@ class PlayerPawn : Actor
virtual void FireWeaponAlt (State stat)
{
// [SO] 9/2/02: People were able to do an awful lot of damage
// when they were observers...
if (player.Bot == null && bot_observer)
{
return;
}
let weapn = player.ReadyWeapon;
if (weapn == null || weapn.FindState('AltFire') == null || !weapn.CheckAmmo (Weapon.AltFire, true))
{

View file

@ -461,7 +461,7 @@ class StatusScreen abstract play version("2.5")
if (cnt == 0)
{
End();
currentUILevel.WorldDone();
Level.WorldDone();
}
}
@ -477,7 +477,7 @@ class StatusScreen abstract play version("2.5")
{
// Last map in episode - there is no next location!
End();
currentUILevel.WorldDone();
Level.WorldDone();
return;
}
@ -608,7 +608,7 @@ class StatusScreen abstract play version("2.5")
virtual void StartMusic()
{
currentUILevel.SetInterMusic(wbs.next);
Level.SetInterMusic(wbs.next);
}
//====================================================================
@ -706,7 +706,7 @@ class StatusScreen abstract play version("2.5")
Par = TexMan.CheckForTexture("WIPAR", TexMan.Type_MiscPatch); // "par"
// Use the local level structure which can be overridden by hubs
lnametexts[0] = currentUILevel.LevelName;
lnametexts[0] = Level.LevelName;
lnametexts[1] = wbstartstruct.nextname;
bg = InterBackground.Create(wbs);

View file

@ -200,17 +200,17 @@ class AltHud ui
// work in cooperative hub games
if (hud_showsecrets)
{
DrawStatLine(x, y, "S:", String.Format("%i/%i ", multiplayer? CPlayer.secretcount : currentUILevel.found_secrets, currentUILevel.total_secrets));
DrawStatLine(x, y, "S:", String.Format("%i/%i ", multiplayer? CPlayer.secretcount : Level.found_secrets, Level.total_secrets));
}
if (hud_showitems)
{
DrawStatLine(x, y, "I:", String.Format("%i/%i ", multiplayer? CPlayer.itemcount : currentUILevel.found_items, currentUILevel.total_items));
DrawStatLine(x, y, "I:", String.Format("%i/%i ", multiplayer? CPlayer.itemcount : Level.found_items, Level.total_items));
}
if (hud_showmonsters)
{
DrawStatLine(x, y, "K:", String.Format("%i/%i ", multiplayer? CPlayer.killcount : currentUILevel.killed_monsters, currentUILevel.total_monsters));
DrawStatLine(x, y, "K:", String.Format("%i/%i ", multiplayer? CPlayer.killcount : Level.killed_monsters, Level.total_monsters));
}
}
}
@ -734,18 +734,18 @@ class AltHud ui
}
else
{
pos.xy = currentUILevel.GetAutomapPosition();
pos.z = currentUILevel.PointInSector(pos.xy).floorplane.ZatPoint(pos.xy);
pos.xy = Level.GetAutomapPosition();
pos.z = Level.PointInSector(pos.xy).floorplane.ZatPoint(pos.xy);
}
int xpos = hudwidth - SmallFont.StringWidth("X: -00000")-6;
int ypos = 18;
screen.DrawText(SmallFont, hudcolor_titl, hudwidth - 6 - SmallFont.StringWidth(currentUILevel.MapName), ypos, currentUILevel.MapName,
screen.DrawText(SmallFont, hudcolor_titl, hudwidth - 6 - SmallFont.StringWidth(Level.MapName), ypos, Level.MapName,
DTA_KeepRatio, true,
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight);
screen.DrawText(SmallFont, hudcolor_titl, hudwidth - 6 - SmallFont.StringWidth(currentUILevel.LevelName), ypos + h, currentUILevel.LevelName,
screen.DrawText(SmallFont, hudcolor_titl, hudwidth - 6 - SmallFont.StringWidth(Level.LevelName), ypos + h, Level.LevelName,
DTA_KeepRatio, true,
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight);
@ -788,10 +788,10 @@ class AltHud ui
{
int timeTicks =
hud_showtime < 4
? currentUILevel.maptime
? Level.maptime
: (hud_showtime < 6
? currentUILevel.time
: currentUILevel.totaltime);
? Level.time
: Level.totaltime);
timeSeconds = Thinker.Tics2Seconds(timeTicks);
}
else
@ -810,7 +810,7 @@ class AltHud ui
if (showMillis)
{
int millis = (currentUILevel.time % Thinker.TICRATE) * (1000 / Thinker.TICRATE);
int millis = (Level.time % Thinker.TICRATE) * (1000 / Thinker.TICRATE);
timeString = String.Format("%02i:%02i:%02i.%03i", hours, minutes, seconds, millis);
}
else if (showSeconds)
@ -941,23 +941,23 @@ class AltHud ui
if (am_showtotaltime)
{
DrawTimeString(SmallFont, hudcolor_ttim, currentUILevel.totaltime, hudwidth-2, bottom, 1);
DrawTimeString(SmallFont, hudcolor_ttim, Level.totaltime, hudwidth-2, bottom, 1);
bottom -= fonth;
}
if (am_showtime)
{
if (currentUILevel.clusterflags & currentUILevel.CLUSTER_HUB)
if (Level.clusterflags & Level.CLUSTER_HUB)
{
DrawTimeString(SmallFont, hudcolor_time, currentUILevel.time, hudwidth-2, bottom, 1);
DrawTimeString(SmallFont, hudcolor_time, Level.time, hudwidth-2, bottom, 1);
bottom -= fonth;
}
// Single level time for hubs
DrawTimeString(SmallFont, hudcolor_ltim, currentUILevel.maptime, hudwidth-2, bottom, 1);
DrawTimeString(SmallFont, hudcolor_ltim, Level.maptime, hudwidth-2, bottom, 1);
}
screen.DrawText(SmallFont, 0, 1, hudheight - fonth - 1, currentUILevel.FormatMapName(hudcolor_titl),
screen.DrawText(SmallFont, 0, 1, hudheight - fonth - 1, Level.FormatMapName(hudcolor_titl),
DTA_KeepRatio, true,
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight);

View file

@ -105,7 +105,7 @@ class DoomStatusBar : BaseStatusBar
DrawImage("STFBANY", (143, 168), DI_ITEM_OFFSETS|DI_TRANSLATABLE);
}
if (CPlayer.mo.InvSel != null && !currentUILevel.NoInventoryBar)
if (CPlayer.mo.InvSel != null && !Level.NoInventoryBar)
{
DrawInventoryIcon(CPlayer.mo.InvSel, (160, 198));
if (CPlayer.mo.InvSel.Amount > 1)
@ -153,7 +153,7 @@ class DoomStatusBar : BaseStatusBar
DrawString(mHUDFont, FormatNumber(ammotype2.Amount, 3), (-30, invY), DI_TEXT_ALIGN_RIGHT);
invY -= 20;
}
if (!isInventoryBarVisible() && !currentUILevel.NoInventoryBar && CPlayer.mo.InvSel != null)
if (!isInventoryBarVisible() && !Level.NoInventoryBar && CPlayer.mo.InvSel != null)
{
DrawInventoryIcon(CPlayer.mo.InvSel, (-14, invY + 17));
DrawString(mHUDFont, FormatNumber(CPlayer.mo.InvSel.Amount, 3), (-30, invY), DI_TEXT_ALIGN_RIGHT);

View file

@ -60,7 +60,7 @@ class HarmonyStatusBar : DoomStatusBar
DrawString(mHUDFont, FormatNumber(ammotype2.Amount, 3), (-30, invY), DI_TEXT_ALIGN_RIGHT);
invY -= 20;
}
if (!isInventoryBarVisible() && !currentUILevel.NoInventoryBar && CPlayer.mo.InvSel != null)
if (!isInventoryBarVisible() && !Level.NoInventoryBar && CPlayer.mo.InvSel != null)
{
DrawInventoryIcon(CPlayer.mo.InvSel, (-14, invY + 17));
DrawString(mHUDFont, FormatNumber(CPlayer.mo.InvSel.Amount, 3), (-30, invY), DI_TEXT_ALIGN_RIGHT);

View file

@ -43,7 +43,7 @@ class HereticStatusBar : BaseStatusBar
mHealthInterpolator.Update(CPlayer.health);
// wiggle the chain if it moves
if (currentUILevel.time & 1)
if (Level.time & 1)
{
wiggle = (mHealthInterpolator.GetValue() != CPlayer.health) && Random[ChainWiggle](0, 1);
}
@ -200,7 +200,7 @@ class HereticStatusBar : BaseStatusBar
y -= 40;
}
if (!isInventoryBarVisible() && !currentUILevel.NoInventoryBar && CPlayer.mo.InvSel != null)
if (!isInventoryBarVisible() && !Level.NoInventoryBar && CPlayer.mo.InvSel != null)
{
// This code was changed to always fit the item into the box, regardless of alignment or sprite size.
// Heretic's ARTIBOX is 30x30 pixels.

View file

@ -74,7 +74,7 @@ class HexenStatusBar : BaseStatusBar
DrawString(mHUDFont, FormatNumber(CPlayer.FragCount, 3), (70, -16));
}
if (!isInventoryBarVisible() && !currentUILevel.NoInventoryBar && CPlayer.mo.InvSel != null)
if (!isInventoryBarVisible() && !Level.NoInventoryBar && CPlayer.mo.InvSel != null)
{
// This code was changed to always fit the item into the box, regardless of alignment or sprite size.
// Heretic's ARTIBOX is 30x30 pixels.

View file

@ -597,9 +597,9 @@ class BaseStatusBar native ui
int GetAirTime()
{
if(CPlayer.mo.waterlevel < 3)
return currentUILevel.airsupply;
return Level.airsupply;
else
return max(CPlayer.air_finished - currentUILevel.time, 0);
return max(CPlayer.air_finished - Level.time, 0);
}
int GetSelectedInventoryAmount()
@ -654,7 +654,7 @@ class BaseStatusBar native ui
bool isInventoryBarVisible()
{
if (CPlayer == null) return false;
return (CPlayer.inventorytics > 0 && !currentUILevel.NoInventoryBar);
return (CPlayer.inventorytics > 0 && !Level.NoInventoryBar);
}
//============================================================================
@ -850,13 +850,13 @@ class BaseStatusBar native ui
let width = SmallFont.StringWidth("00:00:00");
if (am_showtime)
{
printtext = currentUILevel.TimeFormatted();
DrawString(mSmallFont, currentUILevel.TimeFormatted(), (-textdist-width, y), 0, crdefault);
printtext = Level.TimeFormatted();
DrawString(mSmallFont, Level.TimeFormatted(), (-textdist-width, y), 0, crdefault);
y += height;
}
if (am_showtotaltime)
{
DrawString(mSmallFont, currentUILevel.TimeFormatted(true), (-textdist-width, y), 0, crdefault);
DrawString(mSmallFont, Level.TimeFormatted(true), (-textdist-width, y), 0, crdefault);
}
if (!deathmatch)
@ -866,25 +866,25 @@ class BaseStatusBar native ui
// Draw monster count
if (am_showmonsters)
{
DrawString(mSmallFont, String.Format("%s\34%c %d/%d", Stringtable.Localize("$AM_MONSTERS"), crdefault+65, currentUILevel.killed_monsters, currentUILevel.total_monsters), (textdist, y), 0, highlight);
DrawString(mSmallFont, String.Format("%s\34%c %d/%d", Stringtable.Localize("$AM_MONSTERS"), crdefault+65, Level.killed_monsters, Level.total_monsters), (textdist, y), 0, highlight);
y += height;
}
// Draw secret count
if (am_showsecrets)
{
DrawString(mSmallFont, String.Format("%s\34%c %d/%d", Stringtable.Localize("$AM_SECRETS"), crdefault+65, currentUILevel.found_secrets, currentUILevel.total_secrets), (textdist, y), 0, highlight);
DrawString(mSmallFont, String.Format("%s\34%c %d/%d", Stringtable.Localize("$AM_SECRETS"), crdefault+65, Level.found_secrets, Level.total_secrets), (textdist, y), 0, highlight);
y += height;
}
// Draw item count
if (am_showitems)
{
DrawString(mSmallFont, String.Format("%s\34%c %d/%d", Stringtable.Localize("$AM_ITEMS"), crdefault+65, currentUILevel.found_items, currentUILevel.total_items), (textdist, y), 0, highlight);
DrawString(mSmallFont, String.Format("%s\34%c %d/%d", Stringtable.Localize("$AM_ITEMS"), crdefault+65, Level.found_items, Level.total_items), (textdist, y), 0, highlight);
}
}
String mapname = currentUILevel.FormatMapName(crdefault);
String mapname = Level.FormatMapName(crdefault);
BrokenLines lines = SmallFont.BreakLines(mapname, int(SCREENWIDTH / scale.X));
int numlines = lines.Count();
int finalwidth = int(SmallFont.StringWidth(lines.StringAt(numlines-1)) * scale.X);

View file

@ -427,7 +427,7 @@ class StrifeStatusBar : BaseStatusBar
case POP_Log:
{
// Draw the latest log message.
screen.DrawText(SmallFont2, Font.CR_UNTRANSLATED, left + 210 * xscale, top + 8 * yscale, currentUILevel.TimeFormatted(),
screen.DrawText(SmallFont2, Font.CR_UNTRANSLATED, left + 210 * xscale, top + 8 * yscale, Level.TimeFormatted(),
DTA_CleanNoMove, true);
if (CPlayer.LogText.Length() > 0)