Remove LightingUtils
This commit is contained in:
1 parent
a0e7afb97c
commit
511f2179bb
11 files changed
+24
-19
No files matched your search
@@ -11,7 +11,7 @@ namespace CalamityMod.Waters
|
||||
{
|
||||
public class BasaltGullyWaterflow : ModWaterfallStyle, IWaterfallStyleModifyColor
|
||||
{
|
||||
public void ModifyColor(in Tile tile, int x, int y, ref VertexColors liquidColor) => CalamityUtils.ModifySulphuricWaterColor(x, y, ref liquidColor, false);
|
||||
public void ModifyColor(in Tile tile, int x, int y, ref VertexColors liquidColor) => WaterStyleCommon.ModifyTransparentWaterColor(x, y, ref liquidColor, false);
|
||||
}
|
||||
|
||||
public class BasaltGullyWater : ModWaterStyle, IWaterStyleModifyColor, IWaterStyleModifyLight
|
||||
@@ -30,7 +30,7 @@ namespace CalamityMod.Waters
|
||||
|
||||
if (tile.TileType != RustyChestTile.TileType)
|
||||
{
|
||||
CalamityUtils.SunkenSeaWaterLighting(i, j, WaterGlowColor, ref outputColor.X, ref outputColor.Y, ref outputColor.Z);
|
||||
WaterStyleCommon.ModifySunkenSeaWaterLight(i, j, WaterGlowColor, ref outputColor.X, ref outputColor.Y, ref outputColor.Z);
|
||||
}
|
||||
|
||||
r = outputColor.X;
|
||||
@@ -38,7 +38,7 @@ namespace CalamityMod.Waters
|
||||
b = outputColor.Z;
|
||||
}
|
||||
|
||||
public void ModifyColor(in Tile tile, int x, int y, ref VertexColors liquidColor, bool isSlope) => CalamityUtils.ModifySulphuricWaterColor(x, y, ref liquidColor, isSlope);
|
||||
public void ModifyColor(in Tile tile, int x, int y, ref VertexColors liquidColor, bool isSlope) => WaterStyleCommon.ModifyTransparentWaterColor(x, y, ref liquidColor, isSlope);
|
||||
|
||||
public override int ChooseWaterfallStyle() => ModContent.Find<ModWaterfallStyle>("CalamityMod/BasaltGullyWaterflow").Slot;
|
||||
public override int GetSplashDust() => ModContent.DustType<BasaltGullySplash>();
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace CalamityMod.Waters
|
||||
{
|
||||
public class MiddleAbyssWaterflow : ModWaterfallStyle, IWaterfallStyleModifyColor
|
||||
{
|
||||
public void ModifyColor(in Tile tile, int x, int y, ref VertexColors liquidColor) => CalamityUtils.ModifySulphuricWaterColor(x, y, ref liquidColor, false);
|
||||
public void ModifyColor(in Tile tile, int x, int y, ref VertexColors liquidColor) => WaterStyleCommon.ModifyTransparentWaterColor(x, y, ref liquidColor, false);
|
||||
}
|
||||
|
||||
public class MiddleAbyssWater : ModWaterStyle, IWaterStyleModifyColor
|
||||
@@ -41,6 +41,6 @@ namespace CalamityMod.Waters
|
||||
public override int GetDropletGore() => DropletGore;
|
||||
public override Color BiomeHairColor() => new Color(36, 23, 19);
|
||||
|
||||
public void ModifyColor(in Tile tile, int x, int y, ref VertexColors liquidColor, bool isSlope) => CalamityUtils.ModifySulphuricWaterColor(x, y, ref liquidColor, isSlope);
|
||||
public void ModifyColor(in Tile tile, int x, int y, ref VertexColors liquidColor, bool isSlope) => WaterStyleCommon.ModifyTransparentWaterColor(x, y, ref liquidColor, isSlope);
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ namespace CalamityMod.Waters
|
||||
{
|
||||
public class SulphuricDepthsWaterflow : ModWaterfallStyle, IWaterfallStyleModifyColor
|
||||
{
|
||||
public void ModifyColor(in Tile tile, int x, int y, ref VertexColors liquidColor) => CalamityUtils.ModifySulphuricWaterColor(x, y, ref liquidColor, false);
|
||||
public void ModifyColor(in Tile tile, int x, int y, ref VertexColors liquidColor) => WaterStyleCommon.ModifyTransparentWaterColor(x, y, ref liquidColor, false);
|
||||
}
|
||||
|
||||
public class SulphuricDepthsWater : ModWaterStyle, IWaterStyleModifyColor, IWaterStyleModifyLight
|
||||
@@ -44,7 +44,7 @@ namespace CalamityMod.Waters
|
||||
public override int GetSplashDust() => SplashDust;
|
||||
public override int GetDropletGore() => DropletGore;
|
||||
public override Color BiomeHairColor() => new Color(35, 117, 89);
|
||||
public void ModifyColor(in Tile tile, int x, int y, ref VertexColors liquidColor, bool isSlope) => CalamityUtils.ModifySulphuricWaterColor(x, y, ref liquidColor, isSlope);
|
||||
public void ModifyColor(in Tile tile, int x, int y, ref VertexColors liquidColor, bool isSlope) => WaterStyleCommon.ModifyTransparentWaterColor(x, y, ref liquidColor, isSlope);
|
||||
public void ModifyLight(in Tile tile, int i, int j, ref float r, ref float g, ref float b)
|
||||
{
|
||||
Vector3 outputColor = new Vector3(r, g, b);
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace CalamityMod.Waters
|
||||
{
|
||||
public class SulphuricWaterflow : ModWaterfallStyle, IWaterfallStyleModifyColor
|
||||
{
|
||||
public void ModifyColor(in Tile tile, int x, int y, ref VertexColors liquidColor) => CalamityUtils.ModifySulphuricWaterColor(x, y, ref liquidColor, false);
|
||||
public void ModifyColor(in Tile tile, int x, int y, ref VertexColors liquidColor) => WaterStyleCommon.ModifySulphuricWaterColor(x, y, ref liquidColor, false);
|
||||
}
|
||||
|
||||
public class SulphuricWater : ModWaterStyle, IWaterStyleModifyColor, IWaterStyleModifyLight, IWaterStylePostDrawEffect
|
||||
@@ -50,7 +50,7 @@ namespace CalamityMod.Waters
|
||||
|
||||
public override byte GetRainVariant() => (byte)Main.rand.Next(3);
|
||||
public override Color BiomeHairColor() => new Color(43, 168, 110);
|
||||
public void ModifyColor(in Tile tile, int x, int y, ref VertexColors liquidColor, bool isSlope) => CalamityUtils.ModifySulphuricWaterColor(x, y, ref liquidColor, isSlope);
|
||||
public void ModifyColor(in Tile tile, int x, int y, ref VertexColors liquidColor, bool isSlope) => WaterStyleCommon.ModifySulphuricWaterColor(x, y, ref liquidColor, isSlope);
|
||||
public void ModifyLight(in Tile tile, int i, int j, ref float r, ref float g, ref float b)
|
||||
{
|
||||
Vector3 outputColor = new Vector3(r, g, b);
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace CalamityMod.Waters
|
||||
|
||||
if (tile.TileType != RustyChestTile.TileType)
|
||||
{
|
||||
CalamityUtils.SunkenSeaWaterLighting(i, j, WaterGlowColor, ref outputColor.X, ref outputColor.Y, ref outputColor.Z);
|
||||
WaterStyleCommon.ModifySunkenSeaWaterLight(i, j, WaterGlowColor, ref outputColor.X, ref outputColor.Y, ref outputColor.Z);
|
||||
}
|
||||
|
||||
r = outputColor.X;
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace CalamityMod.Waters
|
||||
|
||||
if (tile.TileType != RustyChestTile.TileType)
|
||||
{
|
||||
CalamityUtils.SunkenSeaWaterLighting(i, j, WaterGlowColor, ref outputColor.X, ref outputColor.Y, ref outputColor.Z);
|
||||
WaterStyleCommon.ModifySunkenSeaWaterLight(i, j, WaterGlowColor, ref outputColor.X, ref outputColor.Y, ref outputColor.Z);
|
||||
}
|
||||
|
||||
r = outputColor.X;
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace CalamityMod.Waters
|
||||
|
||||
if (tile.TileType != RustyChestTile.TileType)
|
||||
{
|
||||
CalamityUtils.SunkenSeaWaterLighting(i, j, WaterGlowColor, ref outputColor.X, ref outputColor.Y, ref outputColor.Z);
|
||||
WaterStyleCommon.ModifySunkenSeaWaterLight(i, j, WaterGlowColor, ref outputColor.X, ref outputColor.Y, ref outputColor.Z);
|
||||
}
|
||||
|
||||
r = outputColor.X;
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace CalamityMod.Waters
|
||||
|
||||
if (tile.TileType != RustyChestTile.TileType)
|
||||
{
|
||||
CalamityUtils.SunkenSeaWaterLighting(i, j, WaterGlowColor, ref outputColor.X, ref outputColor.Y, ref outputColor.Z);
|
||||
WaterStyleCommon.ModifySunkenSeaWaterLight(i, j, WaterGlowColor, ref outputColor.X, ref outputColor.Y, ref outputColor.Z);
|
||||
}
|
||||
|
||||
r = outputColor.X;
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace CalamityMod.Waters
|
||||
{
|
||||
public class UpperAbyssWaterflow : ModWaterfallStyle, IWaterfallStyleModifyColor
|
||||
{
|
||||
public void ModifyColor(in Tile tile, int x, int y, ref VertexColors liquidColor) => CalamityUtils.ModifySulphuricWaterColor(x, y, ref liquidColor, false);
|
||||
public void ModifyColor(in Tile tile, int x, int y, ref VertexColors liquidColor) => WaterStyleCommon.ModifyTransparentWaterColor(x, y, ref liquidColor, false);
|
||||
}
|
||||
|
||||
public class UpperAbyssWater : ModWaterStyle, IWaterStyleModifyColor
|
||||
@@ -40,6 +40,6 @@ namespace CalamityMod.Waters
|
||||
public override int GetSplashDust() => SplashDust;
|
||||
public override int GetDropletGore() => DropletGore;
|
||||
public override Color BiomeHairColor() => new Color(9, 69, 82);
|
||||
public void ModifyColor(in Tile tile, int x, int y, ref VertexColors liquidColor, bool isSlope) => CalamityUtils.ModifySulphuricWaterColor(x, y, ref liquidColor, isSlope);
|
||||
public void ModifyColor(in Tile tile, int x, int y, ref VertexColors liquidColor, bool isSlope) => WaterStyleCommon.ModifyTransparentWaterColor(x, y, ref liquidColor, isSlope);
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -10,7 +10,7 @@ namespace CalamityMod.Waters
|
||||
{
|
||||
public class VoidWaterflow : ModWaterfallStyle, IWaterfallStyleModifyColor
|
||||
{
|
||||
public void ModifyColor(in Tile tile, int x, int y, ref VertexColors liquidColor) => CalamityUtils.ModifySulphuricWaterColor(x, y, ref liquidColor, false);
|
||||
public void ModifyColor(in Tile tile, int x, int y, ref VertexColors liquidColor) => WaterStyleCommon.ModifyTransparentWaterColor(x, y, ref liquidColor, false);
|
||||
}
|
||||
|
||||
public class VoidWater : ModWaterStyle, IWaterStyleModifyColor
|
||||
@@ -40,6 +40,6 @@ namespace CalamityMod.Waters
|
||||
public override int GetSplashDust() => SplashDust;
|
||||
public override int GetDropletGore() => DropletGore;
|
||||
public override Color BiomeHairColor() => new Color(16, 8, 30);
|
||||
public void ModifyColor(in Tile tile, int x, int y, ref VertexColors liquidColor, bool isSlope) => CalamityUtils.ModifySulphuricWaterColor(x, y, ref liquidColor, isSlope);
|
||||
public void ModifyColor(in Tile tile, int x, int y, ref VertexColors liquidColor, bool isSlope) => WaterStyleCommon.ModifyTransparentWaterColor(x, y, ref liquidColor, isSlope);
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ using Terraria.Graphics;
|
||||
|
||||
namespace CalamityMod
|
||||
{
|
||||
public static partial class CalamityUtils
|
||||
internal static class WaterStyleCommon
|
||||
{
|
||||
public static void ModifySulphuricWaterColor(int x, int y, ref VertexColors initialColor, bool isSlope)
|
||||
{
|
||||
@@ -32,6 +32,11 @@ namespace CalamityMod
|
||||
ModifyColor(new(x + 0.5f, y + 0.5f), ref initialColor.BottomRightColor);
|
||||
}
|
||||
|
||||
ModifyTransparentWaterColor(x, y, ref initialColor, isSlope);
|
||||
}
|
||||
|
||||
public static void ModifyTransparentWaterColor(int x, int y, ref VertexColors initialColor, bool isSlope)
|
||||
{
|
||||
if (isSlope)
|
||||
{
|
||||
initialColor.TopLeftColor *= 1f / 3;
|
||||
@@ -48,7 +53,7 @@ namespace CalamityMod
|
||||
}
|
||||
}
|
||||
|
||||
public static void SunkenSeaWaterLighting(int x, int y, Vector3 waterColor, ref float r, ref float g, ref float b)
|
||||
public static void ModifySunkenSeaWaterLight(int x, int y, Vector3 waterColor, ref float r, ref float g, ref float b)
|
||||
{
|
||||
float tick = (float)Main.timeForVisualEffects;
|
||||
float brightness = MathHelper.Clamp(0.07f, 0f, 0.07f);
|
||||
Reference in new issue
Block a user