From c285813540da06896685263b4cdb4af691b3c380 Mon Sep 17 00:00:00 2001 From: Marc Date: Wed, 8 Sep 2021 15:18:04 +0100 Subject: [PATCH] replace new with singletone to fix cannot re-declare object lof file spam --- .../scripts/advancedLighting_Shaders.tscript | 12 ++++++------ .../scripts/gfxData/warningTerrainMat.tscript | 2 +- .../templateFiles/terrainMaterial.tscript.template | 2 +- .../worldEditor/scripts/visibility/shadowViz.tscript | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.tscript b/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.tscript index f7bdf56f9..55100d729 100644 --- a/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.tscript +++ b/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.tscript @@ -75,7 +75,7 @@ singleton shaderData( AL_VectorLightShader ) pixVersion = 3.0; }; -new CustomMaterial( AL_VectorLightMaterial ) +singleton CustomMaterial( AL_VectorLightMaterial ) { shader = AL_VectorLightShader; stateBlock = AL_VectorLightState; @@ -149,7 +149,7 @@ singleton shaderData( AL_PointLightShader ) pixVersion = 3.0; }; -new CustomMaterial( AL_PointLightMaterial ) +singleton CustomMaterial( AL_PointLightMaterial ) { shader = AL_PointLightShader; stateBlock = AL_ConvexLightState; @@ -186,7 +186,7 @@ singleton shaderData( AL_SpotLightShader ) pixVersion = 3.0; }; -new CustomMaterial( AL_SpotLightMaterial ) +singleton CustomMaterial( AL_SpotLightMaterial ) { shader = AL_SpotLightShader; stateBlock = AL_ConvexLightState; @@ -205,7 +205,7 @@ new CustomMaterial( AL_SpotLightMaterial ) /// This material is used for generating deferred /// materials for objects that do not have materials. -new Material( AL_DefaultDeferredMaterial ) +singleton Material( AL_DefaultDeferredMaterial ) { // We need something in the first pass else it // won't create a proper material instance. @@ -219,7 +219,7 @@ new Material( AL_DefaultDeferredMaterial ) /// This material is used for generating shadow /// materials for objects that do not have materials. -new Material( AL_DefaultShadowMaterial ) +singleton Material( AL_DefaultShadowMaterial ) { // We need something in the first pass else it // won't create a proper material instance. @@ -255,7 +255,7 @@ singleton shaderData( AL_ParticlePointLightShader ) pixVersion = 3.0; }; -new CustomMaterial( AL_ParticlePointLightMaterial ) +singleton CustomMaterial( AL_ParticlePointLightMaterial ) { shader = AL_ParticlePointLightShader; stateBlock = AL_ConvexLightState; diff --git a/Templates/BaseGame/game/core/rendering/scripts/gfxData/warningTerrainMat.tscript b/Templates/BaseGame/game/core/rendering/scripts/gfxData/warningTerrainMat.tscript index 55b8562ac..f528e285a 100644 --- a/Templates/BaseGame/game/core/rendering/scripts/gfxData/warningTerrainMat.tscript +++ b/Templates/BaseGame/game/core/rendering/scripts/gfxData/warningTerrainMat.tscript @@ -1,4 +1,4 @@ -new TerrainMaterial() +singleton TerrainMaterial() { diffuseSize = "200"; detailSize = "10"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/terrainMaterial.tscript.template b/Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/terrainMaterial.tscript.template index ef614edaf..ee54d964a 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/terrainMaterial.tscript.template +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/terrainMaterial.tscript.template @@ -11,7 +11,7 @@ singleton Material(TerrainFX_@) impactSoundId = "0"; }; -new TerrainMaterial(@) +singleton TerrainMaterial(@) { internalName = "@"; diffuseMap = ""; diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/shadowViz.tscript b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/shadowViz.tscript index bb07ba596..92cd4a6e5 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/shadowViz.tscript +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/shadowViz.tscript @@ -34,7 +34,7 @@ singleton shaderData( AL_ShadowVisualizeShader ) pixVersion = 2.0; }; -new CustomMaterial( AL_ShadowVisualizeMaterial ) +singleton CustomMaterial( AL_ShadowVisualizeMaterial ) { shader = AL_ShadowVisualizeShader; stateBlock = AL_DepthVisualizeState;