setSpecularControl(state.getSeparateSpecular(), record);
}
for (int i = 0, max = state.getNumberOfChildren(); i < max; i++) {
final Light light = state.get(i);
LightRecord lr = record.getLightRecord(i);
// TODO: use the reference to get the lightrecord - rherlitz
if (lr == null) {
lr = new LightRecord();
record.setLightRecord(lr, i);
}
if (light == null) {
setSingleLightEnabled(false, i, record, lr);
} else {
if (light.isEnabled()) {
setLight(i, light, state, record, lr);
} else {
setSingleLightEnabled(false, i, record, lr);
}
}
}
// disable lights at and above the max count in this state
for (int i = state.getNumberOfChildren(); i < LightState.MAX_LIGHTS_ALLOWED; i++) {
LightRecord lr = record.getLightRecord(i);
if (lr == null) {
lr = new LightRecord();
record.setLightRecord(lr, i);
}
setSingleLightEnabled(false, i, record, lr);
}