Skip to content

Commit

Permalink
Revert "WIP"
Browse files Browse the repository at this point in the history
This reverts commit 4ece0cc.
  • Loading branch information
TheFakeMontyOnTheRun committed Aug 13, 2023
1 parent 4ece0cc commit 6c0b7f3
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions mx_frontend/base3d/src/CRenderer_Rasterization.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,15 +338,10 @@ void drawWall(FixP_t x0,
}

if (iy < 0) {
FixP_t diff = -y0;
int32_t iv = fixToInt(v);
lastV = iv;
v += Mul(diff, dv);
iv = fixToInt(v);
destinationLine += -iy * (XRES_FRAMEBUFFER);
iy = 0;
pixel = *(lineOffset);
lineOffset = ((iv & (NATIVE_TEXTURE_SIZE - 1)) + sourceLineStart);
FixP_t diff = intToFix((-iy));
v += Mul(diff, dv);
destinationLine += -iy * (XRES_FRAMEBUFFER);
iy = 0;
}

stipple = (((ix + iy) & 1)) ? 0xFFFFFFFF : 0;
Expand All @@ -358,6 +353,7 @@ void drawWall(FixP_t x0,
stipple = ~stipple;

if (iv != lastV && !(stipple && farForStipple)) {

pixel = *(lineOffset);
lineOffset = ((iv & (NATIVE_TEXTURE_SIZE - 1)) + sourceLineStart);
lastV = iv;
Expand Down Expand Up @@ -856,20 +852,14 @@ void drawFloor(FixP_t y0,
lastDiffX = diffX;
}

sourceLineStart = texture + (fixToInt(v) * NATIVE_TEXTURE_SIZE);

if (ix < 0) {
FixP_t diff = -iX0;
lastU = fixToInt(u);
FixP_t diff = intToFix((-ix + 0));
u += Mul(diff, du);
ix = 0;
const int32_t iu = fixToInt(u);
sourceLineStart += (iu - lastU);
pixel = *(sourceLineStart);
}

destinationLine = bufferData + (XRES_FRAMEBUFFER * iy) + ix;

sourceLineStart = texture + (fixToInt(v) * NATIVE_TEXTURE_SIZE);
pixel = *(sourceLineStart);
stipple = ((iX0 + iy) & 1) ? 0xFFFFFFFF : 0;

Expand Down

0 comments on commit 6c0b7f3

Please sign in to comment.