Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/external/rlsw.h
Original file line number Diff line number Diff line change
Expand Up @@ -3909,7 +3909,6 @@ static void sw_immediate_set_color(const float color[4])
RLSW.primitive.color[2] = color[2];
RLSW.primitive.color[3] = color[3];

RLSW.primitive.hasColorAlpha |= (color[3] < 1.0f);
}

static void sw_immediate_set_texcoord(const float texcoord[2])
Expand Down Expand Up @@ -3948,6 +3947,9 @@ static void sw_immediate_push_vertex(const float position[4])
for (int i = 0; i < 4; i++) vertex->color[i] = RLSW.primitive.color[i];
for (int i = 0; i < 2; i++) vertex->texcoord[i] = RLSW.primitive.texcoord[i];

// Track whether any vertex in this primitive has alpha < 1.0
RLSW.primitive.hasColorAlpha |= (vertex->color[3] < 1.0f);
Comment on lines 3947 to +3951

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And while we're at it, we could also make the intent explicit, for example:

    // Track whether any vertex in this primitive has alpha < 1.0
    RLSW.primitive.hasColorAlpha |= (vertex->color[3] < 1.0f);


// Immediate rendering of the primitive if the required number is reached
if (RLSW.primitive.vertexCount == SW_PRIMITIVE_VERTEX_COUNT[RLSW.drawMode])
{
Expand Down