68882 {
68883
68884
68885
68886
68887
68888
68889
68890
68891
68892
68893
68894
68895
68896
68897
68898
68899
68900
68901
68902
68903
68904
68905
68906
68907
68908
68909
68910
68911
68912
68913
68914
68915
68916
68917
68918
68919
68920
68921
68922
68923
68924
68925
68926
68927
68928
68929
68930
68931
68932
68933
68934
68935
68936
68937
68938
68939
68940
68941
68942
68943
68944
68945
68946
68947
68948
68949
68950
68951
68952
68953
68954
68955
68956
68957
68958
68959
68960
68961
68962
68963
68964
68965
68966
68967
68968
68969
68970
68971
68972
68973
68974
68975
68976
68977
68978
68979
68980
68981
68982
68983
68984
68985
68986
68987
68988
68989
68990
68991
68992
68993
68994
68995
68996
68997
68998
68999
69000
69001
69002
69003
69004
69005
69006
69007
69008
69009
69010
69011
69012
69013
69014
69015
69016
69017
69018
69019
69020
69021
69022
69023
69024
69025
69026
69027
69028
69029
69030
69031
69032
69033
69034
69035
69036
69037
69038
69039
69040
69041
69042
69043
69044
69045
69046
69047
69048
69049
69050
69051
69052
69053
69054
69055
69056
69057
69058
69059
69060
69061
69062
69063
69064
69065
69066
69067
69068
69069
69070
69071
69072
69073
69074
69075
69076
69077
69078
69079
69080
69081
69082
69083
69084
69085
69086
69087
69088
69089
69090
69091
69092
69093
69094
69095
69096
69097
69098
69099
69100
69101
69102
69103
69104
69105
69106
69107
69108
69109
69110
69111
69112
69113
69114
69115
69116
69117
69118
69119
69120
69121
69122
69123
69124
69125
69126
69127
69128
69129
69130
69131
69132
69133
69134
69135
69136
69137
69138
69139
69140
69141
69142
69143
69144
69145
69146
69147
69148
69149
69150
69151
69152
69153
69154
69155
69156
69157
69158 Color[]
slices = (Color[])(
object)
new Color[9];
69164 Vector2
vector =
default(Vector2);
69167 {
69169 }
69175 {
69177 }
69179 {
69181 }
69183 {
69185 }
69189 {
69191 }
69193 {
69195 }
69199 float value = (float)((
double)(screenPosition.Y - (float)(
screenHeight / 2) + 200
f) -
rockLayer * 16.0) / 300
f;
69202 {
69206 }
69208 {
69212 }
69214 {
69218 }
69227 {
69229 }
69231 {
69233 {
69235 {
69237 }
69238 }
69239 else
69240 {
69242 }
69243 }
69245 {
69247 }
69249 {
69253 }
69255 {
69257 }
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];
69273 {
69274 case 0:
69281 break;
69282 case 1:
69284 {
69289 }
69291 {
69296 }
69298 {
69303 }
69304 else
69305 {
69310 }
69312 break;
69313 case 2:
69319 break;
69320 case 3:
69326 break;
69327 case 4:
69333 break;
69334 case 5:
69340 break;
69341 case 6:
69347 break;
69348 case 7:
69354 break;
69355 case 8:
69361 break;
69362 case 9:
69368 break;
69369 case 10:
69375 break;
69376 case 11:
69378 {
69384 }
69385 else
69386 {
69392 }
69393 break;
69394 }
69396 {
69398 }
69400 {
69402 }
69404 {
69406 }
69413 if (i == 0)
69414 {
69415 for (
int j = 0;
j < 6;
j++)
69416 {
69418 }
69419 }
69420 else
69421 {
69422 for (
int k = 0;
k < 6;
k++)
69423 {
69425 }
69426 }
69427 }
69434 {
69435 for (
int m = 0;
m <
num21 / 16;
m++)
69436 {
69439 {
69441 }
69450 {
69457 }
69458 }
69459 }
69464 bool flag2 =
false;
69467 {
69471 if (
worldSurface * 16.0 < (
double)(screenPosition.Y - 16
f))
69472 {
69475 }
69476 else
69477 {
69480 }
69481 if (
rockLayer * 16.0 < (
double)(Camera.ScaledPosition.Y + 600
f))
69482 {
69485 }
69488 {
69490 }
69492 {
69494 {
69496 {
69498 {
69504 {
69506 }
69508 {
69510 {
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, 1
f, (SpriteEffects)0);
69513 }
69515 {
69517 try
69518 {
69520 {
69523 int width = 4;
69524 int height = 4;
69528 {
69529 case 0:
69531 {
69533 }
69534 break;
69535 case 1:
69536 width = 8;
69539 {
69541 }
69542 break;
69543 case 2:
69546 {
69548 }
69549 break;
69550 case 3:
69551 height = 8;
69554 {
69556 }
69557 break;
69558 case 4:
69559 width = 8;
69560 height = 8;
69563 break;
69564 case 5:
69567 height = 8;
69569 {
69571 }
69572 break;
69573 case 6:
69576 {
69578 }
69579 break;
69580 case 7:
69581 width = 8;
69582 height = 4;
69586 {
69588 }
69589 break;
69590 case 8:
69594 {
69596 }
69597 break;
69598 }
69607 {
69614 }
69615 }
69616 }
69617 catch
69618 {
69623 }
69624 }
69626 {
69629 {
69635 {
69636 case 1:
69638 break;
69639 case 2:
69641 break;
69642 case 3:
69645 break;
69646 }
69655 {
69662 }
69663 }
69664 }
69665 else
69666 {
69672 {
69679 }
69680 }
69681 }
69682 else
69683 {
69688 }
69689 }
69690 }
69691 }
69692 }
69694 {
69696 {
69698 {
69700 {
69702 {
69708 {
69710 }
69712 {
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, 1
f, (SpriteEffects)0);
69720 }
69721 }
69722 }
69723 }
69724 }
69725 }
69727 {
69733 {
69735 {
69737 {
69746 {
69753 }
69754 }
69755 }
69756 }
69757 }
69758 }
69760 if (
rockLayer * 16.0 <= (
double)(screenPosition.Y + 600
f))
69761 {
69766 {
69769 }
69770 else
69771 {
69774 }
69775 if (
num7 * 16.0 < (
double)(screenPosition.Y + 600
f))
69776 {
69779 }
69782 {
69784 }
69786 {
69788 {
69790 {
69792 {
69798 {
69799 continue;
69800 }
69802 {
69804 {
69807 {
69815 {
69816 case 0:
69818 {
69820 }
69821 break;
69822 case 1:
69826 {
69828 }
69829 break;
69830 case 2:
69833 {
69835 }
69836 break;
69837 case 3:
69841 {
69843 }
69844 break;
69845 case 4:
69850 break;
69851 case 5:
69856 {
69858 }
69859 break;
69860 case 6:
69863 {
69865 }
69866 break;
69867 case 7:
69873 {
69875 }
69876 break;
69877 case 8:
69881 {
69883 }
69884 break;
69885 }
69894 {
69901 }
69902 }
69903 }
69905 {
69908 {
69914 {
69915 case 1:
69917 break;
69918 case 2:
69920 break;
69921 case 3:
69924 break;
69925 }
69934 {
69941 }
69942 }
69943 }
69944 else
69945 {
69951 {
69958 }
69959 }
69960 }
69961 else
69962 {
69968 {
69975 }
69976 }
69977 }
69978 }
69979 }
69980 }
69983 {
69989 {
69991 {
70000 {
70007 }
70008 }
70009 }
70010 }
70011 }
70012 bgTopY = (int)((
float)((int)
num7 * 16) - screenPosition.Y + 16
f + 600
f) - 8;
70013 if (
num7 * 16.0 <= (
double)(screenPosition.Y + 600
f))
70014 {
70018 {
70021 }
70022 else
70023 {
70026 }
70027 num = (int)((
double)
num * 1.5);
70031 {
70033 }
70035 {
70037 {
70039 {
70041 {
70047 {
70048 continue;
70049 }
70051 {
70053 {
70056 {
70064 {
70065 case 0:
70067 {
70069 }
70070 break;
70071 case 1:
70075 {
70077 }
70078 break;
70079 case 2:
70082 {
70084 }
70085 break;
70086 case 3:
70090 {
70092 }
70093 break;
70094 case 4:
70099 break;
70100 case 5:
70105 {
70107 }
70108 break;
70109 case 6:
70112 {
70114 }
70115 break;
70116 case 7:
70122 {
70124 }
70125 break;
70126 case 8:
70130 {
70132 }
70133 break;
70134 }
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, 0
f,
default(Vector2), 1
f, (SpriteEffects)0, 0
f);
70142 }
70143 }
70145 {
70148 {
70154 {
70155 case 1:
70157 break;
70158 case 2:
70160 break;
70161 case 3:
70164 break;
70165 }
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, 0
f,
default(Vector2), 1
f, (SpriteEffects)0, 0
f);
70173 }
70174 }
70175 else
70176 {
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, 0
f,
default(Vector2), 1
f, (SpriteEffects)0, 0
f);
70181 }
70182 }
70183 else
70184 {
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, 0
f,
default(Vector2), 1
f, (SpriteEffects)0, 0
f);
70189 }
70190 }
70191 }
70192 }
70193 }
70194 }
70196 TimeLogger.DrawTime(3,
stopwatch.Elapsed.TotalMilliseconds);
70197 }
static Asset< Texture2D >[] Background
static SceneMetrics SceneMetrics
static int maxTilesY
The height of the currently-loaded world in tiles.
void LoadBackground(int i)
static SpriteBatch spriteBatch
static double worldSurface
The y-coordinate of the top of the dirt layer, in tile coordinates. Corresponds to 0' on the Depth Me...
static bool WallLightAt(int i, int j)
static double rockLayer
The y-coordinate of the top of the caverns layer, in tile coordinates.
static int oldUndergroundBackground
static int[] caveBackStyle
static float ugBackTransition
static Vector2 screenPosition
The position of the top left corner of the screen in world coordinates. Modify in M:Terraria....
static int undergroundBackground
static int offScreenRange
static TileBatch tileBatch
static int jungleBackStyle
static int[] backgroundHeight
static float caveParallax
static bool ShouldDrawBackgroundTileAt(int i, int j)