6904 {
6907 int num = 0;
6911 for (
int i = 0;
i <
num2;
i++)
6912 {
6916 Tile tile = Main.tile[x, y];
6917 if (tile == null || !tile.active())
6918 {
6919 continue;
6920 }
6921 ushort
type = tile.type;
6922 short frameX = tile.frameX;
6923 short frameY = tile.frameY;
6924 bool flag = tile.wall > 0;
6926 try
6927 {
6930 {
6931 case 5:
6934 break;
6935 case 583:
6936 case 584:
6937 case 585:
6938 case 586:
6939 case 587:
6940 case 588:
6941 case 589:
6944 break;
6945 case 596:
6946 case 616:
6949 break;
6950 case 634:
6953 break;
6954 }
6955 if (
flag2 && frameY >= 198 && frameX >= 22)
6956 {
6958 switch (frameX)
6959 {
6960 case 22:
6961 {
6969 {
6970 continue;
6971 }
6974 {
6976 num14 += (float)(270 - Main.mouseTextColor) / 1000f;
6977 if (tile.color() == 0)
6978 {
6979 Lighting.AddLight(x, y, 0.1f, 0.2f +
num14 / 2f, 0.7f +
num14);
6980 }
6981 else
6982 {
6984 float r3 = (float)(
int)color5.R / 255f;
6985 float g3 = (float)(
int)color5.G / 255f;
6986 float b3 = (float)(
int)color5.B / 255f;
6987 Lighting.AddLight(x, y,
r3,
g3,
b3);
6988 }
6989 }
6994 if (!flag)
6995 {
6997 }
6998 vector.X +=
num15 * 2f;
7001 if (tile.fullbrightBlock())
7002 {
7004 }
7005 Main.spriteBatch.Draw(
treeTopTexture,
vector,
new Rectangle(
treeFrame * (
topTextureFrameWidth3 + 2), 0,
topTextureFrameWidth3,
topTextureFrameHeight3),
color6,
num15 *
num3,
new Vector2(
topTextureFrameWidth3 / 2,
topTextureFrameHeight3), 1f,
SpriteEffects.None, 0f);
7007 {
7010 Main.spriteBatch.Draw(
value3,
vector,
new Rectangle(
treeFrame * (
topTextureFrameWidth3 + 2), 0,
topTextureFrameWidth3,
topTextureFrameHeight3),
white3,
num15 *
num3,
new Vector2(
topTextureFrameWidth3 / 2,
topTextureFrameHeight3), 1f,
SpriteEffects.None, 0f);
7011 }
7012 break;
7013 }
7014 case 44:
7015 {
7021 {
7022 continue;
7023 }
7026 {
7028 num11 += (float)(270 - Main.mouseTextColor) / 1000f;
7029 if (tile.color() == 0)
7030 {
7031 Lighting.AddLight(x, y, 0.1f, 0.2f +
num11 / 2f, 0.7f +
num11);
7032 }
7033 else
7034 {
7036 float r2 = (float)(
int)color3.R / 255f;
7037 float g2 = (float)(
int)color3.G / 255f;
7038 float b2 = (float)(
int)color3.B / 255f;
7039 Lighting.AddLight(x, y,
r2,
g2,
b2);
7040 }
7041 }
7046 if (!flag)
7047 {
7049 }
7051 {
7052 position2.X +=
num12;
7053 }
7056 if (tile.fullbrightBlock())
7057 {
7059 }
7060 Main.spriteBatch.Draw(
treeBranchTexture2,
position2,
new Rectangle(0,
treeFrame * 42, 40, 40),
color4,
num12 *
num4,
new Vector2(40f, 24f), 1f,
SpriteEffects.None, 0f);
7062 {
7065 Main.spriteBatch.Draw(
value2,
position2,
new Rectangle(0,
treeFrame * 42, 40, 40),
white2,
num12 *
num4,
new Vector2(40f, 24f), 1f,
SpriteEffects.None, 0f);
7066 }
7067 break;
7068 }
7069 case 66:
7070 {
7071 int treeStyle = 0;
7076 {
7077 continue;
7078 }
7080 if (treeStyle == 14)
7081 {
7083 num7 += (float)(270 - Main.mouseTextColor) / 1000f;
7084 if (tile.color() == 0)
7085 {
7086 Lighting.AddLight(x, y, 0.1f, 0.2f +
num7 / 2f, 0.7f +
num7);
7087 }
7088 else
7089 {
7091 float r = (float)(
int)color.R / 255f;
7092 float g = (float)(int)color.G / 255f;
7093 float b = (float)(
int)color.B / 255f;
7094 Lighting.AddLight(x, y,
r, g,
b);
7095 }
7096 }
7097 byte tileColor = tile.color();
7101 if (!flag)
7102 {
7104 }
7106 {
7108 }
7111 if (tile.fullbrightBlock())
7112 {
7114 }
7115 Main.spriteBatch.Draw(
treeBranchTexture, position,
new Rectangle(42,
treeFrame * 42, 40, 40),
color2,
num8 *
num4,
new Vector2(0f, 30f), 1f,
SpriteEffects.None, 0f);
7117 {
7120 Main.spriteBatch.Draw(
value, position,
new Rectangle(42,
treeFrame * 42, 40, 40),
white,
num8 *
num4,
new Vector2(0f, 30f), 1f,
SpriteEffects.None, 0f);
7121 }
7122 break;
7123 }
7124 }
7125 }
7126 if (
type == 323 && frameX >= 88 && frameX <= 132)
7127 {
7129 switch (frameX)
7130 {
7131 case 110:
7133 break;
7134 case 132:
7136 break;
7137 }
7146 {
7153 }
7154 int frameY2 = Main.tile[x, y].frameY;
7159 if (!flag)
7160 {
7162 }
7163 position3.X +=
num21 * 2f;
7166 if (tile.fullbrightBlock())
7167 {
7169 }
7170 Main.spriteBatch.Draw(
treeTopTexture2,
position3,
new Rectangle(
num16 * (
num17 + 2),
y2,
num17,
num18),
color7,
num21 *
num3,
new Vector2(
num17 / 2,
num18), 1f,
SpriteEffects.None, 0f);
7171 }
7172 }
7173 catch
7174 {
7175 }
7176 }
7177 }
static double Abs(double value)
void EmitTreeLeaves(int tilePosX, int tilePosY, int grassPosX, int grassPosY)
int GetPalmTreeBiome(int tileX, int tileY)
Texture2D GetTreeTopTexture(int treeTextureIndex, int treeTextureStyle, byte tileColor)
Point[][] _specialPositions
float GetWindCycle(int x, int y, double windCounter)
Texture2D GetTreeBranchTexture(int treeTextureIndex, int treeTextureStyle, byte tileColor)