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

◆ oldDrawWater()

void Terraria.Main.oldDrawWater ( bool bg = false,
int Style = 0,
float Alpha = 1f )
inline

Definition at line 73241 of file Main.cs.

73242 {
73243 //IL_0075: Unknown result type (might be due to invalid IL or missing references)
73244 //IL_009d: Unknown result type (might be due to invalid IL or missing references)
73245 //IL_00ba: Unknown result type (might be due to invalid IL or missing references)
73246 //IL_00e2: Unknown result type (might be due to invalid IL or missing references)
73247 //IL_0031: Unknown result type (might be due to invalid IL or missing references)
73248 //IL_0036: Unknown result type (might be due to invalid IL or missing references)
73249 //IL_0204: Unknown result type (might be due to invalid IL or missing references)
73250 //IL_0209: Unknown result type (might be due to invalid IL or missing references)
73251 //IL_039c: Unknown result type (might be due to invalid IL or missing references)
73252 //IL_03a1: Unknown result type (might be due to invalid IL or missing references)
73253 //IL_03a6: Unknown result type (might be due to invalid IL or missing references)
73254 //IL_03a8: Unknown result type (might be due to invalid IL or missing references)
73255 //IL_0686: Unknown result type (might be due to invalid IL or missing references)
73256 //IL_068d: Unknown result type (might be due to invalid IL or missing references)
73257 //IL_0836: Unknown result type (might be due to invalid IL or missing references)
73258 //IL_07ff: Unknown result type (might be due to invalid IL or missing references)
73259 //IL_0806: Unknown result type (might be due to invalid IL or missing references)
73260 //IL_0b74: Unknown result type (might be due to invalid IL or missing references)
73261 //IL_0b7f: Unknown result type (might be due to invalid IL or missing references)
73262 //IL_0b84: Unknown result type (might be due to invalid IL or missing references)
73263 //IL_0f65: Unknown result type (might be due to invalid IL or missing references)
73264 //IL_08d9: Unknown result type (might be due to invalid IL or missing references)
73265 //IL_08e6: Unknown result type (might be due to invalid IL or missing references)
73266 //IL_08ff: Unknown result type (might be due to invalid IL or missing references)
73267 //IL_0916: Unknown result type (might be due to invalid IL or missing references)
73268 //IL_0920: Unknown result type (might be due to invalid IL or missing references)
73269 //IL_0925: Unknown result type (might be due to invalid IL or missing references)
73270 //IL_0f98: Unknown result type (might be due to invalid IL or missing references)
73271 //IL_0f9a: Unknown result type (might be due to invalid IL or missing references)
73272 //IL_0f9f: Unknown result type (might be due to invalid IL or missing references)
73273 //IL_0fa4: Unknown result type (might be due to invalid IL or missing references)
73274 //IL_0fa6: Unknown result type (might be due to invalid IL or missing references)
73275 //IL_0fab: Unknown result type (might be due to invalid IL or missing references)
73276 //IL_0fb2: Unknown result type (might be due to invalid IL or missing references)
73277 //IL_0fbb: Unknown result type (might be due to invalid IL or missing references)
73278 //IL_0fc1: Unknown result type (might be due to invalid IL or missing references)
73279 //IL_0b9e: Unknown result type (might be due to invalid IL or missing references)
73280 //IL_0ba0: Unknown result type (might be due to invalid IL or missing references)
73281 //IL_0ff6: Unknown result type (might be due to invalid IL or missing references)
73282 //IL_0ff8: Unknown result type (might be due to invalid IL or missing references)
73283 //IL_0ffd: Unknown result type (might be due to invalid IL or missing references)
73284 //IL_1002: Unknown result type (might be due to invalid IL or missing references)
73285 //IL_1004: Unknown result type (might be due to invalid IL or missing references)
73286 //IL_1009: Unknown result type (might be due to invalid IL or missing references)
73287 //IL_1018: Unknown result type (might be due to invalid IL or missing references)
73288 //IL_1024: Unknown result type (might be due to invalid IL or missing references)
73289 //IL_102a: Unknown result type (might be due to invalid IL or missing references)
73290 //IL_0eb9: Unknown result type (might be due to invalid IL or missing references)
73291 //IL_0ebb: Unknown result type (might be due to invalid IL or missing references)
73292 //IL_0ec0: Unknown result type (might be due to invalid IL or missing references)
73293 //IL_0ec5: Unknown result type (might be due to invalid IL or missing references)
73294 //IL_0ec7: Unknown result type (might be due to invalid IL or missing references)
73295 //IL_0ecc: Unknown result type (might be due to invalid IL or missing references)
73296 //IL_0ed3: Unknown result type (might be due to invalid IL or missing references)
73297 //IL_0edc: Unknown result type (might be due to invalid IL or missing references)
73298 //IL_0ee2: Unknown result type (might be due to invalid IL or missing references)
73299 //IL_1060: Unknown result type (might be due to invalid IL or missing references)
73300 //IL_1065: Unknown result type (might be due to invalid IL or missing references)
73301 //IL_0f1a: Unknown result type (might be due to invalid IL or missing references)
73302 //IL_0f1c: Unknown result type (might be due to invalid IL or missing references)
73303 //IL_0f21: Unknown result type (might be due to invalid IL or missing references)
73304 //IL_0f26: Unknown result type (might be due to invalid IL or missing references)
73305 //IL_0f28: Unknown result type (might be due to invalid IL or missing references)
73306 //IL_0f2d: Unknown result type (might be due to invalid IL or missing references)
73307 //IL_0f3c: Unknown result type (might be due to invalid IL or missing references)
73308 //IL_0f48: Unknown result type (might be due to invalid IL or missing references)
73309 //IL_0f4e: Unknown result type (might be due to invalid IL or missing references)
73310 //IL_0a1e: Unknown result type (might be due to invalid IL or missing references)
73311 //IL_10f8: Unknown result type (might be due to invalid IL or missing references)
73312 //IL_10fa: Unknown result type (might be due to invalid IL or missing references)
73313 //IL_10ff: Unknown result type (might be due to invalid IL or missing references)
73314 //IL_1104: Unknown result type (might be due to invalid IL or missing references)
73315 //IL_1106: Unknown result type (might be due to invalid IL or missing references)
73316 //IL_1110: Unknown result type (might be due to invalid IL or missing references)
73317 //IL_111a: Unknown result type (might be due to invalid IL or missing references)
73318 //IL_1123: Unknown result type (might be due to invalid IL or missing references)
73319 //IL_1129: Unknown result type (might be due to invalid IL or missing references)
73320 //IL_10b6: Unknown result type (might be due to invalid IL or missing references)
73321 //IL_10c1: Unknown result type (might be due to invalid IL or missing references)
73322 //IL_10c6: Unknown result type (might be due to invalid IL or missing references)
73323 //IL_09f3: Unknown result type (might be due to invalid IL or missing references)
73324 //IL_0a0b: Unknown result type (might be due to invalid IL or missing references)
73325 //IL_0a11: Unknown result type (might be due to invalid IL or missing references)
73326 //IL_1151: Unknown result type (might be due to invalid IL or missing references)
73327 //IL_1153: Unknown result type (might be due to invalid IL or missing references)
73328 //IL_1158: Unknown result type (might be due to invalid IL or missing references)
73329 //IL_115d: Unknown result type (might be due to invalid IL or missing references)
73330 //IL_115f: Unknown result type (might be due to invalid IL or missing references)
73331 //IL_116a: Unknown result type (might be due to invalid IL or missing references)
73332 //IL_117c: Unknown result type (might be due to invalid IL or missing references)
73333 //IL_1188: Unknown result type (might be due to invalid IL or missing references)
73334 //IL_118e: Unknown result type (might be due to invalid IL or missing references)
73335 //IL_0c06: Unknown result type (might be due to invalid IL or missing references)
73336 //IL_0c08: Unknown result type (might be due to invalid IL or missing references)
73337 //IL_0c0e: Unknown result type (might be due to invalid IL or missing references)
73338 //IL_0c13: Unknown result type (might be due to invalid IL or missing references)
73339 //IL_0a59: Unknown result type (might be due to invalid IL or missing references)
73340 //IL_0a71: Unknown result type (might be due to invalid IL or missing references)
73341 //IL_0a77: Unknown result type (might be due to invalid IL or missing references)
73342 //IL_0a8e: Unknown result type (might be due to invalid IL or missing references)
73343 //IL_0a98: Unknown result type (might be due to invalid IL or missing references)
73344 //IL_0a9d: Unknown result type (might be due to invalid IL or missing references)
73345 //IL_0c21: Unknown result type (might be due to invalid IL or missing references)
73346 //IL_0c26: Unknown result type (might be due to invalid IL or missing references)
73347 //IL_0c28: Unknown result type (might be due to invalid IL or missing references)
73348 //IL_0c48: Unknown result type (might be due to invalid IL or missing references)
73349 //IL_0c4d: Unknown result type (might be due to invalid IL or missing references)
73350 //IL_0c52: Unknown result type (might be due to invalid IL or missing references)
73351 //IL_0c32: Unknown result type (might be due to invalid IL or missing references)
73352 //IL_0c72: Unknown result type (might be due to invalid IL or missing references)
73353 //IL_0c77: Unknown result type (might be due to invalid IL or missing references)
73354 //IL_0c7f: Unknown result type (might be due to invalid IL or missing references)
73355 //IL_0c5c: Unknown result type (might be due to invalid IL or missing references)
73356 //IL_0c97: Unknown result type (might be due to invalid IL or missing references)
73357 //IL_0c9c: Unknown result type (might be due to invalid IL or missing references)
73358 //IL_0ca7: Unknown result type (might be due to invalid IL or missing references)
73359 //IL_1223: Unknown result type (might be due to invalid IL or missing references)
73360 //IL_1225: Unknown result type (might be due to invalid IL or missing references)
73361 //IL_122a: Unknown result type (might be due to invalid IL or missing references)
73362 //IL_122f: Unknown result type (might be due to invalid IL or missing references)
73363 //IL_1231: Unknown result type (might be due to invalid IL or missing references)
73364 //IL_123d: Unknown result type (might be due to invalid IL or missing references)
73365 //IL_1247: Unknown result type (might be due to invalid IL or missing references)
73366 //IL_124b: Unknown result type (might be due to invalid IL or missing references)
73367 //IL_1257: Unknown result type (might be due to invalid IL or missing references)
73368 //IL_125d: Unknown result type (might be due to invalid IL or missing references)
73369 //IL_0da1: Unknown result type (might be due to invalid IL or missing references)
73370 //IL_0da3: Unknown result type (might be due to invalid IL or missing references)
73371 //IL_0da8: Unknown result type (might be due to invalid IL or missing references)
73372 //IL_0db3: Unknown result type (might be due to invalid IL or missing references)
73373 //IL_0db8: Unknown result type (might be due to invalid IL or missing references)
73374 //IL_0dbd: Unknown result type (might be due to invalid IL or missing references)
73375 //IL_0dbf: Unknown result type (might be due to invalid IL or missing references)
73376 //IL_0dc4: Unknown result type (might be due to invalid IL or missing references)
73377 //IL_0dce: Unknown result type (might be due to invalid IL or missing references)
73378 //IL_0ddc: Unknown result type (might be due to invalid IL or missing references)
73379 //IL_0de6: Unknown result type (might be due to invalid IL or missing references)
73380 //IL_0def: Unknown result type (might be due to invalid IL or missing references)
73381 //IL_0df5: Unknown result type (might be due to invalid IL or missing references)
73382 //IL_0d75: Unknown result type (might be due to invalid IL or missing references)
73383 //IL_0d80: Unknown result type (might be due to invalid IL or missing references)
73384 //IL_0d85: Unknown result type (might be due to invalid IL or missing references)
73385 //IL_1285: Unknown result type (might be due to invalid IL or missing references)
73386 //IL_1287: Unknown result type (might be due to invalid IL or missing references)
73387 //IL_128c: Unknown result type (might be due to invalid IL or missing references)
73388 //IL_1291: Unknown result type (might be due to invalid IL or missing references)
73389 //IL_1293: Unknown result type (might be due to invalid IL or missing references)
73390 //IL_129f: Unknown result type (might be due to invalid IL or missing references)
73391 //IL_12b1: Unknown result type (might be due to invalid IL or missing references)
73392 //IL_12b8: Unknown result type (might be due to invalid IL or missing references)
73393 //IL_12c4: Unknown result type (might be due to invalid IL or missing references)
73394 //IL_12ca: Unknown result type (might be due to invalid IL or missing references)
73395 //IL_0e20: Unknown result type (might be due to invalid IL or missing references)
73396 //IL_0e22: Unknown result type (might be due to invalid IL or missing references)
73397 //IL_0e27: Unknown result type (might be due to invalid IL or missing references)
73398 //IL_0e32: Unknown result type (might be due to invalid IL or missing references)
73399 //IL_0e37: Unknown result type (might be due to invalid IL or missing references)
73400 //IL_0e3c: Unknown result type (might be due to invalid IL or missing references)
73401 //IL_0e3e: Unknown result type (might be due to invalid IL or missing references)
73402 //IL_0e43: Unknown result type (might be due to invalid IL or missing references)
73403 //IL_0e4d: Unknown result type (might be due to invalid IL or missing references)
73404 //IL_0e5e: Unknown result type (might be due to invalid IL or missing references)
73405 //IL_0e70: Unknown result type (might be due to invalid IL or missing references)
73406 //IL_0e7c: Unknown result type (might be due to invalid IL or missing references)
73407 //IL_0e82: Unknown result type (might be due to invalid IL or missing references)
73408 float num = 0f;
73409 float num12 = 99999f;
73410 float num23 = 99999f;
73411 int num27 = -1;
73412 int num28 = -1;
73413 Vector2 vector = default(Vector2);
73414 ((Vector2)(ref vector))._002Ector((float)offScreenRange, (float)offScreenRange);
73415 if (drawToScreen)
73416 {
73417 vector = Vector2.Zero;
73418 }
73419 _ = new Color[4];
73420 int num29 = (int)(255f * (1f - gfxQuality) + 40f * gfxQuality);
73421 _ = gfxQuality;
73422 _ = gfxQuality;
73423 int num30 = (int)((screenPosition.X - vector.X) / 16f - 1f);
73424 int num31 = (int)((screenPosition.X + (float)screenWidth + vector.X) / 16f) + 2;
73425 int num32 = (int)((screenPosition.Y - vector.Y) / 16f - 1f);
73426 int num2 = (int)((screenPosition.Y + (float)screenHeight + vector.Y) / 16f) + 5;
73427 if (num30 < 5)
73428 {
73429 num30 = 5;
73430 }
73431 if (num31 > maxTilesX - 5)
73432 {
73433 num31 = maxTilesX - 5;
73434 }
73435 if (num32 < 5)
73436 {
73437 num32 = 5;
73438 }
73439 if (num2 > maxTilesY - 5)
73440 {
73441 num2 = maxTilesY - 5;
73442 }
73443 Vector2 vector2 = default(Vector2);
73444 Rectangle value = default(Rectangle);
73445 Color newColor = default(Color);
73446 for (int i = num32; i < num2 + 4; i++)
73447 {
73448 for (int j = num30 - 2; j < num31 + 2; j++)
73449 {
73450 if (tile[j, i] == null)
73451 {
73452 tile[j, i] = default(Tile);
73453 }
73454 if (tile[j, i].liquid <= 0 || (tile[j, i].nactive() && tileSolid[tile[j, i].type] && !tileSolidTop[tile[j, i].type]) || !(Lighting.Brightness(j, i) > 0f || bg))
73455 {
73456 continue;
73457 }
73458 Color color = Lighting.GetColor(j, i);
73459 float num3 = 256 - tile[j, i].liquid;
73460 num3 /= 32f;
73461 bool flag = false;
73462 int num4 = 0;
73463 if (tile[j, i].lava())
73464 {
73465 if (drewLava)
73466 {
73467 continue;
73468 }
73469 float num5 = Math.Abs((float)(j * 16 + 8) - (screenPosition.X + (float)(screenWidth / 2)));
73470 float num6 = Math.Abs((float)(i * 16 + 8) - (screenPosition.Y + (float)(screenHeight / 2)));
73471 if (num5 < (float)(screenWidth * 2) && num6 < (float)(screenHeight * 2))
73472 {
73473 float num7 = (float)Math.Sqrt(num5 * num5 + num6 * num6);
73474 float num8 = 1f - num7 / ((float)screenWidth * 0.75f);
73475 if (num8 > 0f)
73476 {
73477 num += num8;
73478 }
73479 }
73480 if (num5 < num12)
73481 {
73482 num12 = num5;
73483 num27 = j * 16 + 8;
73484 }
73485 if (num6 < num23)
73486 {
73487 num23 = num5;
73488 num28 = i * 16 + 8;
73489 }
73490 num4 = 1;
73491 }
73492 else if (tile[j, i].honey())
73493 {
73494 num4 = 11;
73495 }
73496 else if (tile[j, i].shimmer())
73497 {
73498 num4 = 14;
73499 flag = true;
73500 }
73501 if (num4 == 0)
73502 {
73503 num4 = Style;
73504 }
73505 if ((num4 == 1 || num4 == 11) && drewLava)
73506 {
73507 continue;
73508 }
73509 float num9 = 0.5f;
73510 if (bg)
73511 {
73512 num9 = 1f;
73513 }
73514 if (num4 != 1 && num4 != 11)
73515 {
73516 num9 *= Alpha;
73517 }
73519 ((Vector2)(ref vector2))._002Ector((float)(j * 16), (float)(i * 16 + (int)num3 * 2));
73520 ((Rectangle)(ref value))._002Ector(0, 0, 16, 16 - (int)num3 * 2);
73521 bool flag2 = true;
73522 if (tile[j, i + 1].liquid < 245 && (!tile[j, i + 1].nactive() || !tileSolid[tile[j, i + 1].type] || tileSolidTop[tile[j, i + 1].type]))
73523 {
73524 float num10 = 256 - tile[j, i + 1].liquid;
73525 num10 /= 32f;
73526 num9 = 0.5f * (8f - num3) / 4f;
73527 if ((double)num9 > 0.55)
73528 {
73529 num9 = 0.55f;
73530 }
73531 if ((double)num9 < 0.35)
73532 {
73533 num9 = 0.35f;
73534 }
73535 float num11 = num3 / 2f;
73536 if (tile[j, i + 1].liquid < 200)
73537 {
73538 if (bg)
73539 {
73540 continue;
73541 }
73542 if (tile[j, i - 1].liquid > 0 && tile[j, i - 1].liquid > 0)
73543 {
73544 ((Rectangle)(ref value))._002Ector(0, 4, 16, 16);
73545 num9 = 0.5f;
73546 }
73547 else if (tile[j, i - 1].liquid > 0)
73548 {
73549 ((Vector2)(ref vector2))._002Ector((float)(j * 16), (float)(i * 16 + 4));
73550 ((Rectangle)(ref value))._002Ector(0, 4, 16, 12);
73551 num9 = 0.5f;
73552 }
73553 else if (tile[j, i + 1].liquid > 0)
73554 {
73555 ((Vector2)(ref vector2))._002Ector((float)(j * 16), (float)(i * 16 + (int)num3 * 2 + (int)num10 * 2));
73556 ((Rectangle)(ref value))._002Ector(0, 4, 16, 16 - (int)num3 * 2);
73557 }
73558 else
73559 {
73560 ((Vector2)(ref vector2))._002Ector((float)(j * 16 + (int)num11), (float)(i * 16 + (int)num11 * 2 + (int)num10 * 2));
73561 ((Rectangle)(ref value))._002Ector(0, 4, 16 - (int)num11 * 2, 16 - (int)num11 * 2);
73562 }
73563 }
73564 else
73565 {
73566 num9 = 0.5f;
73567 ((Rectangle)(ref value))._002Ector(0, 4, 16, 16 - (int)num3 * 2 + (int)num10 * 2);
73568 }
73569 }
73570 else if (tile[j, i - 1].liquid > 32)
73571 {
73572 ((Rectangle)(ref value))._002Ector(0, 4, value.Width, value.Height);
73573 }
73574 else if (num3 < 1f && tile[j, i - 1].nactive() && tileSolid[tile[j, i - 1].type] && !tileSolidTop[tile[j, i - 1].type])
73575 {
73576 ((Vector2)(ref vector2))._002Ector((float)(j * 16), (float)(i * 16));
73577 ((Rectangle)(ref value))._002Ector(0, 4, 16, 16);
73578 }
73579 else
73580 {
73581 for (int k = i + 1; k < i + 6 && (!tile[j, k].nactive() || !tileSolid[tile[j, k].type] || tileSolidTop[tile[j, k].type]); k++)
73582 {
73583 if (tile[j, k].liquid < 200)
73584 {
73585 flag2 = false;
73586 break;
73587 }
73588 }
73589 if (!flag2)
73590 {
73591 num9 = 0.5f;
73592 ((Rectangle)(ref value))._002Ector(0, 4, 16, 16);
73593 }
73594 else if (tile[j, i - 1].liquid > 0)
73595 {
73596 ((Rectangle)(ref value))._002Ector(0, 2, value.Width, value.Height);
73597 }
73598 }
73599 if ((((Color)(ref color)).R > 20 || ((Color)(ref color)).B > 20 || ((Color)(ref color)).G > 20) && value.Y < 4)
73600 {
73601 int num13 = ((Color)(ref color)).R;
73602 if (((Color)(ref color)).G > num13)
73603 {
73604 num13 = ((Color)(ref color)).G;
73605 }
73606 if (((Color)(ref color)).B > num13)
73607 {
73608 num13 = ((Color)(ref color)).B;
73609 }
73610 num13 /= 30;
73611 if (rand.Next(20000) < num13)
73612 {
73613 ((Color)(ref newColor))._002Ector(255, 255, 255);
73614 if (tile[j, i].honey())
73615 {
73616 ((Color)(ref newColor))._002Ector(255, 255, 50);
73617 }
73618 int num14 = Dust.NewDust(new Vector2((float)(j * 16), vector2.Y - 2f), 16, 8, 43, 0f, 0f, 254, newColor, 0.75f);
73619 Dust obj = dust[num14];
73620 obj.velocity *= 0f;
73621 }
73622 }
73623 if (tile[j, i].honey())
73624 {
73625 num9 *= 1.6f;
73626 if (num9 > 1f)
73627 {
73628 num9 = 1f;
73629 }
73630 }
73631 if (tile[j, i].lava())
73632 {
73633 num9 *= 1.8f;
73634 if (num9 > 1f)
73635 {
73636 num9 = 1f;
73637 }
73638 if (((Game)this).IsActive && !gamePaused && Dust.lavaBubbles < 200)
73639 {
73640 if (tile[j, i].liquid > 200 && rand.Next(700) == 0)
73641 {
73642 Dust.NewDust(new Vector2((float)(j * 16), (float)(i * 16)), 16, 16, 35);
73643 }
73644 if (value.Y == 0 && rand.Next(350) == 0)
73645 {
73646 int num15 = Dust.NewDust(new Vector2((float)(j * 16), (float)(i * 16) + num3 * 2f - 8f), 16, 8, 35, 0f, 0f, 50, default(Color), 1.5f);
73647 Dust obj2 = dust[num15];
73648 obj2.velocity *= 0.8f;
73649 dust[num15].velocity.X *= 2f;
73650 dust[num15].velocity.Y -= (float)rand.Next(1, 7) * 0.1f;
73651 if (rand.Next(10) == 0)
73652 {
73653 dust[num15].velocity.Y *= rand.Next(2, 5);
73654 }
73655 dust[num15].noGravity = true;
73656 }
73657 }
73658 }
73659 float num16 = (float)(int)((Color)(ref color)).R * num9;
73660 float num17 = (float)(int)((Color)(ref color)).G * num9;
73661 float num18 = (float)(int)((Color)(ref color)).B * num9;
73662 float num19 = (float)(int)((Color)(ref color)).A * num9;
73663 ((Color)(ref color))._002Ector((int)(byte)num16, (int)(byte)num17, (int)(byte)num18, (int)(byte)num19);
73664 if (flag)
73665 {
73666 ((Color)(ref color))._002Ector(((Color)(ref color)).ToVector4() * LiquidRenderer.GetShimmerBaseColor(j, i));
73667 }
73668 if (Lighting.NotRetro && !bg)
73669 {
73670 Color color2 = color;
73671 if (num4 != 1 && ((double)(int)((Color)(ref color2)).R > (double)num29 * 0.6 || (double)(int)((Color)(ref color2)).G > (double)num29 * 0.65 || (double)(int)((Color)(ref color2)).B > (double)num29 * 0.7))
73672 {
73673 for (int l = 0; l < 4; l++)
73674 {
73675 int num20 = 0;
73676 int num21 = 0;
73677 int width = 8;
73678 int height = 8;
73679 Color color3 = color2;
73680 Color color4 = Lighting.GetColor(j, i);
73681 if (l == 0)
73682 {
73683 color4 = Lighting.GetColor(j - 1, i - 1);
73684 if (value.Height < 8)
73685 {
73686 height = value.Height;
73687 }
73688 }
73689 if (l == 1)
73690 {
73691 color4 = Lighting.GetColor(j + 1, i - 1);
73692 num20 = 8;
73693 if (value.Height < 8)
73694 {
73695 height = value.Height;
73696 }
73697 }
73698 if (l == 2)
73699 {
73700 color4 = Lighting.GetColor(j - 1, i + 1);
73701 num21 = 8;
73702 height = 8 - (16 - value.Height);
73703 }
73704 if (l == 3)
73705 {
73706 color4 = Lighting.GetColor(j + 1, i + 1);
73707 num20 = 8;
73708 num21 = 8;
73709 height = 8 - (16 - value.Height);
73710 }
73711 num16 = (float)(int)((Color)(ref color4)).R * num9;
73712 num17 = (float)(int)((Color)(ref color4)).G * num9;
73713 num18 = (float)(int)((Color)(ref color4)).B * num9;
73714 num19 = (float)(int)((Color)(ref color4)).A * num9;
73715 ((Color)(ref color4))._002Ector((int)(byte)num16, (int)(byte)num17, (int)(byte)num18, (int)(byte)num19);
73716 ((Color)(ref color3)).R = (byte)((((Color)(ref color2)).R * 3 + ((Color)(ref color4)).R * 2) / 5);
73717 ((Color)(ref color3)).G = (byte)((((Color)(ref color2)).G * 3 + ((Color)(ref color4)).G * 2) / 5);
73718 ((Color)(ref color3)).B = (byte)((((Color)(ref color2)).B * 3 + ((Color)(ref color4)).B * 2) / 5);
73719 ((Color)(ref color3)).A = (byte)((((Color)(ref color2)).A * 3 + ((Color)(ref color4)).A * 2) / 5);
73720 if (flag)
73721 {
73722 ((Color)(ref color3))._002Ector(((Color)(ref color3)).ToVector4() * LiquidRenderer.GetShimmerBaseColor(j, i));
73723 }
73724 spriteBatch.Draw(TextureAssets.Liquid[num4].Value, vector2 - screenPosition + new Vector2((float)num20, (float)num21) + vector, (Rectangle?)new Rectangle(value.X + num20, value.Y + num21, width, height), color3, 0f, default(Vector2), 1f, (SpriteEffects)0, 0f);
73725 if (flag)
73726 {
73727 spriteBatch.Draw(TextureAssets.Liquid[num4].Value, vector2 - screenPosition + new Vector2((float)num20, (float)num21) + vector, (Rectangle?)new Rectangle(value.X + num20, value.Y + num21 + 36, width, height), LiquidRenderer.GetShimmerGlitterColor(flag2, j, i), 0f, default(Vector2), 1f, (SpriteEffects)0, 0f);
73728 }
73729 }
73730 }
73731 else
73732 {
73733 spriteBatch.Draw(TextureAssets.Liquid[num4].Value, vector2 - screenPosition + vector, (Rectangle?)value, color, 0f, default(Vector2), 1f, (SpriteEffects)0, 0f);
73734 if (flag)
73735 {
73736 value.Y += 36;
73737 spriteBatch.Draw(TextureAssets.Liquid[num4].Value, vector2 - screenPosition + vector, (Rectangle?)value, LiquidRenderer.GetShimmerGlitterColor(flag2, j, i), 0f, default(Vector2), 1f, (SpriteEffects)0, 0f);
73738 }
73739 }
73740 }
73741 else
73742 {
73743 if (value.Y < 4)
73744 {
73745 value.X += (int)(wFrame * 18f);
73746 }
73747 spriteBatch.Draw(TextureAssets.Liquid[num4].Value, vector2 - screenPosition + vector, (Rectangle?)value, color, 0f, default(Vector2), 1f, (SpriteEffects)0, 0f);
73748 if (flag)
73749 {
73750 value.Y += 36;
73751 spriteBatch.Draw(TextureAssets.Liquid[num4].Value, vector2 - screenPosition + vector, (Rectangle?)value, LiquidRenderer.GetShimmerGlitterColor(flag2, j, i), 0f, default(Vector2), 1f, (SpriteEffects)0, 0f);
73752 }
73753 }
73754 if (!tile[j, i + 1].halfBrick())
73755 {
73756 continue;
73757 }
73758 color = Lighting.GetColor(j, i + 1);
73759 num16 = (float)(int)((Color)(ref color)).R * num9;
73760 num17 = (float)(int)((Color)(ref color)).G * num9;
73761 num18 = (float)(int)((Color)(ref color)).B * num9;
73762 num19 = (float)(int)((Color)(ref color)).A * num9;
73763 ((Color)(ref color))._002Ector((int)(byte)num16, (int)(byte)num17, (int)(byte)num18, (int)(byte)num19);
73764 if (flag)
73765 {
73766 ((Color)(ref color))._002Ector(((Color)(ref color)).ToVector4() * LiquidRenderer.GetShimmerBaseColor(j, i));
73767 }
73768 ((Vector2)(ref vector2))._002Ector((float)(j * 16), (float)(i * 16 + 16));
73769 spriteBatch.Draw(TextureAssets.Liquid[num4].Value, vector2 - screenPosition + vector, (Rectangle?)new Rectangle(0, 4, 16, 8), color, 0f, default(Vector2), 1f, (SpriteEffects)0, 0f);
73770 if (flag)
73771 {
73772 spriteBatch.Draw(TextureAssets.Liquid[num4].Value, vector2 - screenPosition + vector, (Rectangle?)new Rectangle(0, 40, 16, 8), LiquidRenderer.GetShimmerGlitterColor(flag2, j, i), 0f, default(Vector2), 1f, (SpriteEffects)0, 0f);
73773 }
73774 float num22 = 6f;
73775 float num24 = 0.75f;
73776 if (num4 == 1 || num4 == 11)
73777 {
73778 num22 = 4f;
73779 num24 = 0.5f;
73780 }
73781 for (int m = 0; (float)m < num22; m++)
73782 {
73783 int num25 = i + 2 + m;
73784 if (WorldGen.SolidTile(j, num25))
73785 {
73786 break;
73787 }
73788 float num26 = 1f - (float)m / num22;
73789 num26 *= num24;
73790 ((Vector2)(ref vector2))._002Ector((float)(j * 16), (float)(num25 * 16 - 2));
73791 spriteBatch.Draw(TextureAssets.Liquid[num4].Value, vector2 - screenPosition + vector, (Rectangle?)new Rectangle(0, 18, 16, 16), color * num26, 0f, default(Vector2), 1f, (SpriteEffects)0, 0f);
73792 if (flag)
73793 {
73794 spriteBatch.Draw(TextureAssets.Liquid[num4].Value, vector2 - screenPosition + vector, (Rectangle?)new Rectangle(0, 54, 16, 16), LiquidRenderer.GetShimmerGlitterColor(flag2, j, i) * num26, 0f, default(Vector2), 1f, (SpriteEffects)0, 0f);
73795 }
73796 }
73797 }
73798 }
73799 if (!drewLava)
73800 {
73804 }
73805 drewLava = true;
73806 }
static Vector4 GetShimmerBaseColor(float worldPositionX, float worldPositionY)
static Color GetShimmerGlitterColor(bool top, float worldPositionX, float worldPositionY)
static Asset< Texture2D >[] Liquid
static int maxTilesY
The height of the currently-loaded world in tiles.
Definition Main.cs:1191
static bool[] tileSolidTop
Definition Main.cs:1599
static float ambientLavaStrength
Definition Main.cs:2418
static SpriteBatch spriteBatch
Definition Main.cs:1043
static float gfxQuality
Definition Main.cs:1125
static bool drawToScreen
Definition Main.cs:628
static float ambientLavaY
Definition Main.cs:2416
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 maxTilesX
The width of the currently-loaded world in tiles.
Definition Main.cs:1186
static int offScreenRange
Definition Main.cs:905
static bool[] tileSolid
Definition Main.cs:1601
static float ambientLavaX
Definition Main.cs:2414
static bool drewLava
Definition Main.cs:1279
static UnifiedRandom rand
Definition Main.cs:2758
static void DrawTileInWater(Vector2 drawOffset, int x, int y)
Definition Main.cs:73216
static int screenWidth
Definition Main.cs:1868
static Liquid[] liquid
Definition Main.cs:1297
static Tilemap tile
Definition Main.cs:1820
static bool gamePaused
Definition Main.cs:1141
static float wFrame
Definition Main.cs:610
static Dust[] dust
Definition Main.cs:1822

