/*-------------------------------------------------------------------*/
/*-------------------------------------------------------------------*/
private Model processModel()
{
Model result = null;
int value = 0;
result = new Model();
// process model index
if((bitmask & 0x00000800) != 0) {
value = (int)data[offset];
if(value < 0) value = value + 256;
result.setIndex(0, value);
offset = offset + 1;
}
else result.setIndex(0, 0);
if((bitmask & 0x00100000) != 0) {
value = (int)data[offset];
if(value < 0) value = value + 256;
result.setIndex(1, value);
offset = offset + 1;
}
else result.setIndex(1, 0);
if((bitmask & 0x00200000) != 0) {
value = (int)data[offset];
if(value < 0) value = value + 256;
result.setIndex(2, value);
offset = offset + 1;
}
else result.setIndex(2, 0);
if((bitmask & 0x00400000) != 0) {
value = (int)data[offset];
if(value < 0) value = value + 256;
result.setIndex(3, value);
offset = offset + 1;
}
else result.setIndex(3, 0);
// process model frame
result.setFrame(0);
if((bitmask & 0x00000010) != 0) {
value = (int)data[offset];
if(value < 0) value = value + 256;
result.setFrame(value);
offset = offset + 1;
}
if((bitmask & 0x00020000) != 0) {
result.setFrame((int)(Utils.shortValue(data, offset)));
offset = offset + 2;
}
// process model skin
if((bitmask & 0x00010000) != 0) {
if((bitmask & 0x02000000) != 0) {
result.setSkin((int)(Utils.intValue(data, offset)));
offset = offset + 4;
}
else {
value = (int)data[offset];
if(value < 0) value = value + 256;
result.setSkin(value);
offset = offset + 1;
}
}
else if((bitmask & 0x02000000) != 0) {
result.setSkin((int)(Utils.shortValue(data, offset)));
offset = offset + 2;
}
return result;
}