|
@@ -683,10 +683,10 @@ static int PSP_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL
|
|
|
verts->y = xy_[1] * scale_y;
|
|
|
verts->z = 0;
|
|
|
|
|
|
- verts->col.r = (Uint8)(col_->r * 255.0f);
|
|
|
- verts->col.g = (Uint8)(col_->g * 255.0f);
|
|
|
- verts->col.b = (Uint8)(col_->b * 255.0f);
|
|
|
- verts->col.a = (Uint8)(col_->a * 255.0f);
|
|
|
+ verts->col.r = (Uint8)SDL_roundf(col_->r * 255.0f);
|
|
|
+ verts->col.g = (Uint8)SDL_roundf(col_->g * 255.0f);
|
|
|
+ verts->col.b = (Uint8)SDL_roundf(col_->b * 255.0f);
|
|
|
+ verts->col.a = (Uint8)SDL_roundf(col_->a * 255.0f);
|
|
|
|
|
|
verts++;
|
|
|
}
|
|
@@ -722,10 +722,10 @@ static int PSP_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL
|
|
|
verts->y = xy_[1] * scale_y;
|
|
|
verts->z = 0;
|
|
|
|
|
|
- verts->col.r = (Uint8)(col_->r * 255.0f);
|
|
|
- verts->col.g = (Uint8)(col_->g * 255.0f);
|
|
|
- verts->col.b = (Uint8)(col_->b * 255.0f);
|
|
|
- verts->col.a = (Uint8)(col_->a * 255.0f);
|
|
|
+ verts->col.r = (Uint8)SDL_roundf(col_->r * 255.0f);
|
|
|
+ verts->col.g = (Uint8)SDL_roundf(col_->g * 255.0f);
|
|
|
+ verts->col.b = (Uint8)SDL_roundf(col_->b * 255.0f);
|
|
|
+ verts->col.a = (Uint8)SDL_roundf(col_->a * 255.0f);
|
|
|
|
|
|
verts->u = uv_[0] * psp_texture->textureWidth;
|
|
|
verts->v = uv_[1] * psp_texture->textureHeight;
|
|
@@ -1080,10 +1080,10 @@ static int PSP_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, v
|
|
|
|
|
|
case SDL_RENDERCMD_CLEAR:
|
|
|
{
|
|
|
- const Uint8 r = (Uint8)(cmd->data.color.color.r * 255.0f);
|
|
|
- const Uint8 g = (Uint8)(cmd->data.color.color.g * 255.0f);
|
|
|
- const Uint8 b = (Uint8)(cmd->data.color.color.b * 255.0f);
|
|
|
- const Uint8 a = (Uint8)(cmd->data.color.color.a * 255.0f);
|
|
|
+ const Uint8 r = (Uint8)SDL_roundf(cmd->data.color.color.r * 255.0f);
|
|
|
+ const Uint8 g = (Uint8)SDL_roundf(cmd->data.color.color.g * 255.0f);
|
|
|
+ const Uint8 b = (Uint8)SDL_roundf(cmd->data.color.color.b * 255.0f);
|
|
|
+ const Uint8 a = (Uint8)SDL_roundf(cmd->data.color.color.a * 255.0f);
|
|
|
sceGuClearColor(GU_RGBA(r, g, b, a));
|
|
|
sceGuClearStencil(a);
|
|
|
sceGuClear(GU_COLOR_BUFFER_BIT | GU_STENCIL_BUFFER_BIT);
|
|
@@ -1094,10 +1094,10 @@ static int PSP_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, v
|
|
|
{
|
|
|
const size_t count = cmd->data.draw.count;
|
|
|
const VertV *verts = (VertV *)(gpumem + cmd->data.draw.first);
|
|
|
- const Uint8 r = (Uint8)(cmd->data.draw.color.r * 255.0f);
|
|
|
- const Uint8 g = (Uint8)(cmd->data.draw.color.g * 255.0f);
|
|
|
- const Uint8 b = (Uint8)(cmd->data.draw.color.b * 255.0f);
|
|
|
- const Uint8 a = (Uint8)(cmd->data.draw.color.a * 255.0f);
|
|
|
+ const Uint8 r = (Uint8)SDL_roundf(cmd->data.draw.color.r * 255.0f);
|
|
|
+ const Uint8 g = (Uint8)SDL_roundf(cmd->data.draw.color.g * 255.0f);
|
|
|
+ const Uint8 b = (Uint8)SDL_roundf(cmd->data.draw.color.b * 255.0f);
|
|
|
+ const Uint8 a = (Uint8)SDL_roundf(cmd->data.draw.color.a * 255.0f);
|
|
|
PSP_BlendState state = {
|
|
|
.color = GU_RGBA(r, g, b, a),
|
|
|
.texture = NULL,
|
|
@@ -1113,10 +1113,10 @@ static int PSP_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, v
|
|
|
{
|
|
|
const size_t count = cmd->data.draw.count;
|
|
|
const VertV *verts = (VertV *)(gpumem + cmd->data.draw.first);
|
|
|
- const Uint8 r = (Uint8)(cmd->data.draw.color.r * 255.0f);
|
|
|
- const Uint8 g = (Uint8)(cmd->data.draw.color.g * 255.0f);
|
|
|
- const Uint8 b = (Uint8)(cmd->data.draw.color.b * 255.0f);
|
|
|
- const Uint8 a = (Uint8)(cmd->data.draw.color.a * 255.0f);
|
|
|
+ const Uint8 r = (Uint8)SDL_roundf(cmd->data.draw.color.r * 255.0f);
|
|
|
+ const Uint8 g = (Uint8)SDL_roundf(cmd->data.draw.color.g * 255.0f);
|
|
|
+ const Uint8 b = (Uint8)SDL_roundf(cmd->data.draw.color.b * 255.0f);
|
|
|
+ const Uint8 a = (Uint8)SDL_roundf(cmd->data.draw.color.a * 255.0f);
|
|
|
PSP_BlendState state = {
|
|
|
.color = GU_RGBA(r, g, b, a),
|
|
|
.texture = NULL,
|
|
@@ -1132,10 +1132,10 @@ static int PSP_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, v
|
|
|
{
|
|
|
const size_t count = cmd->data.draw.count;
|
|
|
const VertV *verts = (VertV *)(gpumem + cmd->data.draw.first);
|
|
|
- const Uint8 r = (Uint8)(cmd->data.draw.color.r * 255.0f);
|
|
|
- const Uint8 g = (Uint8)(cmd->data.draw.color.g * 255.0f);
|
|
|
- const Uint8 b = (Uint8)(cmd->data.draw.color.b * 255.0f);
|
|
|
- const Uint8 a = (Uint8)(cmd->data.draw.color.a * 255.0f);
|
|
|
+ const Uint8 r = (Uint8)SDL_roundf(cmd->data.draw.color.r * 255.0f);
|
|
|
+ const Uint8 g = (Uint8)SDL_roundf(cmd->data.draw.color.g * 255.0f);
|
|
|
+ const Uint8 b = (Uint8)SDL_roundf(cmd->data.draw.color.b * 255.0f);
|
|
|
+ const Uint8 a = (Uint8)SDL_roundf(cmd->data.draw.color.a * 255.0f);
|
|
|
PSP_BlendState state = {
|
|
|
.color = GU_RGBA(r, g, b, a),
|
|
|
.texture = NULL,
|
|
@@ -1151,10 +1151,10 @@ static int PSP_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, v
|
|
|
{
|
|
|
const size_t count = cmd->data.draw.count;
|
|
|
const VertTV *verts = (VertTV *)(gpumem + cmd->data.draw.first);
|
|
|
- const Uint8 a = (Uint8)(cmd->data.draw.color.a * 255.0f);
|
|
|
- const Uint8 r = (Uint8)(cmd->data.draw.color.r * 255.0f);
|
|
|
- const Uint8 g = (Uint8)(cmd->data.draw.color.g * 255.0f);
|
|
|
- const Uint8 b = (Uint8)(cmd->data.draw.color.b * 255.0f);
|
|
|
+ const Uint8 a = (Uint8)SDL_roundf(cmd->data.draw.color.a * 255.0f);
|
|
|
+ const Uint8 r = (Uint8)SDL_roundf(cmd->data.draw.color.r * 255.0f);
|
|
|
+ const Uint8 g = (Uint8)SDL_roundf(cmd->data.draw.color.g * 255.0f);
|
|
|
+ const Uint8 b = (Uint8)SDL_roundf(cmd->data.draw.color.b * 255.0f);
|
|
|
PSP_BlendState state = {
|
|
|
.color = GU_RGBA(r, g, b, a),
|
|
|
.texture = cmd->data.draw.texture,
|
|
@@ -1169,10 +1169,10 @@ static int PSP_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, v
|
|
|
case SDL_RENDERCMD_COPY_EX:
|
|
|
{
|
|
|
const VertTV *verts = (VertTV *)(gpumem + cmd->data.draw.first);
|
|
|
- const Uint8 a = (Uint8)(cmd->data.draw.color.a * 255.0f);
|
|
|
- const Uint8 r = (Uint8)(cmd->data.draw.color.r * 255.0f);
|
|
|
- const Uint8 g = (Uint8)(cmd->data.draw.color.g * 255.0f);
|
|
|
- const Uint8 b = (Uint8)(cmd->data.draw.color.b * 255.0f);
|
|
|
+ const Uint8 a = (Uint8)SDL_roundf(cmd->data.draw.color.a * 255.0f);
|
|
|
+ const Uint8 r = (Uint8)SDL_roundf(cmd->data.draw.color.r * 255.0f);
|
|
|
+ const Uint8 g = (Uint8)SDL_roundf(cmd->data.draw.color.g * 255.0f);
|
|
|
+ const Uint8 b = (Uint8)SDL_roundf(cmd->data.draw.color.b * 255.0f);
|
|
|
PSP_BlendState state = {
|
|
|
.color = GU_RGBA(r, g, b, a),
|
|
|
.texture = cmd->data.draw.texture,
|
|
@@ -1195,10 +1195,10 @@ static int PSP_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, v
|
|
|
sceGuEnable(GU_TEXTURE_2D);
|
|
|
} else {
|
|
|
const VertTCV *verts = (VertTCV *)(gpumem + cmd->data.draw.first);
|
|
|
- const Uint8 a = (Uint8)(cmd->data.draw.color.a * 255.0f);
|
|
|
- const Uint8 r = (Uint8)(cmd->data.draw.color.r * 255.0f);
|
|
|
- const Uint8 g = (Uint8)(cmd->data.draw.color.g * 255.0f);
|
|
|
- const Uint8 b = (Uint8)(cmd->data.draw.color.b * 255.0f);
|
|
|
+ const Uint8 a = (Uint8)SDL_roundf(cmd->data.draw.color.a * 255.0f);
|
|
|
+ const Uint8 r = (Uint8)SDL_roundf(cmd->data.draw.color.r * 255.0f);
|
|
|
+ const Uint8 g = (Uint8)SDL_roundf(cmd->data.draw.color.g * 255.0f);
|
|
|
+ const Uint8 b = (Uint8)SDL_roundf(cmd->data.draw.color.b * 255.0f);
|
|
|
PSP_BlendState state = {
|
|
|
.color = GU_RGBA(r, g, b, a),
|
|
|
.texture = NULL,
|