- parse GLDEFS and its game-specific variants in lump order instead of both names sequentially.

This commit is contained in:
Christoph Oelckers 2017-01-02 00:28:30 +01:00
parent 9948189193
commit 6ab8e90911

View file

@ -48,6 +48,7 @@
#include "stats.h" #include "stats.h"
#include "zstring.h" #include "zstring.h"
#include "d_dehacked.h" #include "d_dehacked.h"
#include "v_text.h"
#include "gl/dynlights/gl_dynlight.h" #include "gl/dynlights/gl_dynlight.h"
@ -1336,12 +1337,13 @@ void gl_DoParseDefs(FScanner &sc, int workingLump)
// //
//========================================================================== //==========================================================================
void gl_LoadGLDefs(const char * defsLump) void gl_LoadGLDefs(const char *defsLump)
{ {
int workingLump, lastLump; int workingLump, lastLump;
static const char *gldefsnames[] = { "GLDEFS", defsLump, nullptr };
lastLump = 0; lastLump = 0;
while ((workingLump = Wads.FindLump(defsLump, &lastLump)) != -1) while ((workingLump = Wads.FindLumpMulti(gldefsnames, &lastLump)) != -1)
{ {
FScanner sc(workingLump); FScanner sc(workingLump);
gl_DoParseDefs(sc, workingLump); gl_DoParseDefs(sc, workingLump);
@ -1383,8 +1385,7 @@ void gl_ParseDefs()
break; break;
} }
gl_ParseVavoomSkybox(); gl_ParseVavoomSkybox();
if (defsLump != NULL) gl_LoadGLDefs(defsLump); gl_LoadGLDefs(defsLump);
gl_LoadGLDefs("GLDEFS");
gl_InitializeActorLights(); gl_InitializeActorLights();
} }