TinyGL: Fix enabling of lights. Fix #393
This commit is contained in:
parent
576dc6459f
commit
f1f1b32490
1 changed files with 12 additions and 8 deletions
|
@ -169,9 +169,13 @@ void gl_enable_disable_light(GLContext *c, int light, int v) {
|
|||
GLLight *l = &c->lights[light];
|
||||
if (v && !l->enabled) {
|
||||
l->enabled = 1;
|
||||
if (c->first_light != l) {
|
||||
l->next = c->first_light;
|
||||
if (c->first_light)
|
||||
c->first_light->prev = l;
|
||||
c->first_light = l;
|
||||
l->prev = NULL;
|
||||
}
|
||||
} else if (!v && l->enabled) {
|
||||
l->enabled = 0;
|
||||
if (!l->prev)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue