Advertisement
Guest User

Untitled

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