Originally Posted by
A Mage
I had a similar issue but sorted my read values and not having any issues now.
What errors are you getting?
No errors thats the weird part
current readvalues:
Code:
private void decode(Stream buffer) {
while(true) {
final int opcode = buffer.readUnsignedByte();
if (opcode == 0) {
return;
} else if (opcode == 1) {
modelId = buffer.readUnsignedWord();
} else if (opcode == 2) {
animationId = buffer.readUnsignedWord();
if (Animation.anims != null)
animation = Animation.anims[animationId];
} else if (opcode == 4) {
resizeX = buffer.readUnsignedWord();
} else if (opcode == 5) {
resizeY = buffer.readUnsignedWord();
} else if (opcode == 6) {
rotation = buffer.readUnsignedWord();
} else if (opcode == 7) {
ambience = buffer.readUnsignedByte();
} else if (opcode == 8) {
contrast = buffer.readUnsignedByte();
} else if (opcode == 40) {
int len = buffer.readUnsignedByte();
colorToFind = new int[len];
colorToReplace = new int[len];
for (int i = 0; i < len; i++) {
colorToFind[i] = buffer.readUnsignedWord();
colorToReplace[i] = buffer.readUnsignedWord();
}
} else if (opcode == 41) { // re-texture
int len = buffer.readUnsignedByte();
for (int i = 0; i < len; i++) {
buffer.readUnsignedWord();
buffer.readUnsignedWord();
}
} else {
System.out.println("gfx invalid opcode: " + opcode);
}
}
}