- moved all GLDEFS parsing into a dedicated source file.

- split gl_postprocessshader.h in two so that the hardware independent part can be used by GLDEFS without pulling in all of OpenGL.
This commit is contained in:
Christoph Oelckers 2018-04-02 12:28:20 +02:00
commit 1fc4c9801b
18 changed files with 1923 additions and 1839 deletions

View file

@ -108,96 +108,5 @@ bool FSkyBox::UseBasePalette()
void FSkyBox::Unload ()
{
//for(int i=0;i<6;i++) if (faces[i]) faces[i]->Unload();
}
//-----------------------------------------------------------------------------
//
//
//
//-----------------------------------------------------------------------------
void ParseGldefSkybox(FScanner &sc)
{
int facecount=0;
sc.MustGetString();
FSkyBox * sb = new FSkyBox;
sb->Name = sc.String;
sb->Name.ToUpper();
if (sc.CheckString("fliptop"))
{
sb->fliptop = true;
}
sc.MustGetStringName("{");
while (!sc.CheckString("}"))
{
sc.MustGetString();
if (facecount<6)
{
sb->faces[facecount] = TexMan[TexMan.GetTexture(sc.String, ETextureType::Wall, FTextureManager::TEXMAN_TryAny|FTextureManager::TEXMAN_Overridable)];
}
facecount++;
}
if (facecount != 3 && facecount != 6)
{
sc.ScriptError("%s: Skybox definition requires either 3 or 6 faces", sb->Name.GetChars());
}
sb->SetSize();
TexMan.AddTexture(sb);
}
//-----------------------------------------------------------------------------
//
// gl_ParseVavoomSkybox
//
//-----------------------------------------------------------------------------
void ParseVavoomSkybox()
{
int lump = Wads.CheckNumForName("SKYBOXES");
if (lump < 0) return;
FScanner sc(lump);
while (sc.GetString())
{
int facecount=0;
int maplump = -1;
bool error = false;
FSkyBox * sb = new FSkyBox;
sb->Name = sc.String;
sb->Name.ToUpper();
sb->fliptop = true;
sc.MustGetStringName("{");
while (!sc.CheckString("}"))
{
if (facecount<6)
{
sc.MustGetStringName("{");
sc.MustGetStringName("map");
sc.MustGetString();
maplump = Wads.CheckNumForFullName(sc.String, true);
FTexture *tex = TexMan.FindTexture(sc.String, ETextureType::Wall, FTextureManager::TEXMAN_TryAny);
if (tex == NULL)
{
sc.ScriptMessage("Texture '%s' not found in Vavoom skybox '%s'\n", sc.String, sb->Name.GetChars());
error = true;
}
sb->faces[facecount] = tex;
sc.MustGetStringName("}");
}
facecount++;
}
if (facecount != 6)
{
sc.ScriptError("%s: Skybox definition requires 6 faces", sb->Name.GetChars());
}
sb->SetSize();
if (!error) TexMan.AddTexture(sb);
}
}