check whether vertex colors should be interpolated
This commit is contained in:
parent
d5e66da17c
commit
93f273bf84
1 changed files with 12 additions and 1 deletions
13
src/external/rlsw.h
vendored
13
src/external/rlsw.h
vendored
|
|
@ -3783,7 +3783,6 @@ static void sw_immediate_set_color(const float color[4])
|
|||
RLSW.primitive.color[1] = color[1];
|
||||
RLSW.primitive.color[2] = color[2];
|
||||
RLSW.primitive.color[3] = color[3];
|
||||
|
||||
}
|
||||
|
||||
static void sw_immediate_set_texcoord(const float texcoord[2])
|
||||
|
|
@ -3840,6 +3839,18 @@ static void sw_immediate_push_vertex(const float position[4])
|
|||
}
|
||||
}
|
||||
|
||||
// Determine whether colors should be interpolated
|
||||
const float *ref = RLSW.primitive.buffer[0].color;
|
||||
for (int i = 1; i < RLSW.primitive.vertexCount; ++i)
|
||||
{
|
||||
const float *c = RLSW.primitive.buffer[i].color;
|
||||
if (c[0] != ref[0] || c[1] != ref[1] || c[2] != ref[2] || c[3] != ref[3])
|
||||
{
|
||||
state |= SW_STATE_COLOR_INTERP;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch (RLSW.polyMode)
|
||||
{
|
||||
case SW_FILL: sw_poly_fill_render(state); break;
|
||||
|
|
|
|||
Loading…
Reference in a new issue