diff --git a/Backgrounds/AstralDesertSurfaceBGStyle.cs b/Backgrounds/AstralDesertSurfaceBGStyle.cs index 6fb209d35d..d5ef0d60c7 100644 --- a/Backgrounds/AstralDesertSurfaceBGStyle.cs +++ b/Backgrounds/AstralDesertSurfaceBGStyle.cs @@ -81,7 +81,7 @@ namespace CalamityMod.Backgrounds var bgParallax = 0.4; var bgTopY = (int)(backgroundTopMagicNumber * 1800.0 + 1500.0) + (int)scAdj + pushBGTopHack; bgScale *= bgGlobalScaleMultiplier; - var bgWidthScaled = (int)((float)SkyTextureRefs.AstralDesertSurfaceMiddle.Width * bgScale); + var bgWidthScaled = (int)((float)SkyTextureRefs.AstralDesertSurfaceMiddle.Value.Width * bgScale); SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1.2f / (float)bgParallax); var bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); if (Main.gameMenu) @@ -92,7 +92,7 @@ namespace CalamityMod.Backgrounds { for (int i = 0; i < bgLoops; i++) { - Main.spriteBatch.Draw(SkyTextureRefs.AstralDesertSurfaceMiddle, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralDesertSurfaceMiddle.Width, SkyTextureRefs.AstralDesertSurfaceMiddle.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralDesertSurfaceMiddle.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralDesertSurfaceMiddle.Value.Width, SkyTextureRefs.AstralDesertSurfaceMiddle.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); } } @@ -100,7 +100,7 @@ namespace CalamityMod.Backgrounds bgParallax = 0.43; bgTopY = (int)(backgroundTopMagicNumber * 1950.0 + 1750.0) + (int)scAdj + pushBGTopHack; bgScale *= bgGlobalScaleMultiplier; - bgWidthScaled = (int)((float)SkyTextureRefs.AstralDesertSurfaceClose.Width * bgScale); + bgWidthScaled = (int)((float)SkyTextureRefs.AstralDesertSurfaceClose.Value.Width * bgScale); SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float)bgParallax); bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); if (Main.gameMenu) @@ -114,7 +114,7 @@ namespace CalamityMod.Backgrounds { for (int i = 0; i < bgLoops; i++) { - Main.spriteBatch.Draw(SkyTextureRefs.AstralDesertSurfaceClose, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralDesertSurfaceClose.Width, SkyTextureRefs.AstralDesertSurfaceClose.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralDesertSurfaceClose.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralDesertSurfaceClose.Value.Width, SkyTextureRefs.AstralDesertSurfaceClose.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); } } } diff --git a/Backgrounds/AstralSnowSurfaceBGStyle.cs b/Backgrounds/AstralSnowSurfaceBGStyle.cs index aad9d204b6..7300b8c7e3 100644 --- a/Backgrounds/AstralSnowSurfaceBGStyle.cs +++ b/Backgrounds/AstralSnowSurfaceBGStyle.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Backgrounds var bgParallax = 0.4; var bgTopY = (int)(backgroundTopMagicNumber * 1800.0 + 1500.0) + (int)scAdj + pushBGTopHack; bgScale *= bgGlobalScaleMultiplier; - var bgWidthScaled = (int)((float)SkyTextureRefs.AstralSnowSurfaceMiddle.Width * bgScale); + var bgWidthScaled = (int)((float)SkyTextureRefs.AstralSnowSurfaceMiddle.Value.Width * bgScale); SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1.2f / (float)bgParallax); var bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); if (Main.gameMenu) @@ -94,7 +94,7 @@ namespace CalamityMod.Backgrounds { for (int i = 0; i < bgLoops; i++) { - Main.spriteBatch.Draw(SkyTextureRefs.AstralSnowSurfaceMiddle, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSnowSurfaceMiddle.Width, SkyTextureRefs.AstralSnowSurfaceMiddle.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSnowSurfaceMiddle.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSnowSurfaceMiddle.Value.Width, SkyTextureRefs.AstralSnowSurfaceMiddle.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); } } @@ -102,7 +102,7 @@ namespace CalamityMod.Backgrounds bgParallax = 0.43; bgTopY = (int)(backgroundTopMagicNumber * 1950.0 + 1750.0) + (int)scAdj + pushBGTopHack; bgScale *= bgGlobalScaleMultiplier; - bgWidthScaled = (int)((float)SkyTextureRefs.AstralSurfaceClose.Width * bgScale); + bgWidthScaled = (int)((float)SkyTextureRefs.AstralSurfaceClose.Value.Width * bgScale); SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float)bgParallax); bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); if (Main.gameMenu) @@ -116,15 +116,15 @@ namespace CalamityMod.Backgrounds { for (int i = 0; i < bgLoops; i++) { - Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceClose, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceClose.Width, SkyTextureRefs.AstralSurfaceClose.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); - Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceCloseGlow, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceCloseGlow.Width, SkyTextureRefs.AstralSurfaceCloseGlow.Height), new Color(Color.White.R * 0.7f, Color.White.G * 0.7f, Color.White.B * 0.7f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceClose.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceClose.Value.Width, SkyTextureRefs.AstralSurfaceClose.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceCloseGlow.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceCloseGlow.Value.Width, SkyTextureRefs.AstralSurfaceCloseGlow.Value.Height), new Color(Color.White.R * 0.7f, Color.White.G * 0.7f, Color.White.B * 0.7f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); } } bgScale = 1.34f; bgParallax = 0.49; bgTopY = (int)(backgroundTopMagicNumber * 2100.0 + 2000.0) + (int)scAdj + pushBGTopHack; bgScale *= bgGlobalScaleMultiplier; - bgWidthScaled = (int)(SkyTextureRefs.AstralSurfaceFront.Width * bgScale); + bgWidthScaled = (int)(SkyTextureRefs.AstralSurfaceFront.Value.Width * bgScale); SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float)bgParallax); bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); if (Main.gameMenu) @@ -138,8 +138,8 @@ namespace CalamityMod.Backgrounds { for (int i = 0; i < bgLoops; i++) { - Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceFront, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceFront.Width, SkyTextureRefs.AstralSurfaceFront.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); - Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceFrontGlow, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceFrontGlow.Width, SkyTextureRefs.AstralSurfaceFrontGlow.Height), new Color(Color.White.R * 0.9f, Color.White.G * 0.9f, Color.White.B * 0.9f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceFront.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceFront.Value.Width, SkyTextureRefs.AstralSurfaceFront.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceFrontGlow.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceFrontGlow.Value.Width, SkyTextureRefs.AstralSurfaceFrontGlow.Value.Height), new Color(Color.White.R * 0.9f, Color.White.G * 0.9f, Color.White.B * 0.9f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); } } } diff --git a/Backgrounds/AstralSurfaceBGStyle.cs b/Backgrounds/AstralSurfaceBGStyle.cs index 06810d6f3d..c32d475687 100644 --- a/Backgrounds/AstralSurfaceBGStyle.cs +++ b/Backgrounds/AstralSurfaceBGStyle.cs @@ -87,7 +87,7 @@ namespace CalamityMod.Backgrounds var bgParallax = 0.4; //The parallax of the background layer var bgTopY = (int)(backgroundTopMagicNumber * 1800.0 + 1500.0) + (int)scAdj + pushBGTopHack; //the Y position of the background bgScale *= bgGlobalScaleMultiplier; //Scale of the background - var bgWidthScaled = (int)((float)SkyTextureRefs.AstralSurfaceMiddle.Width * bgScale); //The Width of the bg texture scaled to the correct size + var bgWidthScaled = (int)((float)SkyTextureRefs.AstralSurfaceMiddle.Value.Width * bgScale); //The Width of the bg texture scaled to the correct size SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1.2f / (float)bgParallax); var bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); //The starting position of the background layer if (Main.gameMenu) @@ -99,8 +99,8 @@ namespace CalamityMod.Backgrounds for (int i = 0; i < bgLoops; i++) { //Draw the texture and its glowmask to each loop of the texture - Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceMiddle, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceMiddle.Width, SkyTextureRefs.AstralSurfaceMiddle.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); - Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceMiddleGlow, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceMiddleGlow.Width, SkyTextureRefs.AstralSurfaceMiddleGlow.Height), new Color(Color.White.R * 0.5f, Color.White.G * 0.5f, Color.White.B * 0.5f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceMiddle.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceMiddle.Value.Width, SkyTextureRefs.AstralSurfaceMiddle.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceMiddleGlow.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceMiddleGlow.Value.Width, SkyTextureRefs.AstralSurfaceMiddleGlow.Value.Height), new Color(Color.White.R * 0.5f, Color.White.G * 0.5f, Color.White.B * 0.5f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); } } @@ -110,7 +110,7 @@ namespace CalamityMod.Backgrounds bgParallax = 0.43; bgTopY = (int)(backgroundTopMagicNumber * 1950.0 + 1750.0) + (int)scAdj + pushBGTopHack; bgScale *= bgGlobalScaleMultiplier; - bgWidthScaled = (int)((float)SkyTextureRefs.AstralSurfaceClose.Width * bgScale); + bgWidthScaled = (int)((float)SkyTextureRefs.AstralSurfaceClose.Value.Width * bgScale); SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float)bgParallax); bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); if (Main.gameMenu) @@ -124,8 +124,8 @@ namespace CalamityMod.Backgrounds { for (int i = 0; i < bgLoops; i++) { - Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceClose, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceClose.Width, SkyTextureRefs.AstralSurfaceClose.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); - Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceCloseGlow, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceCloseGlow.Width, SkyTextureRefs.AstralSurfaceCloseGlow.Height), new Color(Color.White.R * 0.7f, Color.White.G * 0.7f, Color.White.B * 0.7f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceClose.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceClose.Value.Width, SkyTextureRefs.AstralSurfaceClose.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceCloseGlow.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceCloseGlow.Value.Width, SkyTextureRefs.AstralSurfaceCloseGlow.Value.Height), new Color(Color.White.R * 0.7f, Color.White.G * 0.7f, Color.White.B * 0.7f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); } } @@ -135,7 +135,7 @@ namespace CalamityMod.Backgrounds bgParallax = 0.49; bgTopY = (int)(backgroundTopMagicNumber * 2100.0 + 2000.0) + (int)scAdj + pushBGTopHack; bgScale *= bgGlobalScaleMultiplier; - bgWidthScaled = (int)(SkyTextureRefs.AstralSurfaceFront.Width * bgScale); + bgWidthScaled = (int)(SkyTextureRefs.AstralSurfaceFront.Value.Width * bgScale); SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float)bgParallax); bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); if (Main.gameMenu) @@ -149,8 +149,8 @@ namespace CalamityMod.Backgrounds { for (int i = 0; i < bgLoops; i++) { - Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceFront, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceFront.Width, SkyTextureRefs.AstralSurfaceFront.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); - Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceFrontGlow, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceFrontGlow.Width, SkyTextureRefs.AstralSurfaceFrontGlow.Height), new Color(Color.White.R * 0.9f, Color.White.G * 0.9f, Color.White.B * 0.9f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceFront.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceFront.Value.Width, SkyTextureRefs.AstralSurfaceFront.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceFrontGlow.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceFrontGlow.Value.Width, SkyTextureRefs.AstralSurfaceFrontGlow.Value.Height), new Color(Color.White.R * 0.9f, Color.White.G * 0.9f, Color.White.B * 0.9f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); } } } diff --git a/Skies/AstralMonolithSky.cs b/Skies/AstralMonolithSky.cs index 4b94ddb22d..07dad080e5 100644 --- a/Skies/AstralMonolithSky.cs +++ b/Skies/AstralMonolithSky.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Skies float whateverTheFuckThisVariableIsSupposedToBe = 3.40282347E+38f; if (maxDepth >= whateverTheFuckThisVariableIsSupposedToBe && minDepth < whateverTheFuckThisVariableIsSupposedToBe) { - spriteBatch.Draw(SkyTextureRefs.AstralSky, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.White * opacity); + spriteBatch.Draw(SkyTextureRefs.AstralSky.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.White * opacity); // Terraria's conditions. if (Main.netMode != NetmodeID.Server) diff --git a/Skies/AstralSky.cs b/Skies/AstralSky.cs index e2a14e830a..3c8d2caa0c 100644 --- a/Skies/AstralSky.cs +++ b/Skies/AstralSky.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Skies float whateverTheFuckThisVariableIsSupposedToBe = 3.40282347E+38f; if (maxDepth >= whateverTheFuckThisVariableIsSupposedToBe && minDepth < whateverTheFuckThisVariableIsSupposedToBe) { - spriteBatch.Draw(SkyTextureRefs.AstralSky, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.White * opacity); + spriteBatch.Draw(SkyTextureRefs.AstralSky.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.White * opacity); // Terraria's conditions. if (Main.netMode != NetmodeID.Server) diff --git a/Skies/SkyTextureRefs.cs b/Skies/SkyTextureRefs.cs index 78a59e674e..6e27c10ae5 100644 --- a/Skies/SkyTextureRefs.cs +++ b/Skies/SkyTextureRefs.cs @@ -13,48 +13,48 @@ namespace CalamityMod.Skies internal sealed class SkyTextureRefs : ModSystem { // Astral Sky/BG - public static Texture2D AstralSky; - public static Texture2D AstralSurfaceFront; - public static Texture2D AstralSurfaceFrontGlow; - public static Texture2D AstralSurfaceClose; - public static Texture2D AstralSurfaceCloseGlow; - public static Texture2D AstralSurfaceMiddle; - public static Texture2D AstralSurfaceMiddleGlow; + public static Asset AstralSky; + public static Asset AstralSurfaceFront; + public static Asset AstralSurfaceFrontGlow; + public static Asset AstralSurfaceClose; + public static Asset AstralSurfaceCloseGlow; + public static Asset AstralSurfaceMiddle; + public static Asset AstralSurfaceMiddleGlow; // Astral Desert Sky/BG - public static Texture2D AstralDesertSurfaceClose; - public static Texture2D AstralDesertSurfaceMiddle; + public static Asset AstralDesertSurfaceClose; + public static Asset AstralDesertSurfaceMiddle; // Astral Snow Sky/BG - public static Texture2D AstralSnowSurfaceMiddle; + public static Asset AstralSnowSurfaceMiddle; // Sulphur Sea Sky/BG - public static Texture2D SulphurSeaSky; - public static Texture2D SulphurSeaSkyFront; - public static Texture2D SulphurSeaSurface; + public static Asset SulphurSeaSky; + public static Asset SulphurSeaSkyFront; + public static Asset SulphurSeaSurface; public override void OnModLoad() { // Astral Sky/BG - AstralSky = ModContent.Request("CalamityMod/Skies/AstralSky", AssetRequestMode.ImmediateLoad).Value; - AstralSurfaceFront = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceFront", AssetRequestMode.ImmediateLoad).Value; - AstralSurfaceFrontGlow = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceFrontGlow", AssetRequestMode.ImmediateLoad).Value; - AstralSurfaceClose = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceClose", AssetRequestMode.ImmediateLoad).Value; - AstralSurfaceCloseGlow = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceCloseGlow", AssetRequestMode.ImmediateLoad).Value; - AstralSurfaceMiddle = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceMiddle", AssetRequestMode.ImmediateLoad).Value; - AstralSurfaceMiddleGlow = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceMiddleGlow", AssetRequestMode.ImmediateLoad).Value; + AstralSky = ModContent.Request("CalamityMod/Skies/AstralSky"); + AstralSurfaceFront = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceFront"); + AstralSurfaceFrontGlow = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceFrontGlow"); + AstralSurfaceClose = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceClose"); + AstralSurfaceCloseGlow = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceCloseGlow"); + AstralSurfaceMiddle = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceMiddle"); + AstralSurfaceMiddleGlow = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceMiddleGlow"); //Astral Desert Sky/BG - AstralDesertSurfaceClose = ModContent.Request("CalamityMod/Backgrounds/AstralDesertSurfaceClose", AssetRequestMode.ImmediateLoad).Value; - AstralDesertSurfaceMiddle = ModContent.Request("CalamityMod/Backgrounds/AstralDesertSurfaceMiddle", AssetRequestMode.ImmediateLoad).Value; + AstralDesertSurfaceClose = ModContent.Request("CalamityMod/Backgrounds/AstralDesertSurfaceClose"); + AstralDesertSurfaceMiddle = ModContent.Request("CalamityMod/Backgrounds/AstralDesertSurfaceMiddle"); //Astral Snow Sky/BG - AstralSnowSurfaceMiddle = ModContent.Request("CalamityMod/Backgrounds/AstralSnowSurfaceMiddle", AssetRequestMode.ImmediateLoad).Value; + AstralSnowSurfaceMiddle = ModContent.Request("CalamityMod/Backgrounds/AstralSnowSurfaceMiddle"); // Sulpher Sea Sky/BG - SulphurSeaSky = ModContent.Request("CalamityMod/Skies/SulphurSeaSky", AssetRequestMode.ImmediateLoad).Value; - SulphurSeaSkyFront = ModContent.Request("CalamityMod/Skies/SulphurSeaSkyFront", AssetRequestMode.ImmediateLoad).Value; - SulphurSeaSurface = ModContent.Request("CalamityMod/Skies/SulphurSeaSurface", AssetRequestMode.ImmediateLoad).Value; + SulphurSeaSky = ModContent.Request("CalamityMod/Skies/SulphurSeaSky"); + SulphurSeaSkyFront = ModContent.Request("CalamityMod/Skies/SulphurSeaSkyFront"); + SulphurSeaSurface = ModContent.Request("CalamityMod/Skies/SulphurSeaSurface"); } public override void Unload() diff --git a/Skies/SulphurSeaSky.cs b/Skies/SulphurSeaSky.cs index b639a28362..2c85b7fa4d 100644 --- a/Skies/SulphurSeaSky.cs +++ b/Skies/SulphurSeaSky.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Skies public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth) { if (maxDepth >= 4f && minDepth < 4f) - spriteBatch.Draw(SkyTextureRefs.SulphurSeaSky, new Rectangle(0, (int)(-Main.screenPosition.Y / 6f) + 1300, Main.screenWidth, Main.screenHeight), Color.Lerp(Main.ColorOfTheSkies, Color.LightSeaGreen, 0.33f) * 0.2f * opacity); + spriteBatch.Draw(SkyTextureRefs.SulphurSeaSky.Value, new Rectangle(0, (int)(-Main.screenPosition.Y / 6f) + 1300, Main.screenWidth, Main.screenHeight), Color.Lerp(Main.ColorOfTheSkies, Color.LightSeaGreen, 0.33f) * 0.2f * opacity); // Small worlds, default draw height int sulphurSeaHeight = (World.SulphurousSea.YStart + (int)Main.worldSurface) / 2; @@ -58,7 +58,7 @@ namespace CalamityMod.Skies // This changes the speed of the parralax, the closer the layer to the player the faster it should be. if (maxDepth >= 1f && minDepth < 1f) { - Texture2D texture = SkyTextureRefs.SulphurSeaSkyFront; + Texture2D texture = SkyTextureRefs.SulphurSeaSkyFront.Value; // Keep in mind that y paralex should always be half of x's or it will feel odd compared to how terraria does it. // Keep in mind when you change screen parralax it affects the y offset for the bg in the world. @@ -84,7 +84,7 @@ namespace CalamityMod.Skies if (maxDepth >= 3f && minDepth < 3f) { - Texture2D texture = SkyTextureRefs.SulphurSeaSurface; + Texture2D texture = SkyTextureRefs.SulphurSeaSurface.Value; int x = (int)(Main.screenPosition.X * ScreenParralaxMultiplier); x %= (int)(texture.Width * Scale);