Id[s] made more consistent by capitalizing to ID[s]

Cinematic camera fields renamed and documented
This commit is contained in:
thedaneeffect committed 2023-01-01 13:59:10 -05:00
1 parent 2ed0f2a04d
commit c696ab13ff
14 files changed
+1387 -1201

No files matched your search

+31 -31
View File
@@ -16,7 +16,7 @@ public class Component {
imageCache = new LRUMap<>(500);
Buffer in = new Buffer(config.read("data"));
int parentId = -1;
int parentID = -1;
int count = in.get2U();
instances = new Component[count];
@@ -25,13 +25,13 @@ public class Component {
int id = in.get2U();
if (id == 65535) {
parentId = in.get2U();
parentID = in.get2U();
id = in.get2U();
}
Component c = instances[id] = new Component();
c.id = id;
c.parentId = parentId;
c.parentID = parentID;
c.type = in.get1U();
c.optionType = in.get1U();
c.contentType = in.get2U();
@@ -59,11 +59,11 @@ public class Component {
int scriptCount = in.get1U();
if (scriptCount > 0) {
c.scripts = new int[scriptCount][];
for (int scriptId = 0; scriptId < scriptCount; scriptId++) {
for (int scriptID = 0; scriptID < scriptCount; scriptID++) {
int length = in.get2U();
c.scripts[scriptId] = new int[length];
c.scripts[scriptID] = new int[length];
for (int i = 0; i < length; i++) {
c.scripts[scriptId][i] = in.get2U();
c.scripts[scriptID][i] = in.get2U();
}
}
}
@@ -88,7 +88,7 @@ public class Component {
}
if (c.type == 2) {
c.invSlotObjId = new int[c.width * c.height];
c.invSlotObjID = new int[c.width * c.height];
c.invSlotAmount = new int[c.width * c.height];
c.invDraggable = in.get1U() == 1;
c.aBoolean249 = in.get1U() == 1;
@@ -126,9 +126,9 @@ public class Component {
if ((c.type == 4) || (c.type == 1)) {
c.center = in.get1U() == 1;
int fontId = in.get1U();
int fontID = in.get1U();
if (fonts != null) {
c.font = fonts[fontId];
c.font = fonts[fontID];
}
c.shadow = in.get1U() == 1;
}
@@ -165,41 +165,41 @@ public class Component {
int tmp = in.get1U();
if (tmp != 0) {
c.modelCategory = 1;
c.modelId = ((tmp - 1) << 8) + in.get1U();
c.modelID = ((tmp - 1) << 8) + in.get1U();
}
tmp = in.get1U();
if (tmp != 0) {
c.activeModelCategory = 1;
c.activeModelId = ((tmp - 1) << 8) + in.get1U();
c.activeModelID = ((tmp - 1) << 8) + in.get1U();
}
tmp = in.get1U();
if (tmp != 0) {
c.seqId = ((tmp - 1) << 8) + in.get1U();
c.seqID = ((tmp - 1) << 8) + in.get1U();
} else {
c.seqId = -1;
c.seqID = -1;
}
tmp = in.get1U();
if (tmp != 0) {
c.activeSeqId = ((tmp - 1) << 8) + in.get1U();
c.activeSeqID = ((tmp - 1) << 8) + in.get1U();
} else {
c.activeSeqId = -1;
c.activeSeqID = -1;
}
c.modelZoom = in.get2U();
c.modelEyePitch = in.get2U();
c.modelPitch = in.get2U();
c.modelYaw = in.get2U();
}
if (c.type == 7) {
c.invSlotObjId = new int[c.width * c.height];
c.invSlotObjID = new int[c.width * c.height];
c.invSlotAmount = new int[c.width * c.height];
c.center = in.get1U() == 1;
int fontId = in.get1U();
int fontID = in.get1U();
if (fonts != null) {
c.font = fonts[fontId];
c.font = fonts[fontID];
}
c.shadow = in.get1U() == 1;
c.color = in.get4();
@@ -270,8 +270,8 @@ public class Component {
public int activeHoverColor;
public Image24 activeImage;
public int activeModelCategory;
public int activeModelId;
public int activeSeqId;
public int activeModelID;
public int activeSeqID;
public String activeText;
public boolean center;
public int[] children;
@@ -294,18 +294,18 @@ public class Component {
public String[] invOptions;
public int[] invSlotAmount;
public Image24[] invSlotImage;
public int[] invSlotObjId;
public int[] invSlotObjID;
public int[] invSlotX;
public int[] invSlotY;
public boolean invUsable;
public int modelEyePitch;
public int modelPitch;
public int modelCategory;
public int modelId;
public int modelID;
public int modelYaw;
public int modelZoom;
public String option;
public int optionType;
public int parentId;
public int parentID;
public int[] scriptComparator;
public int[] scriptOperand;
public int[][] scripts;
@@ -313,7 +313,7 @@ public class Component {
public int scrollY;
public int seqCycle;
public int seqFrame;
public int seqId;
public int seqID;
public boolean shadow;
public String spellAction;
public int spellFlags;
@@ -332,9 +332,9 @@ public class Component {
}
public void swapSlots(int src, int dst) {
int tmp = invSlotObjId[src];
invSlotObjId[src] = invSlotObjId[dst];
invSlotObjId[dst] = tmp;
int tmp = invSlotObjID[src];
invSlotObjID[src] = invSlotObjID[dst];
invSlotObjID[dst] = tmp;
tmp = invSlotAmount[src];
invSlotAmount[src] = invSlotAmount[dst];
@@ -368,9 +368,9 @@ public class Component {
Model model;
if (active) {
model = getModel(activeModelCategory, activeModelId);
model = getModel(activeModelCategory, activeModelID);
} else {
model = getModel(modelCategory, modelId);
model = getModel(modelCategory, modelID);
}
if (model == null) {
+14 -14
View File
@@ -164,14 +164,14 @@ public class Draw3D {
public static void unpackTextures(FileArchive archive) {
textureCount = 0;
for (int textureId = 0; textureId < 50; textureId++) {
for (int textureID = 0; textureID < 50; textureID++) {
try {
textures[textureId] = new Image8(archive, String.valueOf(textureId), 0);
textures[textureID] = new Image8(archive, String.valueOf(textureID), 0);
if (lowmem && (textures[textureId].cropW == 128)) {
textures[textureId].shrink();
if (lowmem && (textures[textureID].cropW == 128)) {
textures[textureID].shrink();
} else {
textures[textureId].crop();
textures[textureID].crop();
}
textureCount++;
} catch (Exception ignored) {
@@ -379,25 +379,25 @@ public class Draw3D {
}
}
for (int textureId = 0; textureId < 50; textureId++) {
if (textures[textureId] == null) {
for (int textureID = 0; textureID < 50; textureID++) {
if (textures[textureID] == null) {
continue;
}
int[] palette = textures[textureId].palette;
texturePalette[textureId] = new int[palette.length];
int[] palette = textures[textureID].palette;
texturePalette[textureID] = new int[palette.length];
for (int i = 0; i < palette.length; i++) {
texturePalette[textureId][i] = setGamma(palette[i], brightness);
texturePalette[textureID][i] = setGamma(palette[i], brightness);
if (((texturePalette[textureId][i] & 0xf8f8ff) == 0) && (i != 0)) {
texturePalette[textureId][i] = 1;
if (((texturePalette[textureID][i] & 0xf8f8ff) == 0) && (i != 0)) {
texturePalette[textureID][i] = 1;
}
}
}
for (int textureId = 0; textureId < 50; textureId++) {
unloadTexture(textureId);
for (int textureID = 0; textureID < 50; textureID++) {
unloadTexture(textureID);
}
}
+2 -2
View File
@@ -25,7 +25,7 @@ public class FloType {
public String unusedString;
public int rgb;
public int textureId = -1;
public int textureID = -1;
public boolean unusedBool = false;
public boolean aBoolean393 = true;
public int hue;
@@ -48,7 +48,7 @@ public class FloType {
rgb = buffer.get3();
setColor(rgb);
} else if (i == 2) {
textureId = buffer.get1U();
textureID = buffer.get1U();
} else if (i == 3) {
unusedBool = true;
} else if (i == 5) {
+1032 -853
View File
File diff suppressed because it is too large. Load diff
+14 -14
View File
@@ -25,9 +25,9 @@ public class IDKType {
public final int[] colorSrc = new int[6];
public final int[] colorDst = new int[6];
public final int[] headModelIds = {-1, -1, -1, -1, -1};
public final int[] headModelIDs = {-1, -1, -1, -1, -1};
public int type = -1;
public int[] modelIds;
public int[] modelIDs;
public boolean selectable = false;
public IDKType() {
@@ -43,9 +43,9 @@ public class IDKType {
type = buffer.get1U();
} else if (i == 2) {
int j = buffer.get1U();
modelIds = new int[j];
modelIDs = new int[j];
for (int k = 0; k < j; k++) {
modelIds[k] = buffer.get2U();
modelIDs[k] = buffer.get2U();
}
} else if (i == 3) {
selectable = true;
@@ -54,7 +54,7 @@ public class IDKType {
} else if ((i >= 50) && (i < 60)) {
colorDst[i - 50] = buffer.get2U();
} else if ((i >= 60) && (i < 70)) {
headModelIds[i - 60] = buffer.get2U();
headModelIDs[i - 60] = buffer.get2U();
} else {
System.out.println("Error unrecognised config code: " + i);
}
@@ -62,11 +62,11 @@ public class IDKType {
}
public boolean validateModel() {
if (modelIds == null) {
if (modelIDs == null) {
return true;
}
boolean loaded = true;
for (int modelId : modelIds) {
for (int modelId : modelIDs) {
if (!Model.validate(modelId)) {
loaded = false;
}
@@ -75,12 +75,12 @@ public class IDKType {
}
public Model getModel() {
if (modelIds == null) {
if (modelIDs == null) {
return null;
}
Model[] aclass30_sub2_sub4_sub6 = new Model[modelIds.length];
for (int i = 0; i < modelIds.length; i++) {
aclass30_sub2_sub4_sub6[i] = Model.tryGet(modelIds[i]);
Model[] aclass30_sub2_sub4_sub6 = new Model[modelIDs.length];
for (int i = 0; i < modelIDs.length; i++) {
aclass30_sub2_sub4_sub6[i] = Model.tryGet(modelIDs[i]);
}
Model model;
if (aclass30_sub2_sub4_sub6.length == 1) {
@@ -100,7 +100,7 @@ public class IDKType {
public boolean validateHeadModel() {
boolean loaded = true;
for (int i = 0; i < 5; i++) {
if ((headModelIds[i] != -1) && !Model.validate(headModelIds[i])) {
if ((headModelIDs[i] != -1) && !Model.validate(headModelIDs[i])) {
loaded = false;
}
}
@@ -111,8 +111,8 @@ public class IDKType {
Model[] aclass30_sub2_sub4_sub6 = new Model[5];
int j = 0;
for (int k = 0; k < 5; k++) {
if (headModelIds[k] != -1) {
aclass30_sub2_sub4_sub6[j++] = Model.tryGet(headModelIds[k]);
if (headModelIDs[k] != -1) {
aclass30_sub2_sub4_sub6[j++] = Model.tryGet(headModelIDs[k]);
}
}
Model model = new Model(j, aclass30_sub2_sub4_sub6);
+33 -33
View File
@@ -99,14 +99,14 @@ public class LocType {
*/
public boolean dynamic;
public int scaleZ;
public int[] modelIds;
public int[] modelIDs;
public int varbit;
public int decorationPadding;
public int[] modelKinds;
public String description;
public boolean interactable;
public boolean castShadow;
public int seqId;
public int seqID;
public int translateZ;
public int[] srcColor;
public String[] actions;
@@ -115,7 +115,7 @@ public class LocType {
}
public void reset() {
modelIds = null;
modelIDs = null;
modelKinds = null;
name = null;
description = null;
@@ -129,7 +129,7 @@ public class LocType {
adjustToTerrain = false;
dynamic = false;
occludes = false;
seqId = -1;
seqID = -1;
decorationPadding = 16;
lightAmbient = 0;
lightAttenuation = 0;
@@ -154,31 +154,31 @@ public class LocType {
}
public void method574(OnDemand onDemand) {
if (modelIds == null) {
if (modelIDs == null) {
return;
}
for (int k : modelIds) {
for (int k : modelIDs) {
onDemand.method560(k & 0xffff, 0);
}
}
public boolean validate(int kind) {
if (modelKinds == null) {
if (modelIds == null) {
if (modelIDs == null) {
return true;
}
if (kind != 10) {
return true;
}
boolean valid = true;
for (int modelID : modelIds) {
for (int modelID : modelIDs) {
valid &= Model.validate(modelID & 0xffff);
}
return valid;
}
for (int i = 0; i < modelKinds.length; i++) {
if (modelKinds[i] == kind) {
return Model.validate(modelIds[i] & 0xffff);
return Model.validate(modelIDs[i] & 0xffff);
}
}
return true;
@@ -211,11 +211,11 @@ public class LocType {
}
public boolean method579() {
if (modelIds == null) {
if (modelIDs == null) {
return true;
}
boolean flag1 = true;
for (int j : modelIds) {
for (int j : modelIDs) {
flag1 &= Model.validate(j & 0xffff);
}
return flag1;
@@ -258,30 +258,30 @@ public class LocType {
return cached;
}
if (modelIds == null) {
if (modelIDs == null) {
return null;
}
boolean flip = invert ^ (rotation > 3);
int modelCount = modelIds.length;
int modelCount = modelIDs.length;
for (int i = 0; i < modelCount; i++) {
int modelId = modelIds[i];
int modelID = modelIDs[i];
if (flip) {
modelId += 0x10000;
modelID += 0x10000;
}
model = staticCache.get(modelId);
model = staticCache.get(modelID);
if (model == null) {
model = Model.tryGet(modelId & 0xffff);
model = Model.tryGet(modelID & 0xffff);
if (model == null) {
return null;
}
if (flip) {
model.rotateY180();
}
staticCache.put((long) modelId, model);
staticCache.put((long) modelID, model);
}
if (modelCount > 1) {
@@ -315,17 +315,17 @@ public class LocType {
return cached;
}
int modelId = modelIds[kindIndex];
int modelID = modelIDs[kindIndex];
boolean flip = invert ^ (rotation > 3);
if (flip) {
modelId += 0x10000;
modelID += 0x10000;
}
model = staticCache.get(modelId);
model = staticCache.get(modelID);
if (model == null) {
model = Model.tryGet(modelId & 0xffff);
model = Model.tryGet(modelID & 0xffff);
if (model == null) {
return null;
@@ -335,7 +335,7 @@ public class LocType {
model.rotateY180();
}
staticCache.put((long) modelId, model);
staticCache.put((long) modelID, model);
}
}
@@ -392,11 +392,11 @@ public class LocType {
if (j == 1) {
int k = buffer.get1U();
if (k > 0) {
if ((modelIds == null) || lowmem) {
if ((modelIDs == null) || lowmem) {
modelKinds = new int[k];
modelIds = new int[k];
modelIDs = new int[k];
for (int k1 = 0; k1 < k; k1++) {
modelIds[k1] = buffer.get2U();
modelIDs[k1] = buffer.get2U();
modelKinds[k1] = buffer.get1U();
}
} else {
@@ -410,11 +410,11 @@ public class LocType {
} else if (j == 5) {
int l = buffer.get1U();
if (l > 0) {
if ((modelIds == null) || lowmem) {
if ((modelIDs == null) || lowmem) {
modelKinds = null;
modelIds = new int[l];
modelIDs = new int[l];
for (int l1 = 0; l1 < l; l1++) {
modelIds[l1] = buffer.get2U();
modelIDs[l1] = buffer.get2U();
}
} else {
buffer.position += l * 2;
@@ -440,9 +440,9 @@ public class LocType {
} else if (j == 23) {
occludes = true;
} else if (j == 24) {
seqId = buffer.get2U();
if (seqId == 65535) {
seqId = -1;
seqID = buffer.get2U();
if (seqID == 65535) {
seqID = -1;
}
} else if (j == 28) {
decorationPadding = buffer.get1U();
@@ -518,7 +518,7 @@ public class LocType {
}
} while (true);
if (i == -1) {
interactable = (modelIds != null) && ((modelKinds == null) || (modelKinds[0] == 10));
interactable = (modelIDs != null) && ((modelKinds == null) || (modelKinds[0] == 10));
if (actions != null) {
interactable = true;
}
+38 -38
View File
@@ -56,24 +56,24 @@ public class NPCType {
dat = null;
}
public int seqTurnRightId = -1;
public int varbitId = -1;
public int seqTurnAroundId = -1;
public int varpId = -1;
public int seqTurnRightID = -1;
public int varbitID = -1;
public int seqTurnAroundID = -1;
public int varpID = -1;
public int level = -1;
public String name;
public String[] op;
public int seqWalkId = -1;
public int seqWalkID = -1;
public byte size = 1;
public int[] colorDst;
public int unusedInt0 = -1;
public int[] headModelIds;
public int[] headModelIDs;
public int headicon = -1;
public int[] colorSrc;
public int seqStand = -1;
public int seqStandID = -1;
public long uid = -1L;
public int turnSpeed = 32;
public int seqTurnLeft = -1;
public int seqTurnLeftID = -1;
public boolean aBoolean84 = true;
public int anInt85;
public int anInt86 = 128;
@@ -84,7 +84,7 @@ public class NPCType {
public int anInt91 = 128;
public int anInt92;
public boolean aBoolean93 = false;
public int[] modelIds;
public int[] modelIDs;
public int unusedInt2 = -1;
public NPCType() {
@@ -100,13 +100,13 @@ public class NPCType {
}
}
if (headModelIds == null) {
if (headModelIDs == null) {
return null;
}
boolean loaded = false;
for (int value : headModelIds) {
for (int value : headModelIDs) {
if (!Model.validate(value)) {
loaded = true;
}
@@ -116,10 +116,10 @@ public class NPCType {
return null;
}
Model[] models = new Model[headModelIds.length];
Model[] models = new Model[headModelIDs.length];
for (int i = 0; i < headModelIds.length; i++) {
models[i] = Model.tryGet(headModelIds[i]);
for (int i = 0; i < headModelIDs.length; i++) {
models[i] = Model.tryGet(headModelIDs[i]);
}
Model model;
@@ -141,15 +141,15 @@ public class NPCType {
public NPCType getOverrideType() {
int value = -1;
if (varbitId != -1) {
VarbitType vb = VarbitType.instances[this.varbitId];
if (varbitID != -1) {
VarbitType vb = VarbitType.instances[this.varbitID];
int varp = vb.varp;
int lsb = vb.lsb;
int msb = vb.msb;
int mask = Game.BITMASK[msb - lsb];
value = (game.variables[varp] >> lsb) & mask;
} else if (varpId != -1) {
value = game.variables[varpId];
} else if (varpID != -1) {
value = game.variables[varpID];
}
if ((value < 0) || (value >= overrides.length) || (overrides[value] == -1)) {
@@ -174,7 +174,7 @@ public class NPCType {
if (model == null) {
boolean invalid = false;
for (int value : modelIds) {
for (int value : modelIDs) {
if (!Model.validate(value)) {
invalid = true;
}
@@ -184,10 +184,10 @@ public class NPCType {
return null;
}
Model[] models = new Model[modelIds.length];
Model[] models = new Model[modelIDs.length];
for (int i = 0; i < modelIds.length; i++) {
models[i] = Model.tryGet(modelIds[i]);
for (int i = 0; i < modelIDs.length; i++) {
models[i] = Model.tryGet(modelIDs[i]);
}
if (models.length == 1) {
@@ -237,9 +237,9 @@ public class NPCType {
}
if (i == 1) {
int j = buffer.get1U();
modelIds = new int[j];
modelIDs = new int[j];
for (int j1 = 0; j1 < j; j1++) {
modelIds[j1] = buffer.get2U();
modelIDs[j1] = buffer.get2U();
}
} else if (i == 2) {
name = buffer.getString();
@@ -248,14 +248,14 @@ public class NPCType {
} else if (i == 12) {
size = buffer.get1();
} else if (i == 13) {
seqStand = buffer.get2U();
seqStandID = buffer.get2U();
} else if (i == 14) {
seqWalkId = buffer.get2U();
seqWalkID = buffer.get2U();
} else if (i == 17) {
seqWalkId = buffer.get2U();
seqTurnAroundId = buffer.get2U();
seqTurnLeft = buffer.get2U();
seqTurnRightId = buffer.get2U();
seqWalkID = buffer.get2U();
seqTurnAroundID = buffer.get2U();
seqTurnLeftID = buffer.get2U();
seqTurnRightID = buffer.get2U();
} else if ((i >= 30) && (i < 40)) {
if (op == null) {
op = new String[5];
@@ -274,9 +274,9 @@ public class NPCType {
}
} else if (i == 60) {
int l = buffer.get1U();
headModelIds = new int[l];
headModelIDs = new int[l];
for (int l1 = 0; l1 < l; l1++) {
headModelIds[l1] = buffer.get2U();
headModelIDs[l1] = buffer.get2U();
}
} else if (i == 90) {
unusedInt2 = buffer.get2U();
@@ -303,13 +303,13 @@ public class NPCType {
} else if (i == 103) {
turnSpeed = buffer.get2U();
} else if (i == 106) {
varbitId = buffer.get2U();
if (varbitId == 65535) {
varbitId = -1;
varbitID = buffer.get2U();
if (varbitID == 65535) {
varbitID = -1;
}
varpId = buffer.get2U();
if (varpId == 65535) {
varpId = -1;
varpID = buffer.get2U();
if (varpID == 65535) {
varpID = -1;
}
int i1 = buffer.get1U();
overrides = new int[i1 + 1];
+35 -35
View File
@@ -52,7 +52,7 @@ public class ObjType {
type.id = id;
type.reset();
type.read(dat);
if (type.certificateId != -1) {
if (type.certificateID != -1) {
type.toCertificate();
}
if (!Game.members && type.members) {
@@ -81,19 +81,19 @@ public class ObjType {
ObjType type = get(id);
if (type.stackId == null) {
if (type.stackIDs == null) {
amount = -1;
}
if (amount > 1) {
int newId = -1;
int newID = -1;
for (int j1 = 0; j1 < 10; j1++) {
if ((amount >= type.stackAmount[j1]) && (type.stackAmount[j1] != 0)) {
newId = type.stackId[j1];
newID = type.stackIDs[j1];
}
}
if (newId != -1) {
type = get(newId);
if (newID != -1) {
type = get(newID);
}
}
@@ -106,8 +106,8 @@ public class ObjType {
// this will typically be the certificate item for noted stuff
Image24 originalIcon = null;
if (type.certificateId != -1) {
originalIcon = getIcon(type.linkedId, 10, -1);
if (type.certificateID != -1) {
originalIcon = getIcon(type.linkedID, 10, -1);
if (originalIcon == null) {
return null;
@@ -196,7 +196,7 @@ public class ObjType {
}
}
if (type.certificateId != -1) {
if (type.certificateID != -1) {
int w = originalIcon.cropW;
int h = originalIcon.cropH;
originalIcon.cropW = 32;
@@ -235,7 +235,7 @@ public class ObjType {
public int[] dstColor;
public boolean members;
public int femaleModelId2;
public int certificateId;
public int certificateID;
public int femaleModelId1;
public int maleModelId0;
public int maleHeadModelId1;
@@ -244,11 +244,11 @@ public class ObjType {
public int iconOffsetX;
public String name;
public int femaleHeadModel1;
public int modelId;
public int modelID;
public int maleHeadModelId0;
public boolean stackable;
public byte[] examine;
public int linkedId;
public int linkedID;
public int iconZoom;
public int lightAttenuation;
public int maleModelId2;
@@ -257,7 +257,7 @@ public class ObjType {
public int iconPitch;
public int scaleY;
public int scaleZ;
public int[] stackId;
public int[] stackIDs;
public int iconOffsetY;
public int lightAmbient;
public int femaleHeadModel0;
@@ -376,7 +376,7 @@ public class ObjType {
}
public void reset() {
modelId = 0;
modelID = 0;
name = null;
examine = null;
srcColor = null;
@@ -405,10 +405,10 @@ public class ObjType {
maleHeadModelId1 = -1;
femaleHeadModel0 = -1;
femaleHeadModel1 = -1;
stackId = null;
stackIDs = null;
stackAmount = null;
linkedId = -1;
certificateId = -1;
linkedID = -1;
certificateID = -1;
scaleX = 128;
scaleZ = 128;
scaleY = 128;
@@ -418,8 +418,8 @@ public class ObjType {
}
public void toCertificate() {
ObjType cert = get(certificateId);
modelId = cert.modelId;
ObjType cert = get(certificateID);
modelID = cert.modelID;
iconZoom = cert.iconZoom;
iconPitch = cert.iconPitch;
iconYaw = cert.iconYaw;
@@ -428,7 +428,7 @@ public class ObjType {
iconOffsetY = cert.iconOffsetY;
srcColor = cert.srcColor;
dstColor = cert.dstColor;
ObjType linked = get(linkedId);
ObjType linked = get(linkedID);
name = linked.name;
members = linked.members;
cost = linked.cost;
@@ -442,15 +442,15 @@ public class ObjType {
}
public Model getModel(int amount) {
if ((stackId != null) && (amount > 1)) {
int newId = -1;
if ((stackIDs != null) && (amount > 1)) {
int newID = -1;
for (int k = 0; k < 10; k++) {
if ((amount >= stackAmount[k]) && (stackAmount[k] != 0)) {
newId = stackId[k];
newID = stackIDs[k];
}
}
if (newId != -1) {
return get(newId).getModel(1);
if (newID != -1) {
return get(newID).getModel(1);
}
}
@@ -460,7 +460,7 @@ public class ObjType {
return model;
}
model = Model.tryGet(modelId);
model = Model.tryGet(modelID);
if (model == null) {
return null;
@@ -483,18 +483,18 @@ public class ObjType {
}
public Model getUnlitModel(int amount) {
if ((stackId != null) && (amount > 1)) {
if ((stackIDs != null) && (amount > 1)) {
int j = -1;
for (int k = 0; k < 10; k++) {
if ((amount >= stackAmount[k]) && (stackAmount[k] != 0)) {
j = stackId[k];
j = stackIDs[k];
}
}
if (j != -1) {
return get(j).getUnlitModel(1);
}
}
Model model = Model.tryGet(modelId);
Model model = Model.tryGet(modelID);
if (model == null) {
return null;
}
@@ -513,7 +513,7 @@ public class ObjType {
return;
}
if (i == 1) {
modelId = buffer.get2U();
modelID = buffer.get2U();
} else if (i == 2) {
name = buffer.getString();
} else if (i == 3) {
@@ -588,15 +588,15 @@ public class ObjType {
} else if (i == 95) {
iconRoll = buffer.get2U();
} else if (i == 97) {
linkedId = buffer.get2U();
linkedID = buffer.get2U();
} else if (i == 98) {
certificateId = buffer.get2U();
certificateID = buffer.get2U();
} else if ((i >= 100) && (i < 110)) {
if (stackId == null) {
stackId = new int[10];
if (stackIDs == null) {
stackIDs = new int[10];
stackAmount = new int[10];
}
stackId[i - 100] = buffer.get2U();
stackIDs[i - 100] = buffer.get2U();
stackAmount[i - 100] = buffer.get2U();
} else if (i == 110) {
scaleX = buffer.get2U();
+82 -79
View File
@@ -4,103 +4,106 @@
public class ProjectileEntity extends Entity {
public final int anInt1571;
public final int anInt1572;
public final int anInt1580;
public final int anInt1581;
public final int anInt1582;
public final int anInt1583;
public final int anInt1588;
public final int anInt1589;
public final int anInt1590;
public final SpotAnimType aType_1592;
public final int anInt1597;
public double aDouble1574;
public double aDouble1575;
public double aDouble1576;
public double aDouble1577;
public double aDouble1578;
public boolean aBoolean1579 = false;
public double aDouble1585;
public double aDouble1586;
public double aDouble1587;
public int anInt1593;
public int anInt1594;
public int anInt1595;
public int anInt1596;
public final int startCycle;
public final int lastCycle;
public final int srcX;
public final int srcZ;
public final int srcY;
public final int offsetY;
public final int peakPitch;
public final int arc;
public final int target;
public final SpotAnimType spotanim;
public final int plane;
public double velocityX;
public double velocityZ;
public double velocity;
public double velocityY;
public double accelerationY;
public boolean mobile = false;
public double x;
public double z;
public double y;
public int seqFrame;
public int seqCycle;
public int yaw;
public int pitch;
public ProjectileEntity(int i, int j, int l, int i1, int j1, int k1, int l1, int i2, int j2, int k2, int l2) {
aType_1592 = SpotAnimType.instances[l2];
anInt1597 = k1;
anInt1580 = j2;
anInt1581 = i2;
anInt1582 = l1;
anInt1571 = l;
anInt1572 = i1;
anInt1588 = i;
anInt1589 = j1;
anInt1590 = k2;
anInt1583 = j;
public ProjectileEntity(int peakPitch, int offsetY, int startCycle, int lastCycle, int arc, int plane, int srcY, int srcZ, int srcX, int target, int spotanim) {
this.spotanim = SpotAnimType.instances[spotanim];
this.plane = plane;
this.srcX = srcX;
this.srcZ = srcZ;
this.srcY = srcY;
this.startCycle = startCycle;
this.lastCycle = lastCycle;
this.peakPitch = peakPitch;
this.arc = arc;
this.target = target;
this.offsetY = offsetY;
}
public void method455(int i, int j, int k, int l) {
if (!aBoolean1579) {
double d = l - anInt1580;
double d2 = j - anInt1581;
double d3 = Math.sqrt((d * d) + (d2 * d2));
aDouble1585 = (double) anInt1580 + ((d * (double) anInt1589) / d3);
aDouble1586 = (double) anInt1581 + ((d2 * (double) anInt1589) / d3);
aDouble1587 = anInt1582;
public void updateVelocity(int cycle, int dstZ, int dstY, int dstX) {
if (!mobile) {
double dx = dstX - srcX;
double dz = dstZ - srcZ;
double d = Math.sqrt((dx * dx) + (dz * dz));
x = (double) srcX + ((dx * (double) arc) / d);
z = (double) srcZ + ((dz * (double) arc) / d);
y = srcY;
}
double d1 = (anInt1572 + 1) - i;
aDouble1574 = ((double) l - aDouble1585) / d1;
aDouble1575 = ((double) j - aDouble1586) / d1;
aDouble1576 = Math.sqrt((aDouble1574 * aDouble1574) + (aDouble1575 * aDouble1575));
if (!aBoolean1579) {
aDouble1577 = -aDouble1576 * Math.tan((double) anInt1588 * 0.02454369D);
double dt = (lastCycle + 1) - cycle;
velocityX = ((double) dstX - x) / dt;
velocityZ = ((double) dstZ - z) / dt;
velocity = Math.sqrt((velocityX * velocityX) + (velocityZ * velocityZ));
if (!mobile) {
velocityY = -velocity * Math.tan((double) peakPitch * 0.02454369D);
}
aDouble1578 = (2D * ((double) k - aDouble1587 - (aDouble1577 * d1))) / (d1 * d1);
accelerationY = (2D * ((double) dstY - y - (velocityY * dt))) / (dt * dt);
}
@Override
public Model getModel() {
Model model = aType_1592.getModel();
if (model == null) {
Model tmp = spotanim.getModel();
if (tmp == null) {
return null;
}
int transformID = -1;
if (aType_1592.seq != null) {
transformID = aType_1592.seq.transformIndices[anInt1593];
if (spotanim.seq != null) {
transformID = spotanim.seq.transformIndices[seqFrame];
}
Model model_1 = new Model(true, SeqTransform.isNull(transformID), false, model);
Model model = new Model(true, SeqTransform.isNull(transformID), false, tmp);
if (transformID != -1) {
model_1.createLabelReferences();
model_1.applyTransform(transformID);
model_1.labelFaces = null;
model_1.labelVertices = null;
model.createLabelReferences();
model.applyTransform(transformID);
model.labelFaces = null;
model.labelVertices = null;
}
if ((aType_1592.scaleXY != 128) || (aType_1592.scaleZ != 128)) {
model_1.scale(aType_1592.scaleXY, aType_1592.scaleXY, aType_1592.scaleZ);
if ((spotanim.scaleXY != 128) || (spotanim.scaleZ != 128)) {
model.scale(spotanim.scaleXY, spotanim.scaleXY, spotanim.scaleZ);
}
model_1.rotateX(anInt1596);
model_1.calculateNormals(64 + aType_1592.lightAmbient, 850 + aType_1592.lightAttenuation, -30, -50, -30, true);
return model_1;
model.rotateX(pitch);
model.calculateNormals(64 + spotanim.lightAmbient, 850 + spotanim.lightAttenuation, -30, -50, -30, true);
return model;
}
public void method456(int i) {
aBoolean1579 = true;
aDouble1585 += aDouble1574 * (double) i;
aDouble1586 += aDouble1575 * (double) i;
aDouble1587 += (aDouble1577 * (double) i) + (0.5D * aDouble1578 * (double) i * (double) i);
aDouble1577 += aDouble1578 * (double) i;
anInt1595 = ((int) (Math.atan2(aDouble1574, aDouble1575) * 325.94900000000001D) + 1024) & 0x7ff;
anInt1596 = (int) (Math.atan2(aDouble1577, aDouble1576) * 325.94900000000001D) & 0x7ff;
if (aType_1592.seq != null) {
for (anInt1594 += i; anInt1594 > aType_1592.seq.getFrameDuration(anInt1593); ) {
anInt1594 -= aType_1592.seq.getFrameDuration(anInt1593) + 1;
anInt1593++;
if (anInt1593 >= aType_1592.seq.frameCount) {
anInt1593 = 0;
public void update(int delta) {
mobile = true;
x += velocityX * (double) delta;
z += velocityZ * (double) delta;
y += (velocityY * (double) delta) + (0.5D * accelerationY * (double) delta * (double) delta);
velocityY += accelerationY * (double) delta;
yaw = ((int) (Math.atan2(velocityX, velocityZ) * 325.94900000000001D) + 1024) & 0x7ff;
pitch = (int) (Math.atan2(velocityY, velocity) * 325.94900000000001D) & 0x7ff;
if (spotanim.seq != null) {
for (seqCycle += delta; seqCycle > spotanim.seq.getFrameDuration(seqFrame); ) {
seqCycle -= spotanim.seq.getFrameDuration(seqFrame) + 1;
seqFrame++;
if (seqFrame >= spotanim.seq.frameCount) {
seqFrame = 0;
}
}
}
+16 -16
View File
@@ -22,7 +22,7 @@ public class Scene {
public static final SceneOccluder[] activeOccluders = new SceneOccluder[500];
public static boolean lowmem = true;
public static int anInt446;
public static int anInt447;
public static int topPlane;
public static int cycle;
public static int anInt449;
public static int anInt450;
@@ -41,8 +41,8 @@ public class Scene {
public static boolean aBoolean467;
public static int anInt468;
public static int anInt469;
public static int anInt470 = -1;
public static int anInt471 = -1;
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 activeOccluderCount;
@@ -939,11 +939,11 @@ public class Scene {
aBoolean467 = true;
anInt468 = j;
anInt469 = i;
anInt470 = -1;
anInt471 = -1;
clickTileX = -1;
clickTileZ = -1;
}
public void method313(int eyeX, int eyeZ, int eyeYaw, int eyeY, int i1, int eyePitch) {
public void draw(int eyeX, int eyeZ, int eyeYaw, int eyeY, int topPlane, 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;
anInt447 = i1;
Scene.topPlane = topPlane;
anInt449 = eyeTileX - 25;
if (anInt449 < 0) {
anInt449 = 0;
@@ -990,7 +990,7 @@ public class Scene {
for (int k2 = anInt451; k2 < anInt452; k2++) {
SceneTile tile = aclass30_sub3[i2][k2];
if (tile != null) {
if ((tile.drawPlane > i1) || (!aBooleanArrayArray492[(i2 - eyeTileX) + 25][(k2 - eyeTileZ) + 25] && ((planeHeightmaps[k1][i2][k2] - eyeY) < 2000))) {
if ((tile.drawPlane > topPlane) || (!aBooleanArrayArray492[(i2 - eyeTileX) + 25][(k2 - eyeTileZ) + 25] && ((planeHeightmaps[k1][i2][k2] - eyeY) < 2000))) {
tile.aBoolean1322 = false;
tile.aBoolean1323 = false;
tile.anInt1325 = 0;
@@ -1616,8 +1616,8 @@ public class Scene {
if ((((i6 - k6) * (l5 - l6)) - ((j6 - l6) * (k5 - k6))) > 0) {
Draw3D.clipX = (i6 < 0) || (k6 < 0) || (k5 < 0) || (i6 > Draw2D.boundX) || (k6 > Draw2D.boundX) || (k5 > Draw2D.boundX);
if (aBoolean467 && method318(anInt468, anInt469, j6, l6, l5, i6, k6, k5)) {
anInt470 = j1;
anInt471 = k1;
clickTileX = j1;
clickTileZ = k1;
}
if (underlay.anInt720 == -1) {
if (underlay.anInt718 != 0xbc614e) {
@@ -1637,8 +1637,8 @@ public class Scene {
if ((((i5 - k5) * (l6 - l5)) - ((j5 - l5) * (k6 - k5))) > 0) {
Draw3D.clipX = (i5 < 0) || (k5 < 0) || (k6 < 0) || (i5 > Draw2D.boundX) || (k5 > Draw2D.boundX) || (k6 > Draw2D.boundX);
if (aBoolean467 && method318(anInt468, anInt469, j5, l5, l6, i5, k5, k6)) {
anInt470 = j1;
anInt471 = k1;
clickTileX = j1;
clickTileZ = k1;
}
if (underlay.anInt720 == -1) {
if (underlay.anInt716 != 0xbc614e) {
@@ -1693,8 +1693,8 @@ public class Scene {
if ((((i4 - j4) * (j5 - i5)) - ((l4 - i5) * (k4 - j4))) > 0) {
Draw3D.clipX = (i4 < 0) || (j4 < 0) || (k4 < 0) || (i4 > Draw2D.boundX) || (j4 > Draw2D.boundX) || (k4 > Draw2D.boundX);
if (aBoolean467 && method318(anInt468, anInt469, l4, i5, j5, i4, j4, k4)) {
anInt470 = i;
anInt471 = i1;
clickTileX = i;
clickTileZ = i1;
}
if ((overlay.anIntArray682 == null) || (overlay.anIntArray682[j2] == -1)) {
if (overlay.anIntArray676[j2] != 0xbc614e) {
@@ -1745,8 +1745,8 @@ public class Scene {
}
public void method319() {
int j = anIntArray473[anInt447];
SceneOccluder[] aclass47 = aOccluderArrayArray474[anInt447];
int j = anIntArray473[topPlane];
SceneOccluder[] aclass47 = aOccluderArrayArray474[topPlane];
activeOccluderCount = 0;
for (int k = 0; k < j; k++) {
SceneOccluder occluder = aclass47[k];
+70 -70
View File
@@ -129,10 +129,10 @@ public class SceneBuilder {
if (kind == 22) {
Entity entity;
if ((loc.seqId == -1) && (loc.overrideTypeIDs == null)) {
if ((loc.seqID == -1) && (loc.overrideTypeIDs == null)) {
entity = loc.getModel(22, rotation, heightSW, heightSE, heightNE, heightNW, -1);
} else {
entity = new LocEntity(locID, rotation, 22, heightSE, heightNE, heightSW, heightNW, loc.seqId, true);
entity = new LocEntity(locID, rotation, 22, heightSE, heightNE, heightSW, heightNW, loc.seqID, true);
}
scene.addGroundDecoration(entity, dataPlane, x, z, y, bitset, info);
@@ -143,10 +143,10 @@ public class SceneBuilder {
} else if ((kind == 10) || (kind == 11)) {
Entity entity;
if ((loc.seqId == -1) && (loc.overrideTypeIDs == null)) {
if ((loc.seqID == -1) && (loc.overrideTypeIDs == null)) {
entity = loc.getModel(10, rotation, heightSW, heightSE, heightNE, heightNW, -1);
} else {
entity = new LocEntity(locID, rotation, 10, heightSE, heightNE, heightSW, heightNW, loc.seqId, true);
entity = new LocEntity(locID, rotation, 10, heightSE, heightNE, heightSW, heightNW, loc.seqID, true);
}
if (entity != null) {
@@ -174,10 +174,10 @@ public class SceneBuilder {
}
} else if (kind >= 12) {
Entity entity;
if ((loc.seqId == -1) && (loc.overrideTypeIDs == null)) {
if ((loc.seqID == -1) && (loc.overrideTypeIDs == null)) {
entity = loc.getModel(kind, rotation, heightSW, heightSE, heightNE, heightNW, -1);
} else {
entity = new LocEntity(locID, rotation, kind, heightSE, heightNE, heightSW, heightNW, loc.seqId, true);
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);
@@ -188,10 +188,10 @@ public class SceneBuilder {
} else if (kind == 0) {
Entity entity;
if ((loc.seqId == -1) && (loc.overrideTypeIDs == null)) {
if ((loc.seqID == -1) && (loc.overrideTypeIDs == null)) {
entity = loc.getModel(0, rotation, heightSW, heightSE, heightNE, heightNW, -1);
} else {
entity = new LocEntity(locID, rotation, 0, heightSE, heightNE, heightSW, heightNW, loc.seqId, true);
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);
@@ -202,10 +202,10 @@ public class SceneBuilder {
} else if (kind == 1) {
Entity entity;
if ((loc.seqId == -1) && (loc.overrideTypeIDs == null)) {
if ((loc.seqID == -1) && (loc.overrideTypeIDs == null)) {
entity = loc.getModel(1, rotation, heightSW, heightSE, heightNE, heightNW, -1);
} else {
entity = new LocEntity(locID, rotation, 1, heightSE, heightNE, heightSW, heightNW, loc.seqId, true);
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);
@@ -218,12 +218,12 @@ public class SceneBuilder {
Entity locA;
Entity locB;
if ((loc.seqId == -1) && (loc.overrideTypeIDs == null)) {
if ((loc.seqID == -1) && (loc.overrideTypeIDs == null)) {
locA = loc.getModel(2, 4 + rotation, heightSW, heightSE, heightNE, heightNW, -1);
locB = loc.getModel(2, nextRotation, heightSW, heightSE, heightNE, heightNW, -1);
} else {
locA = new LocEntity(locID, 4 + rotation, 2, heightSE, heightNE, heightSW, heightNW, loc.seqId, true);
locB = new LocEntity(locID, nextRotation, 2, heightSE, heightNE, heightSW, heightNW, loc.seqId, true);
locA = new LocEntity(locID, 4 + rotation, 2, heightSE, heightNE, heightSW, heightNW, loc.seqID, true);
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);
@@ -234,10 +234,10 @@ public class SceneBuilder {
} else if (kind == 3) {
Entity entity;
if ((loc.seqId == -1) && (loc.overrideTypeIDs == null)) {
if ((loc.seqID == -1) && (loc.overrideTypeIDs == null)) {
entity = loc.getModel(3, rotation, heightSW, heightSE, heightNE, heightNW, -1);
} else {
entity = new LocEntity(locID, rotation, 3, heightSE, heightNE, heightSW, heightNW, loc.seqId, true);
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);
@@ -248,10 +248,10 @@ public class SceneBuilder {
} else if (kind == 9) {
Entity entity;
if ((loc.seqId == -1) && (loc.overrideTypeIDs == null)) {
if ((loc.seqID == -1) && (loc.overrideTypeIDs == null)) {
entity = loc.getModel(kind, rotation, heightSW, heightSE, heightNE, heightNW, -1);
} else {
entity = new LocEntity(locID, rotation, kind, heightSE, heightNE, heightSW, heightNW, loc.seqId, true);
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);
@@ -286,10 +286,10 @@ public class SceneBuilder {
if (kind == 4) {
Entity entity;
if ((loc.seqId == -1) && (loc.overrideTypeIDs == null)) {
if ((loc.seqID == -1) && (loc.overrideTypeIDs == null)) {
entity = loc.getModel(4, 0, heightSW, heightSE, heightNE, heightNW, -1);
} else {
entity = new LocEntity(locID, 0, 4, heightSE, heightNE, heightSW, heightNW, loc.seqId, true);
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);
@@ -303,40 +303,40 @@ public class SceneBuilder {
Entity entity;
if ((loc.seqId == -1) && (loc.overrideTypeIDs == null)) {
if ((loc.seqID == -1) && (loc.overrideTypeIDs == null)) {
entity = loc.getModel(4, 0, heightSW, heightSE, heightNE, heightNW, -1);
} else {
entity = new LocEntity(locID, 0, 4, heightSE, heightNE, heightSW, heightNW, loc.seqId, true);
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);
} else if (kind == 6) {
Entity entity;
if ((loc.seqId == -1) && (loc.overrideTypeIDs == null)) {
if ((loc.seqID == -1) && (loc.overrideTypeIDs == null)) {
entity = loc.getModel(4, 0, heightSW, heightSE, heightNE, heightNW, -1);
} else {
entity = new LocEntity(locID, 0, 4, heightSE, heightNE, heightSW, heightNW, loc.seqId, true);
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);
} else if (kind == 7) {
Entity entity;
if ((loc.seqId == -1) && (loc.overrideTypeIDs == null)) {
if ((loc.seqID == -1) && (loc.overrideTypeIDs == null)) {
entity = loc.getModel(4, 0, heightSW, heightSE, heightNE, heightNW, -1);
} else {
entity = new LocEntity(locID, 0, 4, heightSE, heightNE, heightSW, heightNW, loc.seqId, true);
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);
} else if (kind == 8) {
Entity entity;
if ((loc.seqId == -1) && (loc.overrideTypeIDs == null)) {
if ((loc.seqID == -1) && (loc.overrideTypeIDs == null)) {
entity = loc.getModel(4, 0, heightSW, heightSE, heightNE, heightNW, -1);
} else {
entity = new LocEntity(locID, 0, 4, heightSE, heightNE, heightSW, heightNW, loc.seqId, true);
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);
@@ -500,10 +500,10 @@ public class SceneBuilder {
int x1 = x0 + 5;
if ((x1 >= 0) && (x1 < maxTileX)) {
int floId = aByteArrayArrayArray142[plane][x1][z0] & 0xff;
int floID = aByteArrayArrayArray142[plane][x1][z0] & 0xff;
if (floId > 0) {
FloType flo = FloType.instances[floId - 1];
if (floID > 0) {
FloType flo = FloType.instances[floID - 1];
anIntArray124[z0] += flo.chroma;
anIntArray125[z0] += flo.saturation;
anIntArray126[z0] += flo.lightness;
@@ -515,10 +515,10 @@ public class SceneBuilder {
int x2 = x0 - 5;
if ((x2 >= 0) && (x2 < maxTileX)) {
int floId = aByteArrayArrayArray142[plane][x2][z0] & 0xff;
int floID = aByteArrayArrayArray142[plane][x2][z0] & 0xff;
if (floId > 0) {
FloType flo = FloType.instances[floId - 1];
if (floID > 0) {
FloType flo = FloType.instances[floID - 1];
anIntArray124[z0] -= flo.chroma;
anIntArray125[z0] -= flo.saturation;
anIntArray126[z0] -= flo.lightness;
@@ -562,9 +562,9 @@ public class SceneBuilder {
}
int i_43_ = aByteArrayArrayArray142[plane][x0][z0] & 0xff;
int floId = aByteArrayArrayArray130[plane][x0][z0] & 0xff;
int floID = aByteArrayArrayArray130[plane][x0][z0] & 0xff;
if ((i_43_ > 0) || (floId > 0)) {
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];
@@ -602,7 +602,7 @@ public class SceneBuilder {
if ((i_43_ == 0) && (aByteArrayArrayArray136[plane][x0][z0] != 0)) {
bool = false;
}
if ((floId > 0) && !FloType.instances[floId - 1].aBoolean393) {
if ((floID > 0) && !FloType.instances[floID - 1].aBoolean393) {
bool = false;
}
if (bool && (heightSW == heightSE) && (heightSW == heightNE) && (heightSW == heightNW)) {
@@ -616,29 +616,29 @@ public class SceneBuilder {
i_58_ = Draw3D.palette[mulHSL(i_54_, 96)];
}
if (floId == 0) {
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);
} else {
int i_59_ = aByteArrayArrayArray136[plane][x0][z0] + 1;
byte i_60_ = aByteArrayArrayArray148[plane][x0][z0];
FloType flo = FloType.instances[floId - 1];
int textureId = flo.textureId;
FloType flo = FloType.instances[floID - 1];
int textureID = flo.textureID;
int rgb;
int hsl;
if (textureId >= 0) {
rgb = Draw3D.getAverageTextureRGB(textureId);
if (textureID >= 0) {
rgb = Draw3D.getAverageTextureRGB(textureID);
hsl = -1;
} else if (flo.rgb == 16711935) {
rgb = 0;
hsl = -2;
textureId = -1;
textureID = -1;
} else {
hsl = decimateHSL(flo.hue, flo.saturation, flo.lightness);
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(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);
}
}
}
@@ -857,10 +857,10 @@ public class SceneBuilder {
if (!lowmem || type.interactable || type.important) {
Entity entity;
if ((type.seqId == -1) && (type.overrideTypeIDs == null)) {
if ((type.seqID == -1) && (type.overrideTypeIDs == null)) {
entity = type.getModel(22, rotation, heightmapSW, heightmapSE, heightmapNE, heightmapNW, -1);
} else {
entity = new LocEntity(locID, rotation, 22, heightmapSE, heightmapNE, heightmapSW, heightmapNW, type.seqId, true);
entity = new LocEntity(locID, rotation, 22, heightmapSE, heightmapNE, heightmapSW, heightmapNW, type.seqID, true);
}
scene.addGroundDecoration(entity, plane, x, z, heightmapAverage, bitset, info);
@@ -872,10 +872,10 @@ public class SceneBuilder {
} else if ((kind == 10) || (kind == 11)) {
Entity entity;
if ((type.seqId == -1) && (type.overrideTypeIDs == null)) {
if ((type.seqID == -1) && (type.overrideTypeIDs == null)) {
entity = type.getModel(10, rotation, heightmapSW, heightmapSE, heightmapNE, heightmapNW, -1);
} else {
entity = new LocEntity(locID, rotation, 10, heightmapSE, heightmapNE, heightmapSW, heightmapNW, type.seqId, true);
entity = new LocEntity(locID, rotation, 10, heightmapSE, heightmapNE, heightmapSW, heightmapNW, type.seqID, true);
}
if (entity != null) {
@@ -929,10 +929,10 @@ public class SceneBuilder {
} else if (kind >= 12) {
Entity entity;
if ((type.seqId == -1) && (type.overrideTypeIDs == null)) {
if ((type.seqID == -1) && (type.overrideTypeIDs == null)) {
entity = type.getModel(kind, rotation, heightmapSW, heightmapSE, heightmapNE, heightmapNW, -1);
} else {
entity = new LocEntity(locID, rotation, kind, heightmapSE, heightmapNE, heightmapSW, heightmapNW, type.seqId, true);
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);
@@ -947,10 +947,10 @@ public class SceneBuilder {
} else if (kind == 0) {
Entity entity;
if ((type.seqId == -1) && (type.overrideTypeIDs == null)) {
if ((type.seqID == -1) && (type.overrideTypeIDs == null)) {
entity = type.getModel(0, rotation, heightmapSW, heightmapSE, heightmapNE, heightmapNW, -1);
} else {
entity = new LocEntity(locID, rotation, 0, heightmapSE, heightmapNE, heightmapSW, heightmapNW, type.seqId, true);
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);
@@ -999,10 +999,10 @@ public class SceneBuilder {
} else if (kind == 1) {
Entity entity;
if ((type.seqId == -1) && (type.overrideTypeIDs == null)) {
if ((type.seqID == -1) && (type.overrideTypeIDs == null)) {
entity = type.getModel(1, rotation, heightmapSW, heightmapSE, heightmapNE, heightmapNW, -1);
} else {
entity = new LocEntity(locID, rotation, 1, heightmapSE, heightmapNE, heightmapSW, heightmapNW, type.seqId, true);
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);
@@ -1026,12 +1026,12 @@ public class SceneBuilder {
int i_137_ = (rotation + 1) & 0x3;
Entity entity;
Entity entity_138_;
if ((type.seqId == -1) && (type.overrideTypeIDs == null)) {
if ((type.seqID == -1) && (type.overrideTypeIDs == null)) {
entity = type.getModel(2, 4 + rotation, heightmapSW, heightmapSE, heightmapNE, heightmapNW, -1);
entity_138_ = type.getModel(2, i_137_, heightmapSW, heightmapSE, heightmapNE, heightmapNW, -1);
} else {
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);
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);
if (type.occludes) {
@@ -1057,10 +1057,10 @@ public class SceneBuilder {
}
} else if (kind == 3) {
Entity entity;
if ((type.seqId == -1) && (type.overrideTypeIDs == null)) {
if ((type.seqID == -1) && (type.overrideTypeIDs == null)) {
entity = type.getModel(3, rotation, heightmapSW, heightmapSE, heightmapNE, heightmapNW, -1);
} else {
entity = new LocEntity(locID, rotation, 3, heightmapSE, heightmapNE, heightmapSW, heightmapNW, type.seqId, true);
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);
if (type.castShadow) {
@@ -1079,10 +1079,10 @@ public class SceneBuilder {
}
} else if (kind == 9) {
Entity entity;
if ((type.seqId == -1) && (type.overrideTypeIDs == null)) {
if ((type.seqID == -1) && (type.overrideTypeIDs == null)) {
entity = type.getModel(kind, rotation, heightmapSW, heightmapSE, heightmapNE, heightmapNW, -1);
} else {
entity = new LocEntity(locID, rotation, kind, heightmapSE, heightmapNE, heightmapSW, heightmapNW, type.seqId, true);
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);
if (type.solid && (collision != null)) {
@@ -1113,10 +1113,10 @@ public class SceneBuilder {
}
if (kind == 4) {
Entity entity;
if ((type.seqId == -1) && (type.overrideTypeIDs == null)) {
if ((type.seqID == -1) && (type.overrideTypeIDs == null)) {
entity = type.getModel(4, 0, heightmapSW, heightmapSE, heightmapNE, heightmapNW, -1);
} else {
entity = new LocEntity(locID, 0, 4, heightmapSE, heightmapNE, heightmapSW, heightmapNW, type.seqId, true);
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);
} else if (kind == 5) {
@@ -1126,34 +1126,34 @@ public class SceneBuilder {
i_142_ = LocType.get((i_143_ >> 14) & 0x7fff).decorationPadding;
}
Entity entity;
if ((type.seqId == -1) && (type.overrideTypeIDs == null)) {
if ((type.seqID == -1) && (type.overrideTypeIDs == null)) {
entity = type.getModel(4, 0, heightmapSW, heightmapSE, heightmapNE, heightmapNW, -1);
} else {
entity = new LocEntity(locID, 0, 4, heightmapSE, heightmapNE, heightmapSW, heightmapNW, type.seqId, true);
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);
} else if (kind == 6) {
Entity entity;
if ((type.seqId == -1) && (type.overrideTypeIDs == null)) {
if ((type.seqID == -1) && (type.overrideTypeIDs == null)) {
entity = type.getModel(4, 0, heightmapSW, heightmapSE, heightmapNE, heightmapNW, -1);
} else {
entity = new LocEntity(locID, 0, 4, heightmapSE, heightmapNE, heightmapSW, heightmapNW, type.seqId, true);
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);
} else if (kind == 7) {
Entity entity;
if ((type.seqId == -1) && (type.overrideTypeIDs == null)) {
if ((type.seqID == -1) && (type.overrideTypeIDs == null)) {
entity = type.getModel(4, 0, heightmapSW, heightmapSE, heightmapNE, heightmapNW, -1);
} else {
entity = new LocEntity(locID, 0, 4, heightmapSE, heightmapNE, heightmapSW, heightmapNW, type.seqId, true);
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);
} else if (kind == 8) {
Entity entity;
if ((type.seqId == -1) && (type.overrideTypeIDs == null)) {
if ((type.seqID == -1) && (type.overrideTypeIDs == null)) {
entity = type.getModel(4, 0, heightmapSW, heightmapSE, heightmapNE, heightmapNW, -1);
} else {
entity = new LocEntity(locID, 0, 4, heightmapSE, heightmapNE, heightmapSW, heightmapNW, type.seqId, true);
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);
}
+10 -10
View File
@@ -4,21 +4,21 @@
public class SceneLocTemporary extends DoublyLinkedList.Node {
public int anInt1291;
public int anInt1292;
public int anInt1293;
public int anInt1294;
public int id;
public int rotation;
public int kind;
public int duration;
public int plane;
public int classId;
public int classID;
public int localX;
public int localZ;
public int savedLocId;
public int savedRotation;
public int savedKind;
public int anInt1302;
public int previousLocID;
public int previousRotation;
public int previousKind;
public int delay;
public SceneLocTemporary() {
anInt1294 = -1;
duration = -1;
}
}
+4
View File
@@ -61,6 +61,10 @@ public class SeqType {
* @see Scene#addTemporary(Entity, int, int, int, int, int, int, boolean, int)
*/
public boolean forwardRenderPadding = false;
/**
* The priority.
*/
public int priority = 5;
/**
+6 -6
View File
@@ -32,8 +32,8 @@ public class SpotAnimType {
public final int[] colorSrc = new int[6];
public final int[] colorDst = new int[6];
public int index;
public int modelId;
public int seqId = -1;
public int modelID;
public int seqID = -1;
public SeqType seq;
public int scaleXY = 128;
public int scaleZ = 128;
@@ -51,11 +51,11 @@ public class SpotAnimType {
return;
}
if (i == 1) {
modelId = buffer.get2U();
modelID = buffer.get2U();
} else if (i == 2) {
seqId = buffer.get2U();
seqID = buffer.get2U();
if (SeqType.instances != null) {
seq = SeqType.instances[seqId];
seq = SeqType.instances[seqID];
}
} else if (i == 4) {
scaleXY = buffer.get2U();
@@ -84,7 +84,7 @@ public class SpotAnimType {
return model;
}
model = Model.tryGet(modelId);
model = Model.tryGet(modelID);
if (model == null) {
return null;