From 0726a88ab979f0097059a56562e1c53845046e2c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 11 May 2016 12:04:41 +0200 Subject: [PATCH] - only return DWORD aligned addresses in openings because the 3D floor code stores floating point values in there which cannot be accessed on platforms with strict alignment rules. --- src/r_segs.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/r_segs.cpp b/src/r_segs.cpp index 69d517b179..4eb3cb440c 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -2352,6 +2352,7 @@ void R_CheckDrawSegs () ptrdiff_t R_NewOpening (ptrdiff_t len) { ptrdiff_t res = lastopening; + len = (len + 1) & ~1; // only return DWORD aligned addresses because some code stores fixed_t's and floats in openings... lastopening += len; if ((size_t)lastopening > maxopenings) { @@ -2512,6 +2513,7 @@ void R_StoreWallRange (int start, int stop) if(sidedef->GetTexture(side_t::mid).isValid()) ds_p->bFakeBoundary |= 4; // it is also mid texture + // note: This should never have used the openings array to store its data! ds_p->maskedtexturecol = R_NewOpening ((stop - start) * 2); ds_p->swall = R_NewOpening ((stop - start) * 2);