TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ DrawSingleTile()

void Terraria.GameContent.Drawing.TileDrawing.DrawSingleTile ( TileDrawInfo drawData,
bool solidLayer,
int waterStyleOverride,
Vector2 screenPosition,
Vector2 screenOffset,
int tileX,
int tileY )
inlineprivate

Definition at line 871 of file TileDrawing.cs.

872 {
873 //IL_004f: Unknown result type (might be due to invalid IL or missing references)
874 //IL_0054: Unknown result type (might be due to invalid IL or missing references)
875 //IL_00f2: Unknown result type (might be due to invalid IL or missing references)
876 //IL_00f7: Unknown result type (might be due to invalid IL or missing references)
877 //IL_00f8: Unknown result type (might be due to invalid IL or missing references)
878 //IL_00fd: Unknown result type (might be due to invalid IL or missing references)
879 //IL_0372: Unknown result type (might be due to invalid IL or missing references)
880 //IL_0377: Unknown result type (might be due to invalid IL or missing references)
881 //IL_050a: Unknown result type (might be due to invalid IL or missing references)
882 //IL_0533: Unknown result type (might be due to invalid IL or missing references)
883 //IL_0538: Unknown result type (might be due to invalid IL or missing references)
884 //IL_053d: Unknown result type (might be due to invalid IL or missing references)
885 //IL_02ef: Unknown result type (might be due to invalid IL or missing references)
886 //IL_030e: Unknown result type (might be due to invalid IL or missing references)
887 //IL_0314: Unknown result type (might be due to invalid IL or missing references)
888 //IL_033f: Unknown result type (might be due to invalid IL or missing references)
889 //IL_0349: Unknown result type (might be due to invalid IL or missing references)
890 //IL_034e: Unknown result type (might be due to invalid IL or missing references)
891 //IL_01d9: Unknown result type (might be due to invalid IL or missing references)
892 //IL_01f2: Unknown result type (might be due to invalid IL or missing references)
893 //IL_01f8: Unknown result type (might be due to invalid IL or missing references)
894 //IL_0223: Unknown result type (might be due to invalid IL or missing references)
895 //IL_022d: Unknown result type (might be due to invalid IL or missing references)
896 //IL_0232: Unknown result type (might be due to invalid IL or missing references)
897 //IL_06cb: Unknown result type (might be due to invalid IL or missing references)
898 //IL_06ee: Unknown result type (might be due to invalid IL or missing references)
899 //IL_0706: Unknown result type (might be due to invalid IL or missing references)
900 //IL_070b: Unknown result type (might be due to invalid IL or missing references)
901 //IL_070d: Unknown result type (might be due to invalid IL or missing references)
902 //IL_0712: Unknown result type (might be due to invalid IL or missing references)
903 //IL_072f: Unknown result type (might be due to invalid IL or missing references)
904 //IL_0734: Unknown result type (might be due to invalid IL or missing references)
905 //IL_0747: Unknown result type (might be due to invalid IL or missing references)
906 //IL_074d: Unknown result type (might be due to invalid IL or missing references)
907 //IL_0752: Unknown result type (might be due to invalid IL or missing references)
908 //IL_0757: Unknown result type (might be due to invalid IL or missing references)
909 //IL_042d: Unknown result type (might be due to invalid IL or missing references)
910 //IL_042f: Unknown result type (might be due to invalid IL or missing references)
911 //IL_043d: Unknown result type (might be due to invalid IL or missing references)
912 //IL_045a: Unknown result type (might be due to invalid IL or missing references)
913 //IL_0494: Unknown result type (might be due to invalid IL or missing references)
914 //IL_049e: Unknown result type (might be due to invalid IL or missing references)
915 //IL_04a3: Unknown result type (might be due to invalid IL or missing references)
916 //IL_062b: Unknown result type (might be due to invalid IL or missing references)
917 //IL_063d: Unknown result type (might be due to invalid IL or missing references)
918 //IL_064a: Unknown result type (might be due to invalid IL or missing references)
919 //IL_064f: Unknown result type (might be due to invalid IL or missing references)
920 //IL_0651: Unknown result type (might be due to invalid IL or missing references)
921 //IL_0660: Unknown result type (might be due to invalid IL or missing references)
922 //IL_066e: Unknown result type (might be due to invalid IL or missing references)
923 //IL_0678: Unknown result type (might be due to invalid IL or missing references)
924 //IL_0683: Unknown result type (might be due to invalid IL or missing references)
925 //IL_086c: Unknown result type (might be due to invalid IL or missing references)
926 //IL_0876: Unknown result type (might be due to invalid IL or missing references)
927 //IL_087b: Unknown result type (might be due to invalid IL or missing references)
928 //IL_08bd: Unknown result type (might be due to invalid IL or missing references)
929 //IL_08bf: Unknown result type (might be due to invalid IL or missing references)
930 //IL_08b3: Unknown result type (might be due to invalid IL or missing references)
931 //IL_08b5: Unknown result type (might be due to invalid IL or missing references)
932 //IL_08ba: Unknown result type (might be due to invalid IL or missing references)
933 //IL_0a7b: Unknown result type (might be due to invalid IL or missing references)
934 //IL_0a7d: Unknown result type (might be due to invalid IL or missing references)
935 //IL_08db: Unknown result type (might be due to invalid IL or missing references)
936 //IL_08e0: Unknown result type (might be due to invalid IL or missing references)
937 //IL_0aaa: Unknown result type (might be due to invalid IL or missing references)
938 //IL_0aac: Unknown result type (might be due to invalid IL or missing references)
939 //IL_0ab3: Unknown result type (might be due to invalid IL or missing references)
940 //IL_0ab5: Unknown result type (might be due to invalid IL or missing references)
941 //IL_0a99: Unknown result type (might be due to invalid IL or missing references)
942 //IL_0a9b: Unknown result type (might be due to invalid IL or missing references)
943 //IL_08f6: Unknown result type (might be due to invalid IL or missing references)
944 //IL_08fb: Unknown result type (might be due to invalid IL or missing references)
945 //IL_160f: Unknown result type (might be due to invalid IL or missing references)
946 //IL_1632: Unknown result type (might be due to invalid IL or missing references)
947 //IL_1643: Unknown result type (might be due to invalid IL or missing references)
948 //IL_1648: Unknown result type (might be due to invalid IL or missing references)
949 //IL_164a: Unknown result type (might be due to invalid IL or missing references)
950 //IL_164f: Unknown result type (might be due to invalid IL or missing references)
951 //IL_0b1a: Unknown result type (might be due to invalid IL or missing references)
952 //IL_0b1f: Unknown result type (might be due to invalid IL or missing references)
953 //IL_16e4: Unknown result type (might be due to invalid IL or missing references)
954 //IL_170b: Unknown result type (might be due to invalid IL or missing references)
955 //IL_171f: Unknown result type (might be due to invalid IL or missing references)
956 //IL_1724: Unknown result type (might be due to invalid IL or missing references)
957 //IL_1726: Unknown result type (might be due to invalid IL or missing references)
958 //IL_172b: Unknown result type (might be due to invalid IL or missing references)
959 //IL_1731: Unknown result type (might be due to invalid IL or missing references)
960 //IL_1737: Unknown result type (might be due to invalid IL or missing references)
961 //IL_1742: Unknown result type (might be due to invalid IL or missing references)
962 //IL_166e: Unknown result type (might be due to invalid IL or missing references)
963 //IL_1671: Unknown result type (might be due to invalid IL or missing references)
964 //IL_167c: Unknown result type (might be due to invalid IL or missing references)
965 //IL_1686: Unknown result type (might be due to invalid IL or missing references)
966 //IL_1691: Unknown result type (might be due to invalid IL or missing references)
967 //IL_165f: Unknown result type (might be due to invalid IL or missing references)
968 //IL_1661: Unknown result type (might be due to invalid IL or missing references)
969 //IL_0cb7: Unknown result type (might be due to invalid IL or missing references)
970 //IL_0cbc: Unknown result type (might be due to invalid IL or missing references)
971 //IL_0d4c: Unknown result type (might be due to invalid IL or missing references)
972 //IL_0d51: Unknown result type (might be due to invalid IL or missing references)
973 //IL_0c94: Unknown result type (might be due to invalid IL or missing references)
974 //IL_0c9a: Unknown result type (might be due to invalid IL or missing references)
975 //IL_0ca4: Unknown result type (might be due to invalid IL or missing references)
976 //IL_0ca9: Unknown result type (might be due to invalid IL or missing references)
977 //IL_0d18: Unknown result type (might be due to invalid IL or missing references)
978 //IL_0d1d: Unknown result type (might be due to invalid IL or missing references)
979 //IL_0d74: Unknown result type (might be due to invalid IL or missing references)
980 //IL_0d79: Unknown result type (might be due to invalid IL or missing references)
981 //IL_0e5d: Unknown result type (might be due to invalid IL or missing references)
982 //IL_0e62: Unknown result type (might be due to invalid IL or missing references)
983 //IL_0e74: Unknown result type (might be due to invalid IL or missing references)
984 //IL_0e7b: Unknown result type (might be due to invalid IL or missing references)
985 //IL_0e80: Unknown result type (might be due to invalid IL or missing references)
986 //IL_0d3f: Unknown result type (might be due to invalid IL or missing references)
987 //IL_0d44: Unknown result type (might be due to invalid IL or missing references)
988 //IL_0d25: Unknown result type (might be due to invalid IL or missing references)
989 //IL_0d2a: Unknown result type (might be due to invalid IL or missing references)
990 //IL_0d32: Unknown result type (might be due to invalid IL or missing references)
991 //IL_0d37: Unknown result type (might be due to invalid IL or missing references)
992 //IL_0e9a: Unknown result type (might be due to invalid IL or missing references)
993 //IL_0e9e: Unknown result type (might be due to invalid IL or missing references)
994 //IL_0ea8: Unknown result type (might be due to invalid IL or missing references)
995 //IL_0ead: Unknown result type (might be due to invalid IL or missing references)
996 //IL_0edb: Unknown result type (might be due to invalid IL or missing references)
997 //IL_0ee5: Unknown result type (might be due to invalid IL or missing references)
998 //IL_0eec: Unknown result type (might be due to invalid IL or missing references)
999 //IL_0dbc: Unknown result type (might be due to invalid IL or missing references)
1000 //IL_0dc1: Unknown result type (might be due to invalid IL or missing references)
1001 //IL_0fc6: Unknown result type (might be due to invalid IL or missing references)
1002 //IL_0fc8: Unknown result type (might be due to invalid IL or missing references)
1003 //IL_0fcf: Unknown result type (might be due to invalid IL or missing references)
1004 //IL_0fd6: Unknown result type (might be due to invalid IL or missing references)
1005 //IL_0f5b: Unknown result type (might be due to invalid IL or missing references)
1006 //IL_0f83: Unknown result type (might be due to invalid IL or missing references)
1007 //IL_0f8d: Unknown result type (might be due to invalid IL or missing references)
1008 //IL_0f94: Unknown result type (might be due to invalid IL or missing references)
1009 //IL_0d08: Unknown result type (might be due to invalid IL or missing references)
1010 //IL_1012: Unknown result type (might be due to invalid IL or missing references)
1011 //IL_1014: Unknown result type (might be due to invalid IL or missing references)
1012 //IL_101b: Unknown result type (might be due to invalid IL or missing references)
1013 //IL_1022: Unknown result type (might be due to invalid IL or missing references)
1014 //IL_102d: Unknown result type (might be due to invalid IL or missing references)
1015 //IL_142d: Unknown result type (might be due to invalid IL or missing references)
1016 //IL_144d: Unknown result type (might be due to invalid IL or missing references)
1017 //IL_1457: Unknown result type (might be due to invalid IL or missing references)
1018 //IL_145e: Unknown result type (might be due to invalid IL or missing references)
1019 //IL_1469: Unknown result type (might be due to invalid IL or missing references)
1020 //IL_1514: Unknown result type (might be due to invalid IL or missing references)
1021 //IL_1522: Unknown result type (might be due to invalid IL or missing references)
1022 //IL_1527: Unknown result type (might be due to invalid IL or missing references)
1023 //IL_1550: Unknown result type (might be due to invalid IL or missing references)
1024 //IL_155a: Unknown result type (might be due to invalid IL or missing references)
1025 //IL_1561: Unknown result type (might be due to invalid IL or missing references)
1026 //IL_156c: Unknown result type (might be due to invalid IL or missing references)
1027 //IL_15a0: Unknown result type (might be due to invalid IL or missing references)
1028 //IL_15aa: Unknown result type (might be due to invalid IL or missing references)
1029 //IL_15af: Unknown result type (might be due to invalid IL or missing references)
1030 //IL_15d4: Unknown result type (might be due to invalid IL or missing references)
1031 //IL_15de: Unknown result type (might be due to invalid IL or missing references)
1032 //IL_15e5: Unknown result type (might be due to invalid IL or missing references)
1033 //IL_15f0: Unknown result type (might be due to invalid IL or missing references)
1034 //IL_11e2: Unknown result type (might be due to invalid IL or missing references)
1035 //IL_11ee: Unknown result type (might be due to invalid IL or missing references)
1036 //IL_11f3: Unknown result type (might be due to invalid IL or missing references)
1037 //IL_11f8: Unknown result type (might be due to invalid IL or missing references)
1038 //IL_11ff: Unknown result type (might be due to invalid IL or missing references)
1039 //IL_1206: Unknown result type (might be due to invalid IL or missing references)
1040 //IL_1211: Unknown result type (might be due to invalid IL or missing references)
1041 //IL_13cb: Unknown result type (might be due to invalid IL or missing references)
1042 //IL_13d7: Unknown result type (might be due to invalid IL or missing references)
1043 //IL_13dc: Unknown result type (might be due to invalid IL or missing references)
1044 //IL_13e1: Unknown result type (might be due to invalid IL or missing references)
1045 //IL_13e8: Unknown result type (might be due to invalid IL or missing references)
1046 //IL_13ef: Unknown result type (might be due to invalid IL or missing references)
1047 //IL_13fa: Unknown result type (might be due to invalid IL or missing references)
1048 drawData.tileCache = Main.tile[tileX, tileY];
1049 drawData.typeCache = drawData.tileCache.type;
1050 drawData.tileFrameX = drawData.tileCache.frameX;
1051 drawData.tileFrameY = drawData.tileCache.frameY;
1052 drawData.tileLight = Lighting.GetColor(tileX, tileY);
1053 if (drawData.tileCache.liquid > 0 && drawData.tileCache.type == 518)
1054 {
1055 return;
1056 }
1057 GetTileDrawData(tileX, tileY, drawData.tileCache, drawData.typeCache, ref drawData.tileFrameX, ref drawData.tileFrameY, out drawData.tileWidth, out drawData.tileHeight, out drawData.tileTop, out drawData.halfBrickHeight, out drawData.addFrX, out drawData.addFrY, out drawData.tileSpriteEffect, out drawData.glowTexture, out drawData.glowSourceRect, out drawData.glowColor);
1058 drawData.drawTexture = GetTileDrawTexture(drawData.tileCache, tileX, tileY);
1059 Texture2D highlightTexture = null;
1060 Rectangle empty = Rectangle.Empty;
1061 Color highlightColor = Color.Transparent;
1062 if (TileID.Sets.HasOutlines[drawData.typeCache])
1063 {
1065 }
1067 {
1068 if (((Color)(ref drawData.tileLight)).R < byte.MaxValue)
1069 {
1070 ((Color)(ref drawData.tileLight)).R = byte.MaxValue;
1071 }
1072 if (((Color)(ref drawData.tileLight)).G < 50)
1073 {
1074 ((Color)(ref drawData.tileLight)).G = 50;
1075 }
1076 if (((Color)(ref drawData.tileLight)).B < 50)
1077 {
1078 ((Color)(ref drawData.tileLight)).B = 50;
1079 }
1080 if (_isActiveAndNotPaused && _rand.Next(30) == 0)
1081 {
1082 int num = Dust.NewDust(new Vector2((float)(tileX * 16), (float)(tileY * 16)), 16, 16, 60, 0f, 0f, 100, default(Color), 0.3f);
1083 _dust[num].fadeIn = 1f;
1084 Dust obj = _dust[num];
1085 obj.velocity *= 0.1f;
1086 _dust[num].noLight = true;
1087 _dust[num].noGravity = true;
1088 }
1089 }
1090 if (_localPlayer.findTreasure && Main.IsTileSpelunkable(tileX, tileY, drawData.typeCache, drawData.tileFrameX, drawData.tileFrameY))
1091 {
1092 if (((Color)(ref drawData.tileLight)).R < 200)
1093 {
1094 ((Color)(ref drawData.tileLight)).R = 200;
1095 }
1096 if (((Color)(ref drawData.tileLight)).G < 170)
1097 {
1098 ((Color)(ref drawData.tileLight)).G = 170;
1099 }
1100 if (_isActiveAndNotPaused && _rand.Next(60) == 0)
1101 {
1102 int num12 = Dust.NewDust(new Vector2((float)(tileX * 16), (float)(tileY * 16)), 16, 16, 204, 0f, 0f, 150, default(Color), 0.3f);
1103 _dust[num12].fadeIn = 1f;
1104 Dust obj2 = _dust[num12];
1105 obj2.velocity *= 0.1f;
1106 _dust[num12].noLight = true;
1107 }
1108 }
1110 {
1111 Color sightColor = Color.White;
1112 if (Main.IsTileBiomeSightable(tileX, tileY, drawData.typeCache, drawData.tileFrameX, drawData.tileFrameY, ref sightColor))
1113 {
1114 if (((Color)(ref drawData.tileLight)).R < ((Color)(ref sightColor)).R)
1115 {
1116 ((Color)(ref drawData.tileLight)).R = ((Color)(ref sightColor)).R;
1117 }
1118 if (((Color)(ref drawData.tileLight)).G < ((Color)(ref sightColor)).G)
1119 {
1120 ((Color)(ref drawData.tileLight)).G = ((Color)(ref sightColor)).G;
1121 }
1122 if (((Color)(ref drawData.tileLight)).B < ((Color)(ref sightColor)).B)
1123 {
1124 ((Color)(ref drawData.tileLight)).B = ((Color)(ref sightColor)).B;
1125 }
1126 if (_isActiveAndNotPaused && _rand.Next(480) == 0)
1127 {
1128 Color newColor = sightColor;
1129 int num14 = Dust.NewDust(new Vector2((float)(tileX * 16), (float)(tileY * 16)), 16, 16, 267, 0f, 0f, 150, newColor, 0.3f);
1130 _dust[num14].noGravity = true;
1131 _dust[num14].fadeIn = 1f;
1132 Dust obj3 = _dust[num14];
1133 obj3.velocity *= 0.1f;
1135 }
1136 }
1137 }
1139 {
1140 if (!Lighting.UpdateEveryFrame || new FastRandom(Main.TileFrameSeed).WithModifier(tileX, tileY).Next(4) == 0)
1141 {
1142 DrawTiles_EmitParticles(tileY, tileX, drawData.tileCache, drawData.typeCache, drawData.tileFrameX, drawData.tileFrameY, drawData.tileLight);
1143 }
1144 drawData.tileLight = DrawTiles_GetLightOverride(tileY, tileX, drawData.tileCache, drawData.typeCache, drawData.tileFrameX, drawData.tileFrameY, drawData.tileLight);
1145 }
1146 bool flag = false;
1147 if (((Color)(ref drawData.tileLight)).R >= 1 || ((Color)(ref drawData.tileLight)).G >= 1 || ((Color)(ref drawData.tileLight)).B >= 1)
1148 {
1149 flag = true;
1150 }
1151 if (drawData.tileCache.wall > 0 && (drawData.tileCache.wall == 318 || drawData.tileCache.fullbrightWall()))
1152 {
1153 flag = true;
1154 }
1155 flag &= IsVisible(drawData.tileCache);
1156 CacheSpecialDraws_Part1(tileX, tileY, drawData.typeCache, drawData.tileFrameX, drawData.tileFrameY, !flag);
1158 if (drawData.typeCache == 72 && drawData.tileFrameX >= 36)
1159 {
1160 int num15 = 0;
1161 if (drawData.tileFrameY == 18)
1162 {
1163 num15 = 1;
1164 }
1165 else if (drawData.tileFrameY == 36)
1166 {
1167 num15 = 2;
1168 }
1169 Main.spriteBatch.Draw(TextureAssets.ShroomCap.Value, new Vector2((float)(tileX * 16 - (int)screenPosition.X - 22), (float)(tileY * 16 - (int)screenPosition.Y - 26)) + screenOffset, (Rectangle?)new Rectangle(num15 * 62, 0, 60, 42), Lighting.GetColor(tileX, tileY), 0f, _zero, 1f, drawData.tileSpriteEffect, 0f);
1170 }
1171 Rectangle rectangle = default(Rectangle);
1172 ((Rectangle)(ref rectangle))._002Ector(drawData.tileFrameX + drawData.addFrX, drawData.tileFrameY + drawData.addFrY, drawData.tileWidth, drawData.tileHeight - drawData.halfBrickHeight);
1173 Vector2 vector = new Vector2((float)(tileX * 16 - (int)screenPosition.X) - ((float)drawData.tileWidth - 16f) / 2f, (float)(tileY * 16 - (int)screenPosition.Y + drawData.tileTop + drawData.halfBrickHeight)) + screenOffset;
1174 TileLoader.DrawEffects(tileX, tileY, drawData.typeCache, Main.spriteBatch, ref drawData);
1175 if (!flag)
1176 {
1177 return;
1178 }
1179 drawData.colorTint = Color.White;
1180 drawData.finalColor = GetFinalLight(drawData.tileCache, drawData.typeCache, drawData.tileLight, drawData.colorTint);
1181 switch (drawData.typeCache)
1182 {
1183 case 136:
1184 switch (drawData.tileFrameX / 18)
1185 {
1186 case 1:
1187 vector.X += -2f;
1188 break;
1189 case 2:
1190 vector.X += 2f;
1191 break;
1192 }
1193 break;
1194 case 442:
1195 if (drawData.tileFrameX / 22 == 3)
1196 {
1197 vector.X += 2f;
1198 }
1199 break;
1200 case 51:
1201 drawData.finalColor = drawData.tileLight * 0.5f;
1202 break;
1203 case 160:
1204 case 692:
1205 {
1206 Color color = default(Color);
1207 ((Color)(ref color))._002Ector(Main.DiscoR, Main.DiscoG, Main.DiscoB, 255);
1208 if (drawData.tileCache.inActive())
1209 {
1210 color = drawData.tileCache.actColor(color);
1211 }
1212 drawData.finalColor = color;
1213 break;
1214 }
1215 case 129:
1216 {
1217 drawData.finalColor = new Color(255, 255, 255, 100);
1218 int num17 = 2;
1219 if (drawData.tileFrameX >= 324)
1220 {
1221 drawData.finalColor = Color.Transparent;
1222 }
1223 if (drawData.tileFrameY < 36)
1224 {
1225 vector.Y += num17 * (drawData.tileFrameY == 0).ToDirectionInt();
1226 }
1227 else
1228 {
1229 vector.X += num17 * (drawData.tileFrameY == 36).ToDirectionInt();
1230 }
1231 break;
1232 }
1233 case 272:
1234 {
1235 int num16 = Main.tileFrame[drawData.typeCache];
1236 num16 += tileX % 2;
1237 num16 += tileY % 2;
1238 num16 += tileX % 3;
1239 num16 += tileY % 3;
1240 num16 %= 2;
1241 num16 *= 90;
1242 drawData.addFrY += num16;
1243 rectangle.Y += num16;
1244 break;
1245 }
1246 case 80:
1247 {
1248 WorldGen.GetCactusType(tileX, tileY, drawData.tileFrameX, drawData.tileFrameY, out var evil, out var good, out var crimson);
1249 if (evil)
1250 {
1251 rectangle.Y += 54;
1252 }
1253 if (good)
1254 {
1255 rectangle.Y += 108;
1256 }
1257 if (crimson)
1258 {
1259 rectangle.Y += 162;
1260 }
1261 break;
1262 }
1263 case 83:
1264 drawData.drawTexture = GetTileDrawTexture(drawData.tileCache, tileX, tileY);
1265 break;
1266 case 323:
1267 if (drawData.tileCache.frameX <= 132 && drawData.tileCache.frameX >= 88)
1268 {
1269 return;
1270 }
1271 vector.X += drawData.tileCache.frameY;
1272 break;
1273 case 114:
1274 if (drawData.tileFrameY > 0)
1275 {
1276 rectangle.Height += 2;
1277 }
1278 break;
1279 }
1280 if (drawData.typeCache == 314)
1281 {
1283 }
1284 else if (drawData.typeCache == 171)
1285 {
1286 DrawXmasTree(screenPosition, screenOffset, tileX, tileY, drawData);
1287 }
1288 else
1289 {
1291 }
1292 if (Main.tileGlowMask[drawData.tileCache.type] != -1)
1293 {
1294 short num18 = Main.tileGlowMask[drawData.tileCache.type];
1295 if (TextureAssets.GlowMask.IndexInRange(num18))
1296 {
1297 drawData.drawTexture = TextureAssets.GlowMask[num18].Value;
1298 }
1299 double num19 = Main.timeForVisualEffects * 0.08;
1300 Color color2 = Color.White;
1301 bool flag2 = false;
1302 switch (drawData.tileCache.type)
1303 {
1304 case 633:
1305 color2 = Color.Lerp(Color.White, drawData.finalColor, 0.75f);
1306 break;
1307 case 659:
1308 case 667:
1310 break;
1311 case 350:
1312 ((Color)(ref color2))._002Ector(new Vector4((float)((0.0 - Math.Cos(((int)(num19 / 6.283) % 3 == 1) ? num19 : 0.0)) * 0.2 + 0.2)));
1313 break;
1314 case 381:
1315 case 517:
1316 case 687:
1318 break;
1319 case 534:
1320 case 535:
1321 case 689:
1323 break;
1324 case 536:
1325 case 537:
1326 case 690:
1328 break;
1329 case 539:
1330 case 540:
1331 case 688:
1333 break;
1334 case 625:
1335 case 626:
1336 case 691:
1338 break;
1339 case 627:
1340 case 628:
1341 case 692:
1342 ((Color)(ref color2))._002Ector(Main.DiscoR, Main.DiscoG, Main.DiscoB);
1343 break;
1344 case 370:
1345 case 390:
1347 break;
1348 case 391:
1349 ((Color)(ref color2))._002Ector(250, 250, 250, 200);
1350 break;
1351 case 209:
1352 color2 = PortalHelper.GetPortalColor(Main.myPlayer, (drawData.tileCache.frameX >= 288) ? 1 : 0);
1353 break;
1354 case 429:
1355 case 445:
1356 drawData.drawTexture = GetTileDrawTexture(drawData.tileCache, tileX, tileY);
1357 drawData.addFrY = 18;
1358 break;
1359 case 129:
1360 {
1361 if (drawData.tileFrameX < 324)
1362 {
1363 flag2 = true;
1364 break;
1365 }
1366 drawData.drawTexture = GetTileDrawTexture(drawData.tileCache, tileX, tileY);
1367 color2 = Main.hslToRgb(0.7f + (float)Math.Sin((float)Math.PI * 2f * Main.GlobalTimeWrappedHourly * 0.16f + (float)tileX * 0.3f + (float)tileY * 0.7f) * 0.16f, 1f, 0.5f);
1368 ((Color)(ref color2)).A = (byte)(((Color)(ref color2)).A / 2);
1369 color2 *= 0.3f;
1370 int num2 = 72;
1371 for (float num3 = 0f; num3 < (float)Math.PI * 2f; num3 += (float)Math.PI / 2f)
1372 {
1373 Main.spriteBatch.Draw(drawData.drawTexture, vector + num3.ToRotationVector2() * 2f, (Rectangle?)new Rectangle(drawData.tileFrameX + drawData.addFrX, drawData.tileFrameY + drawData.addFrY + num2, drawData.tileWidth, drawData.tileHeight), color2, 0f, Vector2.Zero, 1f, (SpriteEffects)0, 0f);
1374 }
1375 ((Color)(ref color2))._002Ector(255, 255, 255, 100);
1376 break;
1377 }
1378 }
1379 if (!flag2)
1380 {
1381 if (drawData.tileCache.slope() == 0 && !drawData.tileCache.halfBrick())
1382 {
1383 Main.spriteBatch.Draw(drawData.drawTexture, vector, (Rectangle?)new Rectangle(drawData.tileFrameX + drawData.addFrX, drawData.tileFrameY + drawData.addFrY, drawData.tileWidth, drawData.tileHeight), color2, 0f, Vector2.Zero, 1f, (SpriteEffects)0, 0f);
1384 }
1385 else if (drawData.tileCache.halfBrick())
1386 {
1387 Main.spriteBatch.Draw(drawData.drawTexture, vector, (Rectangle?)rectangle, color2, 0f, _zero, 1f, (SpriteEffects)0, 0f);
1388 }
1389 else if (TileID.Sets.Platforms[drawData.tileCache.type])
1390 {
1391 Main.spriteBatch.Draw(drawData.drawTexture, vector, (Rectangle?)rectangle, color2, 0f, _zero, 1f, drawData.tileSpriteEffect, 0f);
1392 if (drawData.tileCache.slope() == 1 && Main.tile[tileX + 1, tileY + 1].active() && Main.tileSolid[Main.tile[tileX + 1, tileY + 1].type] && Main.tile[tileX + 1, tileY + 1].slope() != 2 && !Main.tile[tileX + 1, tileY + 1].halfBrick() && (!Main.tile[tileX, tileY + 1].active() || (Main.tile[tileX, tileY + 1].blockType() != 0 && Main.tile[tileX, tileY + 1].blockType() != 5) || (!TileID.Sets.BlocksStairs[Main.tile[tileX, tileY + 1].type] && !TileID.Sets.BlocksStairsAbove[Main.tile[tileX, tileY + 1].type])))
1393 {
1394 Rectangle value = default(Rectangle);
1395 ((Rectangle)(ref value))._002Ector(198, (int)drawData.tileFrameY, 16, 16);
1396 if (TileID.Sets.Platforms[Main.tile[tileX + 1, tileY + 1].type] && Main.tile[tileX + 1, tileY + 1].slope() == 0)
1397 {
1398 value.X = 324;
1399 }
1400 Main.spriteBatch.Draw(drawData.drawTexture, vector + new Vector2(0f, 16f), (Rectangle?)value, color2, 0f, _zero, 1f, drawData.tileSpriteEffect, 0f);
1401 }
1402 else if (drawData.tileCache.slope() == 2 && Main.tile[tileX - 1, tileY + 1].active() && Main.tileSolid[Main.tile[tileX - 1, tileY + 1].type] && Main.tile[tileX - 1, tileY + 1].slope() != 1 && !Main.tile[tileX - 1, tileY + 1].halfBrick() && (!Main.tile[tileX, tileY + 1].active() || (Main.tile[tileX, tileY + 1].blockType() != 0 && Main.tile[tileX, tileY + 1].blockType() != 4) || (!TileID.Sets.BlocksStairs[Main.tile[tileX, tileY + 1].type] && !TileID.Sets.BlocksStairsAbove[Main.tile[tileX, tileY + 1].type])))
1403 {
1404 Rectangle value2 = default(Rectangle);
1405 ((Rectangle)(ref value2))._002Ector(162, (int)drawData.tileFrameY, 16, 16);
1406 if (TileID.Sets.Platforms[Main.tile[tileX - 1, tileY + 1].type] && Main.tile[tileX - 1, tileY + 1].slope() == 0)
1407 {
1408 value2.X = 306;
1409 }
1410 Main.spriteBatch.Draw(drawData.drawTexture, vector + new Vector2(0f, 16f), (Rectangle?)value2, color2, 0f, _zero, 1f, drawData.tileSpriteEffect, 0f);
1411 }
1412 }
1413 else if (TileID.Sets.HasSlopeFrames[drawData.tileCache.type])
1414 {
1415 Main.spriteBatch.Draw(drawData.drawTexture, vector, (Rectangle?)new Rectangle(drawData.tileFrameX + drawData.addFrX, drawData.tileFrameY + drawData.addFrY, 16, 16), color2, 0f, _zero, 1f, drawData.tileSpriteEffect, 0f);
1416 }
1417 else
1418 {
1419 int num4 = drawData.tileCache.slope();
1420 int num5 = 2;
1421 for (int i = 0; i < 8; i++)
1422 {
1423 int num6 = i * -2;
1424 int num7 = 16 - i * 2;
1425 int num8 = 16 - num7;
1426 int num9;
1427 switch (num4)
1428 {
1429 case 1:
1430 num6 = 0;
1431 num9 = i * 2;
1432 num7 = 14 - i * 2;
1433 num8 = 0;
1434 break;
1435 case 2:
1436 num6 = 0;
1437 num9 = 16 - i * 2 - 2;
1438 num7 = 14 - i * 2;
1439 num8 = 0;
1440 break;
1441 case 3:
1442 num9 = i * 2;
1443 break;
1444 default:
1445 num9 = 16 - i * 2 - 2;
1446 break;
1447 }
1448 Main.spriteBatch.Draw(drawData.drawTexture, vector + new Vector2((float)num9, (float)(i * num5 + num6)), (Rectangle?)new Rectangle(drawData.tileFrameX + drawData.addFrX + num9, drawData.tileFrameY + drawData.addFrY + num8, num5, num7), color2, 0f, _zero, 1f, drawData.tileSpriteEffect, 0f);
1449 }
1450 int num10 = ((num4 <= 2) ? 14 : 0);
1451 Main.spriteBatch.Draw(drawData.drawTexture, vector + new Vector2(0f, (float)num10), (Rectangle?)new Rectangle(drawData.tileFrameX + drawData.addFrX, drawData.tileFrameY + drawData.addFrY + num10, 16, 2), color2, 0f, _zero, 1f, drawData.tileSpriteEffect, 0f);
1452 }
1453 }
1454 }
1455 if (drawData.glowTexture != null)
1456 {
1457 Vector2 position = new Vector2((float)(tileX * 16 - (int)screenPosition.X) - ((float)drawData.tileWidth - 16f) / 2f, (float)(tileY * 16 - (int)screenPosition.Y + drawData.tileTop)) + screenOffset;
1458 if (TileID.Sets.Platforms[drawData.typeCache])
1459 {
1460 position = vector;
1461 }
1462 Main.spriteBatch.Draw(drawData.glowTexture, position, (Rectangle?)drawData.glowSourceRect, drawData.glowColor, 0f, _zero, 1f, drawData.tileSpriteEffect, 0f);
1463 }
1464 if (highlightTexture != null)
1465 {
1466 ((Rectangle)(ref empty))._002Ector(drawData.tileFrameX + drawData.addFrX, drawData.tileFrameY + drawData.addFrY, drawData.tileWidth, drawData.tileHeight);
1467 int num11 = 0;
1468 int num13 = 0;
1469 Main.spriteBatch.Draw(highlightTexture, new Vector2((float)(tileX * 16 - (int)screenPosition.X) - ((float)drawData.tileWidth - 16f) / 2f + (float)num11, (float)(tileY * 16 - (int)screenPosition.Y + drawData.tileTop + num13)) + screenOffset, (Rectangle?)empty, highlightColor, 0f, _zero, 1f, drawData.tileSpriteEffect, 0f);
1470 }
1471 }
bool noGravity
Indicates if a dust should be affected by gravity or not. Not all vanilla dust have logic checking th...
Definition Dust.cs:45
bool noLightEmittence
Definition Dust.cs:62
bool noLight
If true, the dust will not emit light. The specific behavior depends on the dust type,...
Definition Dust.cs:60
float fadeIn
Used by some dust AI to control logic pertaining to the dust fading in. The specific behavior depends...
Definition Dust.cs:40
void DrawBasicTile(Vector2 screenPosition, Vector2 screenOffset, int tileX, int tileY, TileDrawInfo drawData, Rectangle normalTileRect, Vector2 normalTilePosition)
static Color GetFinalLight(Tile tileCache, ushort typeCache, Color tileLight, Color tint)
Color DrawTiles_GetLightOverride(int j, int i, Tile tileCache, ushort typeCache, short tileFrameX, short tileFrameY, Color tileLight)
static bool IsVisible(Tile tile)
Returns true if the tile is visible.
void DrawTile_MinecartTrack(Vector2 screenPosition, Vector2 screenOffset, int tileX, int tileY, TileDrawInfo drawData)
void DrawXmasTree(Vector2 screenPosition, Vector2 screenOffset, int tileX, int tileY, TileDrawInfo drawData)
static bool IsTileDangerous(int tileX, int tileY, Player localPlayer, Tile tileCache, ushort typeCache)
void CacheSpecialDraws_Part2(int tileX, int tileY, TileDrawInfo drawData, bool skipDraw)
void CacheSpecialDraws_Part1(int tileX, int tileY, int tileType, int drawDataTileFrameX, int drawDataTileFrameY, bool skipDraw)
Texture2D GetTileDrawTexture(Tile tile, int tileX, int tileY)
void DrawTiles_EmitParticles(int j, int i, Tile tileCache, ushort typeCache, short tileFrameX, short tileFrameY, Color tileLight)
void GetTileDrawData(int x, int y, Tile tileCache, ushort typeCache, ref short tileFrameX, ref short tileFrameY, out int tileWidth, out int tileHeight, out int tileTop, out int halfBrickHeight, out int addFrX, out int addFrY, out SpriteEffects tileSpriteEffect, out Texture2D glowTexture, out Rectangle glowSourceRect, out Color glowColor)
void GetTileOutlineInfo(int x, int y, ushort typeCache, ref Color tileLight, ref Texture2D highlightTexture, ref Color highlightColor)
static Color GetShimmerGlitterColor(bool top, float worldPositionX, float worldPositionY)
static bool[] BlocksStairsAbove
Definition TileID.cs:322
static bool[] HasSlopeFrames
Definition TileID.cs:244
static bool[] HasOutlines
Indicates that this tile has an outline texture to be drawn to indicate that it is interactable....
Definition TileID.cs:260
static bool[] BlocksStairs
Definition TileID.cs:320
static bool[] Platforms
Definition TileID.cs:219
static void DrawEffects(int i, int j, int type, SpriteBatch spriteBatch, ref TileDrawInfo drawData)
This serves as the central class from which tile-related functions are supported and carried out.
Definition TileLoader.cs:23
bool findTreasure
Definition Player.cs:2889
FastRandom WithModifier(ulong modifier)
Definition FastRandom.cs:27

