This commit is contained in:
Jaklyy 2023-12-25 19:24:35 -05:00
parent 4f3b99f5c4
commit bffc529c04

View File

@ -1760,7 +1760,6 @@ u16 SoftRenderer::BeginPushScanline(s32 y, s32 pixelstodraw)
// it seems to read in pairs of two every two cycles? looks jittery // it seems to read in pairs of two every two cycles? looks jittery
bool jitter = pixelstodraw % 2; bool jitter = pixelstodraw % 2;
// chcckme: + & - might be backwards
pixelstodraw += jitter; pixelstodraw += jitter;
start -= jitter; start -= jitter;
} }
@ -1822,7 +1821,7 @@ void SoftRenderer::RenderPolygons(GPU& gpu, Polygon** polygons, int npolys)
{ {
// check all events to find the earliest scheduled one // check all events to find the earliest scheduled one
nextevent = 0; nextevent = 0;
for (s32 i = 1; i < RasterEvents_MAX; i++) for (u8 i = 1; i < RasterEvents_MAX; i++)
{ {
if (rasterevents[i] < rasterevents[nextevent]) if (rasterevents[i] < rasterevents[nextevent])
nextevent = i; nextevent = i;
@ -1920,6 +1919,7 @@ void SoftRenderer::RenderPolygons(GPU& gpu, Polygon** polygons, int npolys)
} }
{ {
// if a scanline push might intersect a read determine the point at which it intersects
s32 pixelstopush = (scanlinespushed > scanlinesread ? 256 : (rasterevents[ScanlineRead] + (ScanlineReadInc*scanlineswaitingforread)) - rasterevents[PushScanline]); s32 pixelstopush = (scanlinespushed > scanlinesread ? 256 : (rasterevents[ScanlineRead] + (ScanlineReadInc*scanlineswaitingforread)) - rasterevents[PushScanline]);
leftovers = BeginPushScanline(scanlinespushed, pixelstopush); leftovers = BeginPushScanline(scanlinespushed, pixelstopush);
} }