- 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

@ -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)