added origin to mapper parameters
This commit is contained in:
@@ -39,10 +39,12 @@ namespace UwU {
|
||||
|
||||
Helpers::bresenham(0, xl0, y1 - y0, xl1, LeftBound);
|
||||
Helpers::bresenham(0, xr0, y1 - y0, xr1, RightBound);
|
||||
|
||||
uint16_t x0 = std::min(xl0, xl1);
|
||||
|
||||
for (uint16_t i = 0; i < height; i++) {
|
||||
for (uint16_t x = LeftBound[i]; x <= RightBound[i]; x++) {
|
||||
Coord2 uv = mapper.map(x, i + y0);
|
||||
Coord2 uv = mapper.map(x0, y0, x, i + y0);
|
||||
buffer.drawPixel(x, i + y0, shader.shade(uv.x, uv.y));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user