From c9296ead57746b37e53012a2c88c94da16f26d78 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 17 Mar 2017 21:12:09 +0100 Subject: [PATCH] - moved the skybox texture files to the main textures directory. --- src/CMakeLists.txt | 2 +- src/g_shared/a_dynlightdata.cpp | 19 ++++++++----------- src/gl/scene/gl_skydome.cpp | 2 +- src/gl/system/gl_framebuffer.cpp | 2 +- src/gl/textures/gl_texture.cpp | 2 +- .../skyboxtexture.cpp} | 14 ++++++++------ .../skyboxtexture.h} | 8 +++++++- 7 files changed, 27 insertions(+), 22 deletions(-) rename src/{gl/textures/gl_skyboxtexture.cpp => textures/skyboxtexture.cpp} (94%) rename src/{gl/textures/gl_skyboxtexture.h => textures/skyboxtexture.h} (89%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6eb200943..7861e67e3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1152,7 +1152,6 @@ set (PCH_SOURCES gl/textures/gl_samplers.cpp gl/textures/gl_translate.cpp gl/textures/gl_hqresize.cpp - gl/textures/gl_skyboxtexture.cpp menu/joystickmenu.cpp menu/loadsavemenu.cpp menu/menu.cpp @@ -1192,6 +1191,7 @@ set (PCH_SOURCES textures/texturemanager.cpp textures/tgatexture.cpp textures/warptexture.cpp + textures/skyboxtexture.cpp xlat/parse_xlat.cpp fragglescript/t_func.cpp fragglescript/t_load.cpp diff --git a/src/g_shared/a_dynlightdata.cpp b/src/g_shared/a_dynlightdata.cpp index bf4a8cad1..160ddea5f 100644 --- a/src/g_shared/a_dynlightdata.cpp +++ b/src/g_shared/a_dynlightdata.cpp @@ -51,16 +51,14 @@ #include "v_text.h" #include "g_levellocals.h" #include "a_dynlight.h" - +#include "textures/skyboxtexture.h" int ScriptDepth; void gl_InitGlow(FScanner &sc); void gl_ParseBrightmap(FScanner &sc, int); void gl_DestroyUserShaders(); void gl_ParseHardwareShader(FScanner &sc, int deflump); -void gl_ParseSkybox(FScanner &sc); void gl_ParseDetailTexture(FScanner &sc); -void gl_ParseVavoomSkybox(); //========================================================================== // @@ -1207,10 +1205,9 @@ void AActor::RecreateAllAttachedLights() //========================================================================== -// The actual light def parsing code is there. -// DoParseDefs is no longer called directly by ParseDefs, now it's called -// by LoadDynLightDefs, which wasn't simply integrated into ParseDefs -// because of the way the code needs to load two out of five lumps. +// +// +// //========================================================================== static void DoParseDefs(FScanner &sc, int workingLump) { @@ -1267,7 +1264,7 @@ static void DoParseDefs(FScanner &sc, int workingLump) case TAG_CLEARSHADERS: break; case TAG_SKYBOX: - gl_ParseSkybox(sc); + ParseGldefSkybox(sc); break; case TAG_GLOW: gl_InitGlow(sc); @@ -1327,8 +1324,8 @@ void ParseGLDefs() { const char *defsLump = NULL; - LightAssociations.Clear(); - LightDefaults.Clear(); + LightAssociations.Clear(); + LightDefaults.Clear(); gl_DestroyUserShaders(); switch (gameinfo.gametype) { @@ -1350,7 +1347,7 @@ void ParseGLDefs() default: // silence GCC break; } - gl_ParseVavoomSkybox(); + ParseVavoomSkybox(); LoadGLDefs(defsLump); InitializeActorLights(); } diff --git a/src/gl/scene/gl_skydome.cpp b/src/gl/scene/gl_skydome.cpp index 3f7e3dd7c..b57e3f4f4 100644 --- a/src/gl/scene/gl_skydome.cpp +++ b/src/gl/scene/gl_skydome.cpp @@ -61,6 +61,7 @@ #include "r_state.h" #include "r_utility.h" #include "g_levellocals.h" +#include "textures/skyboxtexture.h" #include "gl/system/gl_interface.h" #include "gl/data/gl_data.h" @@ -73,7 +74,6 @@ #include "gl/shaders/gl_shader.h" #include "gl/textures/gl_bitmap.h" #include "gl/textures/gl_texture.h" -#include "gl/textures/gl_skyboxtexture.h" #include "gl/textures/gl_material.h" diff --git a/src/gl/system/gl_framebuffer.cpp b/src/gl/system/gl_framebuffer.cpp index aeffe5a7e..43c56018a 100644 --- a/src/gl/system/gl_framebuffer.cpp +++ b/src/gl/system/gl_framebuffer.cpp @@ -35,6 +35,7 @@ #include "vectors.h" #include "v_palette.h" #include "templates.h" +#include "textures/skyboxtexture.h" #include "gl/system/gl_interface.h" #include "gl/system/gl_framebuffer.h" @@ -45,7 +46,6 @@ #include "gl/textures/gl_hwtexture.h" #include "gl/textures/gl_texture.h" #include "gl/textures/gl_translate.h" -#include "gl/textures/gl_skyboxtexture.h" #include "gl/utility/gl_clock.h" #include "gl/utility/gl_templates.h" #include "gl/gl_functions.h" diff --git a/src/gl/textures/gl_texture.cpp b/src/gl/textures/gl_texture.cpp index 539a7c8ff..fbed6b383 100644 --- a/src/gl/textures/gl_texture.cpp +++ b/src/gl/textures/gl_texture.cpp @@ -38,13 +38,13 @@ #endif #include "v_palette.h" #include "sc_man.h" +#include "textures/skyboxtexture.h" #include "gl/system/gl_interface.h" #include "gl/renderer/gl_renderer.h" #include "gl/textures/gl_texture.h" #include "gl/textures/gl_material.h" #include "gl/textures/gl_samplers.h" -#include "gl/textures/gl_skyboxtexture.h" #include "gl/textures/gl_translate.h" #include "gl/models/gl_models.h" diff --git a/src/gl/textures/gl_skyboxtexture.cpp b/src/textures/skyboxtexture.cpp similarity index 94% rename from src/gl/textures/gl_skyboxtexture.cpp rename to src/textures/skyboxtexture.cpp index acf74da4b..9c3b21b67 100644 --- a/src/gl/textures/gl_skyboxtexture.cpp +++ b/src/textures/skyboxtexture.cpp @@ -23,8 +23,8 @@ #include "doomtype.h" #include "sc_man.h" #include "w_wad.h" -#include "textures/textures.h" -#include "gl/textures/gl_skyboxtexture.h" +#include "textures.h" +#include "skyboxtexture.h" @@ -117,7 +117,7 @@ void FSkyBox::Unload () // //----------------------------------------------------------------------------- -void gl_ParseSkybox(FScanner &sc) +void ParseGldefSkybox(FScanner &sc) { int facecount=0; @@ -154,7 +154,7 @@ void gl_ParseSkybox(FScanner &sc) // //----------------------------------------------------------------------------- -void gl_ParseVavoomSkybox() +void ParseVavoomSkybox() { int lump = Wads.CheckNumForName("SKYBOXES"); @@ -165,6 +165,7 @@ void gl_ParseVavoomSkybox() { int facecount=0; int maplump = -1; + bool error = false; FSkyBox * sb = new FSkyBox; sb->Name = sc.String; sb->Name.ToUpper(); @@ -183,7 +184,8 @@ void gl_ParseVavoomSkybox() FTexture *tex = TexMan.FindTexture(sc.String, FTexture::TEX_Wall, FTextureManager::TEXMAN_TryAny); if (tex == NULL) { - Printf("Texture '%s' not found in Vavoom skybox '%s'\n", sc.String, sb->Name.GetChars()); + sc.ScriptMessage("Texture '%s' not found in Vavoom skybox '%s'\n", sc.String, sb->Name.GetChars()); + error = true; } sb->faces[facecount] = tex; sc.MustGetStringName("}"); @@ -195,7 +197,7 @@ void gl_ParseVavoomSkybox() sc.ScriptError("%s: Skybox definition requires 6 faces", sb->Name.GetChars()); } sb->SetSize(); - TexMan.AddTexture(sb); + if (!error) TexMan.AddTexture(sb); } } diff --git a/src/gl/textures/gl_skyboxtexture.h b/src/textures/skyboxtexture.h similarity index 89% rename from src/gl/textures/gl_skyboxtexture.h rename to src/textures/skyboxtexture.h index deca1496d..3a4edd042 100644 --- a/src/gl/textures/gl_skyboxtexture.h +++ b/src/textures/skyboxtexture.h @@ -1,5 +1,6 @@ +#pragma once - +#include "textures.h" //----------------------------------------------------------------------------- // // This is not a real texture but will be added to the texture manager @@ -42,3 +43,8 @@ public: return fliptop; } }; + + +void ParseGldefSkybox(FScanner &sc); +void ParseVavoomSkybox(); +