Guest User

WorldController

a guest
Mar 7th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 85.94 KB | None | 0 0
  1. import java.io.PrintStream;
  2. import sign.signlink;
  3.  
  4. public class WorldController {
  5.  
  6. public WorldController(int i, int j, int ai[][][], int k) {
  7. aBoolean429 = true;
  8. aBoolean434 = true;
  9. aBoolean435 = false;
  10. obj5Cache = new Object5[5000];
  11. anIntArray486 = new int[10000];
  12. anIntArray487 = new int[10000];
  13. anInt437 = k;
  14. anInt438 = j;
  15. anInt439 = i;
  16. groundArray = new Ground[k][j][i];
  17. anIntArrayArrayArray445 = new int[k][j + 1][i + 1];
  18. anIntArrayArrayArray440 = ai;
  19. method274(619);
  20. return;
  21. }
  22.  
  23. public static void method273(int i) {
  24. aClass28Array462 = null;
  25. while (i >= 0)
  26. anInt432 = -333;
  27. anIntArray473 = null;
  28. aClass47ArrayArray474 = null;
  29. aClass19_477 = null;
  30. aBooleanArrayArrayArrayArray491 = null;
  31. aBooleanArrayArray492 = null;
  32. }
  33.  
  34. public static void drawFog(boolean dungeon) {
  35. int fog = 0;
  36. if (!dungeon) {
  37. fog = 0xc8c0a8;
  38. }
  39. int pos = Texture.anIntArray1471[0];
  40. int src, dst, a;
  41. int fogIntensity = 1;
  42. int fogBegin = 2600;
  43. int fogEnd = 2800;
  44. for (int y = 0; y < DrawingArea.bottomY; y++) {
  45. for (int x = 0; x < DrawingArea.centerX; x++) {
  46. if (DrawingArea.pixels[pos] >= fogEnd) {
  47. DrawingArea.pixels[pos] = fog;
  48. } else if (DrawingArea.pixels[pos] >= fogBegin) {
  49. a = (int) (DrawingArea.pixels[pos] - fogBegin)
  50. / fogIntensity;
  51. src = ((fog & 0xff00ff) * a >> 8 & 0xff00ff)
  52. + ((fog & 0xff00) * a >> 8 & 0xff00);
  53. a = 256 - a;
  54. dst = DrawingArea.pixels[pos];
  55. dst = ((dst & 0xff00ff) * a >> 8 & 0xff00ff)
  56. + ((dst & 0xff00) * a >> 8 & 0xff00);
  57. DrawingArea.pixels[pos] = src + dst;
  58. }
  59. pos++;
  60. }
  61. pos += DrawingArea.width - DrawingArea.centerX;
  62. }
  63. }
  64.  
  65. public void method274(int i) {
  66. for (int j = 0; j < anInt437; j++) {
  67. for (int k = 0; k < anInt438; k++) {
  68. for (int i1 = 0; i1 < anInt439; i1++)
  69. groundArray[j][k][i1] = null;
  70.  
  71. }
  72.  
  73. }
  74.  
  75. i = 37 / i;
  76. for (int l = 0; l < anInt472; l++) {
  77. for (int j1 = 0; j1 < anIntArray473[l]; j1++)
  78. aClass47ArrayArray474[l][j1] = null;
  79.  
  80. anIntArray473[l] = 0;
  81. }
  82.  
  83. for (int k1 = 0; k1 < obj5CacheCurrPos; k1++)
  84. obj5Cache[k1] = null;
  85.  
  86. obj5CacheCurrPos = 0;
  87. for (int l1 = 0; l1 < aClass28Array462.length; l1++)
  88. aClass28Array462[l1] = null;
  89.  
  90. }
  91.  
  92. public void method275(int i, int j) {
  93. if (j != -34686)
  94. return;
  95. anInt442 = i;
  96. for (int k = 0; k < anInt438; k++) {
  97. for (int l = 0; l < anInt439; l++)
  98. if (groundArray[i][k][l] == null)
  99. groundArray[i][k][l] = new Ground(
  100. i, k, l);
  101.  
  102. }
  103.  
  104. }
  105.  
  106. public void method276(int i, int j, int k) {
  107. Ground class30_sub3 = groundArray[0][j][i];
  108. for (int l = 0; l < 3; l++) {
  109. Ground class30_sub3_1 = groundArray[l][j][i] = groundArray[l + 1][j][i];
  110. if (class30_sub3_1 != null) {
  111. class30_sub3_1.anInt1307--;
  112. for (int j1 = 0; j1 < class30_sub3_1.anInt1317; j1++) {
  113. Object5 class28 = class30_sub3_1.obj5Array[j1];
  114. if ((class28.uid >> 29 & 3) == 2
  115. && class28.anInt523 == j && class28.anInt525 == i)
  116. class28.anInt517--;
  117. }
  118.  
  119. }
  120. }
  121.  
  122. while (k >= 0) {
  123. for (int i1 = 1; i1 > 0; i1++)
  124. ;
  125. }
  126. if (groundArray[0][j][i] == null)
  127. groundArray[0][j][i] = new Ground(0, j, i);
  128. groundArray[0][j][i].aClass30_Sub3_1329 = class30_sub3;
  129. groundArray[3][j][i] = null;
  130. }
  131.  
  132. public static void method277(int i, int j, int k, int l, int i1, int j1,
  133. int k1, int l1, int i2) {
  134. while (k1 >= 0)
  135. anInt432 = -170;
  136. Class47 class47 = new Class47();
  137. class47.anInt787 = j / 128;
  138. class47.anInt788 = l / 128;
  139. class47.anInt789 = l1 / 128;
  140. class47.anInt790 = i1 / 128;
  141. class47.anInt791 = i2;
  142. class47.anInt792 = j;
  143. class47.anInt793 = l;
  144. class47.anInt794 = l1;
  145. class47.anInt795 = i1;
  146. class47.anInt796 = j1;
  147. class47.anInt797 = k;
  148. aClass47ArrayArray474[i][anIntArray473[i]++] = class47;
  149. }
  150.  
  151. public void method278(int i, int j, int k, int l) {
  152. Ground class30_sub3 = groundArray[i][j][k];
  153. if (class30_sub3 == null) {
  154. return;
  155. } else {
  156. groundArray[i][j][k].anInt1321 = l;
  157. return;
  158. }
  159. }
  160.  
  161. public void method279(int i, int j, int k, int l, int i1, int j1, int k1,
  162. int l1, int i2, int j2, int k2, int l2, int i3, int j3, int k3,
  163. int l3, int i4, int j4, int k4, int l4) {
  164. if (l == 0) {
  165. Class43 class43 = new Class43(k2, l2, i3, j3, -1, k4, false);
  166. for (int i5 = i; i5 >= 0; i5--)
  167. if (groundArray[i5][j][k] == null)
  168. groundArray[i5][j][k] = new Ground(
  169. i5, j, k);
  170.  
  171. groundArray[i][j][k].aClass43_1311 = class43;
  172. return;
  173. }
  174. if (l == 1) {
  175. Class43 class43_1 = new Class43(k3, l3, i4, j4, j1, l4, k1 == l1
  176. && k1 == i2 && k1 == j2);
  177. for (int j5 = i; j5 >= 0; j5--)
  178. if (groundArray[j5][j][k] == null)
  179. groundArray[j5][j][k] = new Ground(
  180. j5, j, k);
  181.  
  182. groundArray[i][j][k].aClass43_1311 = class43_1;
  183. return;
  184. }
  185. Class40 class40 = new Class40(k, k3, j3, i2, j1, i4, i1, k2, k4, i3,
  186. j2, l1, k1, l, j4, l3, l2, 3, j, l4);
  187. for (int k5 = i; k5 >= 0; k5--)
  188. if (groundArray[k5][j][k] == null)
  189. groundArray[k5][j][k] = new Ground(
  190. k5, j, k);
  191.  
  192. groundArray[i][j][k].aClass40_1312 = class40;
  193. }
  194.  
  195. public void method280(int i, int j, int k, Animable class30_sub2_sub4,
  196. byte byte0, int i1, int j1, int var)
  197. {
  198. if(class30_sub2_sub4 == null)
  199. return;
  200. Object3 groundDecoration = new Object3();//GroundDecoration
  201. groundDecoration.aClass30_Sub2_Sub4_814 = class30_sub2_sub4;
  202. groundDecoration.anInt812 = j1 * 128 + 64;//x
  203. groundDecoration.anInt813 = k * 128 + 64;//y
  204. groundDecoration.anInt811 = j;//z
  205. groundDecoration.uid = i1;
  206. groundDecoration.aByte816 = byte0;//objConfig
  207. groundDecoration.setNewUID(var);
  208. if(groundArray[i][j1][k] == null)
  209. groundArray[i][j1][k] = new Ground(i, j1, k);
  210. groundArray[i][j1][k].obj3 = groundDecoration;
  211. }
  212. public void method281(byte byte0, int i, int j,
  213. Animable class30_sub2_sub4, int k,
  214. Animable class30_sub2_sub4_1,
  215. Animable class30_sub2_sub4_2, int l, int i1) {
  216. Object4 class3 = new Object4();
  217. class3.aClass30_Sub2_Sub4_48 = class30_sub2_sub4_2;
  218. class3.anInt46 = i * 128 + 64;
  219. class3.anInt47 = i1 * 128 + 64;
  220. if (byte0 != 7)
  221. return;
  222. class3.anInt45 = k;
  223. class3.anInt51 = j;
  224. class3.aClass30_Sub2_Sub4_49 = class30_sub2_sub4;
  225. class3.aClass30_Sub2_Sub4_50 = class30_sub2_sub4_1;
  226. int j1 = 0;
  227. Ground class30_sub3 = groundArray[l][i][i1];
  228. if (class30_sub3 != null) {
  229. for (int k1 = 0; k1 < class30_sub3.anInt1317; k1++)
  230. if (class30_sub3.obj5Array[k1].aClass30_Sub2_Sub4_521 instanceof Model) {
  231. int l1 = ((Model) class30_sub3.obj5Array[k1].aClass30_Sub2_Sub4_521).anInt1654;
  232. if (l1 > j1)
  233. j1 = l1;
  234. }
  235.  
  236. }
  237. class3.anInt52 = j1;
  238. if (groundArray[l][i][i1] == null)
  239. groundArray[l][i][i1] = new Ground(l, i,
  240. i1);
  241. groundArray[l][i][i1].aClass3_1316 = class3;
  242. }
  243.  
  244. public void method282(int i, Animable class30_sub2_sub4, int j, int k, byte byte0, int l,
  245. Animable class30_sub2_sub4_1, int i1, int j1, int k1, int var)
  246. {
  247. if(class30_sub2_sub4 == null && class30_sub2_sub4_1 == null)
  248. return;
  249. Object1 wallObj = new Object1();//WallObject
  250. wallObj.uid = j;
  251. wallObj.aByte281 = byte0;//objConfig
  252. wallObj.anInt274 = l * 128 + 64;//x
  253. wallObj.anInt275 = k * 128 + 64;//y
  254. wallObj.anInt273 = i1;//z
  255. wallObj.aClass30_Sub2_Sub4_278 = class30_sub2_sub4;
  256. wallObj.aClass30_Sub2_Sub4_279 = class30_sub2_sub4_1;
  257. wallObj.orientation = i;
  258. wallObj.orientation1 = j1;
  259. wallObj.setNewUID(var);
  260. for(int l1 = k1; l1 >= 0; l1--)
  261. if(groundArray[l1][l][k] == null)
  262. groundArray[l1][l][k] = new Ground(l1, l, k);
  263. groundArray[k1][l][k].obj1 = wallObj;
  264. }
  265.  
  266. public void method283(int i, int j, int k, int i1, int j1, int k1,
  267. Animable class30_sub2_sub4, int l1, byte byte0, int i2, int j2, int var)
  268. {
  269. if(class30_sub2_sub4 == null)
  270. return;
  271. Object2 wallDecoration = new Object2();//WallDecoration
  272. wallDecoration.uid = i;
  273. wallDecoration.aByte506 = byte0;//objConfig
  274. wallDecoration.anInt500 = l1 * 128 + 64 + j1;//x
  275. wallDecoration.anInt501 = j * 128 + 64 + i2;//y
  276. wallDecoration.anInt499 = k1;//z
  277. wallDecoration.aClass30_Sub2_Sub4_504 = class30_sub2_sub4;
  278. wallDecoration.anInt502 = j2;//facebits
  279. wallDecoration.anInt503 = k;//face
  280. wallDecoration.setNewUID(var);
  281. for(int k2 = i1; k2 >= 0; k2--)
  282. if(groundArray[k2][l1][j] == null)
  283. groundArray[k2][l1][j] = new Ground(k2, l1, j);
  284.  
  285. groundArray[i1][l1][j].obj2 = wallDecoration;
  286. }
  287.  
  288. public boolean method284(int i, byte byte0, int j, int k, Animable class30_sub2_sub4,
  289. int l, int i1, int j1, int k1, int l1, int var11)
  290. {
  291. if(class30_sub2_sub4 == null) {
  292. return true;
  293. } else {
  294. int i2 = l1 * 128 + 64 * l;
  295. int j2 = k1 * 128 + 64 * k;
  296. return method287(i1, l1, k1, l, k, i2, j2, j, class30_sub2_sub4, j1, false, i, byte0, var11);
  297. }
  298. }
  299.  
  300. public boolean method285(int i, int j, int k, int l, int i1, int j1, int k1,
  301. Animable class30_sub2_sub4, boolean flag)
  302. {
  303. if(class30_sub2_sub4 == null)
  304. return true;
  305. int l1 = k1 - j1;
  306. int i2 = i1 - j1;
  307. int j2 = k1 + j1;
  308. int k2 = i1 + j1;
  309. if(flag) {
  310. if(j > 640 && j < 1408)
  311. k2 += 128;
  312. if(j > 1152 && j < 1920)
  313. j2 += 128;
  314. if(j > 1664 || j < 384)
  315. i2 -= 128;
  316. if(j > 128 && j < 896)
  317. l1 -= 128;
  318. }
  319. l1 /= 128;
  320. i2 /= 128;
  321. j2 /= 128;
  322. k2 /= 128;
  323. return method287(i, l1, i2, (j2 - l1) + 1, (k2 - i2) + 1, k1, i1, k, class30_sub2_sub4, j, true, l, (byte)0, 0);
  324. }
  325.  
  326. public boolean method286(int j, int k, Animable class30_sub2_sub4, int l, int i1,
  327. int j1, int k1, int l1, int i2, int j2, int k2)
  328. {
  329. return class30_sub2_sub4 == null ||
  330. method287(j, l1, k2, (i2 - l1) + 1, (i1 - k2) + 1, j1, k, k1, class30_sub2_sub4, l, true, j2, (byte) 0, 0);
  331. }
  332.  
  333. private boolean method287(int i, int j, int k, int l, int i1, int j1, int k1, int l1,
  334. Animable class30_sub2_sub4, int i2, boolean flag, int j2, byte byte0, int var)
  335. {
  336. for(int k2 = j; k2 < j + l; k2++) {
  337. for(int l2 = k; l2 < k + i1; l2++) {
  338. if(k2 < 0 || l2 < 0 || k2 >= anInt438 || l2 >= anInt439)
  339. return false;
  340. Ground tile = groundArray[i][k2][l2];
  341. if(tile != null && tile.anInt1317 >= 5)
  342. return false;
  343. }
  344. }
  345. Object5 interactableObj = new Object5();//InteractableObject
  346. interactableObj.uid = j2;
  347. interactableObj.aByte530 = byte0;//objConfig
  348. interactableObj.anInt517 = i;//z
  349. interactableObj.anInt519 = j1;//worldX
  350. interactableObj.anInt520 = k1;//worldY
  351. interactableObj.anInt518 = l1;//worldZ
  352. interactableObj.aClass30_Sub2_Sub4_521 = class30_sub2_sub4;
  353. interactableObj.anInt522 = i2;//rotation
  354. interactableObj.anInt523 = j;//tileLeft
  355. interactableObj.anInt525 = k;//tileTop
  356. interactableObj.anInt524 = (j + l) - 1;//tileRight
  357. interactableObj.anInt526 = (k + i1) - 1;//tileBottom
  358. interactableObj.setNewUID(var);
  359. for(int i3 = j; i3 < j + l; i3++) {
  360. for(int j3 = k; j3 < k + i1; j3++) {
  361. int k3 = 0;
  362. if(i3 > j)
  363. k3++;
  364. if(i3 < (j + l) - 1)
  365. k3 += 4;
  366. if(j3 > k)
  367. k3 += 8;
  368. if(j3 < (k + i1) - 1)
  369. k3 += 2;
  370. for(int l3 = i; l3 >= 0; l3--)
  371. if(groundArray[l3][i3][j3] == null)
  372. groundArray[l3][i3][j3] = new Ground(l3, i3, j3);
  373. Ground tile = groundArray[i][i3][j3];
  374. tile.obj5Array[tile.anInt1317] = interactableObj;
  375. tile.anIntArray1319[tile.anInt1317] = k3;
  376. tile.anInt1320 |= k3;
  377. tile.anInt1317++;
  378. }
  379. }
  380. if(flag)
  381. obj5Cache[obj5CacheCurrPos++] = interactableObj;
  382. return true;
  383. }
  384. public void method288(byte byte0) {
  385. if (byte0 != 104)
  386. aBoolean435 = !aBoolean435;
  387. for (int i = 0; i < obj5CacheCurrPos; i++) {
  388. Object5 class28 = obj5Cache[i];
  389. method289(-997, class28);
  390. obj5Cache[i] = null;
  391. }
  392.  
  393. obj5CacheCurrPos = 0;
  394. }
  395.  
  396. private void method289(int i, Object5 class28) {
  397. if (i >= 0)
  398. return;
  399. for (int j = class28.anInt523; j <= class28.anInt524; j++) {
  400. for (int k = class28.anInt525; k <= class28.anInt526; k++) {
  401. Ground class30_sub3 = groundArray[class28.anInt517][j][k];
  402. if (class30_sub3 != null) {
  403. for (int l = 0; l < class30_sub3.anInt1317; l++) {
  404. if (class30_sub3.obj5Array[l] != class28)
  405. continue;
  406. class30_sub3.anInt1317--;
  407. for (int i1 = l; i1 < class30_sub3.anInt1317; i1++) {
  408. class30_sub3.obj5Array[i1] = class30_sub3.obj5Array[i1 + 1];
  409. class30_sub3.anIntArray1319[i1] = class30_sub3.anIntArray1319[i1 + 1];
  410. }
  411.  
  412. class30_sub3.obj5Array[class30_sub3.anInt1317] = null;
  413. break;
  414. }
  415.  
  416. class30_sub3.anInt1320 = 0;
  417. for (int j1 = 0; j1 < class30_sub3.anInt1317; j1++)
  418. class30_sub3.anInt1320 |= class30_sub3.anIntArray1319[j1];
  419.  
  420. }
  421. }
  422.  
  423. }
  424.  
  425. }
  426.  
  427. public void method290(int i, int j, int k, int l, int i1) {
  428. Ground class30_sub3 = groundArray[i1][l][i];
  429. if (j <= 0)
  430. aBoolean429 = !aBoolean429;
  431. if (class30_sub3 == null)
  432. return;
  433. Object2 class26 = class30_sub3.obj2;
  434. if (class26 == null) {
  435. return;
  436. } else {
  437. int j1 = l * 128 + 64;
  438. int k1 = i * 128 + 64;
  439. class26.anInt500 = j1 + ((class26.anInt500 - j1) * k) / 16;
  440. class26.anInt501 = k1 + ((class26.anInt501 - k1) * k) / 16;
  441. return;
  442. }
  443. }
  444.  
  445. public void method291(int i, int j, int k, byte byte0) {
  446. Ground class30_sub3 = groundArray[j][i][k];
  447. if (byte0 != -119)
  448. aBoolean434 = !aBoolean434;
  449. if (class30_sub3 == null) {
  450. return;
  451. } else {
  452. class30_sub3.obj1 = null;
  453. return;
  454. }
  455. }
  456.  
  457. public void method292(int i, int j, int k, int l) {
  458. Ground class30_sub3 = groundArray[k][l][j];
  459. if (class30_sub3 == null) {
  460. return;
  461. } else {
  462. class30_sub3.obj2 = null;
  463. if (i == 0)
  464. ;
  465. return;
  466. }
  467. }
  468.  
  469. public void method293(int i, int j, int k, int l) {
  470. if (j >= 0) {
  471. for (int i1 = 1; i1 > 0; i1++)
  472. ;
  473. }
  474. Ground class30_sub3 = groundArray[i][k][l];
  475. if (class30_sub3 == null)
  476. return;
  477. for (int j1 = 0; j1 < class30_sub3.anInt1317; j1++) {
  478. Object5 class28 = class30_sub3.obj5Array[j1];
  479. if ((class28.uid >> 29 & 3) == 2 && class28.anInt523 == k
  480. && class28.anInt525 == l) {
  481. method289(-997, class28);
  482. return;
  483. }
  484. }
  485.  
  486. }
  487.  
  488. public void method294(byte byte0, int i, int j, int k) {
  489. Ground class30_sub3 = groundArray[i][k][j];
  490. if (class30_sub3 == null)
  491. return;
  492. class30_sub3.obj3 = null;
  493. if (byte0 == 9)
  494. byte0 = 0;
  495. }
  496.  
  497. public void method295(int i, int j, int k) {
  498. Ground class30_sub3 = groundArray[i][j][k];
  499. if (class30_sub3 == null) {
  500. return;
  501. } else {
  502. class30_sub3.aClass3_1316 = null;
  503. return;
  504. }
  505. }
  506. public int fetchObjectMeshNewUID(int z, int x, int y) {
  507. Ground tile = groundArray[z][x][y];
  508. if(tile == null)
  509. return 0;
  510. for(int l = 0; l < tile.anInt1317; l++) {
  511. Object5 interactableObject = tile.obj5Array[l];
  512. if((interactableObject.uid >> 29 & 3) == 2 &&
  513. interactableObject.anInt523 == x && interactableObject.anInt525 == y) {
  514. return interactableObject.getNewUID();
  515. }
  516. }
  517. return 0;
  518. }
  519.  
  520. public Object1 method296(int i, int j, int k, boolean flag) {
  521. if (flag)
  522. anInt433 = -195;
  523. Ground class30_sub3 = groundArray[i][j][k];
  524. if (class30_sub3 == null)
  525. return null;
  526. else
  527. return class30_sub3.obj1;
  528. }
  529.  
  530. public Object2 method297(int i, int j, int k, int l) {
  531. if (j <= 0)
  532. throw new NullPointerException();
  533. Ground class30_sub3 = groundArray[l][i][k];
  534. if (class30_sub3 == null)
  535. return null;
  536. else
  537. return class30_sub3.obj2;
  538. }
  539.  
  540. public Object5 method298(int i, int j, byte byte0, int k) {
  541. Ground class30_sub3 = groundArray[k][i][j];
  542. if (class30_sub3 == null)
  543. return null;
  544. for (int l = 0; l < class30_sub3.anInt1317; l++) {
  545. Object5 class28 = class30_sub3.obj5Array[l];
  546. if ((class28.uid >> 29 & 3) == 2 && class28.anInt523 == i
  547. && class28.anInt525 == j)
  548. return class28;
  549. }
  550.  
  551. if (byte0 == 4)
  552. byte0 = 0;
  553. else
  554. anInt432 = -376;
  555. return null;
  556. }
  557.  
  558. public Object3 method299(int i, int j, int k, int l) {
  559. Ground class30_sub3 = groundArray[k][j][i];
  560. if (l != 0) {
  561. for (int i1 = 1; i1 > 0; i1++)
  562. ;
  563. }
  564. if (class30_sub3 == null || class30_sub3.obj3 == null)
  565. return null;
  566. else
  567. return class30_sub3.obj3;
  568. }
  569.  
  570. public int method300(int i, int j, int k) {
  571. Ground tile = groundArray[i][j][k];
  572. if(tile == null || tile.obj1 == null)
  573. return 0;
  574. else
  575. return tile.obj1.getNewUID();
  576. }
  577.  
  578. public int method301(int i, int j, int l) {
  579. Ground tile = groundArray[i][j][l];
  580. if(tile == null || tile.obj2 == null)
  581. return 0;
  582. else
  583. return tile.obj2.getNewUID();
  584. }
  585.  
  586. public int method302(int z, int x, int y) {
  587. Ground tile = groundArray[z][x][y];
  588. if(tile == null)
  589. return 0;
  590. for(int l = 0; l < tile.anInt1317; l++) {
  591. Object5 interactableObject = tile.obj5Array[l];
  592. if((interactableObject.getNewUID() >> 29 & 3) == 2 &&
  593. interactableObject.anInt523 == x && interactableObject.anInt525 == y) {
  594. return interactableObject.getNewUID();
  595. }
  596. }
  597. return 0;
  598. }
  599. public int fetchWallObjectNewUID(int i, int j, int k) {
  600. Ground tile = groundArray[i][j][k];
  601. if(tile == null || tile.obj1 == null)
  602. return 0;
  603. else
  604. return tile.obj1.getNewUID();
  605. }
  606. public int method303(int i, int j, int k) {
  607. Ground tile = groundArray[i][j][k];
  608. if(tile == null || tile.obj3 == null)
  609. return 0;
  610. else
  611. return tile.obj3.getNewUID();
  612. }
  613. public int fetchGroundDecorationNewUID(int i, int j, int k) {
  614. Ground tile = groundArray[i][j][k];
  615. if(tile == null || tile.obj3 == null)
  616. return 0;
  617. else
  618. return tile.obj3.getNewUID();
  619. }
  620. public int method304(int z, int x, int y, int objectMesh) {//fecthObjectIDXYZ
  621. Ground tile = groundArray[z][x][y];
  622. if(tile == null)
  623. return -1;
  624. if(tile.obj1 != null && tile.obj1.uid == objectMesh)//obj1 = wall
  625. return tile.obj1.aByte281 & 255;
  626. if(tile.obj2 != null && tile.obj2.uid == objectMesh)//obj2 = wallDec
  627. return tile.obj2.aByte506 & 255;
  628. if(tile.obj3 != null && tile.obj3.uid == objectMesh)//obj3 = groundDec
  629. return tile.obj3.aByte816 & 255;
  630. for(int i1 = 0; i1 < tile.anInt1317; i1++)//anInt1317 = count?
  631. if(tile.obj5Array[i1].getNewUID() == objectMesh)
  632. return tile.obj5Array[i1].aByte530 & 255;
  633.  
  634. return -1;
  635. }
  636.  
  637. public void method305(int i, int k, int i1) {
  638. int j = 100;
  639. int l = 5500;
  640. int j1 = (int) Math.sqrt(k * k + i * i + i1 * i1);
  641. int k1 = l >> 4;
  642. for (int l1 = 0; l1 < anInt437; l1++) {
  643. for (int i2 = 0; i2 < anInt438; i2++) {
  644. for (int j2 = 0; j2 < anInt439; j2++) {
  645. Ground class30_sub3 = groundArray[l1][i2][j2];
  646. if (class30_sub3 != null) {
  647. Object1 class10 = class30_sub3.obj1;
  648. if (class10 != null
  649. && class10.aClass30_Sub2_Sub4_278 != null
  650. && class10.aClass30_Sub2_Sub4_278.aClass33Array1425 != null) {
  651. method307(
  652. l1,
  653. 1,
  654. 1,
  655. i2,
  656. (byte) 115,
  657. j2,
  658. (Model) class10.aClass30_Sub2_Sub4_278);
  659. if (class10.aClass30_Sub2_Sub4_279 != null
  660. && class10.aClass30_Sub2_Sub4_279.aClass33Array1425 != null) {
  661. method307(
  662. l1,
  663. 1,
  664. 1,
  665. i2,
  666. (byte) 115,
  667. j2,
  668. (Model) class10.aClass30_Sub2_Sub4_279);
  669. method308(
  670. (Model) class10.aClass30_Sub2_Sub4_278,
  671. (Model) class10.aClass30_Sub2_Sub4_279,
  672. 0, 0, 0, false);
  673. ((Model) class10.aClass30_Sub2_Sub4_279)
  674. .method480(j, k1, k, i, i1);
  675. }
  676. ((Model) class10.aClass30_Sub2_Sub4_278)
  677. .method480(j, k1, k, i, i1);
  678. }
  679. for (int k2 = 0; k2 < class30_sub3.anInt1317; k2++) {
  680. Object5 class28 = class30_sub3.obj5Array[k2];
  681. if (class28 != null
  682. && class28.aClass30_Sub2_Sub4_521 != null
  683. && class28.aClass30_Sub2_Sub4_521.aClass33Array1425 != null) {
  684. method307(
  685. l1,
  686. (class28.anInt524 - class28.anInt523) + 1,
  687. (class28.anInt526 - class28.anInt525) + 1,
  688. i2,
  689. (byte) 115,
  690. j2,
  691. (Model) class28.aClass30_Sub2_Sub4_521);
  692. ((Model) class28.aClass30_Sub2_Sub4_521)
  693. .method480(j, k1, k, i, i1);
  694. }
  695. }
  696.  
  697. Object3 class49 = class30_sub3.obj3;
  698. if (class49 != null
  699. && class49.aClass30_Sub2_Sub4_814.aClass33Array1425 != null) {
  700. method306(
  701. i2,
  702. l1,
  703. (Model) class49.aClass30_Sub2_Sub4_814,
  704. (byte) 37, j2);
  705. ((Model) class49.aClass30_Sub2_Sub4_814)
  706. .method480(j, k1, k, i, i1);
  707. }
  708. }
  709. }
  710.  
  711. }
  712.  
  713. }
  714.  
  715. }
  716.  
  717. private void method306(int i, int j,
  718. Model Model, byte byte0, int k) {
  719. if (byte0 != 37) {
  720. for (int l = 1; l > 0; l++)
  721. ;
  722. }
  723. if (i < anInt438) {
  724. Ground class30_sub3 = groundArray[j][i + 1][k];
  725. if (class30_sub3 != null
  726. && class30_sub3.obj3 != null
  727. && class30_sub3.obj3.aClass30_Sub2_Sub4_814.aClass33Array1425 != null)
  728. method308(
  729. Model,
  730. (Model) class30_sub3.obj3.aClass30_Sub2_Sub4_814,
  731. 128, 0, 0, true);
  732. }
  733. if (k < anInt438) {
  734. Ground class30_sub3_1 = groundArray[j][i][k + 1];
  735. if (class30_sub3_1 != null
  736. && class30_sub3_1.obj3 != null
  737. && class30_sub3_1.obj3.aClass30_Sub2_Sub4_814.aClass33Array1425 != null)
  738. method308(
  739. Model,
  740. (Model) class30_sub3_1.obj3.aClass30_Sub2_Sub4_814,
  741. 0, 0, 128, true);
  742. }
  743. if (i < anInt438 && k < anInt439) {
  744. Ground class30_sub3_2 = groundArray[j][i + 1][k + 1];
  745. if (class30_sub3_2 != null
  746. && class30_sub3_2.obj3 != null
  747. && class30_sub3_2.obj3.aClass30_Sub2_Sub4_814.aClass33Array1425 != null)
  748. method308(
  749. Model,
  750. (Model) class30_sub3_2.obj3.aClass30_Sub2_Sub4_814,
  751. 128, 0, 128, true);
  752. }
  753. if (i < anInt438 && k > 0) {
  754. Ground class30_sub3_3 = groundArray[j][i + 1][k - 1];
  755. if (class30_sub3_3 != null
  756. && class30_sub3_3.obj3 != null
  757. && class30_sub3_3.obj3.aClass30_Sub2_Sub4_814.aClass33Array1425 != null)
  758. method308(
  759. Model,
  760. (Model) class30_sub3_3.obj3.aClass30_Sub2_Sub4_814,
  761. 128, 0, -128, true);
  762. }
  763. }
  764.  
  765. private void method307(int i, int j, int k, int l, byte byte0, int i1,
  766. Model Model) {
  767. boolean flag = true;
  768. if (byte0 != 115)
  769. anInt431 = 350;
  770. int j1 = l;
  771. int k1 = l + j;
  772. int l1 = i1 - 1;
  773. int i2 = i1 + k;
  774. for (int j2 = i; j2 <= i + 1; j2++)
  775. if (j2 != anInt437) {
  776. for (int k2 = j1; k2 <= k1; k2++)
  777. if (k2 >= 0 && k2 < anInt438) {
  778. for (int l2 = l1; l2 <= i2; l2++)
  779. if (l2 >= 0
  780. && l2 < anInt439
  781. && (!flag || k2 >= k1 || l2 >= i2 || l2 < i1
  782. && k2 != l)) {
  783. Ground class30_sub3 = groundArray[j2][k2][l2];
  784. if (class30_sub3 != null) {
  785. int i3 = (anIntArrayArrayArray440[j2][k2][l2]
  786. + anIntArrayArrayArray440[j2][k2 + 1][l2]
  787. + anIntArrayArrayArray440[j2][k2][l2 + 1] + anIntArrayArrayArray440[j2][k2 + 1][l2 + 1])
  788. / 4
  789. - (anIntArrayArrayArray440[i][l][i1]
  790. + anIntArrayArrayArray440[i][l + 1][i1]
  791. + anIntArrayArrayArray440[i][l][i1 + 1] + anIntArrayArrayArray440[i][l + 1][i1 + 1])
  792. / 4;
  793. Object1 class10 = class30_sub3.obj1;
  794. if (class10 != null
  795. && class10.aClass30_Sub2_Sub4_278 != null
  796. && class10.aClass30_Sub2_Sub4_278.aClass33Array1425 != null)
  797. method308(
  798. Model,
  799. (Model) class10.aClass30_Sub2_Sub4_278,
  800. (k2 - l) * 128 + (1 - j) * 64,
  801. i3, (l2 - i1) * 128 + (1 - k)
  802. * 64, flag);
  803. if (class10 != null
  804. && class10.aClass30_Sub2_Sub4_279 != null
  805. && class10.aClass30_Sub2_Sub4_279.aClass33Array1425 != null)
  806. method308(
  807. Model,
  808. (Model) class10.aClass30_Sub2_Sub4_279,
  809. (k2 - l) * 128 + (1 - j) * 64,
  810. i3, (l2 - i1) * 128 + (1 - k)
  811. * 64, flag);
  812. for (int j3 = 0; j3 < class30_sub3.anInt1317; j3++) {
  813. Object5 class28 = class30_sub3.obj5Array[j3];
  814. if (class28 != null
  815. && class28.aClass30_Sub2_Sub4_521 != null
  816. && class28.aClass30_Sub2_Sub4_521.aClass33Array1425 != null) {
  817. int k3 = (class28.anInt524 - class28.anInt523) + 1;
  818. int l3 = (class28.anInt526 - class28.anInt525) + 1;
  819. method308(
  820. Model,
  821. (Model) class28.aClass30_Sub2_Sub4_521,
  822. (class28.anInt523 - l)
  823. * 128 + (k3 - j)
  824. * 64, i3,
  825. (class28.anInt525 - i1)
  826. * 128 + (l3 - k)
  827. * 64, flag);
  828. }
  829. }
  830.  
  831. }
  832. }
  833.  
  834. }
  835.  
  836. j1--;
  837. flag = false;
  838. }
  839.  
  840. }
  841.  
  842. private void method308(Model Model,
  843. Model Model_1, int i, int j,
  844. int k, boolean flag) {
  845. anInt488++;
  846. int l = 0;
  847. int ai[] = Model_1.anIntArray1627;
  848. int i1 = Model_1.anInt1626;
  849. for (int j1 = 0; j1 < Model.anInt1626; j1++) {
  850. Class33 class33 = ((Animable) (Model)).aClass33Array1425[j1];
  851. Class33 class33_1 = Model.aClass33Array1660[j1];
  852. if (class33_1.anInt605 != 0) {
  853. int i2 = Model.anIntArray1628[j1] - j;
  854. if (i2 <= Model_1.anInt1651) {
  855. int j2 = Model.anIntArray1627[j1] - i;
  856. if (j2 >= Model_1.anInt1646
  857. && j2 <= Model_1.anInt1647) {
  858. int k2 = Model.anIntArray1629[j1] - k;
  859. if (k2 >= Model_1.anInt1649
  860. && k2 <= Model_1.anInt1648) {
  861. for (int l2 = 0; l2 < i1; l2++) {
  862. Class33 class33_2 = ((Animable) (Model_1)).aClass33Array1425[l2];
  863. Class33 class33_3 = Model_1.aClass33Array1660[l2];
  864. if (j2 == ai[l2]
  865. && k2 == Model_1.anIntArray1629[l2]
  866. && i2 == Model_1.anIntArray1628[l2]
  867. && class33_3.anInt605 != 0) {
  868. class33.anInt602 += class33_3.anInt602;
  869. class33.anInt603 += class33_3.anInt603;
  870. class33.anInt604 += class33_3.anInt604;
  871. class33.anInt605 += class33_3.anInt605;
  872. class33_2.anInt602 += class33_1.anInt602;
  873. class33_2.anInt603 += class33_1.anInt603;
  874. class33_2.anInt604 += class33_1.anInt604;
  875. class33_2.anInt605 += class33_1.anInt605;
  876. l++;
  877. anIntArray486[j1] = anInt488;
  878. anIntArray487[l2] = anInt488;
  879. }
  880. }
  881.  
  882. }
  883. }
  884. }
  885. }
  886. }
  887.  
  888. if (l < 3 || !flag)
  889. return;
  890. for (int k1 = 0; k1 < Model.anInt1630; k1++)
  891. if (anIntArray486[Model.trianglePoints1[k1]] == anInt488
  892. && anIntArray486[Model.trianglePoints2[k1]] == anInt488
  893. && anIntArray486[Model.trianglePoints3[k1]] == anInt488)
  894. Model.anIntArray1637[k1] = -1;
  895.  
  896. for (int l1 = 0; l1 < Model_1.anInt1630; l1++)
  897. if (anIntArray487[Model_1.trianglePoints1[l1]] == anInt488
  898. && anIntArray487[Model_1.trianglePoints2[l1]] == anInt488
  899. && anIntArray487[Model_1.trianglePoints3[l1]] == anInt488)
  900. Model_1.anIntArray1637[l1] = -1;
  901.  
  902. }
  903.  
  904. public void method309(int pixels[], int pixelOffset, int z, int x, int y) {
  905. Ground class30_sub3 = groundArray[z][x][y];
  906. if (class30_sub3 == null) {
  907. return;
  908. }
  909. Class43 class43 = class30_sub3.aClass43_1311;
  910. if (class43 != null) {
  911. if (class43.anInt716 != 12345678) {
  912. if (class43.anInt722 == 0) {
  913. return;
  914. }
  915. int hs = class43.anInt716 & ~0x7f;
  916. int l1 = class43.anInt719 & 0x7f;
  917. int l2 = class43.anInt718 & 0x7f;
  918. int l3 = (class43.anInt716 & 0x7f) - l1;
  919. int l4 = (class43.anInt717 & 0x7f) - l2;
  920. l1 <<= 2;
  921. l2 <<= 2;
  922. for (int k1 = 0; k1 < 4; k1++) {
  923. if (!class43.aBoolean721) {
  924. pixels[pixelOffset] = Texture.anIntArray1482[hs
  925. | (l1 >> 2)];
  926. pixels[pixelOffset + 1] = Texture.anIntArray1482[hs
  927. | (l1 * 3 + l2 >> 4)];
  928. pixels[pixelOffset + 2] = Texture.anIntArray1482[hs
  929. | (l1 + l2 >> 3)];
  930. pixels[pixelOffset + 3] = Texture.anIntArray1482[hs
  931. | (l1 + l2 * 3 >> 4)];
  932. } else {
  933. int j1 = class43.anInt722;
  934. int lig = 0xff - ((l1 >> 1) * (l1 >> 1) >> 8);
  935. pixels[pixelOffset] = ((j1 & 0xff00ff) * lig & ~0xff00ff)
  936. + ((j1 & 0xff00) * lig & 0xff0000) >> 8;
  937. lig = 0xff - ((l1 * 3 + l2 >> 3) * (l1 * 3 + l2 >> 3) >> 8);
  938. pixels[pixelOffset + 1] = ((j1 & 0xff00ff) * lig & ~0xff00ff)
  939. + ((j1 & 0xff00) * lig & 0xff0000) >> 8;
  940. lig = 0xff - ((l1 + l2 >> 2) * (l1 + l2 >> 2) >> 8);
  941. pixels[pixelOffset + 2] = ((j1 & 0xff00ff) * lig & ~0xff00ff)
  942. + ((j1 & 0xff00) * lig & 0xff0000) >> 8;
  943. lig = 0xff - ((l1 + l2 * 3 >> 3) * (l1 + l2 * 3 >> 3) >> 8);
  944. pixels[pixelOffset + 3] = ((j1 & 0xff00ff) * lig & ~0xff00ff)
  945. + ((j1 & 0xff00) * lig & 0xff0000) >> 8;
  946. }
  947. l1 += l3;
  948. l2 += l4;
  949. pixelOffset += 512;
  950. }
  951. return;
  952. }
  953. int mapColor = class43.anInt722;
  954. if (mapColor == 0) {
  955. return;
  956. }
  957. for (int k1 = 0; k1 < 4; k1++) {
  958. pixels[pixelOffset] = mapColor;
  959. pixels[pixelOffset + 1] = mapColor;
  960. pixels[pixelOffset + 2] = mapColor;
  961. pixels[pixelOffset + 3] = mapColor;
  962. pixelOffset += 512;
  963. }
  964. return;
  965. }
  966. Class40 class40 = class30_sub3.aClass40_1312;
  967. if (class40 == null) {
  968. return;
  969. }
  970. int l1 = class40.anInt684;
  971. int i2 = class40.anInt685;
  972. int j2 = class40.anInt686;
  973. int k2 = class40.anInt687;
  974. int ai1[] = anIntArrayArray489[l1];
  975. int ai2[] = anIntArrayArray490[i2];
  976. int l2 = 0;
  977. if (class40.color62 != 12345678) {
  978. int hs1 = class40.color62 & ~0x7f;
  979. int l11 = class40.color92 & 0x7f;
  980. int l21 = class40.color82 & 0x7f;
  981. int l31 = (class40.color62 & 0x7f) - l11;
  982. int l41 = (class40.color72 & 0x7f) - l21;
  983. l11 <<= 2;
  984. l21 <<= 2;
  985. for (int k1 = 0; k1 < 4; k1++) {
  986. if (!class40.textured) {
  987. if (ai1[ai2[l2++]] != 0) {
  988. pixels[pixelOffset] = Texture.anIntArray1482[hs1
  989. | (l11 >> 2)];
  990. }
  991. if (ai1[ai2[l2++]] != 0) {
  992. pixels[pixelOffset + 1] = Texture.anIntArray1482[hs1
  993. | (l11 * 3 + l21 >> 4)];
  994. }
  995. if (ai1[ai2[l2++]] != 0) {
  996. pixels[pixelOffset + 2] = Texture.anIntArray1482[hs1
  997. | (l11 + l21 >> 3)];
  998. }
  999. if (ai1[ai2[l2++]] != 0) {
  1000. pixels[pixelOffset + 3] = Texture.anIntArray1482[hs1
  1001. | (l11 + l21 * 3 >> 4)];
  1002. }
  1003. } else {
  1004. int j1 = k2;
  1005. if (ai1[ai2[l2++]] != 0) {
  1006. int lig = 0xff - ((l11 >> 1) * (l11 >> 1) >> 8);
  1007. pixels[pixelOffset] = ((j1 & 0xff00ff) * lig & ~0xff00ff)
  1008. + ((j1 & 0xff00) * lig & 0xff0000) >> 8;
  1009. }
  1010. if (ai1[ai2[l2++]] != 0) {
  1011. int lig = 0xff - ((l11 * 3 + l21 >> 3)
  1012. * (l11 * 3 + l21 >> 3) >> 8);
  1013. pixels[pixelOffset + 1] = ((j1 & 0xff00ff) * lig & ~0xff00ff)
  1014. + ((j1 & 0xff00) * lig & 0xff0000) >> 8;
  1015. }
  1016. if (ai1[ai2[l2++]] != 0) {
  1017. int lig = 0xff - ((l11 + l21 >> 2) * (l11 + l21 >> 2) >> 8);
  1018. pixels[pixelOffset + 2] = ((j1 & 0xff00ff) * lig & ~0xff00ff)
  1019. + ((j1 & 0xff00) * lig & 0xff0000) >> 8;
  1020. }
  1021. if (ai1[ai2[l2++]] != 0) {
  1022. int lig = 0xff - ((l11 + l21 * 3 >> 3)
  1023. * (l11 + l21 * 3 >> 3) >> 8);
  1024. pixels[pixelOffset + 3] = ((j1 & 0xff00ff) * lig & ~0xff00ff)
  1025. + ((j1 & 0xff00) * lig & 0xff0000) >> 8;
  1026. }
  1027. }
  1028. l11 += l31;
  1029. l21 += l41;
  1030. pixelOffset += 512;
  1031. }
  1032. if (j2 != 0 && class40.color61 != 12345678) {
  1033. pixelOffset -= 512 << 2;
  1034. l2 -= 16;
  1035. hs1 = class40.color61 & ~0x7f;
  1036. l11 = class40.color91 & 0x7f;
  1037. l21 = class40.color81 & 0x7f;
  1038. l31 = (class40.color61 & 0x7f) - l11;
  1039. l41 = (class40.color71 & 0x7f) - l21;
  1040. l11 <<= 2;
  1041. l21 <<= 2;
  1042. for (int k1 = 0; k1 < 4; k1++) {
  1043. if (ai1[ai2[l2++]] == 0) {
  1044. pixels[pixelOffset] = Texture.anIntArray1482[hs1
  1045. | (l11 >> 2)];
  1046. }
  1047. if (ai1[ai2[l2++]] == 0) {
  1048. pixels[pixelOffset + 1] = Texture.anIntArray1482[hs1
  1049. | (l11 * 3 + l21 >> 4)];
  1050. }
  1051. if (ai1[ai2[l2++]] == 0) {
  1052. pixels[pixelOffset + 2] = Texture.anIntArray1482[hs1
  1053. | (l11 + l21 >> 3)];
  1054. }
  1055. if (ai1[ai2[l2++]] == 0) {
  1056. pixels[pixelOffset + 3] = Texture.anIntArray1482[hs1
  1057. | (l11 + l21 * 3 >> 4)];
  1058. }
  1059. l11 += l31;
  1060. l21 += l41;
  1061. pixelOffset += 512;
  1062. }
  1063. }
  1064. return;
  1065. }
  1066. if (j2 != 0) {
  1067. for (int i3 = 0; i3 < 4; i3++) {
  1068. pixels[pixelOffset] = ai1[ai2[l2++]] != 0 ? k2 : j2;
  1069. pixels[pixelOffset + 1] = ai1[ai2[l2++]] != 0 ? k2 : j2;
  1070. pixels[pixelOffset + 2] = ai1[ai2[l2++]] != 0 ? k2 : j2;
  1071. pixels[pixelOffset + 3] = ai1[ai2[l2++]] != 0 ? k2 : j2;
  1072. pixelOffset += 512;
  1073. }
  1074. return;
  1075. }
  1076. for (int j3 = 0; j3 < 4; j3++) {
  1077. if (ai1[ai2[l2++]] != 0) {
  1078. pixels[pixelOffset] = k2;
  1079. }
  1080. if (ai1[ai2[l2++]] != 0) {
  1081. pixels[pixelOffset + 1] = k2;
  1082. }
  1083. if (ai1[ai2[l2++]] != 0) {
  1084. pixels[pixelOffset + 2] = k2;
  1085. }
  1086. if (ai1[ai2[l2++]] != 0) {
  1087. pixels[pixelOffset + 3] = k2;
  1088. }
  1089. pixelOffset += 512;
  1090. }
  1091. }
  1092.  
  1093. public static void method310(int i, int j, int k, int l, int ai[])
  1094. {
  1095. anInt495 = 0;
  1096. anInt496 = 0;
  1097. anInt497 = k;
  1098. anInt498 = l;
  1099. anInt493 = k / 2;
  1100. anInt494 = l / 2;
  1101. boolean aflag[][][][] = new boolean[9][32][53][53];
  1102. for(int i1 = 128; i1 <= 384; i1 += 32)
  1103. {
  1104. for(int j1 = 0; j1 < 2048; j1 += 64)
  1105. {
  1106. anInt458 = Model.modelIntArray1[i1];
  1107. anInt459 = Model.modelIntArray2[i1];
  1108. anInt460 = Model.modelIntArray1[j1];
  1109. anInt461 = Model.modelIntArray2[j1];
  1110. int l1 = (i1 - 128) / 32;
  1111. int j2 = j1 / 64;
  1112. for(int l2 = -26; l2 <= 26; l2++)
  1113. {
  1114. for(int j3 = -26; j3 <= 26; j3++)
  1115. {
  1116. int k3 = l2 * 128;
  1117. int i4 = j3 * 128;
  1118. boolean flag2 = false;
  1119. for(int k4 = -i; k4 <= j; k4 += 128)
  1120. {
  1121. if(!method311(ai[l1] + k4, i4, k3))
  1122. continue;
  1123. flag2 = true;
  1124. break;
  1125. }
  1126.  
  1127. aflag[l1][j2][l2 + 25 + 1][j3 + 25 + 1] = flag2;
  1128. }
  1129.  
  1130. }
  1131.  
  1132. }
  1133.  
  1134. }
  1135.  
  1136. for(int k1 = 0; k1 < 8; k1++)
  1137. {
  1138. for(int i2 = 0; i2 < 32; i2++)
  1139. {
  1140. for(int k2 = -25; k2 < 25; k2++)
  1141. {
  1142. for(int i3 = -25; i3 < 25; i3++)
  1143. {
  1144. boolean flag1 = false;
  1145. label0:
  1146. for(int l3 = -1; l3 <= 1; l3++)
  1147. {
  1148. for(int j4 = -1; j4 <= 1; j4++)
  1149. {
  1150. if(aflag[k1][i2][k2 + l3 + 25 + 1][i3 + j4 + 25 + 1])
  1151. flag1 = true;
  1152. else
  1153. if(aflag[k1][(i2 + 1) % 31][k2 + l3 + 25 + 1][i3 + j4 + 25 + 1])
  1154. flag1 = true;
  1155. else
  1156. if(aflag[k1 + 1][i2][k2 + l3 + 25 + 1][i3 + j4 + 25 + 1])
  1157. {
  1158. flag1 = true;
  1159. } else
  1160. {
  1161. if(!aflag[k1 + 1][(i2 + 1) % 31][k2 + l3 + 25 + 1][i3 + j4 + 25 + 1])
  1162. continue;
  1163. flag1 = true;
  1164. }
  1165. break label0;
  1166. }
  1167.  
  1168. }
  1169.  
  1170. aBooleanArrayArrayArrayArray491[k1][i2][k2 + 25][i3 + 25] = flag1;
  1171. }
  1172.  
  1173. }
  1174.  
  1175. }
  1176.  
  1177. }
  1178.  
  1179. }
  1180.  
  1181. private static boolean method311(int i, int j, int k)
  1182. {
  1183. int l = j * anInt460 + k * anInt461 >> 16;
  1184. int i1 = j * anInt461 - k * anInt460 >> 16;
  1185. int j1 = i * anInt458 + i1 * anInt459 >> 16;
  1186. int k1 = i * anInt459 - i1 * anInt458 >> 16;
  1187. if(j1 < 50 || j1 > 3500)
  1188. return false;
  1189. int l1 = anInt493 + (l << viewDistance) / j1;
  1190. int i2 = anInt494 + (k1 << viewDistance) / j1;
  1191. return l1 >= anInt495 && l1 <= anInt497 && i2 >= anInt496 && i2 <= anInt498;
  1192. }
  1193.  
  1194. public void method312(int i, int j) {
  1195. aBoolean467 = true;
  1196. anInt468 = j;
  1197. anInt469 = i;
  1198. anInt470 = -1;
  1199. anInt471 = -1;
  1200. }
  1201.  
  1202. public void method313(int i, int j, int k, int l, int i1, int j1) {
  1203. if (i < 0)
  1204. i = 0;
  1205. else if (i >= anInt438 * 128)
  1206. i = anInt438 * 128 - 1;
  1207. if (j < 0)
  1208. j = 0;
  1209. else if (j >= anInt439 * 128)
  1210. j = anInt439 * 128 - 1;
  1211. anInt448++;
  1212. anInt458 = Model.modelIntArray1[j1];
  1213. anInt459 = Model.modelIntArray2[j1];
  1214. anInt460 = Model.modelIntArray1[k];
  1215. anInt461 = Model.modelIntArray2[k];
  1216. aBooleanArrayArray492 = aBooleanArrayArrayArrayArray491[(j1 - 128) / 32][k / 64];
  1217. anInt455 = i;
  1218. anInt456 = l;
  1219. anInt457 = j;
  1220. anInt453 = i / 128;
  1221. anInt454 = j / 128;
  1222. anInt447 = i1;
  1223. anInt449 = anInt453 - 25;
  1224. if (anInt449 < 0)
  1225. anInt449 = 0;
  1226. anInt451 = anInt454 - 25;
  1227. if (anInt451 < 0)
  1228. anInt451 = 0;
  1229. anInt450 = anInt453 + 25;
  1230. if (anInt450 > anInt438)
  1231. anInt450 = anInt438;
  1232. anInt452 = anInt454 + 25;
  1233. if (anInt452 > anInt439)
  1234. anInt452 = anInt439;
  1235. method319(0);
  1236. anInt446 = 0;
  1237. for (int k1 = anInt442; k1 < anInt437; k1++) {
  1238. Ground aclass30_sub3[][] = groundArray[k1];
  1239. for (int i2 = anInt449; i2 < anInt450; i2++) {
  1240. for (int k2 = anInt451; k2 < anInt452; k2++) {
  1241. Ground class30_sub3 = aclass30_sub3[i2][k2];
  1242. if (class30_sub3 != null)
  1243. if (class30_sub3.anInt1321 > i1
  1244. || !aBooleanArrayArray492[(i2 - anInt453) + 25][(k2 - anInt454) + 25]
  1245. && anIntArrayArrayArray440[k1][i2][k2] - l < 2000) {
  1246. class30_sub3.aBoolean1322 = false;
  1247. class30_sub3.aBoolean1323 = false;
  1248. class30_sub3.anInt1325 = 0;
  1249. } else {
  1250. class30_sub3.aBoolean1322 = true;
  1251. class30_sub3.aBoolean1323 = true;
  1252. if (class30_sub3.anInt1317 > 0)
  1253. class30_sub3.aBoolean1324 = true;
  1254. else
  1255. class30_sub3.aBoolean1324 = false;
  1256. anInt446++;
  1257. }
  1258. }
  1259.  
  1260. }
  1261.  
  1262. }
  1263.  
  1264. for (int l1 = anInt442; l1 < anInt437; l1++) {
  1265. Ground aclass30_sub3_1[][] = groundArray[l1];
  1266. for (int l2 = -25; l2 <= 0; l2++) {
  1267. int i3 = anInt453 + l2;
  1268. int k3 = anInt453 - l2;
  1269. if (i3 >= anInt449 || k3 < anInt450) {
  1270. for (int i4 = -25; i4 <= 0; i4++) {
  1271. int k4 = anInt454 + i4;
  1272. int i5 = anInt454 - i4;
  1273. if (i3 >= anInt449) {
  1274. if (k4 >= anInt451) {
  1275. Ground class30_sub3_1 = aclass30_sub3_1[i3][k4];
  1276. if (class30_sub3_1 != null
  1277. && class30_sub3_1.aBoolean1322)
  1278. method314(class30_sub3_1, true);
  1279. }
  1280. if (i5 < anInt452) {
  1281. Ground class30_sub3_2 = aclass30_sub3_1[i3][i5];
  1282. if (class30_sub3_2 != null
  1283. && class30_sub3_2.aBoolean1322)
  1284. method314(class30_sub3_2, true);
  1285. }
  1286. }
  1287. if (k3 < anInt450) {
  1288. if (k4 >= anInt451) {
  1289. Ground class30_sub3_3 = aclass30_sub3_1[k3][k4];
  1290. if (class30_sub3_3 != null
  1291. && class30_sub3_3.aBoolean1322)
  1292. method314(class30_sub3_3, true);
  1293. }
  1294. if (i5 < anInt452) {
  1295. Ground class30_sub3_4 = aclass30_sub3_1[k3][i5];
  1296. if (class30_sub3_4 != null
  1297. && class30_sub3_4.aBoolean1322)
  1298. method314(class30_sub3_4, true);
  1299. }
  1300. }
  1301. if (anInt446 == 0) {
  1302. aBoolean467 = false;
  1303. return;
  1304. }
  1305. }
  1306.  
  1307. }
  1308. }
  1309.  
  1310. }
  1311.  
  1312. for (int j2 = anInt442; j2 < anInt437; j2++) {
  1313. Ground aclass30_sub3_2[][] = groundArray[j2];
  1314. for (int j3 = -25; j3 <= 0; j3++) {
  1315. int l3 = anInt453 + j3;
  1316. int j4 = anInt453 - j3;
  1317. if (l3 >= anInt449 || j4 < anInt450) {
  1318. for (int l4 = -25; l4 <= 0; l4++) {
  1319. int j5 = anInt454 + l4;
  1320. int k5 = anInt454 - l4;
  1321. if (l3 >= anInt449) {
  1322. if (j5 >= anInt451) {
  1323. Ground class30_sub3_5 = aclass30_sub3_2[l3][j5];
  1324. if (class30_sub3_5 != null
  1325. && class30_sub3_5.aBoolean1322)
  1326. method314(class30_sub3_5, false);
  1327. }
  1328. if (k5 < anInt452) {
  1329. Ground class30_sub3_6 = aclass30_sub3_2[l3][k5];
  1330. if (class30_sub3_6 != null
  1331. && class30_sub3_6.aBoolean1322)
  1332. method314(class30_sub3_6, false);
  1333. }
  1334. }
  1335. if (j4 < anInt450) {
  1336. if (j5 >= anInt451) {
  1337. Ground class30_sub3_7 = aclass30_sub3_2[j4][j5];
  1338. if (class30_sub3_7 != null
  1339. && class30_sub3_7.aBoolean1322)
  1340. method314(class30_sub3_7, false);
  1341. }
  1342. if (k5 < anInt452) {
  1343. Ground class30_sub3_8 = aclass30_sub3_2[j4][k5];
  1344. if (class30_sub3_8 != null
  1345. && class30_sub3_8.aBoolean1322)
  1346. method314(class30_sub3_8, false);
  1347. }
  1348. }
  1349. if (anInt446 == 0) {
  1350. aBoolean467 = false;
  1351. return;
  1352. }
  1353. }
  1354.  
  1355. }
  1356. }
  1357.  
  1358. }
  1359.  
  1360. aBoolean467 = false;
  1361. }
  1362.  
  1363. public void method314(Ground class30_sub3, boolean flag) {
  1364. aClass19_477.method249(class30_sub3);
  1365. do {
  1366. Ground class30_sub3_1;
  1367. do {
  1368. class30_sub3_1 = (Ground) aClass19_477.method251();
  1369. if (class30_sub3_1 == null)
  1370. return;
  1371. } while (!class30_sub3_1.aBoolean1323);
  1372. int i = class30_sub3_1.anInt1308;
  1373. int j = class30_sub3_1.anInt1309;
  1374. int k = class30_sub3_1.anInt1307;
  1375. int l = class30_sub3_1.anInt1310;
  1376. Ground aclass30_sub3[][] = groundArray[k];
  1377. if (class30_sub3_1.aBoolean1322) {
  1378. if (flag) {
  1379. if (k > 0) {
  1380. Ground class30_sub3_2 = groundArray[k - 1][i][j];
  1381. if (class30_sub3_2 != null
  1382. && class30_sub3_2.aBoolean1323)
  1383. continue;
  1384. }
  1385. if (i <= anInt453 && i > anInt449) {
  1386. Ground class30_sub3_3 = aclass30_sub3[i - 1][j];
  1387. if (class30_sub3_3 != null
  1388. && class30_sub3_3.aBoolean1323
  1389. && (class30_sub3_3.aBoolean1322 || (class30_sub3_1.anInt1320 & 1) == 0))
  1390. continue;
  1391. }
  1392. if (i >= anInt453 && i < anInt450 - 1) {
  1393. Ground class30_sub3_4 = aclass30_sub3[i + 1][j];
  1394. if (class30_sub3_4 != null
  1395. && class30_sub3_4.aBoolean1323
  1396. && (class30_sub3_4.aBoolean1322 || (class30_sub3_1.anInt1320 & 4) == 0))
  1397. continue;
  1398. }
  1399. if (j <= anInt454 && j > anInt451) {
  1400. Ground class30_sub3_5 = aclass30_sub3[i][j - 1];
  1401. if (class30_sub3_5 != null
  1402. && class30_sub3_5.aBoolean1323
  1403. && (class30_sub3_5.aBoolean1322 || (class30_sub3_1.anInt1320 & 8) == 0))
  1404. continue;
  1405. }
  1406. if (j >= anInt454 && j < anInt452 - 1) {
  1407. Ground class30_sub3_6 = aclass30_sub3[i][j + 1];
  1408. if (class30_sub3_6 != null
  1409. && class30_sub3_6.aBoolean1323
  1410. && (class30_sub3_6.aBoolean1322 || (class30_sub3_1.anInt1320 & 2) == 0))
  1411. continue;
  1412. }
  1413. } else {
  1414. flag = true;
  1415. }
  1416. class30_sub3_1.aBoolean1322 = false;
  1417. if (class30_sub3_1.aClass30_Sub3_1329 != null) {
  1418. Ground class30_sub3_7 = class30_sub3_1.aClass30_Sub3_1329;
  1419. if (class30_sub3_7.aClass43_1311 != null) {
  1420. if (!method320(0, i, j))
  1421. method315(class30_sub3_7.aClass43_1311, 0,
  1422. anInt458, anInt459, anInt460, anInt461, i,
  1423. j);
  1424. } else if (class30_sub3_7.aClass40_1312 != null
  1425. && !method320(0, i, j))
  1426. method316(i, anInt458, anInt460,
  1427. class30_sub3_7.aClass40_1312, anInt459, j,
  1428. anInt461);
  1429. Object1 class10 = class30_sub3_7.obj1;
  1430. if (class10 != null)
  1431. class10.aClass30_Sub2_Sub4_278.method443(0, anInt458,
  1432. anInt459, anInt460, anInt461, class10.anInt274
  1433. - anInt455,
  1434. class10.anInt273 - anInt456, class10.anInt275
  1435. - anInt457, class10.uid);
  1436. for (int i2 = 0; i2 < class30_sub3_7.anInt1317; i2++) {
  1437. Object5 class28 = class30_sub3_7.obj5Array[i2];
  1438. if (class28 != null)
  1439. class28.aClass30_Sub2_Sub4_521.method443(
  1440. class28.anInt522, anInt458, anInt459,
  1441. anInt460, anInt461, class28.anInt519
  1442. - anInt455, class28.anInt518
  1443. - anInt456, class28.anInt520
  1444. - anInt457, class28.uid);
  1445. }
  1446.  
  1447. }
  1448. boolean flag1 = false;
  1449. if (class30_sub3_1.aClass43_1311 != null) {
  1450. if (!method320(l, i, j)) {
  1451. flag1 = true;
  1452. method315(class30_sub3_1.aClass43_1311, l, anInt458,
  1453. anInt459, anInt460, anInt461, i, j);
  1454. }
  1455. } else if (class30_sub3_1.aClass40_1312 != null
  1456. && !method320(l, i, j)) {
  1457. flag1 = true;
  1458. method316(i, anInt458, anInt460,
  1459. class30_sub3_1.aClass40_1312, anInt459, j, anInt461);
  1460. }
  1461. int j1 = 0;
  1462. int j2 = 0;
  1463. Object1 class10_3 = class30_sub3_1.obj1;
  1464. Object2 class26_1 = class30_sub3_1.obj2;
  1465. if (class10_3 != null || class26_1 != null) {
  1466. if (anInt453 == i)
  1467. j1++;
  1468. else if (anInt453 < i)
  1469. j1 += 2;
  1470. if (anInt454 == j)
  1471. j1 += 3;
  1472. else if (anInt454 > j)
  1473. j1 += 6;
  1474. j2 = anIntArray478[j1];
  1475. class30_sub3_1.anInt1328 = anIntArray480[j1];
  1476. }
  1477. if (class10_3 != null) {
  1478. if ((class10_3.orientation & anIntArray479[j1]) != 0) {
  1479. if (class10_3.orientation == 16) {
  1480. class30_sub3_1.anInt1325 = 3;
  1481. class30_sub3_1.anInt1326 = anIntArray481[j1];
  1482. class30_sub3_1.anInt1327 = 3 - class30_sub3_1.anInt1326;
  1483. } else if (class10_3.orientation == 32) {
  1484. class30_sub3_1.anInt1325 = 6;
  1485. class30_sub3_1.anInt1326 = anIntArray482[j1];
  1486. class30_sub3_1.anInt1327 = 6 - class30_sub3_1.anInt1326;
  1487. } else if (class10_3.orientation == 64) {
  1488. class30_sub3_1.anInt1325 = 12;
  1489. class30_sub3_1.anInt1326 = anIntArray483[j1];
  1490. class30_sub3_1.anInt1327 = 12 - class30_sub3_1.anInt1326;
  1491. } else {
  1492. class30_sub3_1.anInt1325 = 9;
  1493. class30_sub3_1.anInt1326 = anIntArray484[j1];
  1494. class30_sub3_1.anInt1327 = 9 - class30_sub3_1.anInt1326;
  1495. }
  1496. } else {
  1497. class30_sub3_1.anInt1325 = 0;
  1498. }
  1499. if ((class10_3.orientation & j2) != 0
  1500. && !method321(l, i, j, class10_3.orientation))
  1501. class10_3.aClass30_Sub2_Sub4_278.method443(0, anInt458,
  1502. anInt459, anInt460, anInt461,
  1503. class10_3.anInt274 - anInt455,
  1504. class10_3.anInt273 - anInt456,
  1505. class10_3.anInt275 - anInt457,
  1506. class10_3.uid);
  1507. if ((class10_3.orientation1 & j2) != 0
  1508. && !method321(l, i, j, class10_3.orientation1))
  1509. class10_3.aClass30_Sub2_Sub4_279.method443(0, anInt458,
  1510. anInt459, anInt460, anInt461,
  1511. class10_3.anInt274 - anInt455,
  1512. class10_3.anInt273 - anInt456,
  1513. class10_3.anInt275 - anInt457,
  1514. class10_3.uid);
  1515. }
  1516. if (class26_1 != null
  1517. && !method322(l, i, j,
  1518. class26_1.aClass30_Sub2_Sub4_504.modelHeight))
  1519. if ((class26_1.anInt502 & j2) != 0)
  1520. class26_1.aClass30_Sub2_Sub4_504.method443(
  1521. class26_1.anInt503, anInt458, anInt459,
  1522. anInt460, anInt461, class26_1.anInt500
  1523. - anInt455, class26_1.anInt499
  1524. - anInt456, class26_1.anInt501
  1525. - anInt457, class26_1.uid);
  1526. else if ((class26_1.anInt502 & 0x300) != 0) {
  1527. int j4 = class26_1.anInt500 - anInt455;
  1528. int l5 = class26_1.anInt499 - anInt456;
  1529. int k6 = class26_1.anInt501 - anInt457;
  1530. int i8 = class26_1.anInt503;
  1531. int k9;
  1532. if (i8 == 1 || i8 == 2)
  1533. k9 = -j4;
  1534. else
  1535. k9 = j4;
  1536. int k10;
  1537. if (i8 == 2 || i8 == 3)
  1538. k10 = -k6;
  1539. else
  1540. k10 = k6;
  1541. if ((class26_1.anInt502 & 0x100) != 0 && k10 < k9) {
  1542. int i11 = j4 + anIntArray463[i8];
  1543. int k11 = k6 + anIntArray464[i8];
  1544. class26_1.aClass30_Sub2_Sub4_504.method443(
  1545. i8 * 512 + 256, anInt458, anInt459,
  1546. anInt460, anInt461, i11, l5, k11,
  1547. class26_1.uid);
  1548. }
  1549. if ((class26_1.anInt502 & 0x200) != 0 && k10 > k9) {
  1550. int j11 = j4 + anIntArray465[i8];
  1551. int l11 = k6 + anIntArray466[i8];
  1552. class26_1.aClass30_Sub2_Sub4_504.method443(
  1553. i8 * 512 + 1280 & 0x7ff, anInt458,
  1554. anInt459, anInt460, anInt461, j11, l5, l11,
  1555. class26_1.uid);
  1556. }
  1557. }
  1558. if (flag1) {
  1559. Object3 class49 = class30_sub3_1.obj3;
  1560. if (class49 != null)
  1561. class49.aClass30_Sub2_Sub4_814.method443(0, anInt458,
  1562. anInt459, anInt460, anInt461, class49.anInt812
  1563. - anInt455,
  1564. class49.anInt811 - anInt456, class49.anInt813
  1565. - anInt457, class49.uid);
  1566. Object4 class3_1 = class30_sub3_1.aClass3_1316;
  1567. if (class3_1 != null && class3_1.anInt52 == 0) {
  1568. if (class3_1.aClass30_Sub2_Sub4_49 != null)
  1569. class3_1.aClass30_Sub2_Sub4_49.method443(0,
  1570. anInt458, anInt459, anInt460, anInt461,
  1571. class3_1.anInt46 - anInt455,
  1572. class3_1.anInt45 - anInt456,
  1573. class3_1.anInt47 - anInt457,
  1574. class3_1.anInt51);
  1575. if (class3_1.aClass30_Sub2_Sub4_50 != null)
  1576. class3_1.aClass30_Sub2_Sub4_50.method443(0,
  1577. anInt458, anInt459, anInt460, anInt461,
  1578. class3_1.anInt46 - anInt455,
  1579. class3_1.anInt45 - anInt456,
  1580. class3_1.anInt47 - anInt457,
  1581. class3_1.anInt51);
  1582. if (class3_1.aClass30_Sub2_Sub4_48 != null)
  1583. class3_1.aClass30_Sub2_Sub4_48.method443(0,
  1584. anInt458, anInt459, anInt460, anInt461,
  1585. class3_1.anInt46 - anInt455,
  1586. class3_1.anInt45 - anInt456,
  1587. class3_1.anInt47 - anInt457,
  1588. class3_1.anInt51);
  1589. }
  1590. }
  1591. int k4 = class30_sub3_1.anInt1320;
  1592. if (k4 != 0) {
  1593. if (i < anInt453 && (k4 & 4) != 0) {
  1594. Ground class30_sub3_17 = aclass30_sub3[i + 1][j];
  1595. if (class30_sub3_17 != null
  1596. && class30_sub3_17.aBoolean1323)
  1597. aClass19_477.method249(class30_sub3_17);
  1598. }
  1599. if (j < anInt454 && (k4 & 2) != 0) {
  1600. Ground class30_sub3_18 = aclass30_sub3[i][j + 1];
  1601. if (class30_sub3_18 != null
  1602. && class30_sub3_18.aBoolean1323)
  1603. aClass19_477.method249(class30_sub3_18);
  1604. }
  1605. if (i > anInt453 && (k4 & 1) != 0) {
  1606. Ground class30_sub3_19 = aclass30_sub3[i - 1][j];
  1607. if (class30_sub3_19 != null
  1608. && class30_sub3_19.aBoolean1323)
  1609. aClass19_477.method249(class30_sub3_19);
  1610. }
  1611. if (j > anInt454 && (k4 & 8) != 0) {
  1612. Ground class30_sub3_20 = aclass30_sub3[i][j - 1];
  1613. if (class30_sub3_20 != null
  1614. && class30_sub3_20.aBoolean1323)
  1615. aClass19_477.method249(class30_sub3_20);
  1616. }
  1617. }
  1618. }
  1619. if (class30_sub3_1.anInt1325 != 0) {
  1620. boolean flag2 = true;
  1621. for (int k1 = 0; k1 < class30_sub3_1.anInt1317; k1++) {
  1622. if (class30_sub3_1.obj5Array[k1].anInt528 == anInt448
  1623. || (class30_sub3_1.anIntArray1319[k1] & class30_sub3_1.anInt1325) != class30_sub3_1.anInt1326)
  1624. continue;
  1625. flag2 = false;
  1626. break;
  1627. }
  1628.  
  1629. if (flag2) {
  1630. Object1 class10_1 = class30_sub3_1.obj1;
  1631. if (!method321(l, i, j, class10_1.orientation))
  1632. class10_1.aClass30_Sub2_Sub4_278.method443(0, anInt458,
  1633. anInt459, anInt460, anInt461,
  1634. class10_1.anInt274 - anInt455,
  1635. class10_1.anInt273 - anInt456,
  1636. class10_1.anInt275 - anInt457,
  1637. class10_1.uid);
  1638. class30_sub3_1.anInt1325 = 0;
  1639. }
  1640. }
  1641. if (class30_sub3_1.aBoolean1324)
  1642. try {
  1643. int i1 = class30_sub3_1.anInt1317;
  1644. class30_sub3_1.aBoolean1324 = false;
  1645. int l1 = 0;
  1646. label0: for (int k2 = 0; k2 < i1; k2++) {
  1647. Object5 class28_1 = class30_sub3_1.obj5Array[k2];
  1648. if (class28_1.anInt528 == anInt448)
  1649. continue;
  1650. for (int k3 = class28_1.anInt523; k3 <= class28_1.anInt524; k3++) {
  1651. for (int l4 = class28_1.anInt525; l4 <= class28_1.anInt526; l4++) {
  1652. Ground class30_sub3_21 = aclass30_sub3[k3][l4];
  1653. if (class30_sub3_21.aBoolean1322) {
  1654. class30_sub3_1.aBoolean1324 = true;
  1655. } else {
  1656. if (class30_sub3_21.anInt1325 == 0)
  1657. continue;
  1658. int l6 = 0;
  1659. if (k3 > class28_1.anInt523)
  1660. l6++;
  1661. if (k3 < class28_1.anInt524)
  1662. l6 += 4;
  1663. if (l4 > class28_1.anInt525)
  1664. l6 += 8;
  1665. if (l4 < class28_1.anInt526)
  1666. l6 += 2;
  1667. if ((l6 & class30_sub3_21.anInt1325) != class30_sub3_1.anInt1327)
  1668. continue;
  1669. class30_sub3_1.aBoolean1324 = true;
  1670. }
  1671. continue label0;
  1672. }
  1673.  
  1674. }
  1675.  
  1676. aClass28Array462[l1++] = class28_1;
  1677. int i5 = anInt453 - class28_1.anInt523;
  1678. int i6 = class28_1.anInt524 - anInt453;
  1679. if (i6 > i5)
  1680. i5 = i6;
  1681. int i7 = anInt454 - class28_1.anInt525;
  1682. int j8 = class28_1.anInt526 - anInt454;
  1683. if (j8 > i7)
  1684. class28_1.anInt527 = i5 + j8;
  1685. else
  1686. class28_1.anInt527 = i5 + i7;
  1687. }
  1688.  
  1689. while (l1 > 0) {
  1690. int i3 = -50;
  1691. int l3 = -1;
  1692. for (int j5 = 0; j5 < l1; j5++) {
  1693. Object5 class28_2 = aClass28Array462[j5];
  1694. if (class28_2.anInt528 != anInt448)
  1695. if (class28_2.anInt527 > i3) {
  1696. i3 = class28_2.anInt527;
  1697. l3 = j5;
  1698. } else if (class28_2.anInt527 == i3) {
  1699. int j7 = class28_2.anInt519 - anInt455;
  1700. int k8 = class28_2.anInt520 - anInt457;
  1701. int l9 = aClass28Array462[l3].anInt519
  1702. - anInt455;
  1703. int l10 = aClass28Array462[l3].anInt520
  1704. - anInt457;
  1705. if (j7 * j7 + k8 * k8 > l9 * l9 + l10 * l10)
  1706. l3 = j5;
  1707. }
  1708. }
  1709.  
  1710. if (l3 == -1)
  1711. break;
  1712. Object5 class28_3 = aClass28Array462[l3];
  1713. class28_3.anInt528 = anInt448;
  1714. if (!method323(l, class28_3.anInt523,
  1715. class28_3.anInt524, class28_3.anInt525,
  1716. class28_3.anInt526,
  1717. class28_3.aClass30_Sub2_Sub4_521.modelHeight))
  1718. class28_3.aClass30_Sub2_Sub4_521.method443(
  1719. class28_3.anInt522, anInt458, anInt459,
  1720. anInt460, anInt461, class28_3.anInt519
  1721. - anInt455, class28_3.anInt518
  1722. - anInt456, class28_3.anInt520
  1723. - anInt457, class28_3.uid);
  1724. for (int k7 = class28_3.anInt523; k7 <= class28_3.anInt524; k7++) {
  1725. for (int l8 = class28_3.anInt525; l8 <= class28_3.anInt526; l8++) {
  1726. Ground class30_sub3_22 = aclass30_sub3[k7][l8];
  1727. if (class30_sub3_22.anInt1325 != 0)
  1728. aClass19_477.method249(class30_sub3_22);
  1729. else if ((k7 != i || l8 != j)
  1730. && class30_sub3_22.aBoolean1323)
  1731. aClass19_477.method249(class30_sub3_22);
  1732. }
  1733.  
  1734. }
  1735.  
  1736. }
  1737. if (class30_sub3_1.aBoolean1324)
  1738. continue;
  1739. } catch (Exception _ex) {
  1740. class30_sub3_1.aBoolean1324 = false;
  1741. }
  1742. if (!class30_sub3_1.aBoolean1323 || class30_sub3_1.anInt1325 != 0)
  1743. continue;
  1744. if (i <= anInt453 && i > anInt449) {
  1745. Ground class30_sub3_8 = aclass30_sub3[i - 1][j];
  1746. if (class30_sub3_8 != null && class30_sub3_8.aBoolean1323)
  1747. continue;
  1748. }
  1749. if (i >= anInt453 && i < anInt450 - 1) {
  1750. Ground class30_sub3_9 = aclass30_sub3[i + 1][j];
  1751. if (class30_sub3_9 != null && class30_sub3_9.aBoolean1323)
  1752. continue;
  1753. }
  1754. if (j <= anInt454 && j > anInt451) {
  1755. Ground class30_sub3_10 = aclass30_sub3[i][j - 1];
  1756. if (class30_sub3_10 != null && class30_sub3_10.aBoolean1323)
  1757. continue;
  1758. }
  1759. if (j >= anInt454 && j < anInt452 - 1) {
  1760. Ground class30_sub3_11 = aclass30_sub3[i][j + 1];
  1761. if (class30_sub3_11 != null && class30_sub3_11.aBoolean1323)
  1762. continue;
  1763. }
  1764. class30_sub3_1.aBoolean1323 = false;
  1765. anInt446--;
  1766. Object4 class3 = class30_sub3_1.aClass3_1316;
  1767. if (class3 != null && class3.anInt52 != 0) {
  1768. if (class3.aClass30_Sub2_Sub4_49 != null)
  1769. class3.aClass30_Sub2_Sub4_49.method443(0, anInt458,
  1770. anInt459, anInt460, anInt461, class3.anInt46
  1771. - anInt455, class3.anInt45 - anInt456
  1772. - class3.anInt52,
  1773. class3.anInt47 - anInt457, class3.anInt51);
  1774. if (class3.aClass30_Sub2_Sub4_50 != null)
  1775. class3.aClass30_Sub2_Sub4_50.method443(0, anInt458,
  1776. anInt459, anInt460, anInt461, class3.anInt46
  1777. - anInt455, class3.anInt45 - anInt456
  1778. - class3.anInt52,
  1779. class3.anInt47 - anInt457, class3.anInt51);
  1780. if (class3.aClass30_Sub2_Sub4_48 != null)
  1781. class3.aClass30_Sub2_Sub4_48.method443(0, anInt458,
  1782. anInt459, anInt460, anInt461, class3.anInt46
  1783. - anInt455, class3.anInt45 - anInt456
  1784. - class3.anInt52,
  1785. class3.anInt47 - anInt457, class3.anInt51);
  1786. }
  1787. if (class30_sub3_1.anInt1328 != 0) {
  1788. Object2 class26 = class30_sub3_1.obj2;
  1789. if (class26 != null
  1790. && !method322(l, i, j,
  1791. class26.aClass30_Sub2_Sub4_504.modelHeight))
  1792. if ((class26.anInt502 & class30_sub3_1.anInt1328) != 0)
  1793. class26.aClass30_Sub2_Sub4_504.method443(
  1794. class26.anInt503, anInt458, anInt459, anInt460,
  1795. anInt461, class26.anInt500 - anInt455,
  1796. class26.anInt499 - anInt456, class26.anInt501
  1797. - anInt457, class26.uid);
  1798. else if ((class26.anInt502 & 0x300) != 0) {
  1799. int l2 = class26.anInt500 - anInt455;
  1800. int j3 = class26.anInt499 - anInt456;
  1801. int i4 = class26.anInt501 - anInt457;
  1802. int k5 = class26.anInt503;
  1803. int j6;
  1804. if (k5 == 1 || k5 == 2)
  1805. j6 = -l2;
  1806. else
  1807. j6 = l2;
  1808. int l7;
  1809. if (k5 == 2 || k5 == 3)
  1810. l7 = -i4;
  1811. else
  1812. l7 = i4;
  1813. if ((class26.anInt502 & 0x100) != 0 && l7 >= j6) {
  1814. int i9 = l2 + anIntArray463[k5];
  1815. int i10 = i4 + anIntArray464[k5];
  1816. class26.aClass30_Sub2_Sub4_504.method443(
  1817. k5 * 512 + 256, anInt458, anInt459,
  1818. anInt460, anInt461, i9, j3, i10,
  1819. class26.uid);
  1820. }
  1821. if ((class26.anInt502 & 0x200) != 0 && l7 <= j6) {
  1822. int j9 = l2 + anIntArray465[k5];
  1823. int j10 = i4 + anIntArray466[k5];
  1824. class26.aClass30_Sub2_Sub4_504.method443(
  1825. k5 * 512 + 1280 & 0x7ff, anInt458,
  1826. anInt459, anInt460, anInt461, j9, j3, j10,
  1827. class26.uid);
  1828. }
  1829. }
  1830. Object1 class10_2 = class30_sub3_1.obj1;
  1831. if (class10_2 != null) {
  1832. if ((class10_2.orientation1 & class30_sub3_1.anInt1328) != 0
  1833. && !method321(l, i, j, class10_2.orientation1))
  1834. class10_2.aClass30_Sub2_Sub4_279.method443(0, anInt458,
  1835. anInt459, anInt460, anInt461,
  1836. class10_2.anInt274 - anInt455,
  1837. class10_2.anInt273 - anInt456,
  1838. class10_2.anInt275 - anInt457,
  1839. class10_2.uid);
  1840. if ((class10_2.orientation & class30_sub3_1.anInt1328) != 0
  1841. && !method321(l, i, j, class10_2.orientation))
  1842. class10_2.aClass30_Sub2_Sub4_278.method443(0, anInt458,
  1843. anInt459, anInt460, anInt461,
  1844. class10_2.anInt274 - anInt455,
  1845. class10_2.anInt273 - anInt456,
  1846. class10_2.anInt275 - anInt457,
  1847. class10_2.uid);
  1848. }
  1849. }
  1850. if (k < anInt437 - 1) {
  1851. Ground class30_sub3_12 = groundArray[k + 1][i][j];
  1852. if (class30_sub3_12 != null && class30_sub3_12.aBoolean1323)
  1853. aClass19_477.method249(class30_sub3_12);
  1854. }
  1855. if (i < anInt453) {
  1856. Ground class30_sub3_13 = aclass30_sub3[i + 1][j];
  1857. if (class30_sub3_13 != null && class30_sub3_13.aBoolean1323)
  1858. aClass19_477.method249(class30_sub3_13);
  1859. }
  1860. if (j < anInt454) {
  1861. Ground class30_sub3_14 = aclass30_sub3[i][j + 1];
  1862. if (class30_sub3_14 != null && class30_sub3_14.aBoolean1323)
  1863. aClass19_477.method249(class30_sub3_14);
  1864. }
  1865. if (i > anInt453) {
  1866. Ground class30_sub3_15 = aclass30_sub3[i - 1][j];
  1867. if (class30_sub3_15 != null && class30_sub3_15.aBoolean1323)
  1868. aClass19_477.method249(class30_sub3_15);
  1869. }
  1870. if (j > anInt454) {
  1871. Ground class30_sub3_16 = aclass30_sub3[i][j - 1];
  1872. if (class30_sub3_16 != null && class30_sub3_16.aBoolean1323)
  1873. aClass19_477.method249(class30_sub3_16);
  1874. }
  1875. } while (true);
  1876. }
  1877.  
  1878. private void method315(Class43 class43, int i, int j, int k, int l, int i1, int j1, int k1) {
  1879. int l1;
  1880. int i2 = l1 = (j1 << 7) - anInt455;
  1881. int j2;
  1882. int k2 = j2 = (k1 << 7) - anInt457;
  1883. int l2;
  1884. int i3 = l2 = i2 + 128;
  1885. int j3;
  1886. int k3 = j3 = k2 + 128;
  1887. int l3 = anIntArrayArrayArray440[i][j1][k1] - anInt456;
  1888. int i4 = anIntArrayArrayArray440[i][j1 + 1][k1] - anInt456;
  1889. int j4 = anIntArrayArrayArray440[i][j1 + 1][k1 + 1] - anInt456;
  1890. int k4 = anIntArrayArrayArray440[i][j1][k1 + 1] - anInt456;
  1891. int l4 = k2 * l + i2 * i1 >> 16;
  1892. k2 = k2 * i1 - i2 * l >> 16;
  1893. i2 = l4;
  1894. l4 = l3 * k - k2 * j >> 16;
  1895. k2 = l3 * j + k2 * k >> 16;
  1896. l3 = l4;
  1897. if (k2 < 50)
  1898. return;
  1899. l4 = j2 * l + i3 * i1 >> 16;
  1900. j2 = j2 * i1 - i3 * l >> 16;
  1901. i3 = l4;
  1902. l4 = i4 * k - j2 * j >> 16;
  1903. j2 = i4 * j + j2 * k >> 16;
  1904. i4 = l4;
  1905. if (j2 < 50)
  1906. return;
  1907. l4 = k3 * l + l2 * i1 >> 16;
  1908. k3 = k3 * i1 - l2 * l >> 16;
  1909. l2 = l4;
  1910. l4 = j4 * k - k3 * j >> 16;
  1911. k3 = j4 * j + k3 * k >> 16;
  1912. j4 = l4;
  1913. if (k3 < 50)
  1914. return;
  1915. l4 = j3 * l + l1 * i1 >> 16;
  1916. j3 = j3 * i1 - l1 * l >> 16;
  1917. l1 = l4;
  1918. l4 = k4 * k - j3 * j >> 16;
  1919. j3 = k4 * j + j3 * k >> 16;
  1920. k4 = l4;
  1921. if (j3 < 50)
  1922. return;
  1923. int i5 = Texture.centerX + (i2 << viewDistance) / k2;
  1924. int j5 = Texture.centerY + (l3 << viewDistance) / k2;
  1925. int k5 = Texture.centerX + (i3 << viewDistance) / j2;
  1926. int l5 = Texture.centerY + (i4 << viewDistance) / j2;
  1927. int i6 = Texture.centerX + (l2 << viewDistance) / k3;
  1928. int j6 = Texture.centerY + (j4 << viewDistance) / k3;
  1929. int k6 = Texture.centerX + (l1 << viewDistance) / j3;
  1930. int l6 = Texture.centerY + (k4 << viewDistance) / j3;
  1931. Texture.anInt1465 = 0;
  1932. if ((i6 - k6) * (l5 - l6) - (j6 - l6) * (k5 - k6) > 0) {
  1933. Texture.aBoolean1462 = i6 < 0 || k6 < 0 || k5 < 0 || i6 > DrawingArea.centerX || k6 > DrawingArea.centerX || k5 > DrawingArea.centerX;
  1934. if (aBoolean467 && method318(anInt468, anInt469, j6, l6, l5, i6, k6, k5)) {
  1935. anInt470 = j1;
  1936. anInt471 = k1;
  1937. }
  1938. if (class43.anInt720 == -1) {
  1939. if (class43.anInt718 != 0xbc614e) {
  1940. if(Constants.enableDepthBuffer)
  1941. Texture.drawShadedTriangle(j6, l6, l5, i6, k6, k5, class43.anInt718, class43.anInt719, class43.anInt717, k3, j3, j2);
  1942. else
  1943. Texture.method374(j6, l6, l5, i6, k6, k5, class43.anInt718, class43.anInt719, class43.anInt717);
  1944. }
  1945. } else if (!aBoolean436) {
  1946. if (class43.aBoolean721) {
  1947. if(Constants.enableDepthBuffer)
  1948. Texture.drawTexturedTriangle(j6, l6, l5, i6, k6, k5, class43.anInt718, class43.anInt719, class43.anInt717, i2, i3, l1, l3, i4, k4, k2, j2, j3, class43.anInt720, k3, j3, j2);
  1949. else
  1950. Texture.method378(j6, l6, l5, i6, k6, k5, class43.anInt718, class43.anInt719, class43.anInt717, i2, i3, l1, l3, i4, k4, k2, j2, j3, class43.anInt720);
  1951. } else {
  1952. if(Constants.enableDepthBuffer)
  1953. Texture.drawTexturedTriangle(j6, l6, l5, i6, k6, k5, class43.anInt718, class43.anInt719, class43.anInt717, l2, l1, i3, j4, k4, i4, k3, j3, j2, class43.anInt720, k3, j3, j2);
  1954. else
  1955. Texture.method378(j6, l6, l5, i6, k6, k5, class43.anInt718, class43.anInt719, class43.anInt717, l2, l1, i3, j4, k4, i4, k3, j3, j2, class43.anInt720);
  1956. }
  1957. } else {
  1958. int i7 = anIntArray485[class43.anInt720];
  1959. if(Constants.enableDepthBuffer)
  1960. Texture.drawShadedTriangle(j6, l6, l5, i6, k6, k5, method317(i7, class43.anInt718), method317(i7, class43.anInt719), method317(i7, class43.anInt717), k3, j3, j2);
  1961. else
  1962. Texture.method374(j6, l6, l5, i6, k6, k5, method317(i7, class43.anInt718), method317(i7, class43.anInt719), method317(i7, class43.anInt717));
  1963. }
  1964. }
  1965. if ((i5 - k5) * (l6 - l5) - (j5 - l5) * (k6 - k5) > 0) {
  1966. Texture.aBoolean1462 = i5 < 0 || k5 < 0 || k6 < 0 || i5 > DrawingArea.centerX || k5 > DrawingArea.centerX || k6 > DrawingArea.centerX;
  1967. if (aBoolean467 && method318(anInt468, anInt469, j5, l5, l6, i5, k5, k6)) {
  1968. anInt470 = j1;
  1969. anInt471 = k1;
  1970. }
  1971. if (class43.anInt720 == -1) {
  1972. if (class43.anInt716 != 0xbc614e) {
  1973. if(Constants.enableDepthBuffer)
  1974. Texture.drawShadedTriangle(j5, l5, l6, i5, k5, k6, class43.anInt716, class43.anInt717, class43.anInt719, k2, j2, j3);
  1975. else
  1976. Texture.method374(j5, l5, l6, i5, k5, k6, class43.anInt716, class43.anInt717, class43.anInt719);
  1977. }
  1978. } else {
  1979. if (!aBoolean436) {
  1980. if(Constants.enableDepthBuffer)
  1981. Texture.drawTexturedTriangle(j5, l5, l6, i5, k5, k6, class43.anInt716, class43.anInt717, class43.anInt719, i2, i3, l1, l3, i4, k4, k2, j2, j3, class43.anInt720, k2, j2, j3);
  1982. else
  1983. Texture.method378(j5, l5, l6, i5, k5, k6, class43.anInt716, class43.anInt717, class43.anInt719, i2, i3, l1, l3, i4, k4, k2, j2, j3, class43.anInt720);
  1984. return;
  1985. }
  1986. int j7 = anIntArray485[class43.anInt720];
  1987. if(Constants.enableDepthBuffer)
  1988. Texture.drawShadedTriangle(j5, l5, l6, i5, k5, k6, method317(j7, class43.anInt716), method317(j7, class43.anInt717), method317(j7, class43.anInt719), k2, j2, j3);
  1989. else
  1990. Texture.method374(j5, l5, l6, i5, k5, k6, method317(j7, class43.anInt716), method317(j7, class43.anInt717), method317(j7, class43.anInt719));
  1991. }
  1992. }
  1993. }
  1994.  
  1995.  
  1996.  
  1997.  
  1998.  
  1999.  
  2000.  
  2001.  
  2002.  
  2003.  
  2004.  
  2005.  
  2006.  
  2007.  
  2008.  
  2009. private void method316(int i, int j, int k, Class40 class40, int l, int i1, int j1) {
  2010. int k1 = class40.anIntArray673.length;
  2011. for (int l1 = 0; l1 < k1; l1++) {
  2012. int i2 = class40.anIntArray673[l1] - anInt455;
  2013. int k2 = class40.anIntArray674[l1] - anInt456;
  2014. int i3 = class40.anIntArray675[l1] - anInt457;
  2015. int k3 = i3 * k + i2 * j1 >> 16;
  2016. i3 = i3 * j1 - i2 * k >> 16;
  2017. i2 = k3;
  2018. k3 = k2 * l - i3 * j >> 16;
  2019. i3 = k2 * j + i3 * l >> 16;
  2020. k2 = k3;
  2021. if (i3 < 50)
  2022. return;
  2023. if (class40.anIntArray682 != null) {
  2024. Class40.anIntArray690[l1] = i2;
  2025. Class40.anIntArray691[l1] = k2;
  2026. Class40.anIntArray692[l1] = i3;
  2027. }
  2028. Class40.anIntArray688[l1] = Texture.centerX + (i2 << viewDistance) / i3;
  2029. Class40.anIntArray689[l1] = Texture.centerY + (k2 << viewDistance) / i3;
  2030. Class40.depthPoint[l1] = i3;
  2031. }
  2032.  
  2033. Texture.anInt1465 = 0;
  2034. k1 = class40.anIntArray679.length;
  2035. for (int j2 = 0; j2 < k1; j2++) {
  2036. int l2 = class40.anIntArray679[j2];
  2037. int j3 = class40.anIntArray680[j2];
  2038. int l3 = class40.anIntArray681[j2];
  2039. int i4 = Class40.anIntArray688[l2];
  2040. int j4 = Class40.anIntArray688[j3];
  2041. int k4 = Class40.anIntArray688[l3];
  2042. int l4 = Class40.anIntArray689[l2];
  2043. int i5 = Class40.anIntArray689[j3];
  2044. int j5 = Class40.anIntArray689[l3];
  2045. if ((i4 - j4) * (j5 - i5) - (l4 - i5) * (k4 - j4) > 0) {
  2046. Texture.aBoolean1462 = i4 < 0 || j4 < 0 || k4 < 0 || i4 > DrawingArea.centerX || j4 > DrawingArea.centerX || k4 > DrawingArea.centerX;
  2047. if (aBoolean467 && method318(anInt468, anInt469, l4, i5, j5, i4, j4, k4)) {
  2048. anInt470 = i;
  2049. anInt471 = i1;
  2050. }
  2051. if(Constants.enableDepthBuffer)
  2052. Texture.drawDepthTriangle(i4, j4, k4, l4, i5, j5, Class40.depthPoint[l2], Class40.depthPoint[j3], Class40.depthPoint[l3]);
  2053. if (class40.anIntArray682 == null || class40.anIntArray682[j2] == -1) {
  2054. if (class40.anIntArray676[j2] != 0xbc614e) {
  2055. if(Constants.enableDepthBuffer)
  2056. Texture.drawShadedTriangle(l4, i5, j5, i4, j4, k4, class40.anIntArray676[j2], class40.anIntArray677[j2], class40.anIntArray678[j2], Class40.depthPoint[l2], Class40.depthPoint[j3], Class40.depthPoint[l3]);
  2057. else
  2058. Texture.method374(l4, i5, j5, i4, j4, k4, class40.anIntArray676[j2], class40.anIntArray677[j2], class40.anIntArray678[j2]);
  2059. }
  2060. } else if (!aBoolean436) {
  2061. if (class40.aBoolean683) {
  2062. if(Constants.enableDepthBuffer)
  2063. Texture.drawTexturedTriangle(l4, i5, j5, i4, j4, k4, class40.anIntArray676[j2], class40.anIntArray677[j2], class40.anIntArray678[j2], Class40.anIntArray690[0], Class40.anIntArray690[1], Class40.anIntArray690[3], Class40.anIntArray691[0], Class40.anIntArray691[1], Class40.anIntArray691[3], Class40.anIntArray692[0], Class40.anIntArray692[1], Class40.anIntArray692[3], class40.anIntArray682[j2], Class40.depthPoint[l2], Class40.depthPoint[j3], Class40.depthPoint[l3]);
  2064. else
  2065. Texture.method378(l4, i5, j5, i4, j4, k4, class40.anIntArray676[j2], class40.anIntArray677[j2], class40.anIntArray678[j2], Class40.anIntArray690[0], Class40.anIntArray690[1], Class40.anIntArray690[3], Class40.anIntArray691[0], Class40.anIntArray691[1], Class40.anIntArray691[3], Class40.anIntArray692[0], Class40.anIntArray692[1], Class40.anIntArray692[3], class40.anIntArray682[j2]);
  2066. } else {
  2067. if(Constants.enableDepthBuffer)
  2068. Texture.drawTexturedTriangle(l4, i5, j5, i4, j4, k4, class40.anIntArray676[j2], class40.anIntArray677[j2], class40.anIntArray678[j2], Class40.anIntArray690[l2], Class40.anIntArray690[j3], Class40.anIntArray690[l3], Class40.anIntArray691[l2], Class40.anIntArray691[j3], Class40.anIntArray691[l3], Class40.anIntArray692[l2], Class40.anIntArray692[j3], Class40.anIntArray692[l3], class40.anIntArray682[j2], Class40.depthPoint[l2], Class40.depthPoint[j3], Class40.depthPoint[l3]);
  2069. else
  2070. Texture.method378(l4, i5, j5, i4, j4, k4, class40.anIntArray676[j2], class40.anIntArray677[j2], class40.anIntArray678[j2], Class40.anIntArray690[l2], Class40.anIntArray690[j3], Class40.anIntArray690[l3], Class40.anIntArray691[l2], Class40.anIntArray691[j3], Class40.anIntArray691[l3], Class40.anIntArray692[l2], Class40.anIntArray692[j3], Class40.anIntArray692[l3], class40.anIntArray682[j2]);
  2071. }
  2072. } else {
  2073. int k5 = anIntArray485[class40.anIntArray682[j2]];
  2074. if(Constants.enableDepthBuffer)
  2075. Texture.drawShadedTriangle(l4, i5, j5, i4, j4, k4, method317(k5, class40.anIntArray676[j2]), method317(k5, class40.anIntArray677[j2]), method317(k5, class40.anIntArray678[j2]), Class40.depthPoint[l2], Class40.depthPoint[j3], Class40.depthPoint[l3]);
  2076. else
  2077. Texture.method374(l4, i5, j5, i4, j4, k4, method317(k5, class40.anIntArray676[j2]), method317(k5, class40.anIntArray677[j2]), method317(k5, class40.anIntArray678[j2]));
  2078. }
  2079. }
  2080. }
  2081.  
  2082. }
  2083. private int method317(int j, int k)
  2084. {
  2085. k = 127 - k;
  2086. k = (k * (j & 0x7f)) / 160;
  2087. if(k < 2)
  2088. k = 2;
  2089. else
  2090. if(k > 126)
  2091. k = 126;
  2092. return (j & 0xff80) + k;
  2093. }
  2094.  
  2095. public boolean method318(int i, int j, int k, int l, int i1, int j1,
  2096. int k1, int l1) {
  2097. if (j < k && j < l && j < i1)
  2098. return false;
  2099. if (j > k && j > l && j > i1)
  2100. return false;
  2101. if (i < j1 && i < k1 && i < l1)
  2102. return false;
  2103. if (i > j1 && i > k1 && i > l1)
  2104. return false;
  2105. int i2 = (j - k) * (k1 - j1) - (i - j1) * (l - k);
  2106. int j2 = (j - i1) * (j1 - l1) - (i - l1) * (k - i1);
  2107. int k2 = (j - l) * (l1 - k1) - (i - k1) * (i1 - l);
  2108. return i2 * k2 > 0 && k2 * j2 > 0;
  2109. }
  2110.  
  2111. private void method319(int i) {
  2112. if (i != 0)
  2113. return;
  2114. int j = anIntArray473[anInt447];
  2115. Class47 aclass47[] = aClass47ArrayArray474[anInt447];
  2116. anInt475 = 0;
  2117. for (int k = 0; k < j; k++) {
  2118. Class47 class47 = aclass47[k];
  2119. if (class47.anInt791 == 1) {
  2120. int l = (class47.anInt787 - anInt453) + 25;
  2121. if (l < 0 || l > 50)
  2122. continue;
  2123. int k1 = (class47.anInt789 - anInt454) + 25;
  2124. if (k1 < 0)
  2125. k1 = 0;
  2126. int j2 = (class47.anInt790 - anInt454) + 25;
  2127. if (j2 > 50)
  2128. j2 = 50;
  2129. boolean flag = false;
  2130. while (k1 <= j2)
  2131. if (aBooleanArrayArray492[l][k1++]) {
  2132. flag = true;
  2133. break;
  2134. }
  2135. if (!flag)
  2136. continue;
  2137. int j3 = anInt455 - class47.anInt792;
  2138. if (j3 > 32) {
  2139. class47.anInt798 = 1;
  2140. } else {
  2141. if (j3 >= -32)
  2142. continue;
  2143. class47.anInt798 = 2;
  2144. j3 = -j3;
  2145. }
  2146. class47.anInt801 = (class47.anInt794 - anInt457 << 8) / j3;
  2147. class47.anInt802 = (class47.anInt795 - anInt457 << 8) / j3;
  2148. class47.anInt803 = (class47.anInt796 - anInt456 << 8) / j3;
  2149. class47.anInt804 = (class47.anInt797 - anInt456 << 8) / j3;
  2150. aClass47Array476[anInt475++] = class47;
  2151. continue;
  2152. }
  2153. if (class47.anInt791 == 2) {
  2154. int i1 = (class47.anInt789 - anInt454) + 25;
  2155. if (i1 < 0 || i1 > 50)
  2156. continue;
  2157. int l1 = (class47.anInt787 - anInt453) + 25;
  2158. if (l1 < 0)
  2159. l1 = 0;
  2160. int k2 = (class47.anInt788 - anInt453) + 25;
  2161. if (k2 > 50)
  2162. k2 = 50;
  2163. boolean flag1 = false;
  2164. while (l1 <= k2)
  2165. if (aBooleanArrayArray492[l1++][i1]) {
  2166. flag1 = true;
  2167. break;
  2168. }
  2169. if (!flag1)
  2170. continue;
  2171. int k3 = anInt457 - class47.anInt794;
  2172. if (k3 > 32) {
  2173. class47.anInt798 = 3;
  2174. } else {
  2175. if (k3 >= -32)
  2176. continue;
  2177. class47.anInt798 = 4;
  2178. k3 = -k3;
  2179. }
  2180. class47.anInt799 = (class47.anInt792 - anInt455 << 8) / k3;
  2181. class47.anInt800 = (class47.anInt793 - anInt455 << 8) / k3;
  2182. class47.anInt803 = (class47.anInt796 - anInt456 << 8) / k3;
  2183. class47.anInt804 = (class47.anInt797 - anInt456 << 8) / k3;
  2184. aClass47Array476[anInt475++] = class47;
  2185. } else if (class47.anInt791 == 4) {
  2186. int j1 = class47.anInt796 - anInt456;
  2187. if (j1 > 128) {
  2188. int i2 = (class47.anInt789 - anInt454) + 25;
  2189. if (i2 < 0)
  2190. i2 = 0;
  2191. int l2 = (class47.anInt790 - anInt454) + 25;
  2192. if (l2 > 50)
  2193. l2 = 50;
  2194. if (i2 <= l2) {
  2195. int i3 = (class47.anInt787 - anInt453) + 25;
  2196. if (i3 < 0)
  2197. i3 = 0;
  2198. int l3 = (class47.anInt788 - anInt453) + 25;
  2199. if (l3 > 50)
  2200. l3 = 50;
  2201. boolean flag2 = false;
  2202. label0: for (int i4 = i3; i4 <= l3; i4++) {
  2203. for (int j4 = i2; j4 <= l2; j4++) {
  2204. if (!aBooleanArrayArray492[i4][j4])
  2205. continue;
  2206. flag2 = true;
  2207. break label0;
  2208. }
  2209.  
  2210. }
  2211.  
  2212. if (flag2) {
  2213. class47.anInt798 = 5;
  2214. class47.anInt799 = (class47.anInt792 - anInt455 << 8)
  2215. / j1;
  2216. class47.anInt800 = (class47.anInt793 - anInt455 << 8)
  2217. / j1;
  2218. class47.anInt801 = (class47.anInt794 - anInt457 << 8)
  2219. / j1;
  2220. class47.anInt802 = (class47.anInt795 - anInt457 << 8)
  2221. / j1;
  2222. aClass47Array476[anInt475++] = class47;
  2223. }
  2224. }
  2225. }
  2226. }
  2227. }
  2228.  
  2229. }
  2230.  
  2231. private boolean method320(int i, int j, int k) {
  2232. int l = anIntArrayArrayArray445[i][j][k];
  2233. if (l == -anInt448)
  2234. return false;
  2235. if (l == anInt448)
  2236. return true;
  2237. int i1 = j << 7;
  2238. int j1 = k << 7;
  2239. if (method324(i1 + 1, anIntArrayArrayArray440[i][j][k], j1 + 1)
  2240. && method324((i1 + 128) - 1,
  2241. anIntArrayArrayArray440[i][j + 1][k], j1 + 1)
  2242. && method324((i1 + 128) - 1,
  2243. anIntArrayArrayArray440[i][j + 1][k + 1],
  2244. (j1 + 128) - 1)
  2245. && method324(i1 + 1, anIntArrayArrayArray440[i][j][k + 1],
  2246. (j1 + 128) - 1)) {
  2247. anIntArrayArrayArray445[i][j][k] = anInt448;
  2248. return true;
  2249. } else {
  2250. anIntArrayArrayArray445[i][j][k] = -anInt448;
  2251. return false;
  2252. }
  2253. }
  2254.  
  2255. private boolean method321(int i, int j, int k, int l) {
  2256. if (!method320(i, j, k))
  2257. return false;
  2258. int i1 = j << 7;
  2259. int j1 = k << 7;
  2260. int k1 = anIntArrayArrayArray440[i][j][k] - 1;
  2261. int l1 = k1 - 120;
  2262. int i2 = k1 - 230;
  2263. int j2 = k1 - 238;
  2264. if (l < 16) {
  2265. if (l == 1) {
  2266. if (i1 > anInt455) {
  2267. if (!method324(i1, k1, j1))
  2268. return false;
  2269. if (!method324(i1, k1, j1 + 128))
  2270. return false;
  2271. }
  2272. if (i > 0) {
  2273. if (!method324(i1, l1, j1))
  2274. return false;
  2275. if (!method324(i1, l1, j1 + 128))
  2276. return false;
  2277. }
  2278. if (!method324(i1, i2, j1))
  2279. return false;
  2280. return method324(i1, i2, j1 + 128);
  2281. }
  2282. if (l == 2) {
  2283. if (j1 < anInt457) {
  2284. if (!method324(i1, k1, j1 + 128))
  2285. return false;
  2286. if (!method324(i1 + 128, k1, j1 + 128))
  2287. return false;
  2288. }
  2289. if (i > 0) {
  2290. if (!method324(i1, l1, j1 + 128))
  2291. return false;
  2292. if (!method324(i1 + 128, l1, j1 + 128))
  2293. return false;
  2294. }
  2295. if (!method324(i1, i2, j1 + 128))
  2296. return false;
  2297. return method324(i1 + 128, i2, j1 + 128);
  2298. }
  2299. if (l == 4) {
  2300. if (i1 < anInt455) {
  2301. if (!method324(i1 + 128, k1, j1))
  2302. return false;
  2303. if (!method324(i1 + 128, k1, j1 + 128))
  2304. return false;
  2305. }
  2306. if (i > 0) {
  2307. if (!method324(i1 + 128, l1, j1))
  2308. return false;
  2309. if (!method324(i1 + 128, l1, j1 + 128))
  2310. return false;
  2311. }
  2312. if (!method324(i1 + 128, i2, j1))
  2313. return false;
  2314. return method324(i1 + 128, i2, j1 + 128);
  2315. }
  2316. if (l == 8) {
  2317. if (j1 > anInt457) {
  2318. if (!method324(i1, k1, j1))
  2319. return false;
  2320. if (!method324(i1 + 128, k1, j1))
  2321. return false;
  2322. }
  2323. if (i > 0) {
  2324. if (!method324(i1, l1, j1))
  2325. return false;
  2326. if (!method324(i1 + 128, l1, j1))
  2327. return false;
  2328. }
  2329. if (!method324(i1, i2, j1))
  2330. return false;
  2331. return method324(i1 + 128, i2, j1);
  2332. }
  2333. }
  2334. if (!method324(i1 + 64, j2, j1 + 64))
  2335. return false;
  2336. if (l == 16)
  2337. return method324(i1, i2, j1 + 128);
  2338. if (l == 32)
  2339. return method324(i1 + 128, i2, j1 + 128);
  2340. if (l == 64)
  2341. return method324(i1 + 128, i2, j1);
  2342. if (l == 128) {
  2343. return method324(i1, i2, j1);
  2344. } else {
  2345. System.out.println("Warning unsupported wall type");
  2346. return true;
  2347. }
  2348. }
  2349.  
  2350. private boolean method322(int i, int j, int k, int l) {
  2351. if (!method320(i, j, k))
  2352. return false;
  2353. int i1 = j << 7;
  2354. int j1 = k << 7;
  2355. return method324(i1 + 1, anIntArrayArrayArray440[i][j][k] - l, j1 + 1)
  2356. && method324((i1 + 128) - 1,
  2357. anIntArrayArrayArray440[i][j + 1][k] - l, j1 + 1)
  2358. && method324((i1 + 128) - 1,
  2359. anIntArrayArrayArray440[i][j + 1][k + 1] - l,
  2360. (j1 + 128) - 1)
  2361. && method324(i1 + 1, anIntArrayArrayArray440[i][j][k + 1] - l,
  2362. (j1 + 128) - 1);
  2363. }
  2364.  
  2365. private boolean method323(int i, int j, int k, int l, int i1, int j1) {
  2366. if (j == k && l == i1) {
  2367. if (!method320(i, j, l))
  2368. return false;
  2369. int k1 = j << 7;
  2370. int i2 = l << 7;
  2371. return method324(k1 + 1, anIntArrayArrayArray440[i][j][l] - j1,
  2372. i2 + 1)
  2373. && method324((k1 + 128) - 1,
  2374. anIntArrayArrayArray440[i][j + 1][l] - j1, i2 + 1)
  2375. && method324((k1 + 128) - 1,
  2376. anIntArrayArrayArray440[i][j + 1][l + 1] - j1,
  2377. (i2 + 128) - 1)
  2378. && method324(k1 + 1, anIntArrayArrayArray440[i][j][l + 1]
  2379. - j1, (i2 + 128) - 1);
  2380. }
  2381. for (int l1 = j; l1 <= k; l1++) {
  2382. for (int j2 = l; j2 <= i1; j2++)
  2383. if (anIntArrayArrayArray445[i][l1][j2] == -anInt448)
  2384. return false;
  2385.  
  2386. }
  2387.  
  2388. int k2 = (j << 7) + 1;
  2389. int l2 = (l << 7) + 2;
  2390. int i3 = anIntArrayArrayArray440[i][j][l] - j1;
  2391. if (!method324(k2, i3, l2))
  2392. return false;
  2393. int j3 = (k << 7) - 1;
  2394. if (!method324(j3, i3, l2))
  2395. return false;
  2396. int k3 = (i1 << 7) - 1;
  2397. if (!method324(k2, i3, k3))
  2398. return false;
  2399. return method324(j3, i3, k3);
  2400. }
  2401.  
  2402. private boolean method324(int i, int j, int k) {
  2403. for (int l = 0; l < anInt475; l++) {
  2404. Class47 class47 = aClass47Array476[l];
  2405. if (class47.anInt798 == 1) {
  2406. int i1 = class47.anInt792 - i;
  2407. if (i1 > 0) {
  2408. int j2 = class47.anInt794 + (class47.anInt801 * i1 >> 8);
  2409. int k3 = class47.anInt795 + (class47.anInt802 * i1 >> 8);
  2410. int l4 = class47.anInt796 + (class47.anInt803 * i1 >> 8);
  2411. int i6 = class47.anInt797 + (class47.anInt804 * i1 >> 8);
  2412. if (k >= j2 && k <= k3 && j >= l4 && j <= i6)
  2413. return true;
  2414. }
  2415. } else if (class47.anInt798 == 2) {
  2416. int j1 = i - class47.anInt792;
  2417. if (j1 > 0) {
  2418. int k2 = class47.anInt794 + (class47.anInt801 * j1 >> 8);
  2419. int l3 = class47.anInt795 + (class47.anInt802 * j1 >> 8);
  2420. int i5 = class47.anInt796 + (class47.anInt803 * j1 >> 8);
  2421. int j6 = class47.anInt797 + (class47.anInt804 * j1 >> 8);
  2422. if (k >= k2 && k <= l3 && j >= i5 && j <= j6)
  2423. return true;
  2424. }
  2425. } else if (class47.anInt798 == 3) {
  2426. int k1 = class47.anInt794 - k;
  2427. if (k1 > 0) {
  2428. int l2 = class47.anInt792 + (class47.anInt799 * k1 >> 8);
  2429. int i4 = class47.anInt793 + (class47.anInt800 * k1 >> 8);
  2430. int j5 = class47.anInt796 + (class47.anInt803 * k1 >> 8);
  2431. int k6 = class47.anInt797 + (class47.anInt804 * k1 >> 8);
  2432. if (i >= l2 && i <= i4 && j >= j5 && j <= k6)
  2433. return true;
  2434. }
  2435. } else if (class47.anInt798 == 4) {
  2436. int l1 = k - class47.anInt794;
  2437. if (l1 > 0) {
  2438. int i3 = class47.anInt792 + (class47.anInt799 * l1 >> 8);
  2439. int j4 = class47.anInt793 + (class47.anInt800 * l1 >> 8);
  2440. int k5 = class47.anInt796 + (class47.anInt803 * l1 >> 8);
  2441. int l6 = class47.anInt797 + (class47.anInt804 * l1 >> 8);
  2442. if (i >= i3 && i <= j4 && j >= k5 && j <= l6)
  2443. return true;
  2444. }
  2445. } else if (class47.anInt798 == 5) {
  2446. int i2 = j - class47.anInt796;
  2447. if (i2 > 0) {
  2448. int j3 = class47.anInt792 + (class47.anInt799 * i2 >> 8);
  2449. int k4 = class47.anInt793 + (class47.anInt800 * i2 >> 8);
  2450. int l5 = class47.anInt794 + (class47.anInt801 * i2 >> 8);
  2451. int i7 = class47.anInt795 + (class47.anInt802 * i2 >> 8);
  2452. if (i >= j3 && i <= k4 && k >= l5 && k <= i7)
  2453. return true;
  2454. }
  2455. }
  2456. }
  2457.  
  2458. return false;
  2459. }
  2460.  
  2461. private boolean aBoolean429;
  2462. private int anInt430;
  2463. private static int anInt431 = 360;
  2464. private static int anInt432 = 1;
  2465. private static int anInt433 = -460;
  2466. private boolean aBoolean434;
  2467. private boolean aBoolean435;
  2468. public static boolean aBoolean436 = true;
  2469. int anInt437;
  2470. int anInt438;
  2471. int anInt439;
  2472. int anIntArrayArrayArray440[][][];
  2473. Ground groundArray[][][];
  2474. int anInt442;
  2475. int obj5CacheCurrPos;
  2476. Object5 obj5Cache[];
  2477. int anIntArrayArrayArray445[][][];
  2478. static int anInt446;
  2479. static int anInt447;
  2480. static int anInt448;
  2481. static int anInt449;
  2482. static int anInt450;
  2483. static int anInt451;
  2484. static int anInt452;
  2485. static int anInt453;
  2486. static int anInt454;
  2487. static int anInt455;
  2488. static int anInt456;
  2489. static int anInt457;
  2490. static int anInt458;
  2491. static int anInt459;
  2492. static int anInt460;
  2493. static int anInt461;
  2494. static Object5 aClass28Array462[] = new Object5[100];
  2495. static final int anIntArray463[] = { 53, -53, -53, 53 };
  2496. static final int anIntArray464[] = { -53, -53, 53, 53 };
  2497. static final int anIntArray465[] = { -45, 45, 45, -45 };
  2498. static final int anIntArray466[] = { 45, 45, -45, -45 };
  2499. static boolean aBoolean467;
  2500. static int anInt468;
  2501. static int anInt469;
  2502. public static int anInt470 = -1;
  2503. public static int anInt471 = -1;
  2504. static int anInt472;
  2505. static int anIntArray473[];
  2506. static Class47 aClass47ArrayArray474[][];
  2507. public static int anInt475;
  2508. static Class47 aClass47Array476[] = new Class47[500];
  2509. static Class19 aClass19_477 = new Class19(169);
  2510. static final int anIntArray478[] = { 19, 55, 38, 155, 255, 110, 137, 205,
  2511. 76 };
  2512. static final int anIntArray479[] = { 160, 192, 80, 96, 0, 144, 80, 48, 160 };
  2513. static final int anIntArray480[] = { 76, 8, 137, 4, 0, 1, 38, 2, 19 };
  2514. static final int anIntArray481[] = { 0, 0, 2, 0, 0, 2, 1, 1, 0 };
  2515. static final int anIntArray482[] = { 2, 0, 0, 2, 0, 0, 0, 4, 4 };
  2516. static final int anIntArray483[] = { 0, 4, 4, 8, 0, 0, 8, 0, 0 };
  2517. static final int anIntArray484[] = { 1, 1, 0, 0, 0, 8, 0, 0, 8 };
  2518. static final int anIntArray485[] = { 41, 39248, 41, 4643, 41, 41, 41, 41,
  2519. 41, 41, 41, 41, 41, 41, 41, 43086, 41, 41, 41, 41, 41, 41, 41,
  2520. 8602, 41, 28992, 41, 41, 41, 41, 41, 5056, 41, 41, 41, 7079, 41,
  2521. 41, 41, 41, 41, 41, 41, 41, 41, 41, 3131, 41, 41, 41 };
  2522. int anIntArray486[];
  2523. int anIntArray487[];
  2524. int anInt488;
  2525. int anIntArrayArray489[][] = { new int[16],
  2526. { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
  2527. { 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1 },
  2528. { 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 },
  2529. { 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1 },
  2530. { 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
  2531. { 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1 },
  2532. { 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0 },
  2533. { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0 },
  2534. { 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1 },
  2535. { 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 },
  2536. { 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1 },
  2537. { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1 } };
  2538. int anIntArrayArray490[][] = {
  2539. { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
  2540. { 12, 8, 4, 0, 13, 9, 5, 1, 14, 10, 6, 2, 15, 11, 7, 3 },
  2541. { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 },
  2542. { 3, 7, 11, 15, 2, 6, 10, 14, 1, 5, 9, 13, 0, 4, 8, 12 } };
  2543. static boolean aBooleanArrayArrayArrayArray491[][][][] = new boolean[8][32][51][51];
  2544. static boolean aBooleanArrayArray492[][];
  2545. static int anInt493;
  2546. static int anInt494;
  2547. static int anInt495;
  2548. static int anInt496;
  2549. static int anInt497;
  2550. static int anInt498;
  2551. public static int viewDistance = 9;
  2552.  
  2553. static {
  2554. anInt472 = 4;
  2555. anIntArray473 = new int[anInt472];
  2556. aClass47ArrayArray474 = new Class47[anInt472][500];
  2557. }
  2558. }
Advertisement
Add Comment
Please, Sign In to add comment