Managed to implement the way the floors are done in Doom etc but since I can't access the image buffer it's wayyyyyy too slow to actually render a 1x1 pixel graphic for the floor and ceiling data, so for now just using a solid image.
Here is my floor logic if anyone has any ideas on how to make it not laggy, maybe I'm doing it a dumb way, not sure:
PHP Code:
temp.floorxwall = 0;
temp.floorywall = 0;
if(temp.side == 0 && temp.raydirx > 0){
temp.floorxwall = temp.mapx;
temp.floorywall = temp.mapy + temp.wallx;
}else if(temp.side == 0 && temp.raydirx < 0){
temp.floorxwall = temp.mapx + 1;
temp.floorywall = temp.mapy + temp.wallx;
}else if(temp.side == 1 && temp.raydiry > 0){
temp.floorxwall = temp.mapx + temp.wallx;
temp.floorywall = temp.mapy;
}else{
temp.floorxwall = temp.mapx + temp.wallx;
temp.floorywall = temp.mapy + 1;
}
temp.distwall = temp.perpwalldist;
temp.distplayer = 0;
if(temp.drawend < 0){
temp.drawend = this.h;
}
for(temp.y = temp.drawend; temp.y < this.h; temp.y ++){
temp.currentdist = this.h/(2 * temp.y - this.h);
temp.weight = (temp.currentdist)/(temp.distwall);
temp.currentfloorx = temp.weight*temp.floorxwall + (1 - temp.weight) * this.posx;
temp.currentfloory = temp.weight*temp.floorywall + (1 - temp.weight) * this.posy;
temp.floortexx = int(temp.currentfloorx*this.texturewidth)%this.texturewidth;
temp.floortexy = int(temp.currentfloory*this.texturewidth)%this.texturewidth;
Gunderak_3D.drawimagestretched(temp.x, temp.y, 1, 1, "wolftextures.png", temp.floortexx+(64*6), temp.floortexy, 1, 1);
}
I mean, it works, but like 0.00005 FPS lol.