References Terraria.GameContent.Drawing.TileDrawing._argonMossGlow, Terraria.GameContent.Drawing.TileDrawing._dust, Terraria.GameContent.Drawing.TileDrawing._isActiveAndNotPaused, Terraria.GameContent.Drawing.TileDrawing._kryptonMossGlow, Terraria.GameContent.Drawing.TileDrawing._lavaMossGlow, Terraria.GameContent.Drawing.TileDrawing._localPlayer, Terraria.GameContent.Drawing.TileDrawing._meteorGlow, Terraria.GameContent.Drawing.TileDrawing._rand, Terraria.GameContent.Drawing.TileDrawing._violetMossGlow, Terraria.GameContent.Drawing.TileDrawing._xenonMossGlow, Terraria.GameContent.Drawing.TileDrawing._zero, Terraria.Player.biomeSight, Terraria.ID.TileID.Sets.BlocksStairs, Terraria.ID.TileID.Sets.BlocksStairsAbove, Terraria.GameContent.Drawing.TileDrawing.CacheSpecialDraws_Part1(), Terraria.GameContent.Drawing.TileDrawing.CacheSpecialDraws_Part2(), Terraria.Player.dangerSense, Terraria.Main.DiscoB, Terraria.Main.DiscoG, Terraria.Main.DiscoR, Terraria.GameContent.Drawing.TileDrawing.DrawBasicTile(), Terraria.ModLoader.TileLoader.DrawEffects(), Terraria.GameContent.Drawing.TileDrawing.DrawTile_MinecartTrack(), Terraria.GameContent.Drawing.TileDrawing.DrawTiles_EmitParticles(), Terraria.GameContent.Drawing.TileDrawing.DrawTiles_GetLightOverride(), Terraria.GameContent.Drawing.TileDrawing.DrawXmasTree(), Terraria.Dust.fadeIn, Terraria.Player.findTreasure, Terraria.WorldGen.GetCactusType(), Terraria.Lighting.GetColor(), Terraria.GameContent.Drawing.TileDrawing.GetFinalLight(), Terraria.GameContent.PortalHelper.GetPortalColor(), Terraria.GameContent.Liquid.LiquidRenderer.GetShimmerGlitterColor(), Terraria.GameContent.Drawing.TileDrawing.GetTileDrawData(), Terraria.GameContent.Drawing.TileDrawing.GetTileDrawTexture(), Terraria.GameContent.Drawing.TileDrawing.GetTileOutlineInfo(), Terraria.Main.GlobalTimeWrappedHourly, Terraria.GameContent.TextureAssets.GlowMask, Terraria.ID.TileID.Sets.HasOutlines, Terraria.ID.TileID.Sets.HasSlopeFrames, Terraria.Main.hslToRgb(), Terraria.Main.IsTileBiomeSightable(), Terraria.GameContent.Drawing.TileDrawing.IsTileDangerous(), Terraria.Main.IsTileSpelunkable(), Terraria.GameContent.Drawing.TileDrawing.IsVisible(), Terraria.Main.myPlayer, Terraria.Dust.NewDust(), Terraria.Utilities.UnifiedRandom.Next(), Terraria.Utilities.FastRandom.Next(), Terraria.Dust.noGravity, Terraria.Dust.noLight, Terraria.Dust.noLightEmittence, Terraria.ID.TileID.Sets.Platforms, Terraria.GameContent.TextureAssets.ShroomCap, Terraria.Main.spriteBatch, Terraria.Main.tile, Terraria.Main.tileFrame, Terraria.Main.TileFrameSeed, Terraria.Main.tileGlowMask, Terraria.Main.tileSolid, Terraria.Lighting.UpdateEveryFrame, and Terraria.Utilities.FastRandom.WithModifier().

Referenced by Terraria.GameContent.Drawing.TileDrawing.Draw().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: