0 Members and 3 Guests are viewing this topic.
You may want to post the source in case certain people may be able to help. SirCmpwn did stuff with C-like languages before and Critor did the java raycaster
for (y = sfstart; y <= sfend; y++) { setPixelBuf(scrbuf, x, y, 8); //very large value since sprites always cover floors zbuf[x][y] = 1000; if (res == 2 && x < w - 1) { setPixelBuf(scrbuf, x + 1, y, 8); zbuf[x + 1][y] = 1000; } }
for (y = sfstart; y <= sfend; y++) { //very large value since sprites always cover floors if (res == 2 && x < w - 1) { // i did it this way because it appears that you're wanting it to set the z buffer and the pixelbuf thingy at both x and x+1 on res == 2 setPixelBuf(scrbuf, x , y, 8); zbuf[x][y] = 1000; setPixelBuf(scrbuf, x + 1, y, 8); zbuf[x + 1][y] = 1000; } else if (res == 1 && x < w) // it only seems to be either or, but I decided to use an else if in case it wasn't { setPixelBuf(scrbuf, x , y, 8); zbuf[x][y] = 1000; } }
for (y = swstart; y <= swend; y++) { int color = tex[(int) texY][texX]; if (side == 1) color = color / 2; setPixelBuf(scrbuf, x, y, color); //set the zbuffer zbuf[x][y] = perpWallDist; if (res == 2 && x < w - 1) { setPixelBuf(scrbuf, x + 1, y, color); zbuf[x + 1][y] = perpWallDist; } texY += texD; }
for (y = swstart; y <= swend; y++) { int color = tex[(int) texY][texX]; if (side == 1) color = color / 2; //set the zbuffer and the pixel buffer if (res == 2 && x < w - 1) { // same as above, I assumed that you wanted to set both x and x+1 in the pixelbuffer thingy and the zbuffer. setPixelBuf(scrbuf, x, y, color); zbuf[x][y] = perpWallDist; setPixelBuf(scrbuf, x + 1, y, color); zbuf[x + 1][y] = perpWallDist; } else if (res == 1 && x < w) { setPixelBuf(scrbuf, x, y, color); zbuf[x][y] = perpWallDist; } texY += texD; }