/*-------------------------------------------------------------------*/
/*-------------------------------------------------------------------*/
private Effects processEffects()
{
Effects result = null;
int effect = 0;
result = new Effects();
// process entity effects
if((bitmask & 0x00004000) != 0) {
if((bitmask & 0x00080000) != 0) {
result.setEffects((int)(Utils.intValue(data, offset)));
offset = offset + 4;
}
else {
effect = (int)data[offset];
if(effect < 0) effect = effect + 256;
result.setEffects(effect);
offset = offset + 1;
}
}
else if((bitmask & 0x00080000) != 0) {
result.setEffects((int)(Utils.shortValue(data, offset)));
offset = offset + 2;
}
// process render effects
if((bitmask & 0x00001000) != 0) {
if((bitmask & 0x00040000) != 0) {
result.setRenderEffects((int)(Utils.intValue(data, offset)));
offset = offset + 4;
}
else {
effect = (int)data[offset];
if(effect < 0) effect = effect + 256;
result.setRenderEffects(effect);
offset = offset + 1;
}
}
else if((bitmask & 0x00040000) != 0) {
result.setRenderEffects((int)(Utils.shortValue(data, offset)));
offset = offset + 2;
}
else result.setRenderEffects(0);
return result;
}