fix distorted/broken textures when switching from software to opengl

if the map was loaded in software renderer mode the segs floatlength was not set

since this only gets done on map load for non adjusted segs it broke texture mapping on non adjusted segs after switching to gl
This commit is contained in:
Alug 2026-03-09 16:28:33 +01:00
parent 063a6d3710
commit 3f0e421085

View file

@ -3873,7 +3873,7 @@ static inline float P_SegLengthFloat(seg_t *seg)
dx = FIXED_TO_FLOAT(seg->v2->x - seg->v1->x);
dy = FIXED_TO_FLOAT(seg->v2->y - seg->v1->y);
return (float)hypot(dx, dy);
return hypotf(dx, dy);
}
#endif
@ -4033,7 +4033,7 @@ static void P_LoadSegs(UINT8 *data)
seg->length = P_SegLength(seg);
#ifdef HWRENDER
seg->flength = (rendermode == render_opengl) ? P_SegLengthFloat(seg) : 0;
seg->flength = P_SegLengthFloat(seg);
#endif
seg->glseg = false;