ScarletSeaGrass - Texture Caching
This commit is contained in:
1 parent
812a698a3d
commit
4de11f92a1
1 file changed
+8
-1
@@ -3,6 +3,7 @@ using CalamityMod.Systems;
|
||||
using CalamityMod.Tiles.SunkenSea.Ambient;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent.Metadata;
|
||||
@@ -15,10 +16,14 @@ namespace CalamityMod.Tiles.SunkenSea
|
||||
{
|
||||
public class ScarletSeaGrassTile : ModTile
|
||||
{
|
||||
public Asset<Texture2D> GrassTexture;
|
||||
|
||||
private int extraFrameHeight = 36;
|
||||
private int extraFrameWidth = 90;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
GrassTexture = ModContent.Request<Texture2D>("CalamityMod/Tiles/SunkenSea/ScarletSeaGrass");
|
||||
|
||||
TileID.Sets.GeneralPlacementTiles[Type] = false;
|
||||
|
||||
Main.tileSolid[Type] = true;
|
||||
@@ -86,12 +91,13 @@ namespace CalamityMod.Tiles.SunkenSea
|
||||
col.B = (byte)(paintCol.B / 255f * col.B);
|
||||
return col;
|
||||
}
|
||||
|
||||
public override void SpecialDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
|
||||
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
|
||||
Color drawColour = GetDrawColour(i, j);
|
||||
Texture2D leaves = ModContent.Request<Texture2D>("CalamityMod/Tiles/SunkenSea/ScarletSeaGrass").Value;
|
||||
Texture2D leaves = GrassTexture.Value;
|
||||
|
||||
DrawExtraTop(i, j, leaves, drawOffset, drawColour);
|
||||
DrawExtraWallEnds(i, j, leaves, drawOffset, drawColour);
|
||||
@@ -102,6 +108,7 @@ namespace CalamityMod.Tiles.SunkenSea
|
||||
{
|
||||
return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame);
|
||||
}
|
||||
|
||||
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
|
||||
{
|
||||
r = 0.3f;
|
||||
|
||||
Reference in new issue
Block a user