mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 01:44:06 -04:00
minor api reduction
This commit is contained in:
parent
6e67368d89
commit
acedeeceff
@ -8,23 +8,7 @@ static inline float clampf(float a,float min,float max)
|
||||
else return a;
|
||||
}
|
||||
|
||||
void gl_enable_disable_light(GLContext *c,int light,int v)
|
||||
{
|
||||
GLLight *l=&c->lights[light];
|
||||
if (v && !l->enabled) {
|
||||
l->enabled=1;
|
||||
l->next=c->first_light;
|
||||
c->first_light=l;
|
||||
l->prev=NULL;
|
||||
} else if (!v && l->enabled) {
|
||||
l->enabled=0;
|
||||
if (l->prev == NULL) c->first_light=l->next;
|
||||
else l->prev->next=l->next;
|
||||
if (l->next != NULL) l->next->prev=l->prev;
|
||||
}
|
||||
}
|
||||
|
||||
/* non optimized lightening model */
|
||||
/* non optimized lighting model */
|
||||
void gl_shade_vertex(GLContext *c,GLVertex *v)
|
||||
{
|
||||
float R,G,B,A;
|
||||
|
@ -1643,7 +1643,6 @@ do_issue_light() {
|
||||
GLLight *gl_light = _c->first_light;
|
||||
while (gl_light != (GLLight *)NULL) {
|
||||
GLLight *next = gl_light->next;
|
||||
gl_light->enabled = false;
|
||||
gl_light->next = NULL;
|
||||
gl_light = next;
|
||||
}
|
||||
@ -1675,7 +1674,6 @@ do_issue_light() {
|
||||
nassertv(num_enabled < MAX_LIGHTS);
|
||||
GLLight *gl_light = &_c->lights[num_enabled];
|
||||
memset(gl_light, 0, sizeof(GLLight));
|
||||
gl_light->enabled = true;
|
||||
|
||||
gl_light->next = _c->first_light;
|
||||
_c->first_light = gl_light;
|
||||
|
@ -59,9 +59,7 @@ typedef struct GLLight {
|
||||
float cos_spot_cutoff;
|
||||
V3 norm_spot_direction;
|
||||
V3 norm_position;
|
||||
/* we use a linked list to know which are the enabled lights */
|
||||
int enabled;
|
||||
struct GLLight *next,*prev;
|
||||
struct GLLight *next;
|
||||
} GLLight;
|
||||
|
||||
typedef struct GLMaterial {
|
||||
@ -125,13 +123,6 @@ typedef struct GLTexture {
|
||||
int s_max, t_max;
|
||||
} GLTexture;
|
||||
|
||||
/* shared state */
|
||||
|
||||
typedef struct GLSharedState {
|
||||
GLList **lists;
|
||||
GLTexture **texture_hash_table;
|
||||
} GLSharedState;
|
||||
|
||||
struct GLContext;
|
||||
|
||||
typedef void (*gl_draw_triangle_func)(struct GLContext *c,
|
||||
|
Loading…
x
Reference in New Issue
Block a user