#include #include #include int nLights = 0; LIGHT *lights; COLOR ambient; void SetAmbient(COLOR c) { ambient = c; } void AddLight(LIGHT light) { if(nLights == 0) lights = malloc(sizeof(LIGHT)); else lights = realloc(lights, sizeof(LIGHT)*(nLights+1)); lights[nLights] = light; nLights++; } void ResetLights() { if(nLights > 0) { free(lights); nLights = 0; } }