- changed FraggleScript setup so that the MapLoader does not use the global level variable anymore.

This involves passing the level explicitly to many functions. What was done here may seem a bit excessive but at least it covers everything.
Most importantly, the global ActiveThinker pointer has been moved into FLevelLocals and is now getting tracked properly by the level without using dangerous assumptions about how the game organizes its data.
This commit is contained in:
Christoph Oelckers 2019-01-05 09:40:03 +01:00
commit 7b16433e97
16 changed files with 108 additions and 86 deletions

View file

@ -117,7 +117,7 @@ void FS_MapCmd(FScanner &sc)
//
//==========================================================================
void FS_EmulateCmd(char * string)
void FS_EmulateCmd(FLevelLocals *Level, char * string)
{
FScanner sc;
sc.OpenMem("RUNCMD", string, (int)strlen(string));
@ -144,7 +144,7 @@ void FS_EmulateCmd(char * string)
else if (sc.Compare("gravity"))
{
sc.MustGetFloat();
level.gravity=(float)(sc.Float*800);
Level->gravity=(float)(sc.Float*800);
while (sc.GetString())
{
if (sc.Compare(";")) break;
@ -174,15 +174,15 @@ void FS_EmulateCmd(char * string)
{
sc.MustGetNumber();
// Using this disables most MAPINFO fog options!
level.fogdensity = sc.Number * 70 / 400;
level.outsidefogdensity = 0;
level.skyfog = 0;
level.info->outsidefog = 0;
Level->fogdensity = sc.Number * 70 / 400;
Level->outsidefogdensity = 0;
Level->skyfog = 0;
Level->info->outsidefog = 0;
}
else if (sc.Compare("gr_fogcolor"))
{
sc.MustGetString();
level.fadeto = (uint32_t)strtoull(sc.String, NULL, 16);
Level->fadeto = (uint32_t)strtoull(sc.String, NULL, 16);
}
else