mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-23 05:35:36 +00:00
opengl: More work on making line drawing match software renderer.
This commit is contained in:
parent
8442754912
commit
b99543b682
|
@ -914,9 +914,9 @@ GL_QueueDrawLines(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPo
|
|||
const GLfloat yend = verts[3];
|
||||
|
||||
if (ystart == yend) { /* horizontal line */
|
||||
verts[2] += (xend > xstart) ? 1.0f : -1.0f;
|
||||
verts[(xend > xstart) ? 2 : 0] += 1.0f;
|
||||
} else if (xstart == xend) { /* vertical line */
|
||||
verts[3] += (yend > ystart) ? 1.0f : -1.0f;
|
||||
verts[(yend > ystart) ? 3 : 1] += 1.0f;
|
||||
} else { /* bump a pixel in the direction we are moving in. */
|
||||
const GLfloat deltax = xend - xstart;
|
||||
const GLfloat deltay = yend - ystart;
|
||||
|
|
|
@ -587,9 +587,9 @@ GLES_QueueDrawLines(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_F
|
|||
const GLfloat yend = verts[3];
|
||||
|
||||
if (ystart == yend) { /* horizontal line */
|
||||
verts[2] += (xend > xstart) ? 1.0f : -1.0f;
|
||||
verts[(xend > xstart) ? 2 : 0] += 1.0f;
|
||||
} else if (xstart == xend) { /* vertical line */
|
||||
verts[3] += (yend > ystart) ? 1.0f : -1.0f;
|
||||
verts[(yend > ystart) ? 3 : 1] += 1.0f;
|
||||
} else { /* bump a pixel in the direction we are moving in. */
|
||||
const GLfloat deltax = xend - xstart;
|
||||
const GLfloat deltay = yend - ystart;
|
||||
|
|
|
@ -811,9 +811,9 @@ GLES2_QueueDrawLines(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_
|
|||
const GLfloat yend = verts[3];
|
||||
|
||||
if (ystart == yend) { /* horizontal line */
|
||||
verts[2] += (xend > xstart) ? 1.0f : -1.0f;
|
||||
verts[(xend > xstart) ? 2 : 0] += 1.0f;
|
||||
} else if (xstart == xend) { /* vertical line */
|
||||
verts[3] += (yend > ystart) ? 1.0f : -1.0f;
|
||||
verts[(yend > ystart) ? 3 : 1] += 1.0f;
|
||||
} else { /* bump a pixel in the direction we are moving in. */
|
||||
const GLfloat deltax = xend - xstart;
|
||||
const GLfloat deltay = yend - ystart;
|
||||
|
|
Loading…
Reference in a new issue