project: Rev 202

This commit is contained in:
Owain van Brakel
2021-12-14 18:20:58 +01:00
parent e974585ce8
commit 7c7bf0901a
406 changed files with 39725 additions and 39842 deletions

View File

@@ -263,50 +263,50 @@ public class ObjectComposition extends DualNode {
IterableNodeHashTable params;
static {
ObjectDefinition_isLowDetail = false; // L: 17
ObjectDefinition_cached = new EvictingDualNodeHashTable(4096); // L: 20
ObjectDefinition_cachedModelData = new EvictingDualNodeHashTable(500); // L: 21
ObjectDefinition_cachedEntities = new EvictingDualNodeHashTable(30); // L: 22
ObjectDefinition_cachedModels = new EvictingDualNodeHashTable(30); // L: 23
field1957 = new ModelData[4]; // L: 24
ObjectDefinition_isLowDetail = false;
ObjectDefinition_cached = new EvictingDualNodeHashTable(4096);
ObjectDefinition_cachedModelData = new EvictingDualNodeHashTable(500);
ObjectDefinition_cachedEntities = new EvictingDualNodeHashTable(30);
ObjectDefinition_cachedModels = new EvictingDualNodeHashTable(30);
field1957 = new ModelData[4];
}
ObjectComposition() {
this.name = "null"; // L: 28
this.sizeX = 1; // L: 33
this.sizeY = 1; // L: 34
this.interactType = 2; // L: 35
this.boolean1 = true; // L: 36
this.int1 = -1; // L: 37
this.clipType = -1; // L: 38
this.nonFlatShading = false; // L: 39
this.modelClipped = false; // L: 40
this.animationId = -1; // L: 41
this.int2 = 16; // L: 42
this.ambient = 0; // L: 43
this.name = "null";
this.sizeX = 1;
this.sizeY = 1;
this.interactType = 2;
this.boolean1 = true;
this.int1 = -1;
this.clipType = -1;
this.nonFlatShading = false;
this.modelClipped = false;
this.animationId = -1;
this.int2 = 16;
this.ambient = 0;
this.contrast = 0;
this.actions = new String[5];
this.mapIconId = -1; // L: 46
this.mapIconId = -1;
this.mapSceneId = -1;
this.isRotated = false; // L: 48
this.clipped = true; // L: 49
this.modelSizeX = 128; // L: 50
this.modelHeight = 128; // L: 51
this.modelSizeY = 128; // L: 52
this.offsetX = 0; // L: 53
this.offsetHeight = 0; // L: 54
this.offsetY = 0; // L: 55
this.boolean2 = false; // L: 56
this.isRotated = false;
this.clipped = true;
this.modelSizeX = 128;
this.modelHeight = 128;
this.modelSizeY = 128;
this.offsetX = 0;
this.offsetHeight = 0;
this.offsetY = 0;
this.boolean2 = false;
this.isSolid = false;
this.int3 = -1;
this.transformVarbit = -1; // L: 60
this.transformVarp = -1; // L: 61
this.ambientSoundId = -1; // L: 62
this.int7 = 0; // L: 63
this.int5 = 0; // L: 64
this.int6 = 0; // L: 65
this.boolean3 = true; // L: 67
} // L: 70
this.transformVarbit = -1;
this.transformVarp = -1;
this.ambientSoundId = -1;
this.int7 = 0;
this.int5 = 0;
this.int6 = 0;
this.boolean3 = true;
}
@ObfuscatedName("p")
@ObfuscatedSignature(
@@ -315,24 +315,24 @@ public class ObjectComposition extends DualNode {
)
@Export("postDecode")
void postDecode() {
if (this.int1 == -1) { // L: 95
this.int1 = 0; // L: 96
if (this.modelIds != null && (this.models == null || this.models[0] == 10)) { // L: 97
if (this.int1 == -1) {
this.int1 = 0;
if (this.modelIds != null && (this.models == null || this.models[0] == 10)) {
this.int1 = 1;
}
for (int var1 = 0; var1 < 5; ++var1) { // L: 98
for (int var1 = 0; var1 < 5; ++var1) {
if (this.actions[var1] != null) {
this.int1 = 1;
}
}
}
if (this.int3 == -1) { // L: 100
if (this.int3 == -1) {
this.int3 = this.interactType != 0 ? 1 : 0;
}
} // L: 101
}
@ObfuscatedName("m")
@ObfuscatedSignature(
@@ -342,12 +342,12 @@ public class ObjectComposition extends DualNode {
@Export("decode")
void decode(Buffer var1) {
while (true) {
int var2 = var1.readUnsignedByte(); // L: 105
if (var2 == 0) { // L: 106
return; // L: 109
int var2 = var1.readUnsignedByte();
if (var2 == 0) {
return;
}
this.decodeNext(var1, var2); // L: 107
this.decodeNext(var1, var2);
}
}
@@ -360,174 +360,174 @@ public class ObjectComposition extends DualNode {
void decodeNext(Buffer var1, int var2) {
int var3;
int var4;
if (var2 == 1) { // L: 112
var3 = var1.readUnsignedByte(); // L: 113
if (var3 > 0) { // L: 114
if (this.modelIds != null && !ObjectDefinition_isLowDetail) { // L: 115
var1.offset += 3 * var3; // L: 123
if (var2 == 1) {
var3 = var1.readUnsignedByte();
if (var3 > 0) {
if (this.modelIds != null && !ObjectDefinition_isLowDetail) {
var1.offset += 3 * var3;
} else {
this.models = new int[var3]; // L: 116
this.modelIds = new int[var3]; // L: 117
this.models = new int[var3];
this.modelIds = new int[var3];
for (var4 = 0; var4 < var3; ++var4) { // L: 118
this.modelIds[var4] = var1.readUnsignedShort(); // L: 119
this.models[var4] = var1.readUnsignedByte(); // L: 120
for (var4 = 0; var4 < var3; ++var4) {
this.modelIds[var4] = var1.readUnsignedShort();
this.models[var4] = var1.readUnsignedByte();
}
}
}
} else if (var2 == 2) { // L: 126
} else if (var2 == 2) {
this.name = var1.readStringCp1252NullTerminated();
} else if (var2 == 5) { // L: 127
var3 = var1.readUnsignedByte(); // L: 128
if (var3 > 0) { // L: 129
if (this.modelIds != null && !ObjectDefinition_isLowDetail) { // L: 130
var1.offset += var3 * 2; // L: 135
} else if (var2 == 5) {
var3 = var1.readUnsignedByte();
if (var3 > 0) {
if (this.modelIds != null && !ObjectDefinition_isLowDetail) {
var1.offset += var3 * 2;
} else {
this.models = null; // L: 131
this.modelIds = new int[var3]; // L: 132
this.models = null;
this.modelIds = new int[var3];
for (var4 = 0; var4 < var3; ++var4) { // L: 133
for (var4 = 0; var4 < var3; ++var4) {
this.modelIds[var4] = var1.readUnsignedShort();
}
}
}
} else if (var2 == 14) { // L: 138
} else if (var2 == 14) {
this.sizeX = var1.readUnsignedByte();
} else if (var2 == 15) { // L: 139
} else if (var2 == 15) {
this.sizeY = var1.readUnsignedByte();
} else if (var2 == 17) { // L: 140
this.interactType = 0; // L: 141
this.boolean1 = false; // L: 142
} else if (var2 == 18) { // L: 144
} else if (var2 == 17) {
this.interactType = 0;
this.boolean1 = false;
} else if (var2 == 19) { // L: 145
} else if (var2 == 18) {
this.boolean1 = false;
} else if (var2 == 19) {
this.int1 = var1.readUnsignedByte();
} else if (var2 == 21) { // L: 146
} else if (var2 == 21) {
this.clipType = 0;
} else if (var2 == 22) { // L: 147
} else if (var2 == 22) {
this.nonFlatShading = true;
} else if (var2 == 23) { // L: 148
} else if (var2 == 23) {
this.modelClipped = true;
} else if (var2 == 24) { // L: 149
this.animationId = var1.readUnsignedShort(); // L: 150
if (this.animationId == 65535) { // L: 151
} else if (var2 == 24) {
this.animationId = var1.readUnsignedShort();
if (this.animationId == 65535) {
this.animationId = -1;
}
} else if (var2 == 27) { // L: 153
} else if (var2 == 27) {
this.interactType = 1;
} else if (var2 == 28) { // L: 154
} else if (var2 == 28) {
this.int2 = var1.readUnsignedByte();
} else if (var2 == 29) { // L: 155
} else if (var2 == 29) {
this.ambient = var1.readByte();
} else if (var2 == 39) { // L: 156
} else if (var2 == 39) {
this.contrast = var1.readByte() * 25;
} else if (var2 >= 30 && var2 < 35) { // L: 157
this.actions[var2 - 30] = var1.readStringCp1252NullTerminated(); // L: 158
if (this.actions[var2 - 30].equalsIgnoreCase("Hidden")) { // L: 159
} else if (var2 >= 30 && var2 < 35) {
this.actions[var2 - 30] = var1.readStringCp1252NullTerminated();
if (this.actions[var2 - 30].equalsIgnoreCase("Hidden")) {
this.actions[var2 - 30] = null;
}
} else if (var2 == 40) { // L: 161
var3 = var1.readUnsignedByte(); // L: 162
this.recolorFrom = new short[var3]; // L: 163
this.recolorTo = new short[var3]; // L: 164
} else if (var2 == 40) {
var3 = var1.readUnsignedByte();
this.recolorFrom = new short[var3];
this.recolorTo = new short[var3];
for (var4 = 0; var4 < var3; ++var4) { // L: 165
this.recolorFrom[var4] = (short)var1.readUnsignedShort(); // L: 166
this.recolorTo[var4] = (short)var1.readUnsignedShort(); // L: 167
for (var4 = 0; var4 < var3; ++var4) {
this.recolorFrom[var4] = (short)var1.readUnsignedShort();
this.recolorTo[var4] = (short)var1.readUnsignedShort();
}
} else if (var2 == 41) { // L: 170
var3 = var1.readUnsignedByte(); // L: 171
this.retextureFrom = new short[var3]; // L: 172
this.retextureTo = new short[var3]; // L: 173
} else if (var2 == 41) {
var3 = var1.readUnsignedByte();
this.retextureFrom = new short[var3];
this.retextureTo = new short[var3];
for (var4 = 0; var4 < var3; ++var4) { // L: 174
this.retextureFrom[var4] = (short)var1.readUnsignedShort(); // L: 175
this.retextureTo[var4] = (short)var1.readUnsignedShort(); // L: 176
for (var4 = 0; var4 < var3; ++var4) {
this.retextureFrom[var4] = (short)var1.readUnsignedShort();
this.retextureTo[var4] = (short)var1.readUnsignedShort();
}
} else if (var2 == 61) { // L: 179
var1.readUnsignedShort(); // L: 180
} else if (var2 == 62) { // L: 182
} else if (var2 == 61) {
var1.readUnsignedShort();
} else if (var2 == 62) {
this.isRotated = true;
} else if (var2 == 64) { // L: 183
} else if (var2 == 64) {
this.clipped = false;
} else if (var2 == 65) { // L: 184
} else if (var2 == 65) {
this.modelSizeX = var1.readUnsignedShort();
} else if (var2 == 66) { // L: 185
} else if (var2 == 66) {
this.modelHeight = var1.readUnsignedShort();
} else if (var2 == 67) { // L: 186
} else if (var2 == 67) {
this.modelSizeY = var1.readUnsignedShort();
} else if (var2 == 68) { // L: 187
} else if (var2 == 68) {
this.mapSceneId = var1.readUnsignedShort();
} else if (var2 == 69) { // L: 188
var1.readUnsignedByte(); // L: 189
} else if (var2 == 70) { // L: 191
} else if (var2 == 69) {
var1.readUnsignedByte();
} else if (var2 == 70) {
this.offsetX = var1.readShort();
} else if (var2 == 71) { // L: 192
} else if (var2 == 71) {
this.offsetHeight = var1.readShort();
} else if (var2 == 72) {
this.offsetY = var1.readShort(); // L: 193
} else if (var2 == 73) { // L: 194
this.offsetY = var1.readShort();
} else if (var2 == 73) {
this.boolean2 = true;
} else if (var2 == 74) { // L: 195
} else if (var2 == 74) {
this.isSolid = true;
} else if (var2 == 75) { // L: 196
} else if (var2 == 75) {
this.int3 = var1.readUnsignedByte();
} else if (var2 != 77 && var2 != 92) { // L: 197
if (var2 == 78) { // L: 215
this.ambientSoundId = var1.readUnsignedShort(); // L: 216
this.int7 = var1.readUnsignedByte(); // L: 217
} else if (var2 == 79) { // L: 219
this.int5 = var1.readUnsignedShort(); // L: 220
this.int6 = var1.readUnsignedShort(); // L: 221
this.int7 = var1.readUnsignedByte(); // L: 222
var3 = var1.readUnsignedByte(); // L: 223
this.soundEffectIds = new int[var3]; // L: 224
} else if (var2 != 77 && var2 != 92) {
if (var2 == 78) {
this.ambientSoundId = var1.readUnsignedShort();
this.int7 = var1.readUnsignedByte();
} else if (var2 == 79) {
this.int5 = var1.readUnsignedShort();
this.int6 = var1.readUnsignedShort();
this.int7 = var1.readUnsignedByte();
var3 = var1.readUnsignedByte();
this.soundEffectIds = new int[var3];
for (var4 = 0; var4 < var3; ++var4) { // L: 225
for (var4 = 0; var4 < var3; ++var4) {
this.soundEffectIds[var4] = var1.readUnsignedShort();
}
} else if (var2 == 81) { // L: 227
} else if (var2 == 81) {
this.clipType = var1.readUnsignedByte() * 256;
} else if (var2 == 82) { // L: 228
} else if (var2 == 82) {
this.mapIconId = var1.readUnsignedShort();
} else if (var2 == 89) { // L: 229
} else if (var2 == 89) {
this.boolean3 = false;
} else if (var2 == 249) { // L: 230
} else if (var2 == 249) {
this.params = Canvas.readStringIntParameters(var1, this.params);
}
} else {
this.transformVarbit = var1.readUnsignedShort(); // L: 198
if (this.transformVarbit == 65535) { // L: 199
this.transformVarbit = var1.readUnsignedShort();
if (this.transformVarbit == 65535) {
this.transformVarbit = -1;
}
this.transformVarp = var1.readUnsignedShort(); // L: 200
if (this.transformVarp == 65535) { // L: 201
this.transformVarp = var1.readUnsignedShort();
if (this.transformVarp == 65535) {
this.transformVarp = -1;
}
var3 = -1; // L: 202
if (var2 == 92) { // L: 203
var3 = var1.readUnsignedShort(); // L: 204
if (var3 == 65535) { // L: 205
var3 = -1;
if (var2 == 92) {
var3 = var1.readUnsignedShort();
if (var3 == 65535) {
var3 = -1;
}
}
var4 = var1.readUnsignedByte(); // L: 207
this.transforms = new int[var4 + 2]; // L: 208
var4 = var1.readUnsignedByte();
this.transforms = new int[var4 + 2];
for (int var5 = 0; var5 <= var4; ++var5) { // L: 209
this.transforms[var5] = var1.readUnsignedShort(); // L: 210
if (this.transforms[var5] == 65535) { // L: 211
for (int var5 = 0; var5 <= var4; ++var5) {
this.transforms[var5] = var1.readUnsignedShort();
if (this.transforms[var5] == 65535) {
this.transforms[var5] = -1;
}
}
this.transforms[var4 + 1] = var3; // L: 213
this.transforms[var4 + 1] = var3;
}
} // L: 232
}
@ObfuscatedName("s")
@ObfuscatedSignature(
@@ -535,26 +535,26 @@ public class ObjectComposition extends DualNode {
garbageValue = "-2022345468"
)
public final boolean method3491(int var1) {
if (this.models != null) { // L: 235
for (int var4 = 0; var4 < this.models.length; ++var4) { // L: 245
if (this.models[var4] == var1) { // L: 246
if (this.models != null) {
for (int var4 = 0; var4 < this.models.length; ++var4) {
if (this.models[var4] == var1) {
return ObjectDefinition_modelsArchive.tryLoadFile(this.modelIds[var4] & 65535, 0);
}
}
return true; // L: 248
} else if (this.modelIds == null) { // L: 236
return true;
} else if (var1 != 10) { // L: 237
} else if (this.modelIds == null) {
return true;
} else if (var1 != 10) {
return true;
} else {
boolean var2 = true; // L: 238
boolean var2 = true;
for (int var3 = 0; var3 < this.modelIds.length; ++var3) { // L: 239
var2 &= ObjectDefinition_modelsArchive.tryLoadFile(this.modelIds[var3] & 65535, 0); // L: 240
for (int var3 = 0; var3 < this.modelIds.length; ++var3) {
var2 &= ObjectDefinition_modelsArchive.tryLoadFile(this.modelIds[var3] & 65535, 0);
}
return var2; // L: 242
return var2;
}
}
@@ -565,16 +565,16 @@ public class ObjectComposition extends DualNode {
)
@Export("needsModelFiles")
public final boolean needsModelFiles() {
if (this.modelIds == null) { // L: 253
if (this.modelIds == null) {
return true;
} else {
boolean var1 = true; // L: 254
boolean var1 = true;
for (int var2 = 0; var2 < this.modelIds.length; ++var2) { // L: 255
var1 &= ObjectDefinition_modelsArchive.tryLoadFile(this.modelIds[var2] & 65535, 0); // L: 256
for (int var2 = 0; var2 < this.modelIds.length; ++var2) {
var1 &= ObjectDefinition_modelsArchive.tryLoadFile(this.modelIds[var2] & 65535, 0);
}
return var1; // L: 258
return var1;
}
}
@@ -586,44 +586,44 @@ public class ObjectComposition extends DualNode {
@Export("getEntity")
public final Renderable getEntity(int var1, int var2, int[][] var3, int var4, int var5, int var6) {
long var7;
if (this.models == null) { // L: 263
if (this.models == null) {
var7 = (long)(var2 + (this.id << 10));
} else {
var7 = (long)(var2 + (var1 << 3) + (this.id << 10)); // L: 264
var7 = (long)(var2 + (var1 << 3) + (this.id << 10));
}
Object var9 = (Renderable)ObjectDefinition_cachedEntities.get(var7); // L: 265
if (var9 == null) { // L: 266
ModelData var10 = this.getModelData(var1, var2); // L: 267
if (var10 == null) { // L: 268
Object var9 = (Renderable)ObjectDefinition_cachedEntities.get(var7);
if (var9 == null) {
ModelData var10 = this.getModelData(var1, var2);
if (var10 == null) {
return null;
}
if (!this.nonFlatShading) { // L: 269
if (!this.nonFlatShading) {
var9 = var10.toModel(this.ambient + 64, this.contrast + 768, -50, -10, -50);
} else {
var10.ambient = (short)(this.ambient + 64); // L: 271
var10.contrast = (short)(this.contrast + 768); // L: 272
var10.calculateVertexNormals(); // L: 273
var9 = var10; // L: 274
var10.ambient = (short)(this.ambient + 64);
var10.contrast = (short)(this.contrast + 768);
var10.calculateVertexNormals();
var9 = var10;
}
ObjectDefinition_cachedEntities.put((DualNode)var9, var7); // L: 276
ObjectDefinition_cachedEntities.put((DualNode)var9, var7);
}
if (this.nonFlatShading) { // L: 278
var9 = ((ModelData)var9).method3751(); // L: 279
if (this.nonFlatShading) {
var9 = ((ModelData)var9).method3751();
}
if (this.clipType >= 0) { // L: 281
if (var9 instanceof Model) { // L: 282
if (this.clipType >= 0) {
if (var9 instanceof Model) {
var9 = ((Model)var9).contourGround(var3, var4, var5, var6, true, this.clipType);
} else if (var9 instanceof ModelData) {
var9 = ((ModelData)var9).method3752(var3, var4, var5, var6, true, this.clipType); // L: 283
var9 = ((ModelData)var9).method3752(var3, var4, var5, var6, true, this.clipType);
}
}
return (Renderable)var9; // L: 285
return (Renderable)var9;
}
@ObfuscatedName("n")
@@ -634,28 +634,28 @@ public class ObjectComposition extends DualNode {
@Export("getModel")
public final Model getModel(int var1, int var2, int[][] var3, int var4, int var5, int var6) {
long var7;
if (this.models == null) { // L: 290
if (this.models == null) {
var7 = (long)(var2 + (this.id << 10));
} else {
var7 = (long)(var2 + (var1 << 3) + (this.id << 10)); // L: 291
var7 = (long)(var2 + (var1 << 3) + (this.id << 10));
}
Model var9 = (Model)ObjectDefinition_cachedModels.get(var7); // L: 292
if (var9 == null) { // L: 293
ModelData var10 = this.getModelData(var1, var2); // L: 294
if (var10 == null) { // L: 295
Model var9 = (Model)ObjectDefinition_cachedModels.get(var7);
if (var9 == null) {
ModelData var10 = this.getModelData(var1, var2);
if (var10 == null) {
return null;
}
var9 = var10.toModel(this.ambient + 64, this.contrast + 768, -50, -10, -50); // L: 296
ObjectDefinition_cachedModels.put(var9, var7); // L: 297
var9 = var10.toModel(this.ambient + 64, this.contrast + 768, -50, -10, -50);
ObjectDefinition_cachedModels.put(var9, var7);
}
if (this.clipType >= 0) {
var9 = var9.contourGround(var3, var4, var5, var6, true, this.clipType); // L: 299
var9 = var9.contourGround(var3, var4, var5, var6, true, this.clipType);
}
return var9; // L: 300
return var9;
}
@ObfuscatedName("r")
@@ -666,37 +666,37 @@ public class ObjectComposition extends DualNode {
@Export("getModelDynamic")
public final Model getModelDynamic(int var1, int var2, int[][] var3, int var4, int var5, int var6, SequenceDefinition var7, int var8) {
long var9;
if (this.models == null) { // L: 305
if (this.models == null) {
var9 = (long)(var2 + (this.id << 10));
} else {
var9 = (long)(var2 + (var1 << 3) + (this.id << 10)); // L: 306
var9 = (long)(var2 + (var1 << 3) + (this.id << 10));
}
Model var11 = (Model)ObjectDefinition_cachedModels.get(var9); // L: 307
if (var11 == null) { // L: 308
ModelData var12 = this.getModelData(var1, var2); // L: 309
if (var12 == null) { // L: 310
Model var11 = (Model)ObjectDefinition_cachedModels.get(var9);
if (var11 == null) {
ModelData var12 = this.getModelData(var1, var2);
if (var12 == null) {
return null;
}
var11 = var12.toModel(this.ambient + 64, this.contrast + 768, -50, -10, -50); // L: 311
ObjectDefinition_cachedModels.put(var11, var9); // L: 312
var11 = var12.toModel(this.ambient + 64, this.contrast + 768, -50, -10, -50);
ObjectDefinition_cachedModels.put(var11, var9);
}
if (var7 == null && this.clipType == -1) { // L: 314
if (var7 == null && this.clipType == -1) {
return var11;
} else {
if (var7 != null) { // L: 315
var11 = var7.transformObjectModel(var11, var8, var2); // L: 316
if (var7 != null) {
var11 = var7.transformObjectModel(var11, var8, var2);
} else {
var11 = var11.toSharedSequenceModel(true); // L: 318
var11 = var11.toSharedSequenceModel(true);
}
if (this.clipType >= 0) { // L: 319
if (this.clipType >= 0) {
var11 = var11.contourGround(var3, var4, var5, var6, false, this.clipType);
}
return var11; // L: 320
return var11;
}
}
@@ -707,138 +707,138 @@ public class ObjectComposition extends DualNode {
)
@Export("getModelData")
final ModelData getModelData(int var1, int var2) {
ModelData var3 = null; // L: 324
ModelData var3 = null;
boolean var4;
int var5;
int var7;
if (this.models == null) { // L: 325
if (var1 != 10) { // L: 326
if (this.models == null) {
if (var1 != 10) {
return null;
}
if (this.modelIds == null) { // L: 327
if (this.modelIds == null) {
return null;
}
var4 = this.isRotated; // L: 328
if (var1 == 2 && var2 > 3) { // L: 329
var4 = this.isRotated;
if (var1 == 2 && var2 > 3) {
var4 = !var4;
}
var5 = this.modelIds.length; // L: 330
var5 = this.modelIds.length;
for (int var6 = 0; var6 < var5; ++var6) { // L: 331
var7 = this.modelIds[var6]; // L: 332
if (var4) { // L: 333
for (int var6 = 0; var6 < var5; ++var6) {
var7 = this.modelIds[var6];
if (var4) {
var7 += 65536;
}
var3 = (ModelData)ObjectDefinition_cachedModelData.get((long)var7); // L: 334
if (var3 == null) { // L: 335
var3 = ModelData.ModelData_get(ObjectDefinition_modelsArchive, var7 & 65535, 0); // L: 336
if (var3 == null) { // L: 337
var3 = (ModelData)ObjectDefinition_cachedModelData.get((long)var7);
if (var3 == null) {
var3 = ModelData.ModelData_get(ObjectDefinition_modelsArchive, var7 & 65535, 0);
if (var3 == null) {
return null;
}
if (var4) { // L: 338
if (var4) {
var3.method3761();
}
ObjectDefinition_cachedModelData.put(var3, (long)var7); // L: 339
ObjectDefinition_cachedModelData.put(var3, (long)var7);
}
if (var5 > 1) { // L: 341
if (var5 > 1) {
field1957[var6] = var3;
}
}
if (var5 > 1) { // L: 343
if (var5 > 1) {
var3 = new ModelData(field1957, var5);
}
} else {
int var9 = -1; // L: 346
int var9 = -1;
for (var5 = 0; var5 < this.models.length; ++var5) { // L: 347
if (this.models[var5] == var1) { // L: 348
var9 = var5; // L: 349
for (var5 = 0; var5 < this.models.length; ++var5) {
if (this.models[var5] == var1) {
var9 = var5;
break;
}
}
if (var9 == -1) { // L: 353
if (var9 == -1) {
return null;
}
var5 = this.modelIds[var9]; // L: 354
boolean var10 = this.isRotated ^ var2 > 3; // L: 355
if (var10) { // L: 356
var5 = this.modelIds[var9];
boolean var10 = this.isRotated ^ var2 > 3;
if (var10) {
var5 += 65536;
}
var3 = (ModelData)ObjectDefinition_cachedModelData.get((long)var5); // L: 357
if (var3 == null) { // L: 358
var3 = ModelData.ModelData_get(ObjectDefinition_modelsArchive, var5 & 65535, 0); // L: 359
if (var3 == null) { // L: 360
var3 = (ModelData)ObjectDefinition_cachedModelData.get((long)var5);
if (var3 == null) {
var3 = ModelData.ModelData_get(ObjectDefinition_modelsArchive, var5 & 65535, 0);
if (var3 == null) {
return null;
}
if (var10) { // L: 361
if (var10) {
var3.method3761();
}
ObjectDefinition_cachedModelData.put(var3, (long)var5); // L: 362
ObjectDefinition_cachedModelData.put(var3, (long)var5);
}
}
if (this.modelSizeX == 128 && this.modelHeight == 128 && this.modelSizeY == 128) { // L: 366
var4 = false; // L: 367
if (this.modelSizeX == 128 && this.modelHeight == 128 && this.modelSizeY == 128) {
var4 = false;
} else {
var4 = true;
}
boolean var11;
if (this.offsetX == 0 && this.offsetHeight == 0 && this.offsetY == 0) { // L: 369
var11 = false; // L: 370
if (this.offsetX == 0 && this.offsetHeight == 0 && this.offsetY == 0) {
var11 = false;
} else {
var11 = true;
}
ModelData var8 = new ModelData(var3, var2 == 0 && !var4 && !var11, null == this.recolorFrom, null == this.retextureFrom, true); // L: 371
if (var1 == 4 && var2 > 3) { // L: 372
var8.method3757(256); // L: 373
var8.changeOffset(45, 0, -45); // L: 374
ModelData var8 = new ModelData(var3, var2 == 0 && !var4 && !var11, null == this.recolorFrom, null == this.retextureFrom, true);
if (var1 == 4 && var2 > 3) {
var8.method3757(256);
var8.changeOffset(45, 0, -45);
}
var2 &= 3; // L: 376
if (var2 == 1) { // L: 377
var2 &= 3;
if (var2 == 1) {
var8.method3754();
} else if (var2 == 2) { // L: 378
} else if (var2 == 2) {
var8.method3755();
} else if (var2 == 3) { // L: 379
} else if (var2 == 3) {
var8.method3756();
}
if (this.recolorFrom != null) { // L: 380
for (var7 = 0; var7 < this.recolorFrom.length; ++var7) { // L: 381
var8.recolor(this.recolorFrom[var7], this.recolorTo[var7]); // L: 382
if (this.recolorFrom != null) {
for (var7 = 0; var7 < this.recolorFrom.length; ++var7) {
var8.recolor(this.recolorFrom[var7], this.recolorTo[var7]);
}
}
if (this.retextureFrom != null) { // L: 385
for (var7 = 0; var7 < this.retextureFrom.length; ++var7) { // L: 386
var8.retexture(this.retextureFrom[var7], this.retextureTo[var7]); // L: 387
if (this.retextureFrom != null) {
for (var7 = 0; var7 < this.retextureFrom.length; ++var7) {
var8.retexture(this.retextureFrom[var7], this.retextureTo[var7]);
}
}
if (var4) { // L: 390
if (var4) {
var8.resize(this.modelSizeX, this.modelHeight, this.modelSizeY);
}
if (var11) { // L: 391
if (var11) {
var8.changeOffset(this.offsetX, this.offsetHeight, this.offsetY);
}
return var8; // L: 392
return var8;
}
@ObfuscatedName("v")
@@ -848,21 +848,21 @@ public class ObjectComposition extends DualNode {
)
@Export("transform")
public final ObjectComposition transform() {
int var1 = -1; // L: 396
if (this.transformVarbit != -1) { // L: 397
int var1 = -1;
if (this.transformVarbit != -1) {
var1 = class273.getVarbit(this.transformVarbit);
} else if (this.transformVarp != -1) { // L: 398
} else if (this.transformVarp != -1) {
var1 = Varps.Varps_main[this.transformVarp];
}
int var2;
if (var1 >= 0 && var1 < this.transforms.length - 1) { // L: 400
var2 = this.transforms[var1]; // L: 401
if (var1 >= 0 && var1 < this.transforms.length - 1) {
var2 = this.transforms[var1];
} else {
var2 = this.transforms[this.transforms.length - 1];
}
return var2 != -1 ? class148.getObjectDefinition(var2) : null; // L: 402 403
return var2 != -1 ? class148.getObjectDefinition(var2) : null;
}
@ObfuscatedName("d")
@@ -872,7 +872,7 @@ public class ObjectComposition extends DualNode {
)
@Export("getIntParam")
public int getIntParam(int var1, int var2) {
return class12.method158(this.params, var1, var2); // L: 407
return class12.method158(this.params, var1, var2);
}
@ObfuscatedName("h")
@@ -882,7 +882,7 @@ public class ObjectComposition extends DualNode {
)
@Export("getStringParam")
public String getStringParam(int var1, String var2) {
return Skeleton.method3948(this.params, var1, var2); // L: 411
return Skeleton.method3948(this.params, var1, var2);
}
@ObfuscatedName("e")
@@ -892,19 +892,19 @@ public class ObjectComposition extends DualNode {
)
@Export("hasSound")
public boolean hasSound() {
if (this.transforms == null) { // L: 422
if (this.transforms == null) {
return this.ambientSoundId != -1 || this.soundEffectIds != null;
} else {
for (int var1 = 0; var1 < this.transforms.length; ++var1) { // L: 423
if (this.transforms[var1] != -1) { // L: 424
ObjectComposition var2 = class148.getObjectDefinition(this.transforms[var1]); // L: 425
if (var2.ambientSoundId != -1 || var2.soundEffectIds != null) { // L: 426
for (int var1 = 0; var1 < this.transforms.length; ++var1) {
if (this.transforms[var1] != -1) {
ObjectComposition var2 = class148.getObjectDefinition(this.transforms[var1]);
if (var2.ambientSoundId != -1 || var2.soundEffectIds != null) {
return true;
}
}
}
return false; // L: 429
return false;
}
}
@@ -914,13 +914,13 @@ public class ObjectComposition extends DualNode {
garbageValue = "109672406"
)
static void method3540() {
for (ObjectSound var0 = (ObjectSound)ObjectSound.objectSounds.last(); var0 != null; var0 = (ObjectSound)ObjectSound.objectSounds.previous()) { // L: 44
if (var0.obj != null) { // L: 45
for (ObjectSound var0 = (ObjectSound)ObjectSound.objectSounds.last(); var0 != null; var0 = (ObjectSound)ObjectSound.objectSounds.previous()) {
if (var0.obj != null) {
var0.set();
}
}
} // L: 47
}
@ObfuscatedName("w")
@ObfuscatedSignature(
@@ -928,8 +928,8 @@ public class ObjectComposition extends DualNode {
garbageValue = "768656808"
)
public static void method3542() {
StructComposition.StructDefinition_cached.clear(); // L: 57
} // L: 58
StructComposition.StructDefinition_cached.clear();
}
@ObfuscatedName("lt")
@ObfuscatedSignature(
@@ -937,19 +937,19 @@ public class ObjectComposition extends DualNode {
garbageValue = "1543317182"
)
static void method3541(Buffer var0, int var1) {
byte[] var2 = var0.array; // L: 12644
if (Client.randomDatData == null) { // L: 12646
byte[] var2 = var0.array;
if (Client.randomDatData == null) {
Client.randomDatData = new byte[24];
}
class333.writeRandomDat(var2, var1, Client.randomDatData, 0, 24); // L: 12647
if (JagexCache.JagexCache_randomDat != null) { // L: 12650
class333.writeRandomDat(var2, var1, Client.randomDatData, 0, 24);
if (JagexCache.JagexCache_randomDat != null) {
try {
JagexCache.JagexCache_randomDat.seek(0L); // L: 12652
JagexCache.JagexCache_randomDat.write(var0.array, var1, 24); // L: 12653
} catch (Exception var4) { // L: 12655
JagexCache.JagexCache_randomDat.seek(0L);
JagexCache.JagexCache_randomDat.write(var0.array, var1, 24);
} catch (Exception var4) {
}
}
} // L: 12658
}
}