diff --git a/src/hardware/hw_md2.cpp b/src/hardware/hw_md2.cpp index 61a9e9c10..abb6f1869 100644 --- a/src/hardware/hw_md2.cpp +++ b/src/hardware/hw_md2.cpp @@ -1576,28 +1576,29 @@ void HWR_Draw2DModel(md2_t *md2, INT32 x, INT32 y, INT32 skinnum, skincolors_t c memset(&p, 0x00, sizeof(FTransform)); - p.x = x*vid.dup + (vid.width - BASEVIDWIDTH*vid.dup)/2; - p.y = -200.0f; // idk man, but this makes the model not cull, kinda? - p.z = y*vid.dup + (vid.height - BASEVIDHEIGHT*vid.dup)/2; // for whatever reason y and z are switched here + p.x = x*vid.dup + (float)(vid.width - BASEVIDWIDTH*vid.dup)/2.f; + p.y = -200.f; // push it back to prevent wonky culling, idk lul + p.z = y*vid.dup + (float)(vid.height - BASEVIDHEIGHT*vid.dup)/2.f; p.angley = FixedToFloat(AngleFixed(angle)); - p.anglex = 0.0f; - p.anglez = 0.0f; + p.anglex = 0.f; + p.anglez = 0.f; p.roll = false; - p.fliptype = TRANSFORM_NONE; + const float fscale = FixedToFloat(scale*vid.dup); + GL_Draw2DModel( md2->model, frame, - 0.0f, - 0.0f, + 0.f, + 0.f, -1, &p, - FixedToFloat(scale*vid.dup), - FixedToFloat(scale*vid.dup), - true, + fscale, + fscale, + true, // flip it vertically lul false, &Surf ); diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index a48ad4249..c64f31592 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -3136,8 +3136,6 @@ void GL_Draw2DModel(model_t *model, INT32 frameIndex, INT32 duration, INT32 tics // switch to ortho mode to make our lives easier // thisll make sure our coords will be remapped to pixel coords - // try to scale it to the base width and height - // shit still be weird, and needs accounting for diff resolutions pglOrtho(0.0f, (float)vid.width, (float)vid.height, 0.0f, NZCLIP_PLANE, FAR_ZCLIP_DEFAULT); pglMatrixMode(GL_MODELVIEW); @@ -3147,15 +3145,9 @@ void GL_Draw2DModel(model_t *model, INT32 frameIndex, INT32 duration, INT32 tics pglDepthMask(GL_TRUE); pglClear(GL_DEPTH_BUFFER_BIT); - // FIXME: theres some weird culling issues i cant wrap my head around - // so until then gotta disable depth testing until i can figure this out - //pglDisable(GL_DEPTH_TEST); GL_DrawModelEx(model, frameIndex, duration, tics, nextFrameIndex, pos, hscale, vscale, flipped, hflipped, Surface); - //pglDepthMask(GL_TRUE); - //pglEnable(GL_DEPTH_TEST); - // restore the matrix´s pglMatrixMode(GL_PROJECTION); pglPopMatrix();