References Terraria.Main.ambientLavaStrength, Terraria.Main.ambientLavaX, Terraria.Main.ambientLavaY, Terraria.Lighting.Brightness(), Terraria.Graphics.Light.Color, Terraria.Main.DrawTileInWater(), Terraria.Main.drawToScreen, Terraria.Main.drewLava, Terraria.Main.dust, Terraria.Main.gamePaused, Terraria.Lighting.GetColor(), Terraria.GameContent.Liquid.LiquidRenderer.GetShimmerBaseColor(), Terraria.GameContent.Liquid.LiquidRenderer.GetShimmerGlitterColor(), Terraria.Main.gfxQuality, Terraria.Dust.lavaBubbles, Terraria.GameContent.TextureAssets.Liquid, Terraria.Main.liquid, Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, Terraria.Dust.NewDust(), Terraria.Lighting.NotRetro, Terraria.Main.offScreenRange, Terraria.Main.rand, Terraria.Main.screenHeight, Terraria.Main.screenPosition, Terraria.Main.screenWidth, Terraria.WorldGen.SolidTile(), Terraria.Main.spriteBatch, Terraria.Main.tile, Terraria.Main.tileSolid, Terraria.Main.tileSolidTop, and Terraria.Main.wFrame.

Referenced by Terraria.Main.DrawLiquid().

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