mirror of https://github.com/encounter/SDL.git
Remove FillRects from back-end, where RenderGeometry can be used
This commit is contained in:
parent
f02ad2820f
commit
79732c9d1e
|
@ -2388,7 +2388,6 @@ D3D11_CreateRenderer(SDL_Window * window, Uint32 flags)
|
||||||
renderer->QueueSetDrawColor = D3D11_QueueSetViewport; /* SetViewport and SetDrawColor are (currently) no-ops. */
|
renderer->QueueSetDrawColor = D3D11_QueueSetViewport; /* SetViewport and SetDrawColor are (currently) no-ops. */
|
||||||
renderer->QueueDrawPoints = D3D11_QueueDrawPoints;
|
renderer->QueueDrawPoints = D3D11_QueueDrawPoints;
|
||||||
renderer->QueueDrawLines = D3D11_QueueDrawPoints; /* lines and points queue vertices the same way. */
|
renderer->QueueDrawLines = D3D11_QueueDrawPoints; /* lines and points queue vertices the same way. */
|
||||||
renderer->QueueFillRects = D3D11_QueueFillRects;
|
|
||||||
renderer->QueueGeometry = D3D11_QueueGeometry;
|
renderer->QueueGeometry = D3D11_QueueGeometry;
|
||||||
renderer->RunCommandQueue = D3D11_RunCommandQueue;
|
renderer->RunCommandQueue = D3D11_RunCommandQueue;
|
||||||
renderer->RenderReadPixels = D3D11_RenderReadPixels;
|
renderer->RenderReadPixels = D3D11_RenderReadPixels;
|
||||||
|
|
|
@ -93,8 +93,6 @@ static int VITA_GXM_RenderDrawPoints(SDL_Renderer *renderer, const SDL_RenderCom
|
||||||
|
|
||||||
static int VITA_GXM_RenderDrawLines(SDL_Renderer *renderer, const SDL_RenderCommand *cmd);
|
static int VITA_GXM_RenderDrawLines(SDL_Renderer *renderer, const SDL_RenderCommand *cmd);
|
||||||
|
|
||||||
static int VITA_GXM_QueueFillRects(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FRect * rects, int count);
|
|
||||||
|
|
||||||
static int VITA_GXM_RenderFillRects(SDL_Renderer *renderer, const SDL_RenderCommand *cmd);
|
static int VITA_GXM_RenderFillRects(SDL_Renderer *renderer, const SDL_RenderCommand *cmd);
|
||||||
|
|
||||||
|
|
||||||
|
@ -244,7 +242,6 @@ VITA_GXM_CreateRenderer(SDL_Window *window, Uint32 flags)
|
||||||
renderer->QueueSetDrawColor = VITA_GXM_QueueSetDrawColor;
|
renderer->QueueSetDrawColor = VITA_GXM_QueueSetDrawColor;
|
||||||
renderer->QueueDrawPoints = VITA_GXM_QueueDrawPoints;
|
renderer->QueueDrawPoints = VITA_GXM_QueueDrawPoints;
|
||||||
renderer->QueueDrawLines = VITA_GXM_QueueDrawLines;
|
renderer->QueueDrawLines = VITA_GXM_QueueDrawLines;
|
||||||
renderer->QueueFillRects = VITA_GXM_QueueFillRects;
|
|
||||||
renderer->QueueGeometry = VITA_GXM_QueueGeometry;
|
renderer->QueueGeometry = VITA_GXM_QueueGeometry;
|
||||||
renderer->RunCommandQueue = VITA_GXM_RunCommandQueue;
|
renderer->RunCommandQueue = VITA_GXM_RunCommandQueue;
|
||||||
renderer->RenderReadPixels = VITA_GXM_RenderReadPixels;
|
renderer->RenderReadPixels = VITA_GXM_RenderReadPixels;
|
||||||
|
@ -509,47 +506,6 @@ VITA_GXM_QueueDrawLines(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const S
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
VITA_GXM_QueueFillRects(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FRect * rects, int count)
|
|
||||||
{
|
|
||||||
int color;
|
|
||||||
color_vertex *vertices;
|
|
||||||
VITA_GXM_RenderData *data = (VITA_GXM_RenderData *) renderer->driverdata;
|
|
||||||
|
|
||||||
cmd->data.draw.count = count;
|
|
||||||
color = data->drawstate.color;
|
|
||||||
|
|
||||||
vertices = (color_vertex *)pool_memalign(
|
|
||||||
data,
|
|
||||||
4 * count * sizeof(color_vertex), // 4 vertices * count
|
|
||||||
sizeof(color_vertex));
|
|
||||||
|
|
||||||
for (int i =0; i < count; i++)
|
|
||||||
{
|
|
||||||
const SDL_FRect *rect = &rects[i];
|
|
||||||
|
|
||||||
vertices[4*i+0].x = rect->x;
|
|
||||||
vertices[4*i+0].y = rect->y;
|
|
||||||
vertices[4*i+0].color = color;
|
|
||||||
|
|
||||||
vertices[4*i+1].x = rect->x + rect->w;
|
|
||||||
vertices[4*i+1].y = rect->y;
|
|
||||||
vertices[4*i+1].color = color;
|
|
||||||
|
|
||||||
vertices[4*i+2].x = rect->x;
|
|
||||||
vertices[4*i+2].y = rect->y + rect->h;
|
|
||||||
vertices[4*i+2].color = color;
|
|
||||||
|
|
||||||
vertices[4*i+3].x = rect->x + rect->w;
|
|
||||||
vertices[4*i+3].y = rect->y + rect->h;
|
|
||||||
vertices[4*i+3].color = color;
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd->data.draw.first = (size_t)vertices;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
VITA_GXM_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture,
|
VITA_GXM_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture,
|
||||||
const float *xy, int xy_stride, const int *color, int color_stride, const float *uv, int uv_stride,
|
const float *xy, int xy_stride, const int *color, int color_stride, const float *uv, int uv_stride,
|
||||||
|
@ -887,11 +843,8 @@ VITA_GXM_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case SDL_RENDERCMD_FILL_RECTS: {
|
case SDL_RENDERCMD_FILL_RECTS: /* unused */
|
||||||
SetDrawState(data, cmd);
|
|
||||||
VITA_GXM_RenderFillRects(renderer, cmd);
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
case SDL_RENDERCMD_COPY: /* unused */
|
case SDL_RENDERCMD_COPY: /* unused */
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue