Fix color

(cherry picked from commit faa8fc2917e6c24bc3785facecf35ae29a3176b5)
This commit is contained in:
Francisco Javier Trujillo Mata 2024-01-28 00:23:16 +01:00 committed by Sam Lantinga
parent 23cf7a2e0d
commit 4436c09c9d

View file

@ -208,10 +208,10 @@ static int PS2_QueueDrawPoints(SDL_Renderer *renderer, SDL_RenderCommand *cmd, c
cmd->data.draw.count = count;
colorR = cmd->data.draw.r >> 1;
colorG = cmd->data.draw.g >> 1;
colorB = cmd->data.draw.b >> 1;
colorA = cmd->data.draw.a >> 1;
colorR = cmd->data.draw.r;
colorG = cmd->data.draw.g;
colorB = cmd->data.draw.b;
colorA = cmd->data.draw.a;
rgbaq = color_to_RGBAQ(colorR, colorG, colorB, colorA, 0.0f);
for (i = 0; i < count; i++, vertices++, points++) {
@ -261,7 +261,7 @@ static int PS2_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL
uv_ = (float *)((char *)uv + j * uv_stride);
vertices->xyz2 = vertex_to_XYZ2(data->gsGlobal, xy_[0] * scale_x, xy_[1] * scale_y, 0);
vertices->rgbaq = color_to_RGBAQ(col_.r >> 1, col_.g >> 1, col_.b >> 1, col_.a >> 1, 0);
vertices->rgbaq = color_to_RGBAQ(col_.r, col_.g, col_.b, col_.a, 0);
vertices->uv = vertex_to_UV(ps2_tex, uv_[0] * ps2_tex->Width, uv_[1] * ps2_tex->Height);
vertices++;
@ -292,7 +292,7 @@ static int PS2_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL
col_ = *(SDL_Color *)((char *)color + j * color_stride);
vertices->xyz2 = vertex_to_XYZ2(data->gsGlobal, xy_[0] * scale_x, xy_[1] * scale_y, 0);
vertices->rgbaq = color_to_RGBAQ(col_.r >> 1, col_.g >> 1, col_.b >> 1, col_.a >> 1, 0.0f);
vertices->rgbaq = color_to_RGBAQ(col_.r, col_.g, col_.b, col_.a, 0.0f);
vertices++;
}
@ -333,10 +333,10 @@ static int PS2_RenderSetDrawColor(SDL_Renderer *renderer, SDL_RenderCommand *cmd
PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata;
colorR = (cmd->data.color.r) >> 1;
colorG = (cmd->data.color.g) >> 1;
colorB = (cmd->data.color.b) >> 1;
colorA = (cmd->data.color.a) >> 1;
colorR = (cmd->data.color.r);
colorG = (cmd->data.color.g);
colorB = (cmd->data.color.b);
colorA = (cmd->data.color.a);
data->drawColor = GS_SETREG_RGBAQ(colorR, colorG, colorB, colorA, 0x00);
return 0;
}
@ -347,10 +347,10 @@ static int PS2_RenderClear(SDL_Renderer *renderer, SDL_RenderCommand *cmd)
PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata;
colorR = (cmd->data.color.r) >> 1;
colorG = (cmd->data.color.g) >> 1;
colorB = (cmd->data.color.b) >> 1;
colorA = (cmd->data.color.a) >> 1;
colorR = (cmd->data.color.r);
colorG = (cmd->data.color.g);
colorB = (cmd->data.color.b);
colorA = (cmd->data.color.a);
gsKit_clear(data->gsGlobal, GS_SETREG_RGBAQ(colorR, colorG, colorB, colorA, 0x00));
return 0;