- made G_InitLevelLocals a member function of FLevelLocals.

This was another cheap one with a good number of removed references.
This commit is contained in:
Christoph Oelckers 2019-01-25 19:46:03 +01:00
parent 20989a0b41
commit 28761b4c33
3 changed files with 56 additions and 57 deletions

View file

@ -947,7 +947,7 @@ void G_DoLoadLevel (int position, bool autosave, bool newGame)
else else
lastposition = position; lastposition = position;
G_InitLevelLocals (); level.Init();
StatusBar->DetachAllMessages (); StatusBar->DetachAllMessages ();
// Force 'teamplay' to 'true' if need be. // Force 'teamplay' to 'true' if need be.
@ -1450,95 +1450,95 @@ int G_FinishTravel ()
// //
//========================================================================== //==========================================================================
void G_InitLevelLocals () void FLevelLocals::Init()
{ {
level_info_t *info; level_info_t *info;
BaseBlendA = 0.0f; // Remove underwater blend effect, if any BaseBlendA = 0.0f; // Remove underwater blend effect, if any
level.gravity = sv_gravity * 35/TICRATE; gravity = sv_gravity * 35/TICRATE;
level.aircontrol = sv_aircontrol; aircontrol = sv_aircontrol;
level.teamdamage = teamdamage; teamdamage = teamdamage;
level.flags = 0; flags = 0;
level.flags2 = 0; flags2 = 0;
level.flags3 = 0; flags3 = 0;
info = FindLevelInfo (level.MapName); info = FindLevelInfo (MapName);
level.info = info; info = info;
level.skyspeed1 = info->skyspeed1; skyspeed1 = info->skyspeed1;
level.skyspeed2 = info->skyspeed2; skyspeed2 = info->skyspeed2;
level.skytexture1 = TexMan.GetTextureID(info->SkyPic1, ETextureType::Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_ReturnFirst); skytexture1 = TexMan.GetTextureID(info->SkyPic1, ETextureType::Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_ReturnFirst);
level.skytexture2 = TexMan.GetTextureID(info->SkyPic2, ETextureType::Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_ReturnFirst); skytexture2 = TexMan.GetTextureID(info->SkyPic2, ETextureType::Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_ReturnFirst);
level.fadeto = info->fadeto; fadeto = info->fadeto;
level.cdtrack = info->cdtrack; cdtrack = info->cdtrack;
level.cdid = info->cdid; cdid = info->cdid;
level.FromSnapshot = false; FromSnapshot = false;
if (level.fadeto == 0) if (fadeto == 0)
{ {
if (strnicmp (info->FadeTable, "COLORMAP", 8) != 0) if (strnicmp (info->FadeTable, "COLORMAP", 8) != 0)
{ {
level.flags |= LEVEL_HASFADETABLE; flags |= LEVEL_HASFADETABLE;
} }
} }
level.airsupply = info->airsupply*TICRATE; airsupply = info->airsupply*TICRATE;
level.outsidefog = info->outsidefog; outsidefog = info->outsidefog;
level.WallVertLight = info->WallVertLight*2; WallVertLight = info->WallVertLight*2;
level.WallHorizLight = info->WallHorizLight*2; WallHorizLight = info->WallHorizLight*2;
if (info->gravity != 0.f) if (info->gravity != 0.f)
{ {
level.gravity = info->gravity * 35/TICRATE; gravity = info->gravity * 35/TICRATE;
} }
if (info->aircontrol != 0.f) if (info->aircontrol != 0.f)
{ {
level.aircontrol = info->aircontrol; aircontrol = info->aircontrol;
} }
if (info->teamdamage != 0.f) if (info->teamdamage != 0.f)
{ {
level.teamdamage = info->teamdamage; teamdamage = info->teamdamage;
} }
G_AirControlChanged (); G_AirControlChanged ();
cluster_info_t *clus = FindClusterInfo (info->cluster); cluster_info_t *clus = FindClusterInfo (info->cluster);
level.partime = info->partime; partime = info->partime;
level.sucktime = info->sucktime; sucktime = info->sucktime;
level.cluster = info->cluster; cluster = info->cluster;
level.clusterflags = clus ? clus->flags : 0; clusterflags = clus ? clus->flags : 0;
level.flags |= info->flags; flags |= info->flags;
level.flags2 |= info->flags2; flags2 |= info->flags2;
level.flags3 |= info->flags3; flags3 |= info->flags3;
level.levelnum = info->levelnum; levelnum = info->levelnum;
level.Music = info->Music; Music = info->Music;
level.musicorder = info->musicorder; musicorder = info->musicorder;
level.MusicVolume = 1.f; MusicVolume = 1.f;
level.HasHeightSecs = false; HasHeightSecs = false;
level.LevelName = level.info->LookupLevelName(); LevelName = info->LookupLevelName();
level.NextMap = info->NextMap; NextMap = info->NextMap;
level.NextSecretMap = info->NextSecretMap; NextSecretMap = info->NextSecretMap;
level.F1Pic = info->F1Pic; F1Pic = info->F1Pic;
level.hazardcolor = info->hazardcolor; hazardcolor = info->hazardcolor;
level.hazardflash = info->hazardflash; hazardflash = info->hazardflash;
// GL fog stuff modifiable by SetGlobalFogParameter. // GL fog stuff modifiable by SetGlobalFogParameter.
level.fogdensity = info->fogdensity; fogdensity = info->fogdensity;
level.outsidefogdensity = info->outsidefogdensity; outsidefogdensity = info->outsidefogdensity;
level.skyfog = info->skyfog; skyfog = info->skyfog;
level.deathsequence = info->deathsequence; deathsequence = info->deathsequence;
level.pixelstretch = info->pixelstretch; pixelstretch = info->pixelstretch;
compatflags.Callback(); compatflags.Callback();
compatflags2.Callback(); compatflags2.Callback();
level.DefaultEnvironment = info->DefaultEnvironment; DefaultEnvironment = info->DefaultEnvironment;
level.lightMode = info->lightmode == ELightMode::NotSet? (ELightMode)*gl_lightmode : info->lightmode; lightMode = info->lightmode == ELightMode::NotSet? (ELightMode)*gl_lightmode : info->lightmode;
level.brightfog = info->brightfog < 0? gl_brightfog : !!info->brightfog; brightfog = info->brightfog < 0? gl_brightfog : !!info->brightfog;
level.lightadditivesurfaces = info->lightadditivesurfaces < 0 ? gl_lightadditivesurfaces : !!info->lightadditivesurfaces; lightadditivesurfaces = info->lightadditivesurfaces < 0 ? gl_lightadditivesurfaces : !!info->lightadditivesurfaces;
level.notexturefill = info->notexturefill < 0 ? gl_notexturefill : !!info->notexturefill; notexturefill = info->notexturefill < 0 ? gl_notexturefill : !!info->notexturefill;
FLightDefaults::SetAttenuationForLevel(); FLightDefaults::SetAttenuationForLevel();
} }

View file

@ -477,8 +477,6 @@ int G_FinishTravel ();
void G_DoLoadLevel (int position, bool autosave, bool newGame); void G_DoLoadLevel (int position, bool autosave, bool newGame);
void G_InitLevelLocals (void);
void G_AirControlChanged (); void G_AirControlChanged ();
cluster_info_t *FindClusterInfo (int cluster); cluster_info_t *FindClusterInfo (int cluster);

View file

@ -171,6 +171,7 @@ struct FLevelLocals : public FLevelData
int GetConversation(FName classname); int GetConversation(FName classname);
void SetConversation(int convid, PClassActor *Class, int dlgindex); void SetConversation(int convid, PClassActor *Class, int dlgindex);
int FindNode (const FStrifeDialogueNode *node); int FindNode (const FStrifeDialogueNode *node);
void Init();
private: private:
line_t *FindPortalDestination(line_t *src, int tag); line_t *FindPortalDestination(line_t *src, int tag);