--- ray/src/common/rglsrc.c 1998/06/09 11:18:36 3.1 +++ ray/src/common/rglsrc.c 2003/11/14 17:22:06 3.6 @@ -1,13 +1,12 @@ -/* Copyright (c) 1998 Silicon Graphics, Inc. */ - #ifndef lint -static char SCCSid[] = "$SunId$ SGI"; +static const char RCSid[] = "$Id: rglsrc.c,v 3.6 2003/11/14 17:22:06 schorsch Exp $"; #endif - /* * Routines for handling OpenGL light sources */ +#include "copyright.h" + #include "radogl.h" double expval = 0.; /* global exposure value */ @@ -16,7 +15,7 @@ COLOR ambval = {0.2, 0.2, 0.2}; /* global ambient valu int dolights = MAXLIGHTS; /* do how many more light sources? */ -static int lightid[MAXLIGHTS] = {GL_LIGHT0, GL_LIGHT1, GL_LIGHT2, +int glightid[MAXLIGHTS] = {GL_LIGHT0, GL_LIGHT1, GL_LIGHT2, GL_LIGHT3, GL_LIGHT4, GL_LIGHT5, GL_LIGHT6, GL_LIGHT7}; static int lightlist; /* light list id */ @@ -37,13 +36,13 @@ static struct { static int nlights; /* number of defined lights */ -static int l_flatsrc(), l_spheresrc(), l_source(); +static void l_flatsrc(int), l_sphsrc(int), l_source(int); +void lightinit() /* initialize lighting */ { GLfloat ambv[4]; - register int i; if (!dolights) return; @@ -61,6 +60,7 @@ lightinit() /* initialize lighting */ } +void lightclean() /* clean up light source commands */ { if ((dolights += nlights) <= 0) @@ -69,10 +69,9 @@ lightclean() /* clean up light source commands */ } +void lightdefs() /* define light source list */ { - register int i; - if (!nlights) return; glNewList(lightlist, GL_COMPILE); @@ -98,6 +97,7 @@ lightdefs() /* define light source list */ } +int o_source(o) /* record a distant source */ register OBJREC *o; { @@ -158,12 +158,12 @@ double area; } -static +static void l_source(n) /* convert a distant source */ register int n; { register MATREC *m = lightrec[n].m; - int thislight = lightid[n]; + int thislight = glightid[n]; GLfloat vec[4]; /* assign direction */ VCOPY(vec, lightrec[n].pos); @@ -182,13 +182,13 @@ register int n; } -static +static void l_flatsrc(n) /* convert a flat source */ register int n; { GLfloat vec[4]; register MATREC *m = lightrec[n].m; - int thislight = lightid[n]; + int thislight = glightid[n]; /* assign position */ VCOPY(vec, lightrec[n].pos); vec[3] = 1.; glLightfv(thislight, GL_POSITION, vec); @@ -217,13 +217,13 @@ register int n; } -static +static void l_sphsrc(n) /* convert a spherical source */ register int n; { GLfloat vec[4]; register MATREC *m = lightrec[n].m; - int thislight = lightid[n]; + int thislight = glightid[n]; /* assign position */ VCOPY(vec, lightrec[n].pos); vec[3] = 1.; glLightfv(thislight, GL_POSITION, vec);