Plane -> Level

Random renaming in Game
This commit is contained in:
thedaneeffect committed 2023-01-01 19:21:54 -05:00
1 parent c696ab13ff
commit f3d6fe6e4f
11 files changed
+1390 -1241

No files matched your search

+1 -4
View File
@@ -115,7 +115,7 @@ public class Censor {
return ((c >= ' ') && (c <= '\177')) || (c == ' ') || (c == '\n') || (c == '\t') || (c == '\243') || (c == '\u20AC');
}
public static String method497(String s, int i) {
public static String apply(String s) {
char[] ac = s.toCharArray();
method495(ac);
String s1 = (new String(ac)).trim();
@@ -123,9 +123,6 @@ public class Censor {
String s2 = s1.toLowerCase();
method505(ac);
method500(ac);
if (i != 0) {
throw new NullPointerException();
}
method501(ac);
method514(ac);
for (String value : aStringArray626) {
+6 -2
View File
@@ -69,7 +69,7 @@ public class Component {
}
if (c.type == 0) {
c.scrollHeight = in.get2U();
c.scrollableHeight = in.get2U();
c.hidden = in.get1U() == 1;
int childCount = in.get2U();
c.children = new int[childCount];
@@ -283,6 +283,10 @@ public class Component {
public boolean fill;
public BitmapFont font;
public int height;
/**
* Hides this component. Only works for parent components by default.
* @see Game#drawParentComponent(Component, int, int, int)
*/
public boolean hidden;
public int hoverColor;
public int id;
@@ -309,7 +313,7 @@ public class Component {
public int[] scriptComparator;
public int[] scriptOperand;
public int[][] scripts;
public int scrollHeight;
public int scrollableHeight;
public int scrollY;
public int seqCycle;
public int seqFrame;
+945 -813
View File
File diff suppressed because it is too large. Load diff
+3 -3
View File
@@ -14,7 +14,7 @@ public class ProjectileEntity extends Entity {
public final int arc;
public final int target;
public final SpotAnimType spotanim;
public final int plane;
public final int level;
public double velocityX;
public double velocityZ;
public double velocity;
@@ -29,9 +29,9 @@ public class ProjectileEntity extends Entity {
public int yaw;
public int pitch;
public ProjectileEntity(int peakPitch, int offsetY, int startCycle, int lastCycle, int arc, int plane, int srcY, int srcZ, int srcX, int target, int spotanim) {
public ProjectileEntity(int peakPitch, int offsetY, int startCycle, int lastCycle, int arc, int level, int srcY, int srcZ, int srcX, int target, int spotanim) {
this.spotanim = SpotAnimType.instances[spotanim];
this.plane = plane;
this.level = level;
this.srcX = srcX;
this.srcZ = srcZ;
this.srcY = srcY;
+189 -189
View File
@@ -18,11 +18,11 @@ public class Scene {
public static final int[] anIntArray483 = {0, 4, 4, 8, 0, 0, 8, 0, 0};
public static final int[] anIntArray484 = {1, 1, 0, 0, 0, 8, 0, 0, 8};
public static final int[] anIntArray485 = {41, 39248, 41, 4643, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 43086, 41, 41, 41, 41, 41, 41, 41, 8602, 41, 28992, 41, 41, 41, 41, 41, 5056, 41, 41, 41, 7079, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 3131, 41, 41, 41};
public static final int anInt472 = 4;
public static final int LEVEL_COUNT = 4;
public static final SceneOccluder[] activeOccluders = new SceneOccluder[500];
public static boolean lowmem = true;
public static int anInt446;
public static int topPlane;
public static int topLevel;
public static int cycle;
public static int anInt449;
public static int anInt450;
@@ -43,8 +43,8 @@ public class Scene {
public static int anInt469;
public static int clickTileX = -1;
public static int clickTileZ = -1;
public static int[] anIntArray473 = new int[anInt472];
public static SceneOccluder[][] aOccluderArrayArray474 = new SceneOccluder[anInt472][500];
public static int[] levelOccluderCount = new int[LEVEL_COUNT];
public static SceneOccluder[][] levelOccluders = new SceneOccluder[LEVEL_COUNT][500];
public static int activeOccluderCount;
public static DoublyLinkedList aList_477 = new DoublyLinkedList();
public static boolean[][][][] aBooleanArrayArrayArrayArray491 = new boolean[8][32][51][51];
@@ -58,14 +58,14 @@ public class Scene {
public static void unload() {
tmp = null;
anIntArray473 = null;
aOccluderArrayArray474 = null;
levelOccluderCount = null;
levelOccluders = null;
aList_477 = null;
aBooleanArrayArrayArrayArray491 = null;
aBooleanArrayArray492 = null;
}
public static void method277(int i, int j, int k, int l, int i1, int j1, int l1, int i2) {
public static void method277(int level, int j, int k, int l, int i1, int j1, int l1, int i2) {
SceneOccluder occluder = new SceneOccluder();
occluder.anInt787 = j / 128;
occluder.anInt788 = l / 128;
@@ -78,7 +78,7 @@ public class Scene {
occluder.anInt795 = i1;
occluder.anInt796 = j1;
occluder.anInt797 = k;
aOccluderArrayArray474[i][anIntArray473[i]++] = occluder;
levelOccluders[level][levelOccluderCount[level]++] = occluder;
}
public static void method310(int i, int j, int k, int l, int[] ai) {
@@ -157,68 +157,68 @@ public class Scene {
return (l1 >= anInt495) && (l1 <= anInt497) && (i2 >= anInt496) && (i2 <= anInt498);
}
public final int maxPlane;
public final int maxLevel;
public final int maxTileX;
public final int maxTileZ;
public final int[][][] planeHeightmaps;
public final SceneTile[][][] planeTiles;
public final int[][][] levelHeightmaps;
public final SceneTile[][][] levelTiles;
public final SceneLoc[] temporaryLocs = new SceneLoc[5000];
public final int[][][] planeTileOcclusionCycles;
public final int[][][] levelTileOcclusionCycles;
public final int[] anIntArray486 = new int[10000];
public final int[] anIntArray487 = new int[10000];
public final int[][] MINIMAP_TILE_MASK = {new int[16], {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, {1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1}, {1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1}, {0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, {1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1}, {1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0}, {1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1}, {1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1}};
public final int[][] MINIMAP_TILE_ROTATION_MAP = {{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, {12, 8, 4, 0, 13, 9, 5, 1, 14, 10, 6, 2, 15, 11, 7, 3}, {15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0}, {3, 7, 11, 15, 2, 6, 10, 14, 1, 5, 9, 13, 0, 4, 8, 12}};
public int minPlane;
public int minLevel;
public int temporaryLocCount;
public int anInt488;
public Scene(int maxTileZ, int maxTileX, int[][][] planeHeightmaps, int maxPlane) {
this.maxPlane = maxPlane;
public Scene(int maxTileZ, int maxTileX, int[][][] levelHeightmaps, int maxLevel) {
this.maxLevel = maxLevel;
this.maxTileX = maxTileX;
this.maxTileZ = maxTileZ;
planeTiles = new SceneTile[maxPlane][maxTileX][maxTileZ];
planeTileOcclusionCycles = new int[maxPlane][maxTileX + 1][maxTileZ + 1];
this.planeHeightmaps = planeHeightmaps;
levelTiles = new SceneTile[maxLevel][maxTileX][maxTileZ];
levelTileOcclusionCycles = new int[maxLevel][maxTileX + 1][maxTileZ + 1];
this.levelHeightmaps = levelHeightmaps;
clear();
}
public void clear() {
for (int plane = 0; plane < maxPlane; plane++) {
for (int level = 0; level < maxLevel; level++) {
for (int stx = 0; stx < maxTileX; stx++) {
for (int stz = 0; stz < maxTileZ; stz++) {
planeTiles[plane][stx][stz] = null;
levelTiles[level][stx][stz] = null;
}
}
}
for (int l = 0; l < anInt472; l++) {
for (int j1 = 0; j1 < anIntArray473[l]; j1++) {
aOccluderArrayArray474[l][j1] = null;
for (int l = 0; l < LEVEL_COUNT; l++) {
for (int j1 = 0; j1 < levelOccluderCount[l]; j1++) {
levelOccluders[l][j1] = null;
}
anIntArray473[l] = 0;
levelOccluderCount[l] = 0;
}
for (int k1 = 0; k1 < temporaryLocCount; k1++) {
temporaryLocs[k1] = null;
for (int i = 0; i < temporaryLocCount; i++) {
temporaryLocs[i] = null;
}
temporaryLocCount = 0;
Arrays.fill(tmp, null);
}
public void setMinPlane(int plane) {
minPlane = plane;
public void setMinLevel(int level) {
minLevel = level;
for (int stx = 0; stx < maxTileX; stx++) {
for (int stz = 0; stz < maxTileZ; stz++) {
if (planeTiles[plane][stx][stz] == null) {
planeTiles[plane][stx][stz] = new SceneTile(plane, stx, stz);
if (levelTiles[level][stx][stz] == null) {
levelTiles[level][stx][stz] = new SceneTile(level, stx, stz);
}
}
}
}
public void setBridge(int stx, int stz) {
SceneTile ground = planeTiles[0][stx][stz];
SceneTile ground = levelTiles[0][stx][stz];
for (int plane = 0; plane < 3; plane++) {
SceneTile above = planeTiles[plane][stx][stz] = planeTiles[plane + 1][stx][stz];
for (int level = 0; level < 3; level++) {
SceneTile above = levelTiles[level][stx][stz] = levelTiles[level + 1][stx][stz];
if (above == null) {
continue;
@@ -230,72 +230,72 @@ public class Scene {
SceneLoc loc = above.locs[i];
if ((((loc.bitset >> 29) & 3) == 2) && (loc.minSceneTileX == stx) && (loc.minSceneTileZ == stz)) {
loc.plane--;
loc.level--;
}
}
}
if (planeTiles[0][stx][stz] == null) {
planeTiles[0][stx][stz] = new SceneTile(0, stx, stz);
if (levelTiles[0][stx][stz] == null) {
levelTiles[0][stx][stz] = new SceneTile(0, stx, stz);
}
planeTiles[0][stx][stz].bridge = ground;
planeTiles[3][stx][stz] = null;
levelTiles[0][stx][stz].bridge = ground;
levelTiles[3][stx][stz] = null;
}
public void setDrawPlane(int plane, int stx, int stz, int drawPlane) {
SceneTile tile = planeTiles[plane][stx][stz];
public void setDrawLevel(int level, int stx, int stz, int drawLevel) {
SceneTile tile = levelTiles[level][stx][stz];
if (tile != null) {
planeTiles[plane][stx][stz].drawPlane = drawPlane;
levelTiles[level][stx][stz].drawLevel = drawLevel;
}
}
public void setTile(int plane, int stx, int stz, int type, int i1, int j1, int k1, int l1, int i2, int j2, int k2, int l2, int i3, int j3, int k3, int l3, int i4, int j4, int k4, int l4) {
public void setTile(int level, int x, int z, int type, int i1, int j1, int k1, int l1, int i2, int j2, int k2, int l2, int i3, int j3, int k3, int l3, int i4, int j4, int k4, int l4) {
if (type == 0) {
SceneTileUnderlay underlay = new SceneTileUnderlay(k2, l2, i3, j3, -1, k4, false);
for (int p = plane; p >= 0; p--) {
if (planeTiles[p][stx][stz] == null) {
planeTiles[p][stx][stz] = new SceneTile(p, stx, stz);
for (int l = level; l >= 0; l--) {
if (levelTiles[l][x][z] == null) {
levelTiles[l][x][z] = new SceneTile(l, x, z);
}
}
planeTiles[plane][stx][stz].underlay = underlay;
levelTiles[level][x][z].underlay = underlay;
} else if (type == 1) {
SceneTileUnderlay underlay = new SceneTileUnderlay(k3, l3, i4, j4, j1, l4, (k1 == l1) && (k1 == i2) && (k1 == j2));
for (int p = plane; p >= 0; p--) {
if (planeTiles[p][stx][stz] == null) {
planeTiles[p][stx][stz] = new SceneTile(p, stx, stz);
for (int l = level; l >= 0; l--) {
if (levelTiles[l][x][z] == null) {
levelTiles[l][x][z] = new SceneTile(l, x, z);
}
}
planeTiles[plane][stx][stz].underlay = underlay;
levelTiles[level][x][z].underlay = underlay;
} else {
SceneTileOverlay overlay = new SceneTileOverlay(stz, k3, j3, i2, j1, i4, i1, k2, k4, i3, j2, l1, k1, type, j4, l3, l2, stx, l4);
for (int k5 = plane; k5 >= 0; k5--) {
if (planeTiles[k5][stx][stz] == null) {
planeTiles[k5][stx][stz] = new SceneTile(k5, stx, stz);
SceneTileOverlay overlay = new SceneTileOverlay(z, k3, j3, i2, j1, i4, i1, k2, k4, i3, j2, l1, k1, type, j4, l3, l2, x, l4);
for (int l = level; l >= 0; l--) {
if (levelTiles[l][x][z] == null) {
levelTiles[l][x][z] = new SceneTile(l, x, z);
}
}
planeTiles[plane][stx][stz].overlay = overlay;
levelTiles[level][x][z].overlay = overlay;
}
}
public void addGroundDecoration(Entity entity, int plane, int stx, int stz, int y, int bitset, byte info) {
public void addGroundDecoration(Entity entity, int tileLevel, int tileX, int tileZ, int y, int bitset, byte info) {
if (entity == null) {
return;
}
SceneGroundDecoration decor = new SceneGroundDecoration();
decor.entity = entity;
decor.x = (stx * 128) + 64;
decor.z = (stz * 128) + 64;
decor.x = (tileX * 128) + 64;
decor.z = (tileZ * 128) + 64;
decor.y = y;
decor.bitset = bitset;
decor.info = info;
if (planeTiles[plane][stx][stz] == null) {
planeTiles[plane][stx][stz] = new SceneTile(plane, stx, stz);
if (levelTiles[tileLevel][tileX][tileZ] == null) {
levelTiles[tileLevel][tileX][tileZ] = new SceneTile(tileLevel, tileX, tileZ);
}
planeTiles[plane][stx][stz].groundDecoration = decor;
levelTiles[tileLevel][tileX][tileZ].groundDecoration = decor;
}
public void addObjStack(Entity entity0, Entity entity1, Entity entity2, int plane, int stx, int stz, int y, int bitset) {
public void addObjStack(Entity entity0, Entity entity1, Entity entity2, int level, int stx, int stz, int y, int bitset) {
SceneObjStack objStack = new SceneObjStack();
objStack.x = (stx * 128) + 64;
objStack.z = (stz * 128) + 64;
@@ -307,7 +307,7 @@ public class Scene {
int stackOffset = 0;
SceneTile tile = planeTiles[plane][stx][stz];
SceneTile tile = levelTiles[level][stx][stz];
if (tile != null) {
for (int l = 0; l < tile.locCount; l++) {
@@ -323,66 +323,66 @@ public class Scene {
objStack.offset = stackOffset;
if (planeTiles[plane][stx][stz] == null) {
planeTiles[plane][stx][stz] = new SceneTile(plane, stx, stz);
if (levelTiles[level][stx][stz] == null) {
levelTiles[level][stx][stz] = new SceneTile(level, stx, stz);
}
planeTiles[plane][stx][stz].objStack = objStack;
levelTiles[level][stx][stz].objStack = objStack;
}
public void setWall(int occludeA, Entity entityA, int occludeB, Entity entityB, int plane, int localX, int localZ, int y, int bitset, byte info) {
public void setWall(int occludeA, Entity entityA, int occludeB, Entity entityB, int level, int tileX, int tileZ, int y, int bitset, byte info) {
if ((entityA == null) && (entityB == null)) {
return;
}
SceneWall wall = new SceneWall();
wall.bitset = bitset;
wall.info = info;
wall.x = (localX * 128) + 64;
wall.z = (localZ * 128) + 64;
wall.x = (tileX * 128) + 64;
wall.z = (tileZ * 128) + 64;
wall.y = y;
wall.entityA = entityA;
wall.entityB = entityB;
wall.occludeA = occludeA;
wall.occludeB = occludeB;
for (int p = plane; p >= 0; p--) {
if (planeTiles[p][localX][localZ] == null) {
planeTiles[p][localX][localZ] = new SceneTile(p, localX, localZ);
for (int l = level; l >= 0; l--) {
if (levelTiles[l][tileX][tileZ] == null) {
levelTiles[l][tileX][tileZ] = new SceneTile(l, tileX, tileZ);
}
}
planeTiles[plane][localX][localZ].wall = wall;
levelTiles[level][tileX][tileZ].wall = wall;
}
public void setWallDecoration(int occlude, Entity entity, int plane, int localX, int localZ, int y, int yaw, int offsetX, int offsetZ, int bitset, byte info) {
public void setWallDecoration(int occlude, Entity entity, int level, int tileX, int tileZ, int y, int yaw, int offsetX, int offsetZ, int bitset, byte info) {
if (entity == null) {
return;
}
SceneWallDecoration deco = new SceneWallDecoration();
deco.bitset = bitset;
deco.info = info;
deco.x = (localX * 128) + 64 + offsetX;
deco.z = (localZ * 128) + 64 + offsetZ;
deco.x = (tileX * 128) + 64 + offsetX;
deco.z = (tileZ * 128) + 64 + offsetZ;
deco.y = y;
deco.entity = entity;
deco.occlude = occlude;
deco.yaw = yaw;
for (int p = plane; p >= 0; p--) {
if (planeTiles[p][localX][localZ] == null) {
planeTiles[p][localX][localZ] = new SceneTile(p, localX, localZ);
for (int p = level; p >= 0; p--) {
if (levelTiles[p][tileX][tileZ] == null) {
levelTiles[p][tileX][tileZ] = new SceneTile(p, tileX, tileZ);
}
}
planeTiles[plane][localX][localZ].wallDecoration = deco;
levelTiles[level][tileX][tileZ].wallDecoration = deco;
}
public boolean add(Entity entity, int plane, int localX, int localZ, int y, int width, int length, int yaw, int bitset, byte info) {
public boolean add(Entity entity, int level, int tileX, int tileZ, int y, int width, int length, int yaw, int bitset, byte info) {
if (entity == null) {
return true;
} else {
int x = (localX * 128) + (64 * width);
int z = (localZ * 128) + (64 * length);
return add(entity, plane, localX, localZ, width, length, x, z, y, yaw, bitset, info, false);
int sceneX = (tileX * 128) + (64 * width);
int sceneZ = (tileZ * 128) + (64 * length);
return add(entity, level, tileX, tileZ, width, length, sceneX, sceneZ, y, yaw, bitset, info, false);
}
}
public boolean addTemporary(Entity entity, int plane, int x, int z, int y, int yaw, int bitset, boolean forwardPadding, int padding) {
public boolean addTemporary(Entity entity, int level, int x, int z, int y, int yaw, int bitset, boolean forwardPadding, int padding) {
if (entity == null) {
return true;
}
@@ -411,24 +411,24 @@ public class Scene {
z0 /= 128;
x1 /= 128;
z1 /= 128;
return add(entity, plane, x0, z0, (x1 - x0) + 1, (z1 - z0) + 1, x, z, y, yaw, bitset, (byte) 0, true);
return add(entity, level, x0, z0, (x1 - x0) + 1, (z1 - z0) + 1, x, z, y, yaw, bitset, (byte) 0, true);
}
public boolean addTemporary(Entity entity, int plane, int stx0, int stz0, int stx1, int stz1, int x, int z, int y, int yaw, int bitset) {
public boolean addTemporary(Entity entity, int level, int minTileX, int minTileZ, int maxTileX, int maxTileZ, int x, int z, int y, int yaw, int bitset) {
if (entity == null) {
return true;
} else {
return add(entity, plane, stx0, stz0, (stx1 - stx0) + 1, (stz1 - stz0) + 1, x, z, y, yaw, bitset, (byte) 0, true);
return add(entity, level, minTileX, minTileZ, (maxTileX - minTileX) + 1, (maxTileZ - minTileZ) + 1, x, z, y, yaw, bitset, (byte) 0, true);
}
}
public boolean add(Entity entity, int plane, int stx, int stz, int width, int length, int x, int z, int y, int yaw, int bitset, byte info, boolean temporary) {
for (int tx = stx; tx < (stx + width); tx++) {
for (int tz = stz; tz < (stz + length); tz++) {
public boolean add(Entity entity, int level, int tileX, int tileZ, int tileWidth, int tileLength, int x, int z, int y, int yaw, int bitset, byte info, boolean temporary) {
for (int tx = tileX; tx < (tileX + tileWidth); tx++) {
for (int tz = tileZ; tz < (tileZ + tileLength); tz++) {
if ((tx < 0) || (tz < 0) || (tx >= maxTileX) || (tz >= maxTileZ)) {
return false;
}
SceneTile tile = planeTiles[plane][tx][tz];
SceneTile tile = levelTiles[level][tx][tz];
if ((tile != null) && (tile.locCount >= 5)) {
return false;
}
@@ -437,44 +437,44 @@ public class Scene {
SceneLoc loc = new SceneLoc();
loc.bitset = bitset;
loc.info = info;
loc.plane = plane;
loc.level = level;
loc.x = x;
loc.z = z;
loc.y = y;
loc.entity = entity;
loc.yaw = yaw;
loc.minSceneTileX = stx;
loc.minSceneTileZ = stz;
loc.maxSceneTileX = (stx + width) - 1;
loc.maxSceneTileZ = (stz + length) - 1;
loc.minSceneTileX = tileX;
loc.minSceneTileZ = tileZ;
loc.maxSceneTileX = (tileX + tileWidth) - 1;
loc.maxSceneTileZ = (tileZ + tileLength) - 1;
for (int tx = stx; tx < (stx + width); tx++) {
for (int tz = stz; tz < (stz + length); tz++) {
for (int tx = tileX; tx < (tileX + tileWidth); tx++) {
for (int tz = tileZ; tz < (tileZ + tileLength); tz++) {
int flags = 0;
if (tx > stx) {
if (tx > tileX) {
flags++;
}
if (tx < ((stx + width) - 1)) {
if (tx < ((tileX + tileWidth) - 1)) {
flags += 4;
}
if (tz > stz) {
if (tz > tileZ) {
flags += 8;
}
if (tz < ((stz + length) - 1)) {
if (tz < ((tileZ + tileLength) - 1)) {
flags += 2;
}
for (int p = plane; p >= 0; p--) {
if (planeTiles[p][tx][tz] == null) {
planeTiles[p][tx][tz] = new SceneTile(p, tx, tz);
for (int p = level; p >= 0; p--) {
if (levelTiles[p][tx][tz] == null) {
levelTiles[p][tx][tz] = new SceneTile(p, tx, tz);
}
}
SceneTile tile = planeTiles[plane][tx][tz];
SceneTile tile = levelTiles[level][tx][tz];
tile.locs[tile.locCount] = loc;
tile.locFlags[tile.locCount] = flags;
tile.flags |= flags;
@@ -501,7 +501,7 @@ public class Scene {
public void remove(SceneLoc loc) {
for (int tx = loc.minSceneTileX; tx <= loc.maxSceneTileX; tx++) {
for (int tz = loc.minSceneTileZ; tz <= loc.maxSceneTileZ; tz++) {
SceneTile tile = planeTiles[loc.plane][tx][tz];
SceneTile tile = levelTiles[loc.level][tx][tz];
if (tile == null) {
continue;
@@ -531,8 +531,8 @@ public class Scene {
}
}
public void setWallDecorationOffset(int plane, int stx, int stz, int offset) {
SceneTile tile = planeTiles[plane][stx][stz];
public void setWallDecorationOffset(int level, int stx, int stz, int offset) {
SceneTile tile = levelTiles[level][stx][stz];
if (tile == null) {
return;
}
@@ -545,22 +545,22 @@ public class Scene {
}
}
public void removeWall(int x, int plane, int z) {
SceneTile tile = planeTiles[plane][x][z];
public void removeWall(int x, int level, int z) {
SceneTile tile = levelTiles[level][x][z];
if (tile != null) {
tile.wall = null;
}
}
public void removeWallDecoration(int plane, int x, int z) {
SceneTile tile = planeTiles[plane][x][z];
public void removeWallDecoration(int level, int x, int z) {
SceneTile tile = levelTiles[level][x][z];
if (tile != null) {
tile.wallDecoration = null;
}
}
public void removeLoc(int plane, int x, int z) {
SceneTile tile = planeTiles[plane][x][z];
public void removeLoc(int level, int x, int z) {
SceneTile tile = levelTiles[level][x][z];
if (tile == null) {
return;
}
@@ -573,22 +573,22 @@ public class Scene {
}
}
public void removeGroundDecoration(int plane, int x, int z) {
SceneTile tile = planeTiles[plane][x][z];
public void removeGroundDecoration(int level, int x, int z) {
SceneTile tile = levelTiles[level][x][z];
if (tile != null) {
tile.groundDecoration = null;
}
}
public void removeObjStack(int plane, int x, int z) {
SceneTile tile = planeTiles[plane][x][z];
public void removeObjStack(int level, int x, int z) {
SceneTile tile = levelTiles[level][x][z];
if (tile != null) {
tile.objStack = null;
}
}
public SceneWall getWall(int plane, int x, int z) {
SceneTile tile = planeTiles[plane][x][z];
public SceneWall getWall(int level, int x, int z) {
SceneTile tile = levelTiles[level][x][z];
if (tile != null) {
return tile.wall;
} else {
@@ -596,8 +596,8 @@ public class Scene {
}
}
public SceneWallDecoration getWallDecoration(int plane, int x, int z) {
SceneTile tile = planeTiles[plane][x][z];
public SceneWallDecoration getWallDecoration(int level, int x, int z) {
SceneTile tile = levelTiles[level][x][z];
if (tile != null) {
return tile.wallDecoration;
} else {
@@ -605,8 +605,8 @@ public class Scene {
}
}
public SceneLoc getLoc(int plane, int x, int z) {
SceneTile tile = planeTiles[plane][x][z];
public SceneLoc getLoc(int level, int x, int z) {
SceneTile tile = levelTiles[level][x][z];
if (tile == null) {
return null;
}
@@ -619,8 +619,8 @@ public class Scene {
return null;
}
public SceneGroundDecoration getGroundDecoration(int z, int x, int plane) {
SceneTile tile = planeTiles[plane][x][z];
public SceneGroundDecoration getGroundDecoration(int z, int x, int level) {
SceneTile tile = levelTiles[level][x][z];
if ((tile != null) && (tile.groundDecoration != null)) {
return tile.groundDecoration;
} else {
@@ -628,8 +628,8 @@ public class Scene {
}
}
public int getWallBitset(int plane, int x, int z) {
SceneTile tile = planeTiles[plane][x][z];
public int getWallBitset(int level, int x, int z) {
SceneTile tile = levelTiles[level][x][z];
if ((tile != null) && (tile.wall != null)) {
return tile.wall.bitset;
} else {
@@ -637,8 +637,8 @@ public class Scene {
}
}
public int getWallDecorationBitset(int plane, int x, int z) {
SceneTile tile = planeTiles[plane][x][z];
public int getWallDecorationBitset(int level, int x, int z) {
SceneTile tile = levelTiles[level][x][z];
if ((tile == null) || (tile.wallDecoration == null)) {
return 0;
} else {
@@ -646,8 +646,8 @@ public class Scene {
}
}
public int getLocBitset(int plane, int x, int z) {
SceneTile tile = planeTiles[plane][x][z];
public int getLocBitset(int level, int x, int z) {
SceneTile tile = levelTiles[level][x][z];
if (tile == null) {
return 0;
}
@@ -660,8 +660,8 @@ public class Scene {
return 0;
}
public int getGroundDecorationBitset(int plane, int x, int z) {
SceneTile tile = planeTiles[plane][x][z];
public int getGroundDecorationBitset(int level, int x, int z) {
SceneTile tile = levelTiles[level][x][z];
if ((tile == null) || (tile.groundDecoration == null)) {
return 0;
} else {
@@ -669,8 +669,8 @@ public class Scene {
}
}
public int getInfo(int plane, int x, int z, int bitset) {
SceneTile tile = planeTiles[plane][x][z];
public int getInfo(int level, int x, int z, int bitset) {
SceneTile tile = levelTiles[level][x][z];
if (tile == null) {
return -1;
@@ -696,13 +696,13 @@ public class Scene {
return -1;
}
public void method305(int i, int j, int k, int l, int i1) {
public void applyLighting(int i, int j, int k, int l, int i1) {
int j1 = (int) Math.sqrt((k * k) + (i * i) + (i1 * i1));
int k1 = (l * j1) >> 8;
for (int l1 = 0; l1 < maxPlane; l1++) {
for (int l1 = 0; l1 < maxLevel; l1++) {
for (int i2 = 0; i2 < maxTileX; i2++) {
for (int j2 = 0; j2 < maxTileZ; j2++) {
SceneTile tile = planeTiles[l1][i2][j2];
SceneTile tile = levelTiles[l1][i2][j2];
if (tile != null) {
SceneWall wall = tile.wall;
if ((wall != null) && (wall.entityA != null) && (wall.entityA.vertexNormal != null)) {
@@ -734,25 +734,25 @@ public class Scene {
public void method306(int i, int j, Model model, int k) {
if (i < maxTileX) {
SceneTile tile = planeTiles[j][i + 1][k];
SceneTile tile = levelTiles[j][i + 1][k];
if ((tile != null) && (tile.groundDecoration != null) && (tile.groundDecoration.entity.vertexNormal != null)) {
method308(model, (Model) tile.groundDecoration.entity, 128, 0, 0, true);
}
}
if (k < maxTileX) {
SceneTile tile_1 = planeTiles[j][i][k + 1];
SceneTile tile_1 = levelTiles[j][i][k + 1];
if ((tile_1 != null) && (tile_1.groundDecoration != null) && (tile_1.groundDecoration.entity.vertexNormal != null)) {
method308(model, (Model) tile_1.groundDecoration.entity, 0, 0, 128, true);
}
}
if ((i < maxTileX) && (k < maxTileZ)) {
SceneTile tile_2 = planeTiles[j][i + 1][k + 1];
SceneTile tile_2 = levelTiles[j][i + 1][k + 1];
if ((tile_2 != null) && (tile_2.groundDecoration != null) && (tile_2.groundDecoration.entity.vertexNormal != null)) {
method308(model, (Model) tile_2.groundDecoration.entity, 128, 0, 128, true);
}
}
if ((i < maxTileX) && (k > 0)) {
SceneTile tile_3 = planeTiles[j][i + 1][k - 1];
SceneTile tile_3 = levelTiles[j][i + 1][k - 1];
if ((tile_3 != null) && (tile_3.groundDecoration != null) && (tile_3.groundDecoration.entity.vertexNormal != null)) {
method308(model, (Model) tile_3.groundDecoration.entity, 128, 0, -128, true);
}
@@ -766,14 +766,14 @@ public class Scene {
int l1 = i1 - 1;
int i2 = i1 + k;
for (int j2 = i; j2 <= (i + 1); j2++) {
if (j2 != maxPlane) {
if (j2 != maxLevel) {
for (int k2 = j1; k2 <= k1; k2++) {
if ((k2 >= 0) && (k2 < maxTileX)) {
for (int l2 = l1; l2 <= i2; l2++) {
if ((l2 >= 0) && (l2 < maxTileZ) && (!flag || (k2 >= k1) || (l2 >= i2) || ((l2 < i1) && (k2 != l)))) {
SceneTile tile = planeTiles[j2][k2][l2];
SceneTile tile = levelTiles[j2][k2][l2];
if (tile != null) {
int i3 = ((planeHeightmaps[j2][k2][l2] + planeHeightmaps[j2][k2 + 1][l2] + planeHeightmaps[j2][k2][l2 + 1] + planeHeightmaps[j2][k2 + 1][l2 + 1]) / 4) - ((planeHeightmaps[i][l][i1] + planeHeightmaps[i][l + 1][i1] + planeHeightmaps[i][l][i1 + 1] + planeHeightmaps[i][l + 1][i1 + 1]) / 4);
int i3 = ((levelHeightmaps[j2][k2][l2] + levelHeightmaps[j2][k2 + 1][l2] + levelHeightmaps[j2][k2][l2 + 1] + levelHeightmaps[j2][k2 + 1][l2 + 1]) / 4) - ((levelHeightmaps[i][l][i1] + levelHeightmaps[i][l + 1][i1] + levelHeightmaps[i][l][i1 + 1] + levelHeightmaps[i][l + 1][i1 + 1]) / 4);
SceneWall wall = tile.wall;
if ((wall != null) && (wall.entityA != null) && (wall.entityA.vertexNormal != null)) {
method308(model, (Model) wall.entityA, ((k2 - l) * 128) + ((1 - j) * 64), i3, ((l2 - i1) * 128) + ((1 - k) * 64), flag);
@@ -868,8 +868,8 @@ public class Scene {
}
}
public void drawMinimapTile(int[] dst, int offset, int step, int plane, int x, int z) {
SceneTile tile = planeTiles[plane][x][z];
public void drawMinimapTile(int[] dst, int offset, int step, int level, int x, int z) {
SceneTile tile = levelTiles[level][x][z];
if (tile == null) {
return;
@@ -943,7 +943,7 @@ public class Scene {
clickTileZ = -1;
}
public void draw(int eyeX, int eyeZ, int eyeYaw, int eyeY, int topPlane, int eyePitch) {
public void draw(int eyeX, int eyeZ, int eyeYaw, int eyeY, int topLevel, int eyePitch) {
if (eyeX < 0) {
eyeX = 0;
} else if (eyeX >= (maxTileX * 128)) {
@@ -965,7 +965,7 @@ public class Scene {
Scene.eyeZ = eyeZ;
eyeTileX = eyeX / 128;
eyeTileZ = eyeZ / 128;
Scene.topPlane = topPlane;
Scene.topLevel = topLevel;
anInt449 = eyeTileX - 25;
if (anInt449 < 0) {
anInt449 = 0;
@@ -984,13 +984,13 @@ public class Scene {
}
method319();
anInt446 = 0;
for (int k1 = minPlane; k1 < maxPlane; k1++) {
SceneTile[][] aclass30_sub3 = planeTiles[k1];
for (int k1 = minLevel; k1 < maxLevel; k1++) {
SceneTile[][] aclass30_sub3 = levelTiles[k1];
for (int i2 = anInt449; i2 < anInt450; i2++) {
for (int k2 = anInt451; k2 < anInt452; k2++) {
SceneTile tile = aclass30_sub3[i2][k2];
if (tile != null) {
if ((tile.drawPlane > topPlane) || (!aBooleanArrayArray492[(i2 - eyeTileX) + 25][(k2 - eyeTileZ) + 25] && ((planeHeightmaps[k1][i2][k2] - eyeY) < 2000))) {
if ((tile.drawLevel > topLevel) || (!aBooleanArrayArray492[(i2 - eyeTileX) + 25][(k2 - eyeTileZ) + 25] && ((levelHeightmaps[k1][i2][k2] - eyeY) < 2000))) {
tile.aBoolean1322 = false;
tile.aBoolean1323 = false;
tile.anInt1325 = 0;
@@ -1004,8 +1004,8 @@ public class Scene {
}
}
}
for (int l1 = minPlane; l1 < maxPlane; l1++) {
SceneTile[][] aclass30_sub3_1 = planeTiles[l1];
for (int l1 = minLevel; l1 < maxLevel; l1++) {
SceneTile[][] aclass30_sub3_1 = levelTiles[l1];
for (int l2 = -25; l2 <= 0; l2++) {
int i3 = eyeTileX + l2;
int k3 = eyeTileX - l2;
@@ -1049,8 +1049,8 @@ public class Scene {
}
}
}
for (int j2 = minPlane; j2 < maxPlane; j2++) {
SceneTile[][] aclass30_sub3_2 = planeTiles[j2];
for (int j2 = minLevel; j2 < maxLevel; j2++) {
SceneTile[][] aclass30_sub3_2 = levelTiles[j2];
for (int j3 = -25; j3 <= 0; j3++) {
int l3 = eyeTileX + j3;
int j4 = eyeTileX - j3;
@@ -1111,11 +1111,11 @@ public class Scene {
int j = tile_1.anInt1309;
int k = tile_1.anInt1307;
int l = tile_1.anInt1310;
SceneTile[][] tiles = planeTiles[k];
SceneTile[][] tiles = levelTiles[k];
if (tile_1.aBoolean1322) {
if (flag) {
if (k > 0) {
SceneTile tile_2 = planeTiles[k - 1][i][j];
SceneTile tile_2 = levelTiles[k - 1][i][j];
if ((tile_2 != null) && tile_2.aBoolean1323) {
continue;
}
@@ -1522,8 +1522,8 @@ public class Scene {
}
}
}
if (k < (maxPlane - 1)) {
SceneTile tile_12 = planeTiles[k + 1][i][j];
if (k < (maxLevel - 1)) {
SceneTile tile_12 = levelTiles[k + 1][i][j];
if ((tile_12 != null) && tile_12.aBoolean1323) {
aList_477.pushBack(tile_12);
}
@@ -1564,10 +1564,10 @@ public class Scene {
int i3 = l2 = i2 + 128;
int j3;
int k3 = j3 = k2 + 128;
int l3 = planeHeightmaps[i][j1][k1] - eyeY;
int i4 = planeHeightmaps[i][j1 + 1][k1] - eyeY;
int j4 = planeHeightmaps[i][j1 + 1][k1 + 1] - eyeY;
int k4 = planeHeightmaps[i][j1][k1 + 1] - eyeY;
int l3 = levelHeightmaps[i][j1][k1] - eyeY;
int i4 = levelHeightmaps[i][j1 + 1][k1] - eyeY;
int j4 = levelHeightmaps[i][j1 + 1][k1 + 1] - eyeY;
int k4 = levelHeightmaps[i][j1][k1 + 1] - eyeY;
int l4 = ((k2 * l) + (i2 * i1)) >> 16;
k2 = ((k2 * i1) - (i2 * l)) >> 16;
i2 = l4;
@@ -1745,8 +1745,8 @@ public class Scene {
}
public void method319() {
int j = anIntArray473[topPlane];
SceneOccluder[] aclass47 = aOccluderArrayArray474[topPlane];
int j = levelOccluderCount[topLevel];
SceneOccluder[] aclass47 = levelOccluders[topLevel];
activeOccluderCount = 0;
for (int k = 0; k < j; k++) {
SceneOccluder occluder = aclass47[k];
@@ -1873,8 +1873,8 @@ public class Scene {
}
}
public boolean tileOccluded(int plane, int x, int z) {
int cycle = planeTileOcclusionCycles[plane][x][z];
public boolean tileOccluded(int level, int x, int z) {
int cycle = levelTileOcclusionCycles[level][x][z];
if (cycle == -Scene.cycle) {
return false;
@@ -1887,23 +1887,23 @@ public class Scene {
int sx = x << 7;
int sz = z << 7;
if (occluded(sx + 1, planeHeightmaps[plane][x][z], sz + 1) && occluded((sx + 128) - 1, planeHeightmaps[plane][x + 1][z], sz + 1) && occluded((sx + 128) - 1, planeHeightmaps[plane][x + 1][z + 1], (sz + 128) - 1) && occluded(sx + 1, planeHeightmaps[plane][x][z + 1], (sz + 128) - 1)) {
planeTileOcclusionCycles[plane][x][z] = Scene.cycle;
if (occluded(sx + 1, levelHeightmaps[level][x][z], sz + 1) && occluded((sx + 128) - 1, levelHeightmaps[level][x + 1][z], sz + 1) && occluded((sx + 128) - 1, levelHeightmaps[level][x + 1][z + 1], (sz + 128) - 1) && occluded(sx + 1, levelHeightmaps[level][x][z + 1], (sz + 128) - 1)) {
levelTileOcclusionCycles[level][x][z] = Scene.cycle;
return true;
} else {
planeTileOcclusionCycles[plane][x][z] = -Scene.cycle;
levelTileOcclusionCycles[level][x][z] = -Scene.cycle;
return false;
}
}
public boolean wallOccluded(int plane, int stx, int stz, int type) {
if (!tileOccluded(plane, stx, stz)) {
public boolean wallOccluded(int level, int stx, int stz, int type) {
if (!tileOccluded(level, stx, stz)) {
return false;
}
int x = stx << 7;
int z = stz << 7;
int y = planeHeightmaps[plane][stx][stz] - 1;
int y = levelHeightmaps[level][stx][stz] - 1;
int y0 = y - 120;
int y1 = y - 230;
int y2 = y - 238;
@@ -1918,7 +1918,7 @@ public class Scene {
return false;
}
}
if (plane > 0) {
if (level > 0) {
if (!occluded(x, y0, z)) {
return false;
}
@@ -1940,7 +1940,7 @@ public class Scene {
return false;
}
}
if (plane > 0) {
if (level > 0) {
if (!occluded(x, y0, z + 128)) {
return false;
}
@@ -1962,7 +1962,7 @@ public class Scene {
return false;
}
}
if (plane > 0) {
if (level > 0) {
if (!occluded(x + 128, y0, z)) {
return false;
}
@@ -1984,7 +1984,7 @@ public class Scene {
return false;
}
}
if (plane > 0) {
if (level > 0) {
if (!occluded(x, y0, z)) {
return false;
}
@@ -2023,28 +2023,28 @@ public class Scene {
}
}
public boolean occluded(int plane, int tx, int tz, int y) {
if (!tileOccluded(plane, tx, tz)) {
public boolean occluded(int level, int tx, int tz, int y) {
if (!tileOccluded(level, tx, tz)) {
return false;
}
int x = tx << 7;
int z = tz << 7;
return occluded(x + 1, planeHeightmaps[plane][tx][tz] - y, z + 1) && occluded((x + 128) - 1, planeHeightmaps[plane][tx + 1][tz] - y, z + 1) && occluded((x + 128) - 1, planeHeightmaps[plane][tx + 1][tz + 1] - y, (z + 128) - 1) && occluded(x + 1, planeHeightmaps[plane][tx][tz + 1] - y, (z + 128) - 1);
return occluded(x + 1, levelHeightmaps[level][tx][tz] - y, z + 1) && occluded((x + 128) - 1, levelHeightmaps[level][tx + 1][tz] - y, z + 1) && occluded((x + 128) - 1, levelHeightmaps[level][tx + 1][tz + 1] - y, (z + 128) - 1) && occluded(x + 1, levelHeightmaps[level][tx][tz + 1] - y, (z + 128) - 1);
}
public boolean occluded(int plane, int tx0, int tx1, int tz0, int tz1, int y) {
public boolean occluded(int level, int tx0, int tx1, int tz0, int tz1, int y) {
if ((tx0 == tx1) && (tz0 == tz1)) {
if (!tileOccluded(plane, tx0, tz0)) {
if (!tileOccluded(level, tx0, tz0)) {
return false;
}
int x = tx0 << 7;
int z = tz0 << 7;
return occluded(x + 1, planeHeightmaps[plane][tx0][tz0] - y, z + 1) && occluded((x + 128) - 1, planeHeightmaps[plane][tx0 + 1][tz0] - y, z + 1) && occluded((x + 128) - 1, planeHeightmaps[plane][tx0 + 1][tz0 + 1] - y, (z + 128) - 1) && occluded(x + 1, planeHeightmaps[plane][tx0][tz0 + 1] - y, (z + 128) - 1);
return occluded(x + 1, levelHeightmaps[level][tx0][tz0] - y, z + 1) && occluded((x + 128) - 1, levelHeightmaps[level][tx0 + 1][tz0] - y, z + 1) && occluded((x + 128) - 1, levelHeightmaps[level][tx0 + 1][tz0 + 1] - y, (z + 128) - 1) && occluded(x + 1, levelHeightmaps[level][tx0][tz0 + 1] - y, (z + 128) - 1);
}
for (int stx = tx0; stx <= tx1; stx++) {
for (int stz = tz0; stz <= tz1; stz++) {
if (planeTileOcclusionCycles[plane][stx][stz] == -cycle) {
if (levelTileOcclusionCycles[level][stx][stz] == -cycle) {
return false;
}
}
@@ -2052,7 +2052,7 @@ public class Scene {
int x0 = (tx0 << 7) + 1;
int z0 = (tz0 << 7) + 2;
int y0 = planeHeightmaps[plane][tx0][tz0] - y;
int y0 = levelHeightmaps[level][tx0][tz0] - y;
if (!occluded(x0, y0, z0)) {
return false;
+237 -224
View File
@@ -11,7 +11,7 @@ public class SceneBuilder {
public static int anInt123 = (int) (Math.random() * 17.0) - 8;
public static int anInt131;
public static int anInt133 = (int) (Math.random() * 33.0) - 16;
public static int minPlane = 99;
public static int minLevel = 99;
public static boolean lowmem = true;
public static int method170(int i, int i_3_) {
@@ -110,11 +110,11 @@ public class SceneBuilder {
return (hsl & 0xff80) + lightness;
}
public static void addLoc(Scene scene, int rotation, int z, int kind, int plane, SceneCollisionMap collision, int[][][] planeHeightmap, int x, int locID, int dataPlane) {
int heightSW = planeHeightmap[plane][x][z];
int heightSE = planeHeightmap[plane][x + 1][z];
int heightNE = planeHeightmap[plane][x + 1][z + 1];
int heightNW = planeHeightmap[plane][x][z + 1];
public static void addLoc(Scene scene, int rotation, int z, int kind, int tileLevel, SceneCollisionMap collision, int[][][] levelHeightmap, int x, int locID, int dataLevel) {
int heightSW = levelHeightmap[tileLevel][x][z];
int heightSE = levelHeightmap[tileLevel][x + 1][z];
int heightNE = levelHeightmap[tileLevel][x + 1][z + 1];
int heightNW = levelHeightmap[tileLevel][x][z + 1];
int y = (heightSW + heightSE + heightNE + heightNW) >> 2;
LocType loc = LocType.get(locID);
@@ -135,7 +135,7 @@ public class SceneBuilder {
entity = new LocEntity(locID, rotation, 22, heightSE, heightNE, heightSW, heightNW, loc.seqID, true);
}
scene.addGroundDecoration(entity, dataPlane, x, z, y, bitset, info);
scene.addGroundDecoration(entity, dataLevel, x, z, y, bitset, info);
if (loc.solid && loc.interactable) {
collision.addSolid(z, x);
@@ -167,7 +167,7 @@ public class SceneBuilder {
length = loc.length;
}
scene.add(entity, dataPlane, x, z, y, width, length, angle, bitset, info);
scene.add(entity, dataLevel, x, z, y, width, length, angle, bitset, info);
}
if (loc.solid) {
collision.add(loc.blocksProjectiles, loc.width, loc.length, x, z, rotation);
@@ -180,7 +180,7 @@ public class SceneBuilder {
entity = new LocEntity(locID, rotation, kind, heightSE, heightNE, heightSW, heightNW, loc.seqID, true);
}
scene.add(entity, dataPlane, x, z, y, 1, 1, 0, bitset, info);
scene.add(entity, dataLevel, x, z, y, 1, 1, 0, bitset, info);
if (loc.solid) {
collision.add(loc.blocksProjectiles, loc.width, loc.length, x, z, rotation);
@@ -194,7 +194,7 @@ public class SceneBuilder {
entity = new LocEntity(locID, rotation, 0, heightSE, heightNE, heightSW, heightNW, loc.seqID, true);
}
scene.setWall(WALL_ROTATION_OCCLUDE_TYPE[rotation], entity, 0, null, dataPlane, x, z, y, bitset, info);
scene.setWall(WALL_ROTATION_OCCLUDE_TYPE[rotation], entity, 0, null, dataLevel, x, z, y, bitset, info);
if (loc.solid) {
collision.addWall(z, rotation, x, kind, loc.blocksProjectiles);
@@ -208,7 +208,7 @@ public class SceneBuilder {
entity = new LocEntity(locID, rotation, 1, heightSE, heightNE, heightSW, heightNW, loc.seqID, true);
}
scene.setWall(WALL_ROTATION_OCCLUDE_TYPE_1[rotation], entity, 0, null, dataPlane, x, z, y, bitset, info);
scene.setWall(WALL_ROTATION_OCCLUDE_TYPE_1[rotation], entity, 0, null, dataLevel, x, z, y, bitset, info);
if (loc.solid) {
collision.addWall(z, rotation, x, kind, loc.blocksProjectiles);
@@ -226,7 +226,7 @@ public class SceneBuilder {
locB = new LocEntity(locID, nextRotation, 2, heightSE, heightNE, heightSW, heightNW, loc.seqID, true);
}
scene.setWall(WALL_ROTATION_OCCLUDE_TYPE[rotation], locA, WALL_ROTATION_OCCLUDE_TYPE[nextRotation], locB, dataPlane, x, z, y, bitset, info);
scene.setWall(WALL_ROTATION_OCCLUDE_TYPE[rotation], locA, WALL_ROTATION_OCCLUDE_TYPE[nextRotation], locB, dataLevel, x, z, y, bitset, info);
if (loc.solid) {
collision.addWall(z, rotation, x, kind, loc.blocksProjectiles);
@@ -240,7 +240,7 @@ public class SceneBuilder {
entity = new LocEntity(locID, rotation, 3, heightSE, heightNE, heightSW, heightNW, loc.seqID, true);
}
scene.setWall(WALL_ROTATION_OCCLUDE_TYPE_1[rotation], entity, 0, null, dataPlane, x, z, y, bitset, info);
scene.setWall(WALL_ROTATION_OCCLUDE_TYPE_1[rotation], entity, 0, null, dataLevel, x, z, y, bitset, info);
if (loc.solid) {
collision.addWall(z, rotation, x, kind, loc.blocksProjectiles);
@@ -254,7 +254,7 @@ public class SceneBuilder {
entity = new LocEntity(locID, rotation, kind, heightSE, heightNE, heightSW, heightNW, loc.seqID, true);
}
scene.add(entity, dataPlane, x, z, y, 1, 1, 0, bitset, info);
scene.add(entity, dataLevel, x, z, y, 1, 1, 0, bitset, info);
if (loc.solid) {
collision.add(loc.blocksProjectiles, loc.width, loc.length, x, z, rotation);
@@ -292,10 +292,10 @@ public class SceneBuilder {
entity = new LocEntity(locID, 0, 4, heightSE, heightNE, heightSW, heightNW, loc.seqID, true);
}
scene.setWallDecoration(WALL_ROTATION_OCCLUDE_TYPE[rotation], entity, dataPlane, x, z, y, rotation * 512, 0, 0, bitset, info);
scene.setWallDecoration(WALL_ROTATION_OCCLUDE_TYPE[rotation], entity, dataLevel, x, z, y, rotation * 512, 0, 0, bitset, info);
} else if (kind == 5) {
int padding = 16;
int wallBitset = scene.getWallBitset(dataPlane, x, z);
int wallBitset = scene.getWallBitset(dataLevel, x, z);
if (wallBitset > 0) {
padding = LocType.get((wallBitset >> 14) & 0x7fff).decorationPadding;
@@ -309,7 +309,7 @@ public class SceneBuilder {
entity = new LocEntity(locID, 0, 4, heightSE, heightNE, heightSW, heightNW, loc.seqID, true);
}
scene.setWallDecoration(WALL_ROTATION_OCCLUDE_TYPE[rotation], entity, dataPlane, x, z, y, rotation * 512, anIntArray137[rotation] * padding, anIntArray144[rotation] * padding, bitset, info);
scene.setWallDecoration(WALL_ROTATION_OCCLUDE_TYPE[rotation], entity, dataLevel, x, z, y, rotation * 512, anIntArray137[rotation] * padding, anIntArray144[rotation] * padding, bitset, info);
} else if (kind == 6) {
Entity entity;
@@ -319,7 +319,7 @@ public class SceneBuilder {
entity = new LocEntity(locID, 0, 4, heightSE, heightNE, heightSW, heightNW, loc.seqID, true);
}
scene.setWallDecoration(256, entity, dataPlane, x, z, y, rotation, 0, 0, bitset, info);
scene.setWallDecoration(256, entity, dataLevel, x, z, y, rotation, 0, 0, bitset, info);
} else if (kind == 7) {
Entity entity;
@@ -329,7 +329,7 @@ public class SceneBuilder {
entity = new LocEntity(locID, 0, 4, heightSE, heightNE, heightSW, heightNW, loc.seqID, true);
}
scene.setWallDecoration(512, entity, dataPlane, x, z, y, rotation, 0, 0, bitset, info);
scene.setWallDecoration(512, entity, dataLevel, x, z, y, rotation, 0, 0, bitset, info);
} else if (kind == 8) {
Entity entity;
@@ -339,7 +339,7 @@ public class SceneBuilder {
entity = new LocEntity(locID, 0, 4, heightSE, heightNE, heightSW, heightNW, loc.seqID, true);
}
scene.setWallDecoration(768, entity, dataPlane, x, z, y, rotation, 0, 0, bitset, info);
scene.setWallDecoration(768, entity, dataLevel, x, z, y, rotation, 0, 0, bitset, info);
}
}
}
@@ -392,31 +392,31 @@ public class SceneBuilder {
public final int[] anIntArray126;
public final int[] anIntArray127;
public final int[] anIntArray128;
public final int[][][] planeHeightmap;
public final int[][][] levelHeightmap;
public final byte[][][] aByteArrayArrayArray130;
public final byte[][][] planeShademap;
public final int[][][] planeOccludemap;
public final byte[][][] levelShademap;
public final int[][][] levelOccludemap;
public final byte[][][] aByteArrayArrayArray136;
public final int[][] planeTileLightness;
public final int[][] levelLightmap;
public final byte[][][] aByteArrayArrayArray142;
public final int maxTileX;
public final int maxTileZ;
public final byte[][][] aByteArrayArrayArray148;
public final byte[][][] planeTileFlags;
public final byte[][][] levelTileFlags;
public SceneBuilder(byte[][][] planeTileFlags, int maxTileZ, int maxTileX, int[][][] planeHeightmap) {
minPlane = 99;
public SceneBuilder(byte[][][] levelTileFlags, int maxTileZ, int maxTileX, int[][][] levelHeightmap) {
minLevel = 99;
this.maxTileX = maxTileX;
this.maxTileZ = maxTileZ;
this.planeHeightmap = planeHeightmap;
this.planeTileFlags = planeTileFlags;
this.levelHeightmap = levelHeightmap;
this.levelTileFlags = levelTileFlags;
aByteArrayArrayArray142 = new byte[4][this.maxTileX][this.maxTileZ];
aByteArrayArrayArray130 = new byte[4][this.maxTileX][this.maxTileZ];
aByteArrayArrayArray136 = new byte[4][this.maxTileX][this.maxTileZ];
aByteArrayArrayArray148 = new byte[4][this.maxTileX][this.maxTileZ];
planeOccludemap = new int[4][this.maxTileX + 1][this.maxTileZ + 1];
planeShademap = new byte[4][this.maxTileX + 1][this.maxTileZ + 1];
planeTileLightness = new int[this.maxTileX + 1][this.maxTileZ + 1];
levelOccludemap = new int[4][this.maxTileX + 1][this.maxTileZ + 1];
levelShademap = new byte[4][this.maxTileX + 1][this.maxTileZ + 1];
levelLightmap = new int[this.maxTileX + 1][this.maxTileZ + 1];
anIntArray124 = new int[this.maxTileZ];
anIntArray125 = new int[this.maxTileZ];
anIntArray126 = new int[this.maxTileZ];
@@ -424,25 +424,24 @@ public class SceneBuilder {
anIntArray128 = new int[this.maxTileZ];
}
public void method171(SceneCollisionMap[] planeCollisions, Scene scene) {
for (int plane = 0; plane < 4; plane++) {
public void method171(SceneCollisionMap[] levelCollisionMaps, Scene scene) {
for (int level = 0; level < 4; level++) {
for (int x = 0; x < 104; x++) {
for (int z = 0; z < 104; z++) {
if ((planeTileFlags[plane][x][z] & 0x1) == 1) {
int physicalPlane = plane;
if ((levelTileFlags[level][x][z] & 0x1) == 1) {
int trueLevel = level;
// bridge
if ((planeTileFlags[1][x][z] & 0x2) == 2) {
physicalPlane--;
if ((levelTileFlags[1][x][z] & 0x2) == 2) {
trueLevel--;
}
if (physicalPlane >= 0) {
planeCollisions[physicalPlane].addSolid(z, x);
if (trueLevel >= 0) {
levelCollisionMaps[trueLevel].addSolid(z, x);
}
}
}
}
}
anInt123 += (int) (Math.random() * 5.0) - 2;
@@ -464,8 +463,8 @@ public class SceneBuilder {
anInt133 = 16;
}
for (int plane = 0; plane < 4; plane++) {
byte[][] shademap = planeShademap[plane];
for (int level = 0; level < 4; level++) {
byte[][] shademap = levelShademap[level];
int lightAmbient = 96;
int lightAttenuation = 768;
int lightX = -50;
@@ -475,15 +474,15 @@ public class SceneBuilder {
for (int z = 1; z < (maxTileZ - 1); z++) {
for (int x = 1; x < (maxTileX - 1); x++) {
int dx = planeHeightmap[plane][x + 1][z] - planeHeightmap[plane][x - 1][z];
int dz = planeHeightmap[plane][x][z + 1] - planeHeightmap[plane][x][z - 1];
int dx = levelHeightmap[level][x + 1][z] - levelHeightmap[level][x - 1][z];
int dz = levelHeightmap[level][x][z + 1] - levelHeightmap[level][x][z - 1];
int len = (int) Math.sqrt((dx * dx) + 65536 + (dz * dz));
int nx = (dx << 8) / len;
int ny = 65536 / len;
int nz = (dz << 8) / len;
int light = lightAmbient + (((lightX * nx) + (lightY * ny) + (lightZ * nz)) / lightMagnitude);
int shade = (shademap[x - 1][z] >> 2) + (shademap[x + 1][z] >> 3) + (shademap[x][z - 1] >> 2) + (shademap[x][z + 1] >> 3) + (shademap[x][z] >> 1);
planeTileLightness[x][z] = light - shade;
levelLightmap[x][z] = light - shade;
}
}
@@ -500,7 +499,7 @@ public class SceneBuilder {
int x1 = x0 + 5;
if ((x1 >= 0) && (x1 < maxTileX)) {
int floID = aByteArrayArrayArray142[plane][x1][z0] & 0xff;
int floID = aByteArrayArrayArray142[level][x1][z0] & 0xff;
if (floID > 0) {
FloType flo = FloType.instances[floID - 1];
@@ -515,7 +514,7 @@ public class SceneBuilder {
int x2 = x0 - 5;
if ((x2 >= 0) && (x2 < maxTileX)) {
int floID = aByteArrayArrayArray142[plane][x2][z0] & 0xff;
int floID = aByteArrayArrayArray142[level][x2][z0] & 0xff;
if (floID > 0) {
FloType flo = FloType.instances[floID - 1];
@@ -556,24 +555,24 @@ public class SceneBuilder {
i_39_ -= anIntArray128[dz2];
}
if ((z0 >= 1) && (z0 < (maxTileZ - 1)) && (!lowmem || ((planeTileFlags[0][x0][z0] & 0x2) != 0) || (((planeTileFlags[plane][x0][z0] & 0x10) == 0) && (getDrawPlane(plane, x0, z0) == anInt131)))) {
if (plane < minPlane) {
minPlane = plane;
if ((z0 >= 1) && (z0 < (maxTileZ - 1)) && (!lowmem || ((levelTileFlags[0][x0][z0] & 0x2) != 0) || (((levelTileFlags[level][x0][z0] & 0x10) == 0) && (getDrawLevel(level, x0, z0) == anInt131)))) {
if (level < minLevel) {
minLevel = level;
}
int i_43_ = aByteArrayArrayArray142[plane][x0][z0] & 0xff;
int floID = aByteArrayArrayArray130[plane][x0][z0] & 0xff;
int i_43_ = aByteArrayArrayArray142[level][x0][z0] & 0xff;
int floID = aByteArrayArrayArray130[level][x0][z0] & 0xff;
if ((i_43_ > 0) || (floID > 0)) {
int heightSW = planeHeightmap[plane][x0][z0];
int heightSE = planeHeightmap[plane][x0 + 1][z0];
int heightNE = planeHeightmap[plane][x0 + 1][z0 + 1];
int heightNW = planeHeightmap[plane][x0][z0 + 1];
int heightSW = levelHeightmap[level][x0][z0];
int heightSE = levelHeightmap[level][x0 + 1][z0];
int heightNE = levelHeightmap[level][x0 + 1][z0 + 1];
int heightNW = levelHeightmap[level][x0][z0 + 1];
int tileHeight00 = planeTileLightness[x0][z0];
int tileHeight10 = planeTileLightness[x0 + 1][z0];
int tileHeight11 = planeTileLightness[x0 + 1][z0 + 1];
int tileHeight01 = planeTileLightness[x0][z0 + 1];
int tileHeight00 = levelLightmap[x0][z0];
int tileHeight10 = levelLightmap[x0 + 1][z0];
int tileHeight11 = levelLightmap[x0 + 1][z0 + 1];
int tileHeight01 = levelLightmap[x0][z0 + 1];
int i_53_ = -1;
int i_54_ = -1;
@@ -597,16 +596,16 @@ public class SceneBuilder {
i_54_ = decimateHSL(hue, saturation, lightness);
}
if (plane > 0) {
if (level > 0) {
boolean bool = true;
if ((i_43_ == 0) && (aByteArrayArrayArray136[plane][x0][z0] != 0)) {
if ((i_43_ == 0) && (aByteArrayArrayArray136[level][x0][z0] != 0)) {
bool = false;
}
if ((floID > 0) && !FloType.instances[floID - 1].aBoolean393) {
bool = false;
}
if (bool && (heightSW == heightSE) && (heightSW == heightNE) && (heightSW == heightNW)) {
planeOccludemap[plane][x0][z0] |= 0x924;
levelOccludemap[level][x0][z0] |= 0x924;
}
}
@@ -617,10 +616,10 @@ public class SceneBuilder {
}
if (floID == 0) {
scene.setTile(plane, x0, z0, 0, 0, -1, heightSW, heightSE, heightNE, heightNW, mulHSL(i_53_, tileHeight00), mulHSL(i_53_, tileHeight10), mulHSL(i_53_, tileHeight11), mulHSL(i_53_, tileHeight01), 0, 0, 0, 0, i_58_, 0);
scene.setTile(level, x0, z0, 0, 0, -1, heightSW, heightSE, heightNE, heightNW, mulHSL(i_53_, tileHeight00), mulHSL(i_53_, tileHeight10), mulHSL(i_53_, tileHeight11), mulHSL(i_53_, tileHeight01), 0, 0, 0, 0, i_58_, 0);
} else {
int i_59_ = aByteArrayArrayArray136[plane][x0][z0] + 1;
byte i_60_ = aByteArrayArrayArray148[plane][x0][z0];
int i_59_ = aByteArrayArrayArray136[level][x0][z0] + 1;
byte i_60_ = aByteArrayArrayArray148[level][x0][z0];
FloType flo = FloType.instances[floID - 1];
int textureID = flo.textureID;
int rgb;
@@ -638,7 +637,7 @@ public class SceneBuilder {
rgb = Draw3D.palette[adjustLightness(flo.hsl, 96)];
}
scene.setTile(plane, x0, z0, i_59_, i_60_, textureID, heightSW, heightSE, heightNE, heightNW, mulHSL(i_53_, tileHeight00), mulHSL(i_53_, tileHeight10), mulHSL(i_53_, tileHeight11), mulHSL(i_53_, tileHeight01), adjustLightness(hsl, tileHeight00), adjustLightness(hsl, tileHeight10), adjustLightness(hsl, tileHeight11), adjustLightness(hsl, tileHeight01), i_58_, rgb);
scene.setTile(level, x0, z0, i_59_, i_60_, textureID, heightSW, heightSE, heightNE, heightNW, mulHSL(i_53_, tileHeight00), mulHSL(i_53_, tileHeight10), mulHSL(i_53_, tileHeight11), mulHSL(i_53_, tileHeight01), adjustLightness(hsl, tileHeight00), adjustLightness(hsl, tileHeight10), adjustLightness(hsl, tileHeight11), adjustLightness(hsl, tileHeight01), i_58_, rgb);
}
}
}
@@ -648,140 +647,154 @@ public class SceneBuilder {
for (int stz = 1; stz < (maxTileZ - 1); stz++) {
for (int stx = 1; stx < (maxTileX - 1); stx++) {
scene.setDrawPlane(plane, stx, stz, getDrawPlane(plane, stx, stz));
scene.setDrawLevel(level, stx, stz, getDrawLevel(level, stx, stz));
}
}
}
scene.method305(-10, 64, -50, 768, -50);
scene.applyLighting(-10, 64, -50, 768, -50);
for (int x = 0; x < maxTileX; x++) {
for (int z = 0; z < maxTileZ; z++) {
if ((planeTileFlags[1][x][z] & 0x2) == 2) {
if ((levelTileFlags[1][x][z] & 0x2) == 2) {
scene.setBridge(x, z);
}
}
}
int i_68_ = 1;
int i_69_ = 2;
int i_70_ = 4;
for (int i_71_ = 0; i_71_ < 4; i_71_++) {
if (i_71_ > 0) {
i_68_ <<= 3;
i_69_ <<= 3;
i_70_ <<= 3;
// TODO: Find a reasonable name for these.
int maskA = 0b001;
int maskB = 0b010;
int maskC = 0b100;
for (int current = 0; current < 4; current++) {
if (current > 0) {
maskA <<= 3;
maskB <<= 3;
maskC <<= 3;
}
for (int plane = 0; plane <= i_71_; plane++) {
for (int z = 0; z <= maxTileZ; z++) {
for (int x = 0; x <= maxTileX; x++) {
if ((planeOccludemap[plane][x][z] & i_68_) != 0) {
int i_75_ = z;
int i_76_ = z;
int i_77_ = plane;
int i_78_ = plane;
for (/**/; i_75_ > 0; i_75_--) {
if ((planeOccludemap[plane][x][i_75_ - 1] & i_68_) == 0) {
for (int level = 0; level <= current; level++) {
for (int tileZ = 0; tileZ <= maxTileZ; tileZ++) {
for (int tileX = 0; tileX <= maxTileX; tileX++) {
if ((levelOccludemap[level][tileX][tileZ] & maskA) != 0) {
int minZ = tileZ;
int maxZ = tileZ;
int minLevel = level;
int maxLevel = level;
for (/**/; minZ > 0; minZ--) {
if ((levelOccludemap[level][tileX][minZ - 1] & maskA) == 0) {
break;
}
}
for (/**/; i_76_ < maxTileZ; i_76_++) {
if ((planeOccludemap[plane][x][i_76_ + 1] & i_68_) == 0) {
for (/**/; maxZ < maxTileZ; maxZ++) {
if ((levelOccludemap[level][tileX][maxZ + 1] & maskA) == 0) {
break;
}
}
while_0_:
for (/**/; i_77_ > 0; i_77_--) {
for (int i_79_ = i_75_; i_79_ <= i_76_; i_79_++) {
if ((planeOccludemap[i_77_ - 1][x][i_79_] & i_68_) == 0) {
break while_0_;
find_min_level:
for (/**/; minLevel > 0; minLevel--) {
for (int z = minZ; z <= maxZ; z++) {
if ((levelOccludemap[minLevel - 1][tileX][z] & maskA) == 0) {
break find_min_level;
}
}
}
while_1_:
for (/**/; i_78_ < i_71_; i_78_++) {
for (int i_80_ = i_75_; i_80_ <= i_76_; i_80_++) {
if ((planeOccludemap[i_78_ + 1][x][i_80_] & i_68_) == 0) {
break while_1_;
find_max_level:
for (/**/; maxLevel < current; maxLevel++) {
for (int z = minZ; z <= maxZ; z++) {
if ((levelOccludemap[maxLevel + 1][tileX][z] & maskA) == 0) {
break find_max_level;
}
}
}
int i_81_ = ((i_78_ + 1) - i_77_) * ((i_76_ - i_75_) + 1);
if (i_81_ >= 8) {
int i_82_ = 240;
int i_83_ = planeHeightmap[i_78_][x][i_75_] - i_82_;
int i_84_ = planeHeightmap[i_77_][x][i_75_];
Scene.method277(i_71_, x * 128, i_84_, x * 128, (i_76_ * 128) + 128, i_83_, i_75_ * 128, 1);
for (int i_85_ = i_77_; i_85_ <= i_78_; i_85_++) {
for (int i_86_ = i_75_; i_86_ <= i_76_; i_86_++) {
planeOccludemap[i_85_][x][i_86_] &= ~i_68_;
int area = ((maxLevel + 1) - minLevel) * ((maxZ - minZ) + 1);
if (area >= 8) {
int maxY = levelHeightmap[maxLevel][tileX][minZ] - 240;
int minY = levelHeightmap[minLevel][tileX][minZ];
Scene.method277(current, tileX * 128, minY, tileX * 128, (maxZ * 128) + 128, maxY, minZ * 128, 1);
for (int l = minLevel; l <= maxLevel; l++) {
for (int z = minZ; z <= maxZ; z++) {
levelOccludemap[l][tileX][z] &= ~maskA;
}
}
}
}
if ((planeOccludemap[plane][x][z] & i_69_) != 0) {
int i_87_ = x;
int i_88_ = x;
int i_89_ = plane;
int i_90_ = plane;
for (/**/; i_87_ > 0; i_87_--) {
if ((planeOccludemap[plane][i_87_ - 1][z] & i_69_) == 0) {
if ((levelOccludemap[level][tileX][tileZ] & maskB) != 0) {
int minX = tileX;
int maxX = tileX;
int minLevel = level;
int maxLevel = level;
for (/**/; minX > 0; minX--) {
if ((levelOccludemap[level][minX - 1][tileZ] & maskB) == 0) {
break;
}
}
for (/**/; i_88_ < maxTileX; i_88_++) {
if ((planeOccludemap[plane][i_88_ + 1][z] & i_69_) == 0) {
for (/**/; maxX < maxTileX; maxX++) {
if ((levelOccludemap[level][maxX + 1][tileZ] & maskB) == 0) {
break;
}
}
while_2_:
for (/**/; i_89_ > 0; i_89_--) {
for (int i_91_ = i_87_; i_91_ <= i_88_; i_91_++) {
if ((planeOccludemap[i_89_ - 1][i_91_][z] & i_69_) == 0) {
break while_2_;
find_min_level:
for (/**/; minLevel > 0; minLevel--) {
for (int x = minX; x <= maxX; x++) {
if ((levelOccludemap[minLevel - 1][x][tileZ] & maskB) == 0) {
break find_min_level;
}
}
}
while_3_:
for (/**/; i_90_ < i_71_; i_90_++) {
for (int i_92_ = i_87_; i_92_ <= i_88_; i_92_++) {
if ((planeOccludemap[i_90_ + 1][i_92_][z] & i_69_) == 0) {
break while_3_;
find_max_level:
for (/**/; maxLevel < current; maxLevel++) {
for (int x = minX; x <= maxX; x++) {
if ((levelOccludemap[maxLevel + 1][x][tileZ] & maskB) == 0) {
break find_max_level;
}
}
}
int i_93_ = ((i_90_ + 1) - i_89_) * ((i_88_ - i_87_) + 1);
if (i_93_ >= 8) {
int i_94_ = 240;
int i_95_ = planeHeightmap[i_90_][i_87_][z] - i_94_;
int i_96_ = planeHeightmap[i_89_][i_87_][z];
Scene.method277(i_71_, i_87_ * 128, i_96_, (i_88_ * 128) + 128, z * 128, i_95_, z * 128, 2);
for (int i_97_ = i_89_; i_97_ <= i_90_; i_97_++) {
for (int i_98_ = i_87_; i_98_ <= i_88_; i_98_++) {
planeOccludemap[i_97_][i_98_][z] &= ~i_69_;
int area = ((maxLevel + 1) - minLevel) * ((maxX - minX) + 1);
if (area >= 8) {
int maxY = levelHeightmap[maxLevel][minX][tileZ] - 240;
int minY = levelHeightmap[minLevel][minX][tileZ];
Scene.method277(current, minX * 128, minY, (maxX * 128) + 128, tileZ * 128, maxY, tileZ * 128, 2);
for (int i_97_ = minLevel; i_97_ <= maxLevel; i_97_++) {
for (int i_98_ = minX; i_98_ <= maxX; i_98_++) {
levelOccludemap[i_97_][i_98_][tileZ] &= ~maskB;
}
}
}
}
if ((planeOccludemap[plane][x][z] & i_70_) != 0) {
int i_99_ = x;
int i_100_ = x;
int i_101_ = z;
int i_102_ = z;
if ((levelOccludemap[level][tileX][tileZ] & maskC) != 0) {
int i_99_ = tileX;
int i_100_ = tileX;
int i_101_ = tileZ;
int i_102_ = tileZ;
for (/**/; i_101_ > 0; i_101_--) {
if ((planeOccludemap[plane][x][i_101_ - 1] & i_70_) == 0) {
if ((levelOccludemap[level][tileX][i_101_ - 1] & maskC) == 0) {
break;
}
}
for (/**/; i_102_ < maxTileZ; i_102_++) {
if ((planeOccludemap[plane][x][i_102_ + 1] & i_70_) == 0) {
if ((levelOccludemap[level][tileX][i_102_ + 1] & maskC) == 0) {
break;
}
}
while_4_:
for (/**/; i_99_ > 0; i_99_--) {
for (int i_103_ = i_101_; i_103_ <= i_102_; i_103_++) {
if ((planeOccludemap[plane][i_99_ - 1][i_103_] & i_70_) == 0) {
if ((levelOccludemap[level][i_99_ - 1][i_103_] & maskC) == 0) {
break while_4_;
}
}
@@ -789,17 +802,17 @@ public class SceneBuilder {
while_5_:
for (/**/; i_100_ < maxTileX; i_100_++) {
for (int i_104_ = i_101_; i_104_ <= i_102_; i_104_++) {
if ((planeOccludemap[plane][i_100_ + 1][i_104_] & i_70_) == 0) {
if ((levelOccludemap[level][i_100_ + 1][i_104_] & maskC) == 0) {
break while_5_;
}
}
}
if ((((i_100_ - i_99_) + 1) * ((i_102_ - i_101_) + 1)) >= 4) {
int i_105_ = planeHeightmap[plane][i_99_][i_101_];
Scene.method277(i_71_, i_99_ * 128, i_105_, (i_100_ * 128) + 128, (i_102_ * 128) + 128, i_105_, i_101_ * 128, 4);
int i_105_ = levelHeightmap[level][i_99_][i_101_];
Scene.method277(current, i_99_ * 128, i_105_, (i_100_ * 128) + 128, (i_102_ * 128) + 128, i_105_, i_101_ * 128, 4);
for (int i_106_ = i_99_; i_106_ <= i_100_; i_106_++) {
for (int i_107_ = i_101_; i_107_ <= i_102_; i_107_++) {
planeOccludemap[plane][i_106_][i_107_] &= ~i_70_;
levelOccludemap[level][i_106_][i_107_] &= ~maskC;
}
}
}
@@ -814,35 +827,35 @@ public class SceneBuilder {
for (int i_117_ = i; i_117_ <= (i + i_113_); i_117_++) {
for (int i_118_ = i_116_; i_118_ <= (i_116_ + i_115_); i_118_++) {
if ((i_118_ >= 0) && (i_118_ < maxTileX) && (i_117_ >= 0) && (i_117_ < maxTileZ)) {
planeShademap[0][i_118_][i_117_] = (byte) 127;
levelShademap[0][i_118_][i_117_] = (byte) 127;
if ((i_118_ == i_116_) && (i_118_ > 0)) {
planeHeightmap[0][i_118_][i_117_] = planeHeightmap[0][i_118_ - 1][i_117_];
levelHeightmap[0][i_118_][i_117_] = levelHeightmap[0][i_118_ - 1][i_117_];
}
if ((i_118_ == (i_116_ + i_115_)) && (i_118_ < (maxTileX - 1))) {
planeHeightmap[0][i_118_][i_117_] = planeHeightmap[0][i_118_ + 1][i_117_];
levelHeightmap[0][i_118_][i_117_] = levelHeightmap[0][i_118_ + 1][i_117_];
}
if ((i_117_ == i) && (i_117_ > 0)) {
planeHeightmap[0][i_118_][i_117_] = planeHeightmap[0][i_118_][i_117_ - 1];
levelHeightmap[0][i_118_][i_117_] = levelHeightmap[0][i_118_][i_117_ - 1];
}
if ((i_117_ == (i + i_113_)) && (i_117_ < (maxTileZ - 1))) {
planeHeightmap[0][i_118_][i_117_] = planeHeightmap[0][i_118_][i_117_ + 1];
levelHeightmap[0][i_118_][i_117_] = levelHeightmap[0][i_118_][i_117_ + 1];
}
}
}
}
}
public void method175(int z, Scene scene, SceneCollisionMap collision, int kind, int plane, int x, int locID, int rotation) {
if (lowmem && ((planeTileFlags[0][x][z] & 0x2) == 0) && (((planeTileFlags[plane][x][z] & 0x10) != 0) || (getDrawPlane(plane, x, z) != anInt131))) {
public void method175(int z, Scene scene, SceneCollisionMap collision, int kind, int level, int x, int locID, int rotation) {
if (lowmem && ((levelTileFlags[0][x][z] & 0x2) == 0) && (((levelTileFlags[level][x][z] & 0x10) != 0) || (getDrawLevel(level, x, z) != anInt131))) {
return;
}
if (plane < minPlane) {
minPlane = plane;
if (level < minLevel) {
minLevel = level;
}
int heightmapSW = planeHeightmap[plane][x][z];
int heightmapSE = planeHeightmap[plane][x + 1][z];
int heightmapNE = planeHeightmap[plane][x + 1][z + 1];
int heightmapNW = planeHeightmap[plane][x][z + 1];
int heightmapSW = levelHeightmap[level][x][z];
int heightmapSE = levelHeightmap[level][x + 1][z];
int heightmapNE = levelHeightmap[level][x + 1][z + 1];
int heightmapNW = levelHeightmap[level][x][z + 1];
int heightmapAverage = (heightmapSW + heightmapSE + heightmapNE + heightmapNW) >> 2;
LocType type = LocType.get(locID);
int bitset = x + (z << 7) + (locID << 14) + 0x40000000;
@@ -863,7 +876,7 @@ public class SceneBuilder {
entity = new LocEntity(locID, rotation, 22, heightmapSE, heightmapNE, heightmapSW, heightmapNW, type.seqID, true);
}
scene.addGroundDecoration(entity, plane, x, z, heightmapAverage, bitset, info);
scene.addGroundDecoration(entity, level, x, z, heightmapAverage, bitset, info);
if (type.solid && type.interactable && (collision != null)) {
collision.addSolid(z, x);
@@ -896,7 +909,7 @@ public class SceneBuilder {
height = type.length;
}
if (scene.add(entity, plane, x, z, heightmapAverage, width, height, yaw, bitset, info) && type.castShadow) {
if (scene.add(entity, level, x, z, heightmapAverage, width, height, yaw, bitset, info) && type.castShadow) {
Model model;
if (entity instanceof Model) {
@@ -914,8 +927,8 @@ public class SceneBuilder {
shade = 30;
}
if (shade > planeShademap[plane][x + dx][z + dz]) {
planeShademap[plane][x + dx][z + dz] = (byte) shade;
if (shade > levelShademap[level][x + dx][z + dz]) {
levelShademap[level][x + dx][z + dz] = (byte) shade;
}
}
}
@@ -935,10 +948,10 @@ public class SceneBuilder {
entity = new LocEntity(locID, rotation, kind, heightmapSE, heightmapNE, heightmapSW, heightmapNW, type.seqID, true);
}
scene.add(entity, plane, x, z, heightmapAverage, 1, 1, 0, bitset, info);
scene.add(entity, level, x, z, heightmapAverage, 1, 1, 0, bitset, info);
if ((kind >= 12) && (kind <= 17) && (kind != 13) && (plane > 0)) {
planeOccludemap[plane][x][z] |= 0x924;
if ((kind >= 12) && (kind <= 17) && (kind != 13) && (level > 0)) {
levelOccludemap[level][x][z] |= 0x924;
}
if (type.solid && (collision != null)) {
@@ -953,39 +966,39 @@ public class SceneBuilder {
entity = new LocEntity(locID, rotation, 0, heightmapSE, heightmapNE, heightmapSW, heightmapNW, type.seqID, true);
}
scene.setWall(WALL_ROTATION_OCCLUDE_TYPE[rotation], entity, 0, null, plane, x, z, heightmapAverage, bitset, info);
scene.setWall(WALL_ROTATION_OCCLUDE_TYPE[rotation], entity, 0, null, level, x, z, heightmapAverage, bitset, info);
if (rotation == 0) {
if (type.castShadow) {
planeShademap[plane][x][z] = (byte) 50;
planeShademap[plane][x][z + 1] = (byte) 50;
levelShademap[level][x][z] = (byte) 50;
levelShademap[level][x][z + 1] = (byte) 50;
}
if (type.occludes) {
planeOccludemap[plane][x][z] |= 0x249;
levelOccludemap[level][x][z] |= 0x249;
}
} else if (rotation == 1) {
if (type.castShadow) {
planeShademap[plane][x][z + 1] = (byte) 50;
planeShademap[plane][x + 1][z + 1] = (byte) 50;
levelShademap[level][x][z + 1] = (byte) 50;
levelShademap[level][x + 1][z + 1] = (byte) 50;
}
if (type.occludes) {
planeOccludemap[plane][x][z + 1] |= 0x492;
levelOccludemap[level][x][z + 1] |= 0x492;
}
} else if (rotation == 2) {
if (type.castShadow) {
planeShademap[plane][x + 1][z] = (byte) 50;
planeShademap[plane][x + 1][z + 1] = (byte) 50;
levelShademap[level][x + 1][z] = (byte) 50;
levelShademap[level][x + 1][z + 1] = (byte) 50;
}
if (type.occludes) {
planeOccludemap[plane][x + 1][z] |= 0x249;
levelOccludemap[level][x + 1][z] |= 0x249;
}
} else if (rotation == 3) {
if (type.castShadow) {
planeShademap[plane][x][z] = (byte) 50;
planeShademap[plane][x + 1][z] = (byte) 50;
levelShademap[level][x][z] = (byte) 50;
levelShademap[level][x + 1][z] = (byte) 50;
}
if (type.occludes) {
planeOccludemap[plane][x][z] |= 0x492;
levelOccludemap[level][x][z] |= 0x492;
}
}
@@ -994,7 +1007,7 @@ public class SceneBuilder {
}
if (type.decorationPadding != 16) {
scene.setWallDecorationOffset(plane, x, z, type.decorationPadding);
scene.setWallDecorationOffset(level, x, z, type.decorationPadding);
}
} else if (kind == 1) {
Entity entity;
@@ -1005,17 +1018,17 @@ public class SceneBuilder {
entity = new LocEntity(locID, rotation, 1, heightmapSE, heightmapNE, heightmapSW, heightmapNW, type.seqID, true);
}
scene.setWall(WALL_ROTATION_OCCLUDE_TYPE_1[rotation], entity, 0, null, plane, x, z, heightmapAverage, bitset, info);
scene.setWall(WALL_ROTATION_OCCLUDE_TYPE_1[rotation], entity, 0, null, level, x, z, heightmapAverage, bitset, info);
if (type.castShadow) {
if (rotation == 0) {
planeShademap[plane][x][z + 1] = (byte) 50;
levelShademap[level][x][z + 1] = (byte) 50;
} else if (rotation == 1) {
planeShademap[plane][x + 1][z + 1] = (byte) 50;
levelShademap[level][x + 1][z + 1] = (byte) 50;
} else if (rotation == 2) {
planeShademap[plane][x + 1][z] = (byte) 50;
levelShademap[level][x + 1][z] = (byte) 50;
} else if (rotation == 3) {
planeShademap[plane][x][z] = (byte) 50;
levelShademap[level][x][z] = (byte) 50;
}
}
@@ -1033,27 +1046,27 @@ public class SceneBuilder {
entity = new LocEntity(locID, 4 + rotation, 2, heightmapSE, heightmapNE, heightmapSW, heightmapNW, type.seqID, true);
entity_138_ = new LocEntity(locID, i_137_, 2, heightmapSE, heightmapNE, heightmapSW, heightmapNW, type.seqID, true);
}
scene.setWall(WALL_ROTATION_OCCLUDE_TYPE[rotation], entity, WALL_ROTATION_OCCLUDE_TYPE[i_137_], entity_138_, plane, x, z, heightmapAverage, bitset, info);
scene.setWall(WALL_ROTATION_OCCLUDE_TYPE[rotation], entity, WALL_ROTATION_OCCLUDE_TYPE[i_137_], entity_138_, level, x, z, heightmapAverage, bitset, info);
if (type.occludes) {
if (rotation == 0) {
planeOccludemap[plane][x][z] |= 0x249;
planeOccludemap[plane][x][z + 1] |= 0x492;
levelOccludemap[level][x][z] |= 0x249;
levelOccludemap[level][x][z + 1] |= 0x492;
} else if (rotation == 1) {
planeOccludemap[plane][x][z + 1] |= 0x492;
planeOccludemap[plane][x + 1][z] |= 0x249;
levelOccludemap[level][x][z + 1] |= 0x492;
levelOccludemap[level][x + 1][z] |= 0x249;
} else if (rotation == 2) {
planeOccludemap[plane][x + 1][z] |= 0x249;
planeOccludemap[plane][x][z] |= 0x492;
levelOccludemap[level][x + 1][z] |= 0x249;
levelOccludemap[level][x][z] |= 0x492;
} else if (rotation == 3) {
planeOccludemap[plane][x][z] |= 0x492;
planeOccludemap[plane][x][z] |= 0x249;
levelOccludemap[level][x][z] |= 0x492;
levelOccludemap[level][x][z] |= 0x249;
}
}
if (type.solid && (collision != null)) {
collision.addWall(z, rotation, x, kind, type.blocksProjectiles);
}
if (type.decorationPadding != 16) {
scene.setWallDecorationOffset(plane, x, z, type.decorationPadding);
scene.setWallDecorationOffset(level, x, z, type.decorationPadding);
}
} else if (kind == 3) {
Entity entity;
@@ -1062,16 +1075,16 @@ public class SceneBuilder {
} else {
entity = new LocEntity(locID, rotation, 3, heightmapSE, heightmapNE, heightmapSW, heightmapNW, type.seqID, true);
}
scene.setWall(WALL_ROTATION_OCCLUDE_TYPE_1[rotation], entity, 0, null, plane, x, z, heightmapAverage, bitset, info);
scene.setWall(WALL_ROTATION_OCCLUDE_TYPE_1[rotation], entity, 0, null, level, x, z, heightmapAverage, bitset, info);
if (type.castShadow) {
if (rotation == 0) {
planeShademap[plane][x][z + 1] = (byte) 50;
levelShademap[level][x][z + 1] = (byte) 50;
} else if (rotation == 1) {
planeShademap[plane][x + 1][z + 1] = (byte) 50;
levelShademap[level][x + 1][z + 1] = (byte) 50;
} else if (rotation == 2) {
planeShademap[plane][x + 1][z] = (byte) 50;
levelShademap[level][x + 1][z] = (byte) 50;
} else if (rotation == 3) {
planeShademap[plane][x][z] = (byte) 50;
levelShademap[level][x][z] = (byte) 50;
}
}
if (type.solid && (collision != null)) {
@@ -1084,7 +1097,7 @@ public class SceneBuilder {
} else {
entity = new LocEntity(locID, rotation, kind, heightmapSE, heightmapNE, heightmapSW, heightmapNW, type.seqID, true);
}
scene.add(entity, plane, x, z, heightmapAverage, 1, 1, 0, bitset, info);
scene.add(entity, level, x, z, heightmapAverage, 1, 1, 0, bitset, info);
if (type.solid && (collision != null)) {
collision.add(type.blocksProjectiles, type.width, type.length, x, z, rotation);
}
@@ -1118,10 +1131,10 @@ public class SceneBuilder {
} else {
entity = new LocEntity(locID, 0, 4, heightmapSE, heightmapNE, heightmapSW, heightmapNW, type.seqID, true);
}
scene.setWallDecoration(WALL_ROTATION_OCCLUDE_TYPE[rotation], entity, plane, x, z, heightmapAverage, rotation * 512, 0, 0, bitset, info);
scene.setWallDecoration(WALL_ROTATION_OCCLUDE_TYPE[rotation], entity, level, x, z, heightmapAverage, rotation * 512, 0, 0, bitset, info);
} else if (kind == 5) {
int i_142_ = 16;
int i_143_ = scene.getWallBitset(plane, x, z);
int i_143_ = scene.getWallBitset(level, x, z);
if (i_143_ > 0) {
i_142_ = LocType.get((i_143_ >> 14) & 0x7fff).decorationPadding;
}
@@ -1131,7 +1144,7 @@ public class SceneBuilder {
} else {
entity = new LocEntity(locID, 0, 4, heightmapSE, heightmapNE, heightmapSW, heightmapNW, type.seqID, true);
}
scene.setWallDecoration(WALL_ROTATION_OCCLUDE_TYPE[rotation], entity, plane, x, z, heightmapAverage, rotation * 512, anIntArray137[rotation] * i_142_, anIntArray144[rotation] * i_142_, bitset, info);
scene.setWallDecoration(WALL_ROTATION_OCCLUDE_TYPE[rotation], entity, level, x, z, heightmapAverage, rotation * 512, anIntArray137[rotation] * i_142_, anIntArray144[rotation] * i_142_, bitset, info);
} else if (kind == 6) {
Entity entity;
if ((type.seqID == -1) && (type.overrideTypeIDs == null)) {
@@ -1139,7 +1152,7 @@ public class SceneBuilder {
} else {
entity = new LocEntity(locID, 0, 4, heightmapSE, heightmapNE, heightmapSW, heightmapNW, type.seqID, true);
}
scene.setWallDecoration(256, entity, plane, x, z, heightmapAverage, rotation, 0, 0, bitset, info);
scene.setWallDecoration(256, entity, level, x, z, heightmapAverage, rotation, 0, 0, bitset, info);
} else if (kind == 7) {
Entity entity;
if ((type.seqID == -1) && (type.overrideTypeIDs == null)) {
@@ -1147,7 +1160,7 @@ public class SceneBuilder {
} else {
entity = new LocEntity(locID, 0, 4, heightmapSE, heightmapNE, heightmapSW, heightmapNW, type.seqID, true);
}
scene.setWallDecoration(512, entity, plane, x, z, heightmapAverage, rotation, 0, 0, bitset, info);
scene.setWallDecoration(512, entity, level, x, z, heightmapAverage, rotation, 0, 0, bitset, info);
} else if (kind == 8) {
Entity entity;
if ((type.seqID == -1) && (type.overrideTypeIDs == null)) {
@@ -1155,7 +1168,7 @@ public class SceneBuilder {
} else {
entity = new LocEntity(locID, 0, 4, heightmapSE, heightmapNE, heightmapSW, heightmapNW, type.seqID, true);
}
scene.setWallDecoration(768, entity, plane, x, z, heightmapAverage, rotation, 0, 0, bitset, info);
scene.setWallDecoration(768, entity, level, x, z, heightmapAverage, rotation, 0, 0, bitset, info);
}
}
}
@@ -1220,14 +1233,14 @@ public class SceneBuilder {
public void method181(int i, int i_185_, Buffer buffer, int i_186_, int i_187_, int i_188_, int i_190_) {
if ((i_186_ >= 0) && (i_186_ < 104) && (i >= 0) && (i < 104)) {
planeTileFlags[i_187_][i_186_][i] = (byte) 0;
levelTileFlags[i_187_][i_186_][i] = (byte) 0;
for (; ; ) {
int i_191_ = buffer.get1U();
if (i_191_ == 0) {
if (i_187_ == 0) {
planeHeightmap[0][i_186_][i] = -method172(932731 + i_186_ + i_190_, 556238 + i + i_185_) * 8;
levelHeightmap[0][i_186_][i] = -method172(932731 + i_186_ + i_190_, 556238 + i + i_185_) * 8;
} else {
planeHeightmap[i_187_][i_186_][i] = planeHeightmap[i_187_ - 1][i_186_][i] - 240;
levelHeightmap[i_187_][i_186_][i] = levelHeightmap[i_187_ - 1][i_186_][i] - 240;
break;
}
break;
@@ -1238,9 +1251,9 @@ public class SceneBuilder {
i_192_ = 0;
}
if (i_187_ == 0) {
planeHeightmap[0][i_186_][i] = -i_192_ * 8;
levelHeightmap[0][i_186_][i] = -i_192_ * 8;
} else {
planeHeightmap[i_187_][i_186_][i] = planeHeightmap[i_187_ - 1][i_186_][i] - (i_192_ * 8);
levelHeightmap[i_187_][i_186_][i] = levelHeightmap[i_187_ - 1][i_186_][i] - (i_192_ * 8);
break;
}
break;
@@ -1250,7 +1263,7 @@ public class SceneBuilder {
aByteArrayArrayArray136[i_187_][i_186_][i] = (byte) ((i_191_ - 2) / 4);
aByteArrayArrayArray148[i_187_][i_186_][i] = (byte) (((i_191_ - 2) + i_188_) & 0x3);
} else if (i_191_ <= 81) {
planeTileFlags[i_187_][i_186_][i] = (byte) (i_191_ - 49);
levelTileFlags[i_187_][i_186_][i] = (byte) (i_191_ - 49);
} else {
aByteArrayArrayArray142[i_187_][i_186_][i] = (byte) (i_191_ - 81);
}
@@ -1272,14 +1285,14 @@ public class SceneBuilder {
}
}
public int getDrawPlane(int plane, int stx, int stz) {
if ((planeTileFlags[plane][stx][stz] & 0x8) != 0) {
public int getDrawLevel(int level, int stx, int stz) {
if ((levelTileFlags[level][stx][stz] & 0x8) != 0) {
return 0;
}
if ((plane > 0) && ((planeTileFlags[1][stx][stz] & 0x2) != 0)) {
return plane - 1;
if ((level > 0) && ((levelTileFlags[1][stx][stz] & 0x2) != 0)) {
return level - 1;
}
return plane;
return level;
}
public void method183(SceneCollisionMap[] collisionMaps, Scene scene, int i, int i_197_, int i_198_, int i_199_, byte[] is, int i_200_, int i_201_, int i_202_) {
@@ -1310,7 +1323,7 @@ public class SceneBuilder {
int i_214_ = i_202_ + ZoneUtil.method158(i_207_ & 0x7, type.length, i_201_, type.width, i_208_ & 0x7);
if ((i_213_ > 0) && (i_214_ > 0) && (i_213_ < 103) && (i_214_ < 103)) {
int i_215_ = i_209_;
if ((planeTileFlags[1][i_213_][i_214_] & 0x2) == 2) {
if ((levelTileFlags[1][i_213_][i_214_] & 0x2) == 2) {
i_215_--;
}
SceneCollisionMap collisionMap = null;
@@ -1376,7 +1389,7 @@ public class SceneBuilder {
int i_276_ = i_269_ + i_263_;
if ((i_275_ > 0) && (i_276_ > 0) && (i_275_ < 103) && (i_276_ < 103)) {
int i_277_ = i_271_;
if ((planeTileFlags[1][i_275_][i_276_] & 0x2) == 2) {
if ((levelTileFlags[1][i_275_][i_276_] & 0x2) == 2) {
i_277_--;
}
SceneCollisionMap collisionMap = null;
+1 -1
View File
@@ -4,7 +4,7 @@
public class SceneLoc {
public int plane;
public int level;
public int y;
public int x;
public int z;
+1 -1
View File
@@ -8,7 +8,7 @@ public class SceneLocTemporary extends DoublyLinkedList.Node {
public int rotation;
public int kind;
public int duration;
public int plane;
public int level;
public int classID;
public int localX;
public int localZ;
+1 -1
View File
@@ -18,7 +18,7 @@ public class SceneTile extends DoublyLinkedList.Node {
public SceneObjStack objStack;
public int locCount;
public int flags;
public int drawPlane;
public int drawLevel;
public boolean aBoolean1322;
public boolean aBoolean1323;
public boolean aBoolean1324;
+3 -3
View File
@@ -4,7 +4,7 @@
public class SpotAnimEntity extends Entity {
public final int plane;
public final int level;
public final int x;
public final int z;
public final int y;
@@ -14,9 +14,9 @@ public class SpotAnimEntity extends Entity {
public int seqFrame;
public int seqCycle;
public SpotAnimEntity(int plane, int cycle, int delay, int id, int y, int z, int x) {
public SpotAnimEntity(int level, int cycle, int delay, int id, int y, int z, int x) {
type = SpotAnimType.instances[id];
this.plane = plane;
this.level = level;
this.x = x;
this.z = z;
this.y = y;
+3
View File
@@ -61,6 +61,9 @@ public class StringUtil {
return String.format("%d.%d.%d.%d", (ipv4 >> 24) & 0xff, (ipv4 >> 16) & 0xff, (ipv4 >> 8) & 0xff, ipv4 & 0xff);
}
public static String formatName(long name37) {
return formatName(fromBase37(name37));
}
public static String formatName(String s) {
if (s.length() > 0) {
char[] ac = s.toCharArray();