diff --git a/src/external/rlsw.h b/src/external/rlsw.h index 491e33996..c27fab8f9 100644 --- a/src/external/rlsw.h +++ b/src/external/rlsw.h @@ -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;