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

◆ DrawUnderworldBackgroudLayer()

static void Terraria.Main.DrawUnderworldBackgroudLayer ( bool flat,
Vector2 screenOffset,
float pushUp,
int layerTextureIndex )
inlinestaticprivate

Definition at line 67108 of file Main.cs.

67109 {
67110 //IL_003e: Unknown result type (might be due to invalid IL or missing references)
67111 //IL_0048: Unknown result type (might be due to invalid IL or missing references)
67112 //IL_004d: Unknown result type (might be due to invalid IL or missing references)
67113 //IL_008f: Unknown result type (might be due to invalid IL or missing references)
67114 //IL_0094: Unknown result type (might be due to invalid IL or missing references)
67115 //IL_011b: Unknown result type (might be due to invalid IL or missing references)
67116 //IL_0121: Unknown result type (might be due to invalid IL or missing references)
67117 //IL_0126: Unknown result type (might be due to invalid IL or missing references)
67118 //IL_01d6: Unknown result type (might be due to invalid IL or missing references)
67119 //IL_01dc: Unknown result type (might be due to invalid IL or missing references)
67120 //IL_01e1: Unknown result type (might be due to invalid IL or missing references)
67121 //IL_0246: Unknown result type (might be due to invalid IL or missing references)
67122 //IL_024c: Unknown result type (might be due to invalid IL or missing references)
67123 //IL_0251: Unknown result type (might be due to invalid IL or missing references)
67124 //IL_02c6: Unknown result type (might be due to invalid IL or missing references)
67125 //IL_02cc: Unknown result type (might be due to invalid IL or missing references)
67126 //IL_02d1: Unknown result type (might be due to invalid IL or missing references)
67127 //IL_03ae: Unknown result type (might be due to invalid IL or missing references)
67128 //IL_03b4: Unknown result type (might be due to invalid IL or missing references)
67129 //IL_03b9: Unknown result type (might be due to invalid IL or missing references)
67130 //IL_03c7: Unknown result type (might be due to invalid IL or missing references)
67131 //IL_03ca: Unknown result type (might be due to invalid IL or missing references)
67132 //IL_03cf: Unknown result type (might be due to invalid IL or missing references)
67133 //IL_03df: Unknown result type (might be due to invalid IL or missing references)
67134 //IL_0424: Unknown result type (might be due to invalid IL or missing references)
67135 //IL_042f: Unknown result type (might be due to invalid IL or missing references)
67136 //IL_0435: Unknown result type (might be due to invalid IL or missing references)
67137 //IL_043d: Unknown result type (might be due to invalid IL or missing references)
67138 //IL_0444: Unknown result type (might be due to invalid IL or missing references)
67139 //IL_045d: Unknown result type (might be due to invalid IL or missing references)
67140 //IL_045e: Unknown result type (might be due to invalid IL or missing references)
67141 //IL_0463: Unknown result type (might be due to invalid IL or missing references)
67142 //IL_0478: Unknown result type (might be due to invalid IL or missing references)
67143 //IL_0482: Unknown result type (might be due to invalid IL or missing references)
67144 //IL_04a2: Unknown result type (might be due to invalid IL or missing references)
67145 //IL_04a7: Unknown result type (might be due to invalid IL or missing references)
67146 //IL_04a8: Unknown result type (might be due to invalid IL or missing references)
67147 //IL_04ad: Unknown result type (might be due to invalid IL or missing references)
67148 //IL_04ae: Unknown result type (might be due to invalid IL or missing references)
67149 //IL_04b3: Unknown result type (might be due to invalid IL or missing references)
67150 //IL_04b5: Unknown result type (might be due to invalid IL or missing references)
67151 //IL_04ba: Unknown result type (might be due to invalid IL or missing references)
67152 //IL_04bb: Unknown result type (might be due to invalid IL or missing references)
67153 //IL_04c0: Unknown result type (might be due to invalid IL or missing references)
67154 //IL_04c5: Unknown result type (might be due to invalid IL or missing references)
67155 //IL_04ca: Unknown result type (might be due to invalid IL or missing references)
67156 //IL_04cb: Unknown result type (might be due to invalid IL or missing references)
67157 //IL_04d0: Unknown result type (might be due to invalid IL or missing references)
67158 //IL_04d2: Unknown result type (might be due to invalid IL or missing references)
67159 //IL_04d7: Unknown result type (might be due to invalid IL or missing references)
67160 //IL_04d9: Unknown result type (might be due to invalid IL or missing references)
67161 //IL_04db: Unknown result type (might be due to invalid IL or missing references)
67162 //IL_04e0: Unknown result type (might be due to invalid IL or missing references)
67163 //IL_040d: Unknown result type (might be due to invalid IL or missing references)
67164 //IL_04f7: Unknown result type (might be due to invalid IL or missing references)
67165 //IL_0519: Unknown result type (might be due to invalid IL or missing references)
67166 //IL_051b: Unknown result type (might be due to invalid IL or missing references)
67167 //IL_0522: Unknown result type (might be due to invalid IL or missing references)
67168 //IL_052c: Unknown result type (might be due to invalid IL or missing references)
67169 //IL_0541: Unknown result type (might be due to invalid IL or missing references)
67170 //IL_0548: Unknown result type (might be due to invalid IL or missing references)
67171 //IL_0566: Unknown result type (might be due to invalid IL or missing references)
67172 //IL_0570: Unknown result type (might be due to invalid IL or missing references)
67173 //IL_058a: Unknown result type (might be due to invalid IL or missing references)
67174 //IL_0593: Unknown result type (might be due to invalid IL or missing references)
67177 if (!asset.IsLoaded)
67178 {
67179 Assets.Request<Texture2D>(asset.Name);
67180 }
67181 Texture2D value = asset.Value;
67182 Vector2 vec = new Vector2((float)value.Width, (float)value.Height) * 0.5f;
67183 float num7 = (flat ? 1f : ((float)(layerTextureIndex * 2) + 3f));
67184 Vector2 vector = default(Vector2);
67185 ((Vector2)(ref vector))._002Ector(1f / num7);
67186 Rectangle value2 = default(Rectangle);
67187 ((Rectangle)(ref value2))._002Ector(0, 0, value.Width, value.Height);
67188 float num8 = 1.3f;
67189 Vector2 zero = Vector2.Zero;
67190 int num9 = 0;
67191 switch (num)
67192 {
67193 case 1:
67194 {
67195 int num14 = (int)(GlobalTimeWrappedHourly * 8f) % 4;
67196 ((Rectangle)(ref value2))._002Ector((num14 >> 1) * (value.Width >> 1), num14 % 2 * (value.Height >> 1), value.Width >> 1, value.Height >> 1);
67197 vec *= 0.5f;
67198 zero.Y += 175f;
67199 break;
67200 }
67201 case 2:
67202 zero.Y += 100f;
67203 break;
67204 case 3:
67205 zero.Y += 75f;
67206 break;
67207 case 4:
67208 num8 = 0.5f;
67209 zero.Y -= 0f;
67210 break;
67211 case 5:
67212 zero.Y += num9;
67213 break;
67214 case 6:
67215 {
67216 int num13 = (int)(GlobalTimeWrappedHourly * 8f) % 4;
67217 ((Rectangle)(ref value2))._002Ector(num13 % 2 * (value.Width >> 1), (num13 >> 1) * (value.Height >> 1), value.Width >> 1, value.Height >> 1);
67218 vec *= 0.5f;
67219 zero.Y += num9;
67220 zero.Y += -60f;
67221 break;
67222 }
67223 case 7:
67224 {
67225 int num12 = (int)(GlobalTimeWrappedHourly * 8f) % 4;
67226 ((Rectangle)(ref value2))._002Ector(num12 % 2 * (value.Width >> 1), (num12 >> 1) * (value.Height >> 1), value.Width >> 1, value.Height >> 1);
67227 vec *= 0.5f;
67228 zero.Y += num9;
67229 zero.X -= 400f;
67230 zero.Y += 90f;
67231 break;
67232 }
67233 case 8:
67234 {
67235 int num11 = (int)(GlobalTimeWrappedHourly * 8f) % 4;
67236 ((Rectangle)(ref value2))._002Ector(num11 % 2 * (value.Width >> 1), (num11 >> 1) * (value.Height >> 1), value.Width >> 1, value.Height >> 1);
67237 vec *= 0.5f;
67238 zero.Y += num9;
67239 zero.Y += 90f;
67240 break;
67241 }
67242 case 9:
67243 zero.Y += num9;
67244 zero.Y -= 30f;
67245 break;
67246 case 10:
67247 zero.Y += 250f * num7;
67248 break;
67249 case 11:
67250 zero.Y += 100f * num7;
67251 break;
67252 case 12:
67253 zero.Y += 20f * num7;
67254 break;
67255 case 13:
67256 {
67257 zero.Y += 20f * num7;
67258 int num10 = (int)(GlobalTimeWrappedHourly * 8f) % 4;
67259 ((Rectangle)(ref value2))._002Ector(num10 % 2 * (value.Width >> 1), (num10 >> 1) * (value.Height >> 1), value.Width >> 1, value.Height >> 1);
67260 vec *= 0.5f;
67261 break;
67262 }
67263 }
67264 if (flat)
67265 {
67266 num8 *= 1.5f;
67267 }
67268 vec *= num8;
67269 SkyManager.Instance.DrawToDepth(spriteBatch, 1f / vector.X);
67270 if (flat)
67271 {
67272 zero.Y += (float)(TextureAssets.Underworld[0].Height() >> 1) * 1.3f - vec.Y;
67273 }
67274 zero.Y -= pushUp;
67275 float num2 = num8 * (float)value2.Width;
67276 int num3 = (int)((float)(int)(screenOffset.X * vector.X - vec.X + zero.X - (float)(screenWidth >> 1)) / num2);
67277 vec = vec.Floor();
67278 int num4 = (int)Math.Ceiling((float)screenWidth / num2);
67279 int num5 = (int)(num8 * ((float)(value2.Width - 1) / vector.X));
67280 Vector2 vec2 = (new Vector2((float)((num3 - 2) * num5), (float)UnderworldLayer * 16f) + vec - screenOffset) * vector + screenOffset - screenPosition - vec + zero;
67281 vec2 = vec2.Floor();
67282 while (vec2.X + num2 < 0f)
67283 {
67284 num3++;
67285 vec2.X += num2;
67286 }
67287 for (int i = num3 - 2; i <= num3 + 4 + num4; i++)
67288 {
67289 spriteBatch.Draw(value, vec2, (Rectangle?)value2, Color.White, 0f, Vector2.Zero, num8, (SpriteEffects)0, 0f);
67290 if (layerTextureIndex == 0)
67291 {
67292 int num6 = (int)(vec2.Y + (float)value2.Height * num8);
67293 spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle((int)vec2.X, num6, (int)((float)value2.Width * num8), Math.Max(0, screenHeight - num6)), new Color(11, 3, 7));
67294 }
67295 vec2.X += num2;
67296 }
67297 }
static Asset< Texture2D >[] Underworld
static Asset< Texture2D > BlackTile
static int[] underworldBG
Definition Main.cs:694
static SpriteBatch spriteBatch
Definition Main.cs:1043
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 screenWidth
Definition Main.cs:1868
static int UnderworldLayer
The y-coordinate of the top of the underworld, in tile coordinates.
Definition Main.cs:2993
static float GlobalTimeWrappedHourly
Definition Main.cs:433

References Terraria.GameContent.TextureAssets.BlackTile, Terraria.Graphics.Light.Color, Terraria.Main.GlobalTimeWrappedHourly, Terraria.Graphics.Effects.SkyManager.Instance, Terraria.Main.screenHeight, Terraria.Main.screenPosition, Terraria.Main.screenWidth, Terraria.Main.spriteBatch, Terraria.GameContent.TextureAssets.Underworld, Terraria.Main.underworldBG, and Terraria.Main.UnderworldLayer.

Referenced by Terraria.Main.DrawUnderworldBackground().

+ Here is the caller graph for this function: