fix pixel origin in line rasterization
my bad, an oversight in my previous fix. This offset should have been moved here rather than per pixel during truncation.
This commit is contained in:
parent
fd6fdcce91
commit
7ac973b4b8
9
src/external/rlsw.h
vendored
9
src/external/rlsw.h
vendored
|
|
@ -5749,10 +5749,11 @@ static void SW_RASTER_QUAD(const sw_vertex_t *a, const sw_vertex_t *b,
|
||||||
|
|
||||||
static void SW_RASTER_LINE(const sw_vertex_t *v0, const sw_vertex_t *v1)
|
static void SW_RASTER_LINE(const sw_vertex_t *v0, const sw_vertex_t *v1)
|
||||||
{
|
{
|
||||||
float x0 = v0->screen[0];
|
// Convert from pixel-center convention (n+0.5) to pixel-origin convention (n)
|
||||||
float y0 = v0->screen[1];
|
float x0 = v0->screen[0] - 0.5f;
|
||||||
float x1 = v1->screen[0];
|
float y0 = v0->screen[1] - 0.5f;
|
||||||
float y1 = v1->screen[1];
|
float x1 = v1->screen[0] - 0.5f;
|
||||||
|
float y1 = v1->screen[1] - 0.5f;
|
||||||
|
|
||||||
float dx = x1 - x0;
|
float dx = x1 - x0;
|
||||||
float dy = y1 - y0;
|
float dy = y1 - y0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user