Fix frame buffer bounds and access errors

This commit is contained in:
Magnus Norddahl 2016-11-08 15:27:45 +01:00
parent cb4b74e0c3
commit 6620d99fbb
2 changed files with 5 additions and 4 deletions

View file

@ -67,6 +67,7 @@ void RenderPolyBsp::Render()
RenderSubsector(*it);
RenderPlayerSprites();
DrawerCommandQueue::WaitForWorkers();
RenderScreenSprites(); // To do: should be called by FSoftwareRenderer::DrawRemainingPlayerSprites instead of here
}

View file

@ -425,7 +425,7 @@ void ScreenPolyTriangleDrawer::draw(const ScreenPolyTriangleDrawerArgs *args, Dr
for (int ix = x; ix < x + q; ix++)
{
bool visible = ix >= clipleft && ix <= clipright && (cliptop <= y + iy) && (clipbottom > y + iy);
bool visible = ix >= clipleft && ix < clipright && (cliptop <= y + iy) && (clipbottom > y + iy);
if (CX1 > 0 && CX2 > 0 && CX3 > 0 && visible)
{
@ -594,7 +594,7 @@ void ScreenPolyTriangleDrawer::fill(const ScreenPolyTriangleDrawerArgs *args, Dr
for (int ix = x; ix < x + q; ix++)
{
bool visible = ix >= clipleft && ix <= clipright && (cliptop <= y + iy) && (clipbottom > y + iy);
bool visible = ix >= clipleft && ix < clipright && (cliptop <= y + iy) && (clipbottom > y + iy);
if (CX1 > 0 && CX2 > 0 && CX3 > 0 && visible)
{
@ -819,7 +819,7 @@ void ScreenPolyTriangleDrawer::draw32(const ScreenPolyTriangleDrawerArgs *args,
for (int ix = x; ix < x + q; ix++)
{
bool visible = ix >= clipleft && ix <= clipright && (cliptop <= y + iy) && (clipbottom > y + iy);
bool visible = ix >= clipleft && ix < clipright && (cliptop <= y + iy) && (clipbottom > y + iy);
if (CX1 > 0 && CX2 > 0 && CX3 > 0 && visible)
{
@ -995,7 +995,7 @@ void ScreenPolyTriangleDrawer::fill32(const ScreenPolyTriangleDrawerArgs *args,
for (int ix = x; ix < x + q; ix++)
{
bool visible = ix >= clipleft && ix <= clipright && (cliptop <= y + iy) && (clipbottom > y + iy);
bool visible = ix >= clipleft && ix < clipright && (cliptop <= y + iy) && (clipbottom > y + iy);
if (CX1 > 0 && CX2 > 0 && CX3 > 0 && visible)
{