diff --git a/src/gl/scene/gl_bsp.cpp b/src/gl/scene/gl_bsp.cpp index 725ea86639..98053784ce 100644 --- a/src/gl/scene/gl_bsp.cpp +++ b/src/gl/scene/gl_bsp.cpp @@ -63,6 +63,7 @@ CVAR(Bool, gl_render_things, true, 0) CVAR(Bool, gl_render_walls, true, 0) CVAR(Bool, gl_render_flats, true, 0) +extern fixed_t viewx, viewy; static void UnclipSubsector(subsector_t *sub) { diff --git a/src/gl/scene/gl_clipper.cpp b/src/gl/scene/gl_clipper.cpp index ab4bb83d41..e7cb14b26c 100644 --- a/src/gl/scene/gl_clipper.cpp +++ b/src/gl/scene/gl_clipper.cpp @@ -388,6 +388,8 @@ angle_t Clipper::AngleToPseudo(angle_t ang) // //----------------------------------------------------------------------------- +fixed_t viewx, viewy; + void R_SetView() { viewx = FLOAT2FIXED(ViewPos.X); diff --git a/src/gl/scene/gl_sky.cpp b/src/gl/scene/gl_sky.cpp index d556dcdabf..80ecc76327 100644 --- a/src/gl/scene/gl_sky.cpp +++ b/src/gl/scene/gl_sky.cpp @@ -272,7 +272,7 @@ void GLWall::SkyTop(seg_t * seg,sector_t * fs,sector_t * bs,vertex_t * v1,vertex // or it will cause glitches elsewhere. tex = TexMan(seg->sidedef->GetTexture(side_t::mid)); if (tex != NULL && !(seg->linedef->flags & ML_DONTPEGTOP) && - seg->sidedef->GetTextureYOffset(side_t::mid) > 0) + seg->sidedef->GetTextureYOffsetF(side_t::mid) > 0) { ztop[0]=ztop[1]=32768.0f; zbottom[0]=zbottom[1]= diff --git a/src/gl/scene/gl_sprite.cpp b/src/gl/scene/gl_sprite.cpp index 48c20fad4c..5bbf26d929 100644 --- a/src/gl/scene/gl_sprite.cpp +++ b/src/gl/scene/gl_sprite.cpp @@ -644,7 +644,7 @@ void GLSprite::Process(AActor* thing, sector_t * sector, bool thruportal) gltexture=NULL; } - depth = (int)((x - ViewPos.X) * viewtancos + (y - ViewPos.Y) * viewtansin); + depth = FloatToFixed((x - ViewPos.X) * ViewTanCos + (y - ViewPos.Y) * ViewTanSin); // light calculation @@ -945,7 +945,7 @@ void GLSprite::ProcessParticle (particle_t *particle, sector_t *sector)//, int s z1=z-scalefac; z2=z+scalefac; - depth = (int)((x - ViewPos.X) * viewtancos + (y - ViewPos.Y) * viewtansin); + depth = FloatToFixed((x - ViewPos.X) * ViewTanCos + (y - ViewPos.Y) * ViewTanSin); actor=NULL; this->particle=particle;