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

◆ OldDrawBackground()

void Terraria.Main.OldDrawBackground ( )
inlineprotected

Definition at line 68881 of file Main.cs.

68882 {
68883 //IL_139f: Unknown result type (might be due to invalid IL or missing references)
68884 //IL_13a4: Unknown result type (might be due to invalid IL or missing references)
68885 //IL_13a6: Unknown result type (might be due to invalid IL or missing references)
68886 //IL_13bf: Unknown result type (might be due to invalid IL or missing references)
68887 //IL_13c9: Unknown result type (might be due to invalid IL or missing references)
68888 //IL_0073: Unknown result type (might be due to invalid IL or missing references)
68889 //IL_0078: Unknown result type (might be due to invalid IL or missing references)
68890 //IL_0dba: Unknown result type (might be due to invalid IL or missing references)
68891 //IL_0dbf: Unknown result type (might be due to invalid IL or missing references)
68892 //IL_0e6f: Unknown result type (might be due to invalid IL or missing references)
68893 //IL_0e74: Unknown result type (might be due to invalid IL or missing references)
68894 //IL_0e76: Unknown result type (might be due to invalid IL or missing references)
68895 //IL_0e8f: Unknown result type (might be due to invalid IL or missing references)
68896 //IL_0e9b: Unknown result type (might be due to invalid IL or missing references)
68897 //IL_1880: Unknown result type (might be due to invalid IL or missing references)
68898 //IL_1885: Unknown result type (might be due to invalid IL or missing references)
68899 //IL_1887: Unknown result type (might be due to invalid IL or missing references)
68900 //IL_18a0: Unknown result type (might be due to invalid IL or missing references)
68901 //IL_18aa: Unknown result type (might be due to invalid IL or missing references)
68902 //IL_16eb: Unknown result type (might be due to invalid IL or missing references)
68903 //IL_16f0: Unknown result type (might be due to invalid IL or missing references)
68904 //IL_16f2: Unknown result type (might be due to invalid IL or missing references)
68905 //IL_170b: Unknown result type (might be due to invalid IL or missing references)
68906 //IL_1715: Unknown result type (might be due to invalid IL or missing references)
68907 //IL_172b: Unknown result type (might be due to invalid IL or missing references)
68908 //IL_172d: Unknown result type (might be due to invalid IL or missing references)
68909 //IL_17cc: Unknown result type (might be due to invalid IL or missing references)
68910 //IL_17d1: Unknown result type (might be due to invalid IL or missing references)
68911 //IL_17d3: Unknown result type (might be due to invalid IL or missing references)
68912 //IL_17ec: Unknown result type (might be due to invalid IL or missing references)
68913 //IL_17f6: Unknown result type (might be due to invalid IL or missing references)
68914 //IL_1b32: Unknown result type (might be due to invalid IL or missing references)
68915 //IL_1b46: Unknown result type (might be due to invalid IL or missing references)
68916 //IL_1436: Unknown result type (might be due to invalid IL or missing references)
68917 //IL_1438: Unknown result type (might be due to invalid IL or missing references)
68918 //IL_143d: Unknown result type (might be due to invalid IL or missing references)
68919 //IL_1442: Unknown result type (might be due to invalid IL or missing references)
68920 //IL_1df2: Unknown result type (might be due to invalid IL or missing references)
68921 //IL_1e06: Unknown result type (might be due to invalid IL or missing references)
68922 //IL_0f41: Unknown result type (might be due to invalid IL or missing references)
68923 //IL_0f43: Unknown result type (might be due to invalid IL or missing references)
68924 //IL_0f45: Unknown result type (might be due to invalid IL or missing references)
68925 //IL_0f47: Unknown result type (might be due to invalid IL or missing references)
68926 //IL_2dc3: Unknown result type (might be due to invalid IL or missing references)
68927 //IL_2dd7: Unknown result type (might be due to invalid IL or missing references)
68928 //IL_1eaa: Unknown result type (might be due to invalid IL or missing references)
68929 //IL_1e75: Unknown result type (might be due to invalid IL or missing references)
68930 //IL_153a: Unknown result type (might be due to invalid IL or missing references)
68931 //IL_153f: Unknown result type (might be due to invalid IL or missing references)
68932 //IL_1541: Unknown result type (might be due to invalid IL or missing references)
68933 //IL_155e: Unknown result type (might be due to invalid IL or missing references)
68934 //IL_1568: Unknown result type (might be due to invalid IL or missing references)
68935 //IL_2e78: Unknown result type (might be due to invalid IL or missing references)
68936 //IL_2e43: Unknown result type (might be due to invalid IL or missing references)
68937 //IL_157e: Unknown result type (might be due to invalid IL or missing references)
68938 //IL_1580: Unknown result type (might be due to invalid IL or missing references)
68939 //IL_1625: Unknown result type (might be due to invalid IL or missing references)
68940 //IL_162a: Unknown result type (might be due to invalid IL or missing references)
68941 //IL_162c: Unknown result type (might be due to invalid IL or missing references)
68942 //IL_1649: Unknown result type (might be due to invalid IL or missing references)
68943 //IL_1653: Unknown result type (might be due to invalid IL or missing references)
68944 //IL_11e8: Unknown result type (might be due to invalid IL or missing references)
68945 //IL_11ed: Unknown result type (might be due to invalid IL or missing references)
68946 //IL_11ef: Unknown result type (might be due to invalid IL or missing references)
68947 //IL_120e: Unknown result type (might be due to invalid IL or missing references)
68948 //IL_1218: Unknown result type (might be due to invalid IL or missing references)
68949 //IL_0f9c: Unknown result type (might be due to invalid IL or missing references)
68950 //IL_0fa1: Unknown result type (might be due to invalid IL or missing references)
68951 //IL_0fcf: Unknown result type (might be due to invalid IL or missing references)
68952 //IL_0fd4: Unknown result type (might be due to invalid IL or missing references)
68953 //IL_1002: Unknown result type (might be due to invalid IL or missing references)
68954 //IL_1007: Unknown result type (might be due to invalid IL or missing references)
68955 //IL_1035: Unknown result type (might be due to invalid IL or missing references)
68956 //IL_103a: Unknown result type (might be due to invalid IL or missing references)
68957 //IL_107d: Unknown result type (might be due to invalid IL or missing references)
68958 //IL_1082: Unknown result type (might be due to invalid IL or missing references)
68959 //IL_10ad: Unknown result type (might be due to invalid IL or missing references)
68960 //IL_10b2: Unknown result type (might be due to invalid IL or missing references)
68961 //IL_10e1: Unknown result type (might be due to invalid IL or missing references)
68962 //IL_10e6: Unknown result type (might be due to invalid IL or missing references)
68963 //IL_1112: Unknown result type (might be due to invalid IL or missing references)
68964 //IL_1117: Unknown result type (might be due to invalid IL or missing references)
68965 //IL_122e: Unknown result type (might be due to invalid IL or missing references)
68966 //IL_1230: Unknown result type (might be due to invalid IL or missing references)
68967 //IL_12d5: Unknown result type (might be due to invalid IL or missing references)
68968 //IL_12da: Unknown result type (might be due to invalid IL or missing references)
68969 //IL_12dc: Unknown result type (might be due to invalid IL or missing references)
68970 //IL_12fb: Unknown result type (might be due to invalid IL or missing references)
68971 //IL_1305: Unknown result type (might be due to invalid IL or missing references)
68972 //IL_1bd7: Unknown result type (might be due to invalid IL or missing references)
68973 //IL_1bdc: Unknown result type (might be due to invalid IL or missing references)
68974 //IL_1c48: Unknown result type (might be due to invalid IL or missing references)
68975 //IL_1c4d: Unknown result type (might be due to invalid IL or missing references)
68976 //IL_1c4f: Unknown result type (might be due to invalid IL or missing references)
68977 //IL_1c64: Unknown result type (might be due to invalid IL or missing references)
68978 //IL_1c6e: Unknown result type (might be due to invalid IL or missing references)
68979 //IL_1c84: Unknown result type (might be due to invalid IL or missing references)
68980 //IL_1c86: Unknown result type (might be due to invalid IL or missing references)
68981 //IL_1d11: Unknown result type (might be due to invalid IL or missing references)
68982 //IL_1d16: Unknown result type (might be due to invalid IL or missing references)
68983 //IL_1d18: Unknown result type (might be due to invalid IL or missing references)
68984 //IL_1d2d: Unknown result type (might be due to invalid IL or missing references)
68985 //IL_1d37: Unknown result type (might be due to invalid IL or missing references)
68986 //IL_197c: Unknown result type (might be due to invalid IL or missing references)
68987 //IL_1981: Unknown result type (might be due to invalid IL or missing references)
68988 //IL_08a4: Unknown result type (might be due to invalid IL or missing references)
68989 //IL_08b8: Unknown result type (might be due to invalid IL or missing references)
68990 //IL_2b18: Unknown result type (might be due to invalid IL or missing references)
68991 //IL_2b2c: Unknown result type (might be due to invalid IL or missing references)
68992 //IL_1a6d: Unknown result type (might be due to invalid IL or missing references)
68993 //IL_1a72: Unknown result type (might be due to invalid IL or missing references)
68994 //IL_1a74: Unknown result type (might be due to invalid IL or missing references)
68995 //IL_1a8d: Unknown result type (might be due to invalid IL or missing references)
68996 //IL_1a99: Unknown result type (might be due to invalid IL or missing references)
68997 //IL_0bd8: Unknown result type (might be due to invalid IL or missing references)
68998 //IL_0bec: Unknown result type (might be due to invalid IL or missing references)
68999 //IL_0c89: Unknown result type (might be due to invalid IL or missing references)
69000 //IL_0c54: Unknown result type (might be due to invalid IL or missing references)
69001 //IL_2bb0: Unknown result type (might be due to invalid IL or missing references)
69002 //IL_2bb5: Unknown result type (might be due to invalid IL or missing references)
69003 //IL_2c21: Unknown result type (might be due to invalid IL or missing references)
69004 //IL_2c26: Unknown result type (might be due to invalid IL or missing references)
69005 //IL_2c28: Unknown result type (might be due to invalid IL or missing references)
69006 //IL_2c44: Unknown result type (might be due to invalid IL or missing references)
69007 //IL_2c4e: Unknown result type (might be due to invalid IL or missing references)
69008 //IL_0981: Unknown result type (might be due to invalid IL or missing references)
69009 //IL_0986: Unknown result type (might be due to invalid IL or missing references)
69010 //IL_09f2: Unknown result type (might be due to invalid IL or missing references)
69011 //IL_09f7: Unknown result type (might be due to invalid IL or missing references)
69012 //IL_09f9: Unknown result type (might be due to invalid IL or missing references)
69013 //IL_0a0e: Unknown result type (might be due to invalid IL or missing references)
69014 //IL_0a18: Unknown result type (might be due to invalid IL or missing references)
69015 //IL_0cb7: Unknown result type (might be due to invalid IL or missing references)
69016 //IL_2f5f: Unknown result type (might be due to invalid IL or missing references)
69017 //IL_2f64: Unknown result type (might be due to invalid IL or missing references)
69018 //IL_1fd0: Unknown result type (might be due to invalid IL or missing references)
69019 //IL_1fd5: Unknown result type (might be due to invalid IL or missing references)
69020 //IL_2c64: Unknown result type (might be due to invalid IL or missing references)
69021 //IL_2c66: Unknown result type (might be due to invalid IL or missing references)
69022 //IL_2cf1: Unknown result type (might be due to invalid IL or missing references)
69023 //IL_2cf6: Unknown result type (might be due to invalid IL or missing references)
69024 //IL_2cf8: Unknown result type (might be due to invalid IL or missing references)
69025 //IL_2d14: Unknown result type (might be due to invalid IL or missing references)
69026 //IL_2d1e: Unknown result type (might be due to invalid IL or missing references)
69027 //IL_0a2e: Unknown result type (might be due to invalid IL or missing references)
69028 //IL_0a30: Unknown result type (might be due to invalid IL or missing references)
69029 //IL_0abb: Unknown result type (might be due to invalid IL or missing references)
69030 //IL_0ac0: Unknown result type (might be due to invalid IL or missing references)
69031 //IL_0ac2: Unknown result type (might be due to invalid IL or missing references)
69032 //IL_0ad7: Unknown result type (might be due to invalid IL or missing references)
69033 //IL_0ae1: Unknown result type (might be due to invalid IL or missing references)
69034 //IL_36a9: Unknown result type (might be due to invalid IL or missing references)
69035 //IL_36ae: Unknown result type (might be due to invalid IL or missing references)
69036 //IL_36b0: Unknown result type (might be due to invalid IL or missing references)
69037 //IL_36d7: Unknown result type (might be due to invalid IL or missing references)
69038 //IL_36e1: Unknown result type (might be due to invalid IL or missing references)
69039 //IL_36ea: Unknown result type (might be due to invalid IL or missing references)
69040 //IL_36f0: Unknown result type (might be due to invalid IL or missing references)
69041 //IL_2976: Unknown result type (might be due to invalid IL or missing references)
69042 //IL_297b: Unknown result type (might be due to invalid IL or missing references)
69043 //IL_297d: Unknown result type (might be due to invalid IL or missing references)
69044 //IL_2996: Unknown result type (might be due to invalid IL or missing references)
69045 //IL_29a0: Unknown result type (might be due to invalid IL or missing references)
69046 //IL_29b6: Unknown result type (might be due to invalid IL or missing references)
69047 //IL_29b8: Unknown result type (might be due to invalid IL or missing references)
69048 //IL_2a57: Unknown result type (might be due to invalid IL or missing references)
69049 //IL_2a5c: Unknown result type (might be due to invalid IL or missing references)
69050 //IL_2a5e: Unknown result type (might be due to invalid IL or missing references)
69051 //IL_2a77: Unknown result type (might be due to invalid IL or missing references)
69052 //IL_2a81: Unknown result type (might be due to invalid IL or missing references)
69053 //IL_307b: Unknown result type (might be due to invalid IL or missing references)
69054 //IL_307d: Unknown result type (might be due to invalid IL or missing references)
69055 //IL_307f: Unknown result type (might be due to invalid IL or missing references)
69056 //IL_3081: Unknown result type (might be due to invalid IL or missing references)
69057 //IL_33e4: Unknown result type (might be due to invalid IL or missing references)
69058 //IL_33e6: Unknown result type (might be due to invalid IL or missing references)
69059 //IL_33eb: Unknown result type (might be due to invalid IL or missing references)
69060 //IL_33f0: Unknown result type (might be due to invalid IL or missing references)
69061 //IL_35d0: Unknown result type (might be due to invalid IL or missing references)
69062 //IL_35d5: Unknown result type (might be due to invalid IL or missing references)
69063 //IL_35d7: Unknown result type (might be due to invalid IL or missing references)
69064 //IL_35fe: Unknown result type (might be due to invalid IL or missing references)
69065 //IL_3608: Unknown result type (might be due to invalid IL or missing references)
69066 //IL_3611: Unknown result type (might be due to invalid IL or missing references)
69067 //IL_3617: Unknown result type (might be due to invalid IL or missing references)
69068 //IL_20fb: Unknown result type (might be due to invalid IL or missing references)
69069 //IL_20fd: Unknown result type (might be due to invalid IL or missing references)
69070 //IL_20ff: Unknown result type (might be due to invalid IL or missing references)
69071 //IL_2101: Unknown result type (might be due to invalid IL or missing references)
69072 //IL_331f: Unknown result type (might be due to invalid IL or missing references)
69073 //IL_3324: Unknown result type (might be due to invalid IL or missing references)
69074 //IL_3326: Unknown result type (might be due to invalid IL or missing references)
69075 //IL_3353: Unknown result type (might be due to invalid IL or missing references)
69076 //IL_335d: Unknown result type (might be due to invalid IL or missing references)
69077 //IL_3366: Unknown result type (might be due to invalid IL or missing references)
69078 //IL_336c: Unknown result type (might be due to invalid IL or missing references)
69079 //IL_30d6: Unknown result type (might be due to invalid IL or missing references)
69080 //IL_30db: Unknown result type (might be due to invalid IL or missing references)
69081 //IL_3109: Unknown result type (might be due to invalid IL or missing references)
69082 //IL_310e: Unknown result type (might be due to invalid IL or missing references)
69083 //IL_313c: Unknown result type (might be due to invalid IL or missing references)
69084 //IL_3141: Unknown result type (might be due to invalid IL or missing references)
69085 //IL_316f: Unknown result type (might be due to invalid IL or missing references)
69086 //IL_3174: Unknown result type (might be due to invalid IL or missing references)
69087 //IL_31b7: Unknown result type (might be due to invalid IL or missing references)
69088 //IL_31bc: Unknown result type (might be due to invalid IL or missing references)
69089 //IL_31e7: Unknown result type (might be due to invalid IL or missing references)
69090 //IL_31ec: Unknown result type (might be due to invalid IL or missing references)
69091 //IL_321b: Unknown result type (might be due to invalid IL or missing references)
69092 //IL_3220: Unknown result type (might be due to invalid IL or missing references)
69093 //IL_324c: Unknown result type (might be due to invalid IL or missing references)
69094 //IL_3251: Unknown result type (might be due to invalid IL or missing references)
69095 //IL_252c: Unknown result type (might be due to invalid IL or missing references)
69096 //IL_252e: Unknown result type (might be due to invalid IL or missing references)
69097 //IL_2533: Unknown result type (might be due to invalid IL or missing references)
69098 //IL_2538: Unknown result type (might be due to invalid IL or missing references)
69099 //IL_27e1: Unknown result type (might be due to invalid IL or missing references)
69100 //IL_27e6: Unknown result type (might be due to invalid IL or missing references)
69101 //IL_27e8: Unknown result type (might be due to invalid IL or missing references)
69102 //IL_2801: Unknown result type (might be due to invalid IL or missing references)
69103 //IL_280b: Unknown result type (might be due to invalid IL or missing references)
69104 //IL_34e5: Unknown result type (might be due to invalid IL or missing references)
69105 //IL_34ea: Unknown result type (might be due to invalid IL or missing references)
69106 //IL_34ec: Unknown result type (might be due to invalid IL or missing references)
69107 //IL_3517: Unknown result type (might be due to invalid IL or missing references)
69108 //IL_3521: Unknown result type (might be due to invalid IL or missing references)
69109 //IL_352a: Unknown result type (might be due to invalid IL or missing references)
69110 //IL_3530: Unknown result type (might be due to invalid IL or missing references)
69111 //IL_2821: Unknown result type (might be due to invalid IL or missing references)
69112 //IL_2823: Unknown result type (might be due to invalid IL or missing references)
69113 //IL_28c2: Unknown result type (might be due to invalid IL or missing references)
69114 //IL_28c7: Unknown result type (might be due to invalid IL or missing references)
69115 //IL_28c9: Unknown result type (might be due to invalid IL or missing references)
69116 //IL_28e2: Unknown result type (might be due to invalid IL or missing references)
69117 //IL_28ec: Unknown result type (might be due to invalid IL or missing references)
69118 //IL_23a2: Unknown result type (might be due to invalid IL or missing references)
69119 //IL_23a7: Unknown result type (might be due to invalid IL or missing references)
69120 //IL_23a9: Unknown result type (might be due to invalid IL or missing references)
69121 //IL_23c8: Unknown result type (might be due to invalid IL or missing references)
69122 //IL_23d2: Unknown result type (might be due to invalid IL or missing references)
69123 //IL_2156: Unknown result type (might be due to invalid IL or missing references)
69124 //IL_215b: Unknown result type (might be due to invalid IL or missing references)
69125 //IL_2189: Unknown result type (might be due to invalid IL or missing references)
69126 //IL_218e: Unknown result type (might be due to invalid IL or missing references)
69127 //IL_21bc: Unknown result type (might be due to invalid IL or missing references)
69128 //IL_21c1: Unknown result type (might be due to invalid IL or missing references)
69129 //IL_21ef: Unknown result type (might be due to invalid IL or missing references)
69130 //IL_21f4: Unknown result type (might be due to invalid IL or missing references)
69131 //IL_2237: Unknown result type (might be due to invalid IL or missing references)
69132 //IL_223c: Unknown result type (might be due to invalid IL or missing references)
69133 //IL_2267: Unknown result type (might be due to invalid IL or missing references)
69134 //IL_226c: Unknown result type (might be due to invalid IL or missing references)
69135 //IL_229b: Unknown result type (might be due to invalid IL or missing references)
69136 //IL_22a0: Unknown result type (might be due to invalid IL or missing references)
69137 //IL_22cc: Unknown result type (might be due to invalid IL or missing references)
69138 //IL_22d1: Unknown result type (might be due to invalid IL or missing references)
69139 //IL_2630: Unknown result type (might be due to invalid IL or missing references)
69140 //IL_2635: Unknown result type (might be due to invalid IL or missing references)
69141 //IL_2637: Unknown result type (might be due to invalid IL or missing references)
69142 //IL_2654: Unknown result type (might be due to invalid IL or missing references)
69143 //IL_265e: Unknown result type (might be due to invalid IL or missing references)
69144 //IL_23e8: Unknown result type (might be due to invalid IL or missing references)
69145 //IL_23ea: Unknown result type (might be due to invalid IL or missing references)
69146 //IL_248f: Unknown result type (might be due to invalid IL or missing references)
69147 //IL_2494: Unknown result type (might be due to invalid IL or missing references)
69148 //IL_2496: Unknown result type (might be due to invalid IL or missing references)
69149 //IL_24b5: Unknown result type (might be due to invalid IL or missing references)
69150 //IL_24bf: Unknown result type (might be due to invalid IL or missing references)
69151 //IL_2674: Unknown result type (might be due to invalid IL or missing references)
69152 //IL_2676: Unknown result type (might be due to invalid IL or missing references)
69153 //IL_271b: Unknown result type (might be due to invalid IL or missing references)
69154 //IL_2720: Unknown result type (might be due to invalid IL or missing references)
69155 //IL_2722: Unknown result type (might be due to invalid IL or missing references)
69156 //IL_273f: Unknown result type (might be due to invalid IL or missing references)
69157 //IL_2749: Unknown result type (might be due to invalid IL or missing references)
69158 Color[] slices = (Color[])(object)new Color[9];
69159 Stopwatch stopwatch = new Stopwatch();
69160 stopwatch.Start();
69161 int num = (int)(255f * (1f - gfxQuality) + 140f * gfxQuality);
69162 int num11 = (int)(200f * (1f - gfxQuality) + 40f * gfxQuality);
69163 int num21 = 128;
69164 Vector2 vector = default(Vector2);
69165 ((Vector2)(ref vector))._002Ector((float)offScreenRange, (float)offScreenRange);
69166 if (drawToScreen)
69167 {
69168 vector = Vector2.Zero;
69169 }
69170 float num31;
69171 float num40;
69172 float num50 = (num40 = (num31 = 0.9f));
69173 float num60 = 0f;
69174 if (SceneMetrics.BloodTileCount > SceneMetrics.EvilTileCount && SceneMetrics.BloodTileCount > SceneMetrics.HolyTileCount)
69175 {
69176 num60 = SceneMetrics.BloodTileCount;
69177 }
69178 else if (SceneMetrics.HolyTileCount > SceneMetrics.EvilTileCount)
69179 {
69180 num60 = SceneMetrics.HolyTileCount;
69181 }
69182 else if (SceneMetrics.EvilTileCount > SceneMetrics.HolyTileCount)
69183 {
69184 num60 = SceneMetrics.EvilTileCount;
69185 }
69186 num60 = MathHelper.Clamp(num60 / 800f, 0f, 1f);
69187 float num65 = (float)((double)screenPosition.Y - worldSurface * 16.0) / 300f;
69188 if (num65 < 0f)
69189 {
69190 num65 = 0f;
69191 }
69192 else if (num65 > 1f)
69193 {
69194 num65 = 1f;
69195 }
69196 float num66 = 1f * (1f - num65) + num31 * num65;
69197 float globalBrightness = Lighting.GlobalBrightness;
69198 Lighting.GlobalBrightness = globalBrightness * (1f - num65) + 1f * num65;
69199 float value = (float)((double)(screenPosition.Y - (float)(screenHeight / 2) + 200f) - rockLayer * 16.0) / 300f;
69200 value = MathHelper.Clamp(value, 0f, 1f);
69201 if (SceneMetrics.BloodTileCount > SceneMetrics.EvilTileCount && SceneMetrics.BloodTileCount > SceneMetrics.HolyTileCount)
69202 {
69203 num31 = 1f * num60 + num31 * (1f - num60);
69204 num40 = 0.55f * num60 + num40 * (1f - num60);
69205 num50 = 0.5f * num60 + num50 * (1f - num60);
69206 }
69207 else if (SceneMetrics.EvilTileCount > 0)
69208 {
69209 num31 = 0.8f * num60 + num31 * (1f - num60);
69210 num40 = 0.75f * num60 + num40 * (1f - num60);
69211 num50 = 1.1f * num60 + num50 * (1f - num60);
69212 }
69213 else if (SceneMetrics.HolyTileCount > 0)
69214 {
69215 num31 = 1f * num60 + num31 * (1f - num60);
69216 num40 = 0.7f * num60 + num40 * (1f - num60);
69217 num50 = 0.9f * num60 + num50 * (1f - num60);
69218 }
69219 num31 = 1f * (num66 - value) + num31 * value;
69220 num40 = 1f * (num66 - value) + num40 * value;
69221 num50 = 1f * (num66 - value) + num50 * value;
69222 int num2 = (int)((screenPosition.X + (float)(screenWidth / 2)) / 16f);
69223 int num3 = 3;
69224 num3 = ((num2 <= caveBackX[0]) ? caveBackStyle[0] : ((num2 <= caveBackX[1]) ? caveBackStyle[1] : ((num2 > caveBackX[2]) ? caveBackStyle[3] : caveBackStyle[2])));
69225 num3 += 3;
69226 if (SceneMetrics.SnowTileCount > SceneMetrics.SnowTileThreshold && (screenPosition.Y + (float)screenHeight) / 16f < (float)(maxTilesY - 250))
69227 {
69228 num3 = 1;
69229 }
69230 if (SceneMetrics.JungleTileCount > SceneMetrics.JungleTileThreshold)
69231 {
69232 if (num3 == 1)
69233 {
69234 if (SceneMetrics.JungleTileCount > SceneMetrics.SnowTileCount)
69235 {
69236 num3 = 11;
69237 }
69238 }
69239 else
69240 {
69241 num3 = 11;
69242 }
69243 }
69244 if (SceneMetrics.EnoughTilesForGlowingMushroom)
69245 {
69246 num3 = 2;
69247 }
69249 {
69253 }
69254 if (ugBackTransition > 0f)
69255 {
69256 ugBackTransition -= 0.25f;
69257 }
69258 if (ugBackTransition < 0f)
69259 {
69261 }
69262 int[] array = new int[6];
69263 int[] array2 = new int[6];
69264 for (int i = 0; i < 2; i++)
69265 {
69267 if (i == 1)
69268 {
69270 }
69271 int[] array3 = new int[6];
69272 switch (num4)
69273 {
69274 case 0:
69275 array3[0] = 1;
69276 array3[1] = 2;
69277 array3[2] = 4;
69278 array3[3] = 3;
69279 array3[4] = 6;
69280 array3[5] = 5;
69281 break;
69282 case 1:
69283 if (iceBackStyle == 0)
69284 {
69285 array3[1] = 33;
69286 array3[3] = 32;
69287 array3[0] = 40;
69288 array3[2] = 34;
69289 }
69290 else if (iceBackStyle == 1)
69291 {
69292 array3[1] = 118;
69293 array3[3] = 117;
69294 array3[0] = 160;
69295 array3[2] = 161;
69296 }
69297 else if (iceBackStyle == 2)
69298 {
69299 array3[1] = 165;
69300 array3[3] = 167;
69301 array3[0] = 164;
69302 array3[2] = 166;
69303 }
69304 else
69305 {
69306 array3[1] = 120;
69307 array3[3] = 119;
69308 array3[0] = 162;
69309 array3[2] = 163;
69310 }
69311 array3[4] = array3[3];
69312 break;
69313 case 2:
69314 array3[0] = 62;
69315 array3[1] = 63;
69316 array3[2] = 64;
69317 array3[3] = 65;
69318 array3[4] = 143 + hellBackStyle;
69319 break;
69320 case 3:
69321 array3[0] = 66;
69322 array3[1] = 67;
69323 array3[2] = 68;
69324 array3[3] = 69;
69325 array3[4] = 128 + hellBackStyle;
69326 break;
69327 case 4:
69328 array3[0] = 70;
69329 array3[1] = 71;
69330 array3[2] = 68;
69331 array3[3] = 72;
69332 array3[4] = 128 + hellBackStyle;
69333 break;
69334 case 5:
69335 array3[0] = 73;
69336 array3[1] = 74;
69337 array3[2] = 75;
69338 array3[3] = 76;
69339 array3[4] = 131 + hellBackStyle;
69340 break;
69341 case 6:
69342 array3[0] = 77;
69343 array3[1] = 78;
69344 array3[2] = 79;
69345 array3[3] = 80;
69346 array3[4] = 134 + hellBackStyle;
69347 break;
69348 case 7:
69349 array3[0] = 77;
69350 array3[1] = 81;
69351 array3[2] = 79;
69352 array3[3] = 82;
69353 array3[4] = 134 + hellBackStyle;
69354 break;
69355 case 8:
69356 array3[0] = 83;
69357 array3[1] = 84;
69358 array3[2] = 85;
69359 array3[3] = 86;
69360 array3[4] = 137 + hellBackStyle;
69361 break;
69362 case 9:
69363 array3[0] = 83;
69364 array3[1] = 87;
69365 array3[2] = 88;
69366 array3[3] = 89;
69367 array3[4] = 137 + hellBackStyle;
69368 break;
69369 case 10:
69370 array3[0] = 121;
69371 array3[1] = 122;
69372 array3[2] = 123;
69373 array3[3] = 124;
69374 array3[4] = 140 + hellBackStyle;
69375 break;
69376 case 11:
69377 if (jungleBackStyle == 0)
69378 {
69379 array3[0] = 153;
69380 array3[1] = 147;
69381 array3[2] = 148;
69382 array3[3] = 149;
69383 array3[4] = 150 + hellBackStyle;
69384 }
69385 else
69386 {
69387 array3[0] = 146;
69388 array3[1] = 154;
69389 array3[2] = 155;
69390 array3[3] = 156;
69391 array3[4] = 157 + hellBackStyle;
69392 }
69393 break;
69394 }
69395 if (hellBackStyle == 0)
69396 {
69397 array3[5] = 125;
69398 }
69399 if (hellBackStyle == 1)
69400 {
69401 array3[5] = 126;
69402 }
69403 if (hellBackStyle == 2)
69404 {
69405 array3[5] = 127;
69406 }
69413 if (i == 0)
69414 {
69415 for (int j = 0; j < 6; j++)
69416 {
69417 array[j] = array3[j];
69418 }
69419 }
69420 else
69421 {
69422 for (int k = 0; k < 6; k++)
69423 {
69424 array2[k] = array3[k];
69425 }
69426 }
69427 }
69428 globalBrightness = 1.2f * (1f - value) + 1f * value;
69430 bgStartX = (int)(0.0 - Math.IEEERemainder((double)num21 + (double)screenPosition.X * bgParallax, num21) - (double)(num21 / 2)) - (int)vector.X;
69431 bgLoops = (screenWidth + (int)vector.X * 2) / num21 + 2;
69432 bgTopY = (int)((float)((int)worldSurface * 16 - 16) - screenPosition.Y + 16f);
69433 for (int l = 0; l < bgLoops; l++)
69434 {
69435 for (int m = 0; m < num21 / 16; m++)
69436 {
69437 int num5 = (int)(float)Math.Round(0f - (float)Math.IEEERemainder((float)bgStartX + screenPosition.X, 16.0));
69438 if (num5 == -8)
69439 {
69440 num5 = 8;
69441 }
69442 float num67 = bgStartX + num21 * l + m * 16 + 8;
69443 float num6 = bgTopY;
69444 Color color = Lighting.GetColor((int)((num67 + screenPosition.X) / 16f), (int)((screenPosition.Y + num6) / 16f));
69445 ((Color)(ref color)).R = (byte)((float)(int)((Color)(ref color)).R * num31);
69446 ((Color)(ref color)).G = (byte)((float)(int)((Color)(ref color)).G * num40);
69447 ((Color)(ref color)).B = (byte)((float)(int)((Color)(ref color)).B * num50);
69448 spriteBatch.Draw(TextureAssets.Background[array[0]].Value, new Vector2((float)(bgStartX + num21 * l + 16 * m + num5), (float)bgTopY) + vector, (Rectangle?)new Rectangle(16 * m + num5 + 16, 0, 16, 16), color);
69449 if (ugBackTransition > 0f)
69450 {
69451 Color color12 = color;
69452 ((Color)(ref color12)).R = (byte)((float)(int)((Color)(ref color12)).R * ugBackTransition);
69453 ((Color)(ref color12)).G = (byte)((float)(int)((Color)(ref color12)).G * ugBackTransition);
69454 ((Color)(ref color12)).B = (byte)((float)(int)((Color)(ref color12)).B * ugBackTransition);
69455 ((Color)(ref color12)).A = (byte)((float)(int)((Color)(ref color12)).A * ugBackTransition);
69456 spriteBatch.Draw(TextureAssets.Background[array2[0]].Value, new Vector2((float)(bgStartX + num21 * l + 16 * m + num5), (float)bgTopY) + vector, (Rectangle?)new Rectangle(16 * m + num5 + 16, 0, 16, 16), color12);
69457 }
69458 }
69459 }
69460 double num7 = maxTilesY - 230;
69461 double num8 = (int)((num7 - worldSurface) / 6.0) * 6;
69462 num7 = worldSurface + num8 - 5.0;
69463 bool flag = false;
69464 bool flag2 = false;
69465 bgTopY = (int)((float)((int)worldSurface * 16) - screenPosition.Y + 16f);
69466 if (worldSurface * 16.0 <= (double)(screenPosition.Y + (float)screenHeight + (float)offScreenRange))
69467 {
69469 bgStartX = (int)(0.0 - Math.IEEERemainder((double)num21 + (double)screenPosition.X * bgParallax, num21) - (double)(num21 / 2)) - (int)vector.X;
69470 bgLoops = (screenWidth + (int)vector.X * 2) / num21 + 2;
69471 if (worldSurface * 16.0 < (double)(screenPosition.Y - 16f))
69472 {
69473 bgStartY = (int)(Math.IEEERemainder(bgTopY, backgroundHeight[2]) - (double)backgroundHeight[2]);
69474 bgLoopsY = (screenHeight - bgStartY + (int)vector.Y * 2) / backgroundHeight[2] + 1;
69475 }
69476 else
69477 {
69478 bgStartY = bgTopY;
69479 bgLoopsY = (screenHeight - bgTopY + (int)vector.Y * 2) / backgroundHeight[2] + 1;
69480 }
69481 if (rockLayer * 16.0 < (double)(Camera.ScaledPosition.Y + 600f))
69482 {
69483 bgLoopsY = (int)(rockLayer * 16.0 - (double)screenPosition.Y + 600.0 - (double)bgStartY) / backgroundHeight[2];
69484 flag2 = true;
69485 }
69486 int num9 = (int)(float)Math.Round(0f - (float)Math.IEEERemainder((float)bgStartX + screenPosition.X, 16.0));
69487 if (num9 == -8)
69488 {
69489 num9 = 8;
69490 }
69491 for (int n = 0; n < bgLoops; n++)
69492 {
69493 for (int num10 = 0; num10 < bgLoopsY; num10++)
69494 {
69495 for (int num12 = 0; num12 < num21 / 16; num12++)
69496 {
69497 for (int num13 = 0; num13 < 6; num13++)
69498 {
69499 float num68 = bgStartY + num10 * 96 + num13 * 16 + 8;
69500 int num14 = (int)(((float)(bgStartX + num21 * n + num12 * 16 + 8) + screenPosition.X) / 16f);
69501 int num15 = (int)((num68 + screenPosition.Y) / 16f);
69502 Color color23 = Lighting.GetColor(num14, num15);
69503 if (tile[num14, num15] == null)
69504 {
69505 tile[num14, num15] = default(Tile);
69506 }
69507 if (((Color)(ref color23)).R > 0 || ((Color)(ref color23)).G > 0 || ((Color)(ref color23)).B > 0)
69508 {
69509 if (!drawToScreen)
69510 {
69511 Lighting.GetCornerColors(num14, num15, out var vertices);
69512 tileBatch.Draw(TextureAssets.Background[array[1]].Value, new Vector2((float)(bgStartX + num21 * n + 16 * num12 + num9), (float)(bgStartY + backgroundHeight[array2[1]] * num10 + 16 * num13)) + vector, (Rectangle?)new Rectangle(16 * num12 + num9 + 16, 16 * num13, 16, 16), vertices, Vector2.Zero, 1f, (SpriteEffects)0);
69513 }
69514 else if ((((Color)(ref color23)).R > num || (double)(int)((Color)(ref color23)).G > (double)num * 1.1 || (double)(int)((Color)(ref color23)).B > (double)num * 1.2) && !tile[num14, num15].active() && WallLightAt(num14, num15) && ugBackTransition == 0f)
69515 {
69516 Lighting.GetColor9Slice(num14, num15, ref slices);
69517 try
69518 {
69519 for (int num16 = 0; num16 < 9; num16++)
69520 {
69521 int num17 = 0;
69522 int num18 = 0;
69523 int width = 4;
69524 int height = 4;
69525 Color color24 = color23;
69526 Color color25 = color23;
69527 switch (num16)
69528 {
69529 case 0:
69530 if (!tile[num14 - 1, num15 - 1].active())
69531 {
69532 color25 = slices[num16];
69533 }
69534 break;
69535 case 1:
69536 width = 8;
69537 num17 = 4;
69538 if (!tile[num14, num15 - 1].active())
69539 {
69540 color25 = slices[num16];
69541 }
69542 break;
69543 case 2:
69544 num17 = 12;
69545 if (!tile[num14 + 1, num15 - 1].active())
69546 {
69547 color25 = slices[num16];
69548 }
69549 break;
69550 case 3:
69551 height = 8;
69552 num18 = 4;
69553 if (!tile[num14 - 1, num15].active())
69554 {
69555 color25 = slices[num16];
69556 }
69557 break;
69558 case 4:
69559 width = 8;
69560 height = 8;
69561 num17 = 4;
69562 num18 = 4;
69563 break;
69564 case 5:
69565 num17 = 12;
69566 num18 = 4;
69567 height = 8;
69568 if (!tile[num14 + 1, num15].active())
69569 {
69570 color25 = slices[num16];
69571 }
69572 break;
69573 case 6:
69574 num18 = 12;
69575 if (!tile[num14 - 1, num15 + 1].active())
69576 {
69577 color25 = slices[num16];
69578 }
69579 break;
69580 case 7:
69581 width = 8;
69582 height = 4;
69583 num17 = 4;
69584 num18 = 12;
69585 if (!tile[num14, num15 + 1].active())
69586 {
69587 color25 = slices[num16];
69588 }
69589 break;
69590 case 8:
69591 num17 = 12;
69592 num18 = 12;
69593 if (!tile[num14 + 1, num15 + 1].active())
69594 {
69595 color25 = slices[num16];
69596 }
69597 break;
69598 }
69599 ((Color)(ref color24)).R = (byte)((((Color)(ref color23)).R + ((Color)(ref color25)).R) / 2);
69600 ((Color)(ref color24)).G = (byte)((((Color)(ref color23)).G + ((Color)(ref color25)).G) / 2);
69601 ((Color)(ref color24)).B = (byte)((((Color)(ref color23)).B + ((Color)(ref color25)).B) / 2);
69602 ((Color)(ref color24)).R = (byte)((float)(int)((Color)(ref color24)).R * num31);
69603 ((Color)(ref color24)).G = (byte)((float)(int)((Color)(ref color24)).G * num40);
69604 ((Color)(ref color24)).B = (byte)((float)(int)((Color)(ref color24)).B * num50);
69605 spriteBatch.Draw(TextureAssets.Background[array[1]].Value, new Vector2((float)(bgStartX + num21 * n + 16 * num12 + num17 + num9), (float)(bgStartY + backgroundHeight[array[1]] * num10 + 16 * num13 + num18)) + vector, (Rectangle?)new Rectangle(16 * num12 + num17 + num9 + 16, 16 * num13 + num18, width, height), color24);
69606 if (ugBackTransition > 0f)
69607 {
69608 Color color26 = color24;
69609 ((Color)(ref color26)).R = (byte)((float)(int)((Color)(ref color26)).R * ugBackTransition);
69610 ((Color)(ref color26)).G = (byte)((float)(int)((Color)(ref color26)).G * ugBackTransition);
69611 ((Color)(ref color26)).B = (byte)((float)(int)((Color)(ref color26)).B * ugBackTransition);
69612 ((Color)(ref color26)).A = (byte)((float)(int)((Color)(ref color26)).A * ugBackTransition);
69613 spriteBatch.Draw(TextureAssets.Background[array2[1]].Value, new Vector2((float)(bgStartX + num21 * n + 16 * num12 + num17 + num9), (float)(bgStartY + backgroundHeight[array2[1]] * num10 + 16 * num13 + num18)) + vector, (Rectangle?)new Rectangle(16 * num12 + num17 + num9 + 16, 16 * num13 + num18, width, height), color26);
69614 }
69615 }
69616 }
69617 catch
69618 {
69619 ((Color)(ref color23)).R = (byte)((float)(int)((Color)(ref color23)).R * num31);
69620 ((Color)(ref color23)).G = (byte)((float)(int)((Color)(ref color23)).G * num40);
69621 ((Color)(ref color23)).B = (byte)((float)(int)((Color)(ref color23)).B * num50);
69622 spriteBatch.Draw(TextureAssets.Background[array[1]].Value, new Vector2((float)(bgStartX + num21 * n + 16 * num12 + num9), (float)(bgStartY + backgroundHeight[array[1]] * num10 + 16 * num13)) + vector, (Rectangle?)new Rectangle(16 * num12 + num9 + 16, 16 * num13, 16, 16), color23);
69623 }
69624 }
69625 else if ((((Color)(ref color23)).R > num11 || (double)(int)((Color)(ref color23)).G > (double)num11 * 1.1 || (double)(int)((Color)(ref color23)).B > (double)num11 * 1.2) && ugBackTransition == 0f)
69626 {
69627 Lighting.GetColor4Slice(num14, num15, ref slices);
69628 for (int num19 = 0; num19 < 4; num19++)
69629 {
69630 int num20 = 0;
69631 int num22 = 0;
69632 Color color27 = color23;
69633 Color color28 = slices[num19];
69634 switch (num19)
69635 {
69636 case 1:
69637 num20 = 8;
69638 break;
69639 case 2:
69640 num22 = 8;
69641 break;
69642 case 3:
69643 num20 = 8;
69644 num22 = 8;
69645 break;
69646 }
69647 ((Color)(ref color27)).R = (byte)((((Color)(ref color23)).R + ((Color)(ref color28)).R) / 2);
69648 ((Color)(ref color27)).G = (byte)((((Color)(ref color23)).G + ((Color)(ref color28)).G) / 2);
69649 ((Color)(ref color27)).B = (byte)((((Color)(ref color23)).B + ((Color)(ref color28)).B) / 2);
69650 ((Color)(ref color27)).R = (byte)((float)(int)((Color)(ref color27)).R * num31);
69651 ((Color)(ref color27)).G = (byte)((float)(int)((Color)(ref color27)).G * num40);
69652 ((Color)(ref color27)).B = (byte)((float)(int)((Color)(ref color27)).B * num50);
69653 spriteBatch.Draw(TextureAssets.Background[array[1]].Value, new Vector2((float)(bgStartX + num21 * n + 16 * num12 + num20 + num9), (float)(bgStartY + backgroundHeight[array[1]] * num10 + 16 * num13 + num22)) + vector, (Rectangle?)new Rectangle(16 * num12 + num20 + num9 + 16, 16 * num13 + num22, 8, 8), color27);
69654 if (ugBackTransition > 0f)
69655 {
69656 Color color29 = color27;
69657 ((Color)(ref color29)).R = (byte)((float)(int)((Color)(ref color29)).R * ugBackTransition);
69658 ((Color)(ref color29)).G = (byte)((float)(int)((Color)(ref color29)).G * ugBackTransition);
69659 ((Color)(ref color29)).B = (byte)((float)(int)((Color)(ref color29)).B * ugBackTransition);
69660 ((Color)(ref color29)).A = (byte)((float)(int)((Color)(ref color29)).A * ugBackTransition);
69661 spriteBatch.Draw(TextureAssets.Background[array2[1]].Value, new Vector2((float)(bgStartX + num21 * n + 16 * num12 + num20 + num9), (float)(bgStartY + backgroundHeight[array2[1]] * num10 + 16 * num13 + num22)) + vector, (Rectangle?)new Rectangle(16 * num12 + num20 + num9 + 16, 16 * num13 + num22, 8, 8), color29);
69662 }
69663 }
69664 }
69665 else
69666 {
69667 ((Color)(ref color23)).R = (byte)((float)(int)((Color)(ref color23)).R * num31);
69668 ((Color)(ref color23)).G = (byte)((float)(int)((Color)(ref color23)).G * num40);
69669 ((Color)(ref color23)).B = (byte)((float)(int)((Color)(ref color23)).B * num50);
69670 spriteBatch.Draw(TextureAssets.Background[array[1]].Value, new Vector2((float)(bgStartX + num21 * n + 16 * num12 + num9), (float)(bgStartY + backgroundHeight[array[1]] * num10 + 16 * num13)) + vector, (Rectangle?)new Rectangle(16 * num12 + num9 + 16, 16 * num13, 16, 16), color23);
69671 if (ugBackTransition > 0f)
69672 {
69673 Color color2 = color23;
69674 ((Color)(ref color2)).R = (byte)((float)(int)((Color)(ref color2)).R * ugBackTransition);
69675 ((Color)(ref color2)).G = (byte)((float)(int)((Color)(ref color2)).G * ugBackTransition);
69676 ((Color)(ref color2)).B = (byte)((float)(int)((Color)(ref color2)).B * ugBackTransition);
69677 ((Color)(ref color2)).A = (byte)((float)(int)((Color)(ref color2)).A * ugBackTransition);
69678 spriteBatch.Draw(TextureAssets.Background[array2[1]].Value, new Vector2((float)(bgStartX + num21 * n + 16 * num12 + num9), (float)(bgStartY + backgroundHeight[array2[1]] * num10 + 16 * num13)) + vector, (Rectangle?)new Rectangle(16 * num12 + num9 + 16, 16 * num13, 16, 16), color2);
69679 }
69680 }
69681 }
69682 else
69683 {
69684 ((Color)(ref color23)).R = (byte)((float)(int)((Color)(ref color23)).R * num31);
69685 ((Color)(ref color23)).G = (byte)((float)(int)((Color)(ref color23)).G * num40);
69686 ((Color)(ref color23)).B = (byte)((float)(int)((Color)(ref color23)).B * num50);
69687 spriteBatch.Draw(TextureAssets.Background[array[1]].Value, new Vector2((float)(bgStartX + num21 * n + 16 * num12 + num9), (float)(bgStartY + backgroundHeight[array[1]] * num10 + 16 * num13)) + vector, (Rectangle?)new Rectangle(16 * num12 + num9 + 16, 16 * num13, 16, 16), color23);
69688 }
69689 }
69690 }
69691 }
69692 }
69693 if (ugBackTransition > 0f)
69694 {
69695 for (int num23 = 0; num23 < bgLoops; num23++)
69696 {
69697 for (int num24 = 0; num24 < bgLoopsY; num24++)
69698 {
69699 for (int num25 = 0; num25 < num21 / 16; num25++)
69700 {
69701 for (int num26 = 0; num26 < 6; num26++)
69702 {
69703 float num69 = bgStartY + num24 * 96 + num26 * 16 + 8;
69704 int num27 = (int)(((float)(bgStartX + num21 * num23 + num25 * 16 + 8) + screenPosition.X) / 16f);
69705 int num28 = (int)((num69 + screenPosition.Y) / 16f);
69706 Color color3 = Lighting.GetColor(num27, num28);
69707 if (tile[num27, num28] == null)
69708 {
69709 tile[num27, num28] = default(Tile);
69710 }
69711 if (((Color)(ref color3)).R > 0 || ((Color)(ref color3)).G > 0 || ((Color)(ref color3)).B > 0)
69712 {
69713 Lighting.GetCornerColors(num27, num28, out var vertices2, ugBackTransition);
69714 byte a = (byte)(255f * ugBackTransition);
69715 ((Color)(ref vertices2.BottomLeftColor)).A = a;
69716 ((Color)(ref vertices2.BottomRightColor)).A = a;
69717 ((Color)(ref vertices2.TopLeftColor)).A = a;
69718 ((Color)(ref vertices2.TopRightColor)).A = a;
69719 tileBatch.Draw(TextureAssets.Background[array2[1]].Value, new Vector2((float)(bgStartX + num21 * num23 + 16 * num25 + num9), (float)(bgStartY + backgroundHeight[array2[1]] * num24 + 16 * num26)) + vector, (Rectangle?)new Rectangle(16 * num25 + num9 + 16, 16 * num26, 16, 16), vertices2, Vector2.Zero, 1f, (SpriteEffects)0);
69720 }
69721 }
69722 }
69723 }
69724 }
69725 }
69726 if (flag2)
69727 {
69729 bgStartX = (int)(0.0 - Math.IEEERemainder((double)num21 + (double)screenPosition.X * bgParallax, num21) - (double)(num21 / 2)) - (int)vector.X;
69730 bgLoops = (screenWidth + (int)vector.X * 2) / num21 + 2;
69732 if (bgTopY > -32)
69733 {
69734 for (int num29 = 0; num29 < bgLoops; num29++)
69735 {
69736 for (int num30 = 0; num30 < num21 / 16; num30++)
69737 {
69738 float num70 = bgStartX + num21 * num29 + num30 * 16 + 8;
69739 float num32 = bgTopY;
69740 Color color4 = Lighting.GetColor((int)((num70 + screenPosition.X) / 16f), (int)((screenPosition.Y + num32) / 16f));
69741 ((Color)(ref color4)).R = (byte)((float)(int)((Color)(ref color4)).R * num31);
69742 ((Color)(ref color4)).G = (byte)((float)(int)((Color)(ref color4)).G * num40);
69743 ((Color)(ref color4)).B = (byte)((float)(int)((Color)(ref color4)).B * num50);
69744 spriteBatch.Draw(TextureAssets.Background[array[2]].Value, new Vector2((float)(bgStartX + num21 * num29 + 16 * num30 + num9), (float)bgTopY) + vector, (Rectangle?)new Rectangle(16 * num30 + num9 + 16, 0, 16, 16), color4);
69745 if (ugBackTransition > 0f)
69746 {
69747 Color color5 = color4;
69748 ((Color)(ref color5)).R = (byte)((float)(int)((Color)(ref color5)).R * ugBackTransition);
69749 ((Color)(ref color5)).G = (byte)((float)(int)((Color)(ref color5)).G * ugBackTransition);
69750 ((Color)(ref color5)).B = (byte)((float)(int)((Color)(ref color5)).B * ugBackTransition);
69751 ((Color)(ref color5)).A = (byte)((float)(int)((Color)(ref color5)).A * ugBackTransition);
69752 spriteBatch.Draw(TextureAssets.Background[array2[2]].Value, new Vector2((float)(bgStartX + num21 * num29 + 16 * num30 + num9), (float)bgTopY) + vector, (Rectangle?)new Rectangle(16 * num30 + num9 + 16, 0, 16, 16), color5);
69753 }
69754 }
69755 }
69756 }
69757 }
69758 }
69759 bgTopY = (int)((float)((int)rockLayer * 16) - screenPosition.Y + 16f + 600f - 8f);
69760 if (rockLayer * 16.0 <= (double)(screenPosition.Y + 600f))
69761 {
69763 bgStartX = (int)(0.0 - Math.IEEERemainder((double)num21 + (double)screenPosition.X * bgParallax, num21) - (double)(num21 / 2)) - (int)vector.X;
69764 bgLoops = (screenWidth + (int)vector.X * 2) / num21 + 2;
69765 if (rockLayer * 16.0 + (double)screenHeight < (double)(screenPosition.Y - 16f))
69766 {
69767 bgStartY = (int)(Math.IEEERemainder(bgTopY, backgroundHeight[3]) - (double)backgroundHeight[3]);
69768 bgLoopsY = (screenHeight - bgStartY + (int)vector.Y * 2) / backgroundHeight[2] + 1;
69769 }
69770 else
69771 {
69772 bgStartY = bgTopY;
69773 bgLoopsY = (screenHeight - bgTopY + (int)vector.Y * 2) / backgroundHeight[2] + 1;
69774 }
69775 if (num7 * 16.0 < (double)(screenPosition.Y + 600f))
69776 {
69777 bgLoopsY = (int)(num7 * 16.0 - (double)screenPosition.Y + 600.0 - (double)bgStartY) / backgroundHeight[2];
69778 flag = true;
69779 }
69780 int num33 = (int)(float)Math.Round(0f - (float)Math.IEEERemainder((float)bgStartX + screenPosition.X, 16.0));
69781 if (num33 == -8)
69782 {
69783 num33 = 8;
69784 }
69785 for (int num34 = 0; num34 < bgLoops; num34++)
69786 {
69787 for (int num35 = 0; num35 < bgLoopsY; num35++)
69788 {
69789 for (int num36 = 0; num36 < num21 / 16; num36++)
69790 {
69791 for (int num37 = 0; num37 < 6; num37++)
69792 {
69793 float num71 = bgStartY + num35 * 96 + num37 * 16 + 8;
69794 int num38 = (int)(((float)(bgStartX + num21 * num34 + num36 * 16 + 8) + screenPosition.X) / 16f);
69795 int num39 = (int)((num71 + screenPosition.Y) / 16f);
69796 Color color6 = Lighting.GetColor(num38, num39);
69797 if ((!ShouldDrawBackgroundTileAt(num38, num39) && ((Color)(ref color6)).R != 0 && ((Color)(ref color6)).G != 0 && ((Color)(ref color6)).B != 0) || (((Color)(ref color6)).R <= 0 && ((Color)(ref color6)).G <= 0 && ((Color)(ref color6)).B <= 0) || (!WallLightAt(num38, num39) && caveParallax == 0f))
69798 {
69799 continue;
69800 }
69801 if (Lighting.NotRetro && ((Color)(ref color6)).R < 230 && ((Color)(ref color6)).G < 230 && ((Color)(ref color6)).B < 230 && ugBackTransition == 0f)
69802 {
69803 if ((((Color)(ref color6)).R > num || (double)(int)((Color)(ref color6)).G > (double)num * 1.1 || (double)(int)((Color)(ref color6)).B > (double)num * 1.2) && !tile[num38, num39].active())
69804 {
69805 Lighting.GetColor9Slice(num38, num39, ref slices);
69806 for (int num41 = 0; num41 < 9; num41++)
69807 {
69808 int num42 = 0;
69809 int num43 = 0;
69810 int width2 = 4;
69811 int height2 = 4;
69812 Color color7 = color6;
69813 Color color8 = color6;
69814 switch (num41)
69815 {
69816 case 0:
69817 if (!tile[num38 - 1, num39 - 1].active())
69818 {
69819 color8 = slices[num41];
69820 }
69821 break;
69822 case 1:
69823 width2 = 8;
69824 num42 = 4;
69825 if (!tile[num38, num39 - 1].active())
69826 {
69827 color8 = slices[num41];
69828 }
69829 break;
69830 case 2:
69831 num42 = 12;
69832 if (!tile[num38 + 1, num39 - 1].active())
69833 {
69834 color8 = slices[num41];
69835 }
69836 break;
69837 case 3:
69838 height2 = 8;
69839 num43 = 4;
69840 if (!tile[num38 - 1, num39].active())
69841 {
69842 color8 = slices[num41];
69843 }
69844 break;
69845 case 4:
69846 width2 = 8;
69847 height2 = 8;
69848 num42 = 4;
69849 num43 = 4;
69850 break;
69851 case 5:
69852 num42 = 12;
69853 num43 = 4;
69854 height2 = 8;
69855 if (!tile[num38 + 1, num39].active())
69856 {
69857 color8 = slices[num41];
69858 }
69859 break;
69860 case 6:
69861 num43 = 12;
69862 if (!tile[num38 - 1, num39 + 1].active())
69863 {
69864 color8 = slices[num41];
69865 }
69866 break;
69867 case 7:
69868 width2 = 8;
69869 height2 = 4;
69870 num42 = 4;
69871 num43 = 12;
69872 if (!tile[num38, num39 + 1].active())
69873 {
69874 color8 = slices[num41];
69875 }
69876 break;
69877 case 8:
69878 num42 = 12;
69879 num43 = 12;
69880 if (!tile[num38 + 1, num39 + 1].active())
69881 {
69882 color8 = slices[num41];
69883 }
69884 break;
69885 }
69886 ((Color)(ref color7)).R = (byte)((((Color)(ref color6)).R + ((Color)(ref color8)).R) / 2);
69887 ((Color)(ref color7)).G = (byte)((((Color)(ref color6)).G + ((Color)(ref color8)).G) / 2);
69888 ((Color)(ref color7)).B = (byte)((((Color)(ref color6)).B + ((Color)(ref color8)).B) / 2);
69889 ((Color)(ref color7)).R = (byte)((float)(int)((Color)(ref color7)).R * num31);
69890 ((Color)(ref color7)).G = (byte)((float)(int)((Color)(ref color7)).G * num40);
69891 ((Color)(ref color7)).B = (byte)((float)(int)((Color)(ref color7)).B * num50);
69892 spriteBatch.Draw(TextureAssets.Background[array[3]].Value, new Vector2((float)(bgStartX + num21 * num34 + 16 * num36 + num42 + num33), (float)(bgStartY + backgroundHeight[array[3]] * num35 + 16 * num37 + num43)) + vector, (Rectangle?)new Rectangle(16 * num36 + num42 + num33 + 16, 16 * num37 + num43, width2, height2), color7);
69893 if (ugBackTransition > 0f)
69894 {
69895 Color color9 = color7;
69896 ((Color)(ref color9)).R = (byte)((float)(int)((Color)(ref color9)).R * ugBackTransition);
69897 ((Color)(ref color9)).G = (byte)((float)(int)((Color)(ref color9)).G * ugBackTransition);
69898 ((Color)(ref color9)).B = (byte)((float)(int)((Color)(ref color9)).B * ugBackTransition);
69899 ((Color)(ref color9)).A = (byte)((float)(int)((Color)(ref color9)).A * ugBackTransition);
69900 spriteBatch.Draw(TextureAssets.Background[array2[3]].Value, new Vector2((float)(bgStartX + num21 * num34 + 16 * num36 + num42 + num33), (float)(bgStartY + backgroundHeight[array2[3]] * num35 + 16 * num37 + num43)) + vector, (Rectangle?)new Rectangle(16 * num36 + num42 + num33 + 16, 16 * num37 + num43, width2, height2), color9);
69901 }
69902 }
69903 }
69904 else if (((Color)(ref color6)).R > num11 || (double)(int)((Color)(ref color6)).G > (double)num11 * 1.1 || (double)(int)((Color)(ref color6)).B > (double)num11 * 1.2)
69905 {
69906 Lighting.GetColor4Slice(num38, num39, ref slices);
69907 for (int num44 = 0; num44 < 4; num44++)
69908 {
69909 int num45 = 0;
69910 int num46 = 0;
69911 Color color10 = color6;
69912 Color color11 = slices[num44];
69913 switch (num44)
69914 {
69915 case 1:
69916 num45 = 8;
69917 break;
69918 case 2:
69919 num46 = 8;
69920 break;
69921 case 3:
69922 num45 = 8;
69923 num46 = 8;
69924 break;
69925 }
69926 ((Color)(ref color10)).R = (byte)((((Color)(ref color6)).R + ((Color)(ref color11)).R) / 2);
69927 ((Color)(ref color10)).G = (byte)((((Color)(ref color6)).G + ((Color)(ref color11)).G) / 2);
69928 ((Color)(ref color10)).B = (byte)((((Color)(ref color6)).B + ((Color)(ref color11)).B) / 2);
69929 ((Color)(ref color10)).R = (byte)((float)(int)((Color)(ref color10)).R * num31);
69930 ((Color)(ref color10)).G = (byte)((float)(int)((Color)(ref color10)).G * num40);
69931 ((Color)(ref color10)).B = (byte)((float)(int)((Color)(ref color10)).B * num50);
69932 spriteBatch.Draw(TextureAssets.Background[array[3]].Value, new Vector2((float)(bgStartX + num21 * num34 + 16 * num36 + num45 + num33), (float)(bgStartY + backgroundHeight[array[3]] * num35 + 16 * num37 + num46)) + vector, (Rectangle?)new Rectangle(16 * num36 + num45 + num33 + 16, 16 * num37 + num46, 8, 8), color10);
69933 if (ugBackTransition > 0f)
69934 {
69935 Color color13 = color10;
69936 ((Color)(ref color13)).R = (byte)((float)(int)((Color)(ref color13)).R * ugBackTransition);
69937 ((Color)(ref color13)).G = (byte)((float)(int)((Color)(ref color13)).G * ugBackTransition);
69938 ((Color)(ref color13)).B = (byte)((float)(int)((Color)(ref color13)).B * ugBackTransition);
69939 ((Color)(ref color13)).A = (byte)((float)(int)((Color)(ref color13)).A * ugBackTransition);
69940 spriteBatch.Draw(TextureAssets.Background[array2[3]].Value, new Vector2((float)(bgStartX + num21 * num34 + 16 * num36 + num45 + num33), (float)(bgStartY + backgroundHeight[array2[3]] * num35 + 16 * num37 + num46)) + vector, (Rectangle?)new Rectangle(16 * num36 + num45 + num33 + 16, 16 * num37 + num46, 8, 8), color13);
69941 }
69942 }
69943 }
69944 else
69945 {
69946 ((Color)(ref color6)).R = (byte)((float)(int)((Color)(ref color6)).R * num31);
69947 ((Color)(ref color6)).G = (byte)((float)(int)((Color)(ref color6)).G * num40);
69948 ((Color)(ref color6)).B = (byte)((float)(int)((Color)(ref color6)).B * num50);
69949 spriteBatch.Draw(TextureAssets.Background[array[3]].Value, new Vector2((float)(bgStartX + num21 * num34 + 16 * num36 + num33), (float)(bgStartY + backgroundHeight[array[3]] * num35 + 16 * num37)) + vector, (Rectangle?)new Rectangle(16 * num36 + num33 + 16, 16 * num37, 16, 16), color6);
69950 if (ugBackTransition > 0f)
69951 {
69952 Color color14 = color6;
69953 ((Color)(ref color14)).R = (byte)((float)(int)((Color)(ref color14)).R * ugBackTransition);
69954 ((Color)(ref color14)).G = (byte)((float)(int)((Color)(ref color14)).G * ugBackTransition);
69955 ((Color)(ref color14)).B = (byte)((float)(int)((Color)(ref color14)).B * ugBackTransition);
69956 ((Color)(ref color14)).A = (byte)((float)(int)((Color)(ref color14)).A * ugBackTransition);
69957 spriteBatch.Draw(TextureAssets.Background[array2[3]].Value, new Vector2((float)(bgStartX + num21 * num34 + 16 * num36 + num33), (float)(bgStartY + backgroundHeight[array2[3]] * num35 + 16 * num37)) + vector, (Rectangle?)new Rectangle(16 * num36 + num33 + 16, 16 * num37, 16, 16), color14);
69958 }
69959 }
69960 }
69961 else
69962 {
69963 ((Color)(ref color6)).R = (byte)((float)(int)((Color)(ref color6)).R * num31);
69964 ((Color)(ref color6)).G = (byte)((float)(int)((Color)(ref color6)).G * num40);
69965 ((Color)(ref color6)).B = (byte)((float)(int)((Color)(ref color6)).B * num50);
69966 spriteBatch.Draw(TextureAssets.Background[array[3]].Value, new Vector2((float)(bgStartX + num21 * num34 + 16 * num36 + num33), (float)(bgStartY + backgroundHeight[array[3]] * num35 + 16 * num37)) + vector, (Rectangle?)new Rectangle(16 * num36 + num33 + 16, 16 * num37, 16, 16), color6);
69967 if (ugBackTransition > 0f)
69968 {
69969 Color color15 = color6;
69970 ((Color)(ref color15)).R = (byte)((float)(int)((Color)(ref color15)).R * ugBackTransition);
69971 ((Color)(ref color15)).G = (byte)((float)(int)((Color)(ref color15)).G * ugBackTransition);
69972 ((Color)(ref color15)).B = (byte)((float)(int)((Color)(ref color15)).B * ugBackTransition);
69973 ((Color)(ref color15)).A = (byte)((float)(int)((Color)(ref color15)).A * ugBackTransition);
69974 spriteBatch.Draw(TextureAssets.Background[array2[3]].Value, new Vector2((float)(bgStartX + num21 * num34 + 16 * num36 + num33), (float)(bgStartY + backgroundHeight[array2[3]] * num35 + 16 * num37)) + vector, (Rectangle?)new Rectangle(16 * num36 + num33 + 16, 16 * num37, 16, 16), color15);
69975 }
69976 }
69977 }
69978 }
69979 }
69980 }
69981 num21 = 128;
69982 if (flag)
69983 {
69985 bgStartX = (int)(0.0 - Math.IEEERemainder((double)num21 + (double)screenPosition.X * bgParallax, num21) - (double)(num21 / 2)) - (int)vector.X;
69986 bgLoops = (screenWidth + (int)vector.X * 2) / num21 + 2;
69988 for (int num47 = 0; num47 < bgLoops; num47++)
69989 {
69990 for (int num48 = 0; num48 < num21 / 16; num48++)
69991 {
69992 float num72 = bgStartX + num21 * num47 + num48 * 16 + 8;
69993 float num49 = bgTopY;
69994 Color color16 = Lighting.GetColor((int)((num72 + screenPosition.X) / 16f), (int)((screenPosition.Y + num49) / 16f));
69995 ((Color)(ref color16)).R = (byte)((float)(int)((Color)(ref color16)).R * num31);
69996 ((Color)(ref color16)).G = (byte)((float)(int)((Color)(ref color16)).G * num40);
69997 ((Color)(ref color16)).B = (byte)((float)(int)((Color)(ref color16)).B * num50);
69998 spriteBatch.Draw(TextureAssets.Background[array[4]].Value, new Vector2((float)(bgStartX + num21 * num47 + 16 * num48 + num33), (float)bgTopY) + vector, (Rectangle?)new Rectangle(16 * num48 + num33 + 16, magmaBGFrame * 16, 16, 16), color16);
69999 if (ugBackTransition > 0f)
70000 {
70001 Color color17 = color16;
70002 ((Color)(ref color17)).R = (byte)((float)(int)((Color)(ref color17)).R * ugBackTransition);
70003 ((Color)(ref color17)).G = (byte)((float)(int)((Color)(ref color17)).G * ugBackTransition);
70004 ((Color)(ref color17)).B = (byte)((float)(int)((Color)(ref color17)).B * ugBackTransition);
70005 ((Color)(ref color17)).A = (byte)((float)(int)((Color)(ref color17)).A * ugBackTransition);
70006 spriteBatch.Draw(TextureAssets.Background[array2[4]].Value, new Vector2((float)(bgStartX + num21 * num47 + 16 * num48 + num33), (float)bgTopY) + vector, (Rectangle?)new Rectangle(16 * num48 + num33 + 16, magmaBGFrame * 16, 16, 16), color17);
70007 }
70008 }
70009 }
70010 }
70011 }
70012 bgTopY = (int)((float)((int)num7 * 16) - screenPosition.Y + 16f + 600f) - 8;
70013 if (num7 * 16.0 <= (double)(screenPosition.Y + 600f))
70014 {
70015 bgStartX = (int)(0.0 - Math.IEEERemainder((double)num21 + (double)screenPosition.X * bgParallax, num21) - (double)(num21 / 2)) - (int)vector.X;
70016 bgLoops = (screenWidth + (int)vector.X * 2) / num21 + 2;
70017 if (num7 * 16.0 + (double)screenHeight < (double)(screenPosition.Y - 16f))
70018 {
70019 bgStartY = (int)(Math.IEEERemainder(bgTopY, backgroundHeight[2]) - (double)backgroundHeight[2]);
70020 bgLoopsY = (screenHeight - bgStartY + (int)vector.Y * 2) / backgroundHeight[2] + 1;
70021 }
70022 else
70023 {
70024 bgStartY = bgTopY;
70025 bgLoopsY = (screenHeight - bgTopY + (int)vector.Y * 2) / backgroundHeight[2] + 1;
70026 }
70027 num = (int)((double)num * 1.5);
70028 num11 = (int)((double)num11 * 1.5);
70029 int num51 = (int)(float)Math.Round(0f - (float)Math.IEEERemainder((float)bgStartX + screenPosition.X, 16.0));
70030 if (num51 == -8)
70031 {
70032 num51 = 8;
70033 }
70034 for (int num52 = 0; num52 < bgLoops; num52++)
70035 {
70036 for (int num53 = 0; num53 < bgLoopsY; num53++)
70037 {
70038 for (int num54 = 0; num54 < num21 / 16; num54++)
70039 {
70040 for (int num55 = 0; num55 < 6; num55++)
70041 {
70042 float num73 = bgStartY + num53 * 96 + num55 * 16 + 8;
70043 int num56 = (int)(((float)(bgStartX + num21 * num52 + num54 * 16 + 8) + screenPosition.X) / 16f);
70044 int num57 = (int)((num73 + screenPosition.Y) / 16f);
70045 Color color18 = Lighting.GetColor(num56, num57);
70046 if ((!ShouldDrawBackgroundTileAt(num56, num57) && ((Color)(ref color18)).R != 0 && ((Color)(ref color18)).G != 0 && ((Color)(ref color18)).B != 0) || (((Color)(ref color18)).R <= 0 && ((Color)(ref color18)).G <= 0 && ((Color)(ref color18)).B <= 0) || (!WallLightAt(num56, num57) && caveParallax == 0f))
70047 {
70048 continue;
70049 }
70050 if (Lighting.NotRetro && ((Color)(ref color18)).R < 230 && ((Color)(ref color18)).G < 230 && ((Color)(ref color18)).B < 230)
70051 {
70052 if ((((Color)(ref color18)).R > num || (double)(int)((Color)(ref color18)).G > (double)num * 1.1 || (double)(int)((Color)(ref color18)).B > (double)num * 1.2) && !tile[num56, num57].active())
70053 {
70054 Lighting.GetColor9Slice(num56, num57, ref slices);
70055 for (int num58 = 0; num58 < 9; num58++)
70056 {
70057 int num59 = 0;
70058 int num61 = 0;
70059 int width3 = 4;
70060 int height3 = 4;
70061 Color color19 = color18;
70062 Color color20 = color18;
70063 switch (num58)
70064 {
70065 case 0:
70066 if (!tile[num56 - 1, num57 - 1].active())
70067 {
70068 color20 = slices[num58];
70069 }
70070 break;
70071 case 1:
70072 width3 = 8;
70073 num59 = 4;
70074 if (!tile[num56, num57 - 1].active())
70075 {
70076 color20 = slices[num58];
70077 }
70078 break;
70079 case 2:
70080 num59 = 12;
70081 if (!tile[num56 + 1, num57 - 1].active())
70082 {
70083 color20 = slices[num58];
70084 }
70085 break;
70086 case 3:
70087 height3 = 8;
70088 num61 = 4;
70089 if (!tile[num56 - 1, num57].active())
70090 {
70091 color20 = slices[num58];
70092 }
70093 break;
70094 case 4:
70095 width3 = 8;
70096 height3 = 8;
70097 num59 = 4;
70098 num61 = 4;
70099 break;
70100 case 5:
70101 num59 = 12;
70102 num61 = 4;
70103 height3 = 8;
70104 if (!tile[num56 + 1, num57].active())
70105 {
70106 color20 = slices[num58];
70107 }
70108 break;
70109 case 6:
70110 num61 = 12;
70111 if (!tile[num56 - 1, num57 + 1].active())
70112 {
70113 color20 = slices[num58];
70114 }
70115 break;
70116 case 7:
70117 width3 = 8;
70118 height3 = 4;
70119 num59 = 4;
70120 num61 = 12;
70121 if (!tile[num56, num57 + 1].active())
70122 {
70123 color20 = slices[num58];
70124 }
70125 break;
70126 case 8:
70127 num59 = 12;
70128 num61 = 12;
70129 if (!tile[num56 + 1, num57 + 1].active())
70130 {
70131 color20 = slices[num58];
70132 }
70133 break;
70134 }
70135 ((Color)(ref color19)).R = (byte)((((Color)(ref color18)).R + ((Color)(ref color20)).R) / 2);
70136 ((Color)(ref color19)).G = (byte)((((Color)(ref color18)).G + ((Color)(ref color20)).G) / 2);
70137 ((Color)(ref color19)).B = (byte)((((Color)(ref color18)).B + ((Color)(ref color20)).B) / 2);
70138 ((Color)(ref color19)).R = (byte)((float)(int)((Color)(ref color19)).R * num31);
70139 ((Color)(ref color19)).G = (byte)((float)(int)((Color)(ref color19)).G * num40);
70140 ((Color)(ref color19)).B = (byte)((float)(int)((Color)(ref color19)).B * num50);
70141 spriteBatch.Draw(TextureAssets.Background[array[5]].Value, new Vector2((float)(bgStartX + num21 * num52 + 16 * num54 + num59 + num51), (float)(bgStartY + backgroundHeight[2] * num53 + 16 * num55 + num61)) + vector, (Rectangle?)new Rectangle(16 * num54 + num59 + num51 + 16, 16 * num55 + backgroundHeight[2] * magmaBGFrame + num61, width3, height3), color19, 0f, default(Vector2), 1f, (SpriteEffects)0, 0f);
70142 }
70143 }
70144 else if (((Color)(ref color18)).R > num11 || (double)(int)((Color)(ref color18)).G > (double)num11 * 1.1 || (double)(int)((Color)(ref color18)).B > (double)num11 * 1.2)
70145 {
70146 Lighting.GetColor4Slice(num56, num57, ref slices);
70147 for (int num62 = 0; num62 < 4; num62++)
70148 {
70149 int num63 = 0;
70150 int num64 = 0;
70151 Color color21 = color18;
70152 Color color22 = slices[num62];
70153 switch (num62)
70154 {
70155 case 1:
70156 num63 = 8;
70157 break;
70158 case 2:
70159 num64 = 8;
70160 break;
70161 case 3:
70162 num63 = 8;
70163 num64 = 8;
70164 break;
70165 }
70166 ((Color)(ref color21)).R = (byte)((((Color)(ref color18)).R + ((Color)(ref color22)).R) / 2);
70167 ((Color)(ref color21)).G = (byte)((((Color)(ref color18)).G + ((Color)(ref color22)).G) / 2);
70168 ((Color)(ref color21)).B = (byte)((((Color)(ref color18)).B + ((Color)(ref color22)).B) / 2);
70169 ((Color)(ref color21)).R = (byte)((float)(int)((Color)(ref color21)).R * num31);
70170 ((Color)(ref color21)).G = (byte)((float)(int)((Color)(ref color21)).G * num40);
70171 ((Color)(ref color21)).B = (byte)((float)(int)((Color)(ref color21)).B * num50);
70172 spriteBatch.Draw(TextureAssets.Background[array[5]].Value, new Vector2((float)(bgStartX + num21 * num52 + 16 * num54 + num63 + num51), (float)(bgStartY + backgroundHeight[2] * num53 + 16 * num55 + num64)) + vector, (Rectangle?)new Rectangle(16 * num54 + num63 + num51 + 16, 16 * num55 + backgroundHeight[2] * magmaBGFrame + num64, 8, 8), color21, 0f, default(Vector2), 1f, (SpriteEffects)0, 0f);
70173 }
70174 }
70175 else
70176 {
70177 ((Color)(ref color18)).R = (byte)((float)(int)((Color)(ref color18)).R * num31);
70178 ((Color)(ref color18)).G = (byte)((float)(int)((Color)(ref color18)).G * num40);
70179 ((Color)(ref color18)).B = (byte)((float)(int)((Color)(ref color18)).B * num50);
70180 spriteBatch.Draw(TextureAssets.Background[array[5]].Value, new Vector2((float)(bgStartX + num21 * num52 + 16 * num54 + num51), (float)(bgStartY + backgroundHeight[2] * num53 + 16 * num55)) + vector, (Rectangle?)new Rectangle(16 * num54 + num51 + 16, 16 * num55 + backgroundHeight[2] * magmaBGFrame, 16, 16), color18, 0f, default(Vector2), 1f, (SpriteEffects)0, 0f);
70181 }
70182 }
70183 else
70184 {
70185 ((Color)(ref color18)).R = (byte)((float)(int)((Color)(ref color18)).R * num31);
70186 ((Color)(ref color18)).G = (byte)((float)(int)((Color)(ref color18)).G * num40);
70187 ((Color)(ref color18)).B = (byte)((float)(int)((Color)(ref color18)).B * num50);
70188 spriteBatch.Draw(TextureAssets.Background[array[5]].Value, new Vector2((float)(bgStartX + num21 * num52 + 16 * num54 + num51), (float)(bgStartY + backgroundHeight[2] * num53 + 16 * num55)) + vector, (Rectangle?)new Rectangle(16 * num54 + num51 + 16, 16 * num55 + backgroundHeight[2] * magmaBGFrame, 16, 16), color18, 0f, default(Vector2), 1f, (SpriteEffects)0, 0f);
70189 }
70190 }
70191 }
70192 }
70193 }
70194 }
70195 Lighting.GlobalBrightness = globalBrightness;
70196 TimeLogger.DrawTime(3, stopwatch.Elapsed.TotalMilliseconds);
70197 }
static Asset< Texture2D >[] Background
static SceneMetrics SceneMetrics
Definition Main.cs:1441
double bgParallax
Definition Main.cs:1025
static int maxTilesY
The height of the currently-loaded world in tiles.
Definition Main.cs:1191
void LoadBackground(int i)
Definition Main.cs:75357
static SpriteBatch spriteBatch
Definition Main.cs:1043
static double worldSurface
The y-coordinate of the top of the dirt layer, in tile coordinates. Corresponds to 0' on the Depth Me...
Definition Main.cs:1351
static float gfxQuality
Definition Main.cs:1125
static bool WallLightAt(int i, int j)
Definition Main.cs:70227
static double rockLayer
The y-coordinate of the top of the caverns layer, in tile coordinates.
Definition Main.cs:1357
static bool drawToScreen
Definition Main.cs:628
static int magmaBGFrame
Definition Main.cs:1165
static int oldUndergroundBackground
Definition Main.cs:586
static int[] caveBackStyle
Definition Main.cs:702
static float ugBackTransition
Definition Main.cs:1343
static int screenHeight
Definition Main.cs:1870
static Vector2 screenPosition
The position of the top left corner of the screen in world coordinates. Modify in M:Terraria....
Definition Main.cs:1864
static int undergroundBackground
Definition Main.cs:584
static int offScreenRange
Definition Main.cs:905
int bgLoops
Definition Main.cs:1029
static int hellBackStyle
Definition Main.cs:706
int bgLoopsY
Definition Main.cs:1033
static TileBatch tileBatch
Definition Main.cs:1045
static int jungleBackStyle
Definition Main.cs:708
int bgStartX
Definition Main.cs:1027
int bgStartY
Definition Main.cs:1031
static int[] backgroundHeight
Definition Main.cs:1812
static float caveParallax
Definition Main.cs:1291
static int screenWidth
Definition Main.cs:1868
static int iceBackStyle
Definition Main.cs:704
static bool ShouldDrawBackgroundTileAt(int i, int j)
Definition Main.cs:70199
static Tilemap tile
Definition Main.cs:1820
static int[] caveBackX
Definition Main.cs:700

References Terraria.GameContent.TextureAssets.Background, Terraria.Main.backgroundHeight, Terraria.Main.bgLoops, Terraria.Main.bgLoopsY, Terraria.Main.bgParallax, Terraria.Main.bgStartX, Terraria.Main.bgStartY, Terraria.Main.bgTopY, Terraria.SceneMetrics.BloodTileCount, Terraria.Main.caveBackStyle, Terraria.Main.caveBackX, Terraria.Main.caveParallax, Terraria.Graphics.Light.Color, Terraria.TimeLogger.DrawTime(), Terraria.Main.drawToScreen, Terraria.SceneMetrics.EnoughTilesForGlowingMushroom, Terraria.SceneMetrics.EvilTileCount, Terraria.Lighting.GetColor(), Terraria.Lighting.GetColor4Slice(), Terraria.Lighting.GetColor9Slice(), Terraria.Lighting.GetCornerColors(), Terraria.Main.gfxQuality, Terraria.Lighting.GlobalBrightness, Terraria.Main.hellBackStyle, Terraria.SceneMetrics.HolyTileCount, Terraria.Main.iceBackStyle, Terraria.Main.jungleBackStyle, Terraria.SceneMetrics.JungleTileCount, Terraria.SceneMetrics.JungleTileThreshold, Terraria.Main.LoadBackground(), Terraria.Main.magmaBGFrame, Terraria.Main.maxTilesY, Terraria.Lighting.NotRetro, Terraria.Main.offScreenRange, Terraria.Main.oldUndergroundBackground, Terraria.Main.rockLayer, Terraria.Main.screenHeight, Terraria.Main.screenPosition, Terraria.Main.screenWidth, Terraria.Main.ShouldDrawBackgroundTileAt(), Terraria.SceneMetrics.SnowTileCount, Terraria.SceneMetrics.SnowTileThreshold, Terraria.Main.spriteBatch, Terraria.Main.tile, Terraria.Main.tileBatch, Terraria.Main.ugBackTransition, Terraria.Main.undergroundBackground, Terraria.Main.WallLightAt(), and Terraria.Main.worldSurface.

Referenced by Terraria.Main.DrawBackground().

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