diff --git a/polymer/eduke32/build/include/compat.h b/polymer/eduke32/build/include/compat.h index b2fcd1f73..240777b82 100644 --- a/polymer/eduke32/build/include/compat.h +++ b/polymer/eduke32/build/include/compat.h @@ -77,7 +77,6 @@ # endif # include # include -# include # include # include # include @@ -95,6 +94,20 @@ #if defined(_MSC_VER) # define inline __inline # define longlong(x) x##i64 +static inline float nearbyintf(float x) +{ + uint32_t w1, w2; + __asm fnstcw w1 + w2 = w1 | 0x00000020; + __asm + { + fldcw w2 + fld x + frndint + fclex + fldcw w1 + } +} #else # define longlong(x) x##ll #endif diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 35322deb3..31c177e9a 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -3622,15 +3622,21 @@ static int32_t DrawTiles(int32_t iTopLeft, int32_t iSelected, int32_t nXTiles, i y2=min(y2, ydim-1); // box - plotlines2d((int32_t[]){x1, x1, x2, x2, x1}, - (int32_t[]){y1, y2, y2, y1, y1}, 5, iTile==iSelected ? whitecol : markedcol); + + { + int32_t xx[] = {x1, x1, x2, x2, x1}; + int32_t yy[] = {y1, y2, y2, y1, y1}; + plotlines2d(xx, yy, 5, iTile==iSelected ? whitecol : markedcol); + } // cross if (marked) { - plotlines2d((int32_t[]){x1, x2}, - (int32_t[]){y1, y2}, 2, markedcol); - plotlines2d((int32_t[]){x1, x2}, - (int32_t[]){y2, y1}, 2, markedcol); + int32_t xx[] = {x1, x2}; + int32_t yy[] = {y1, y2}; + + plotlines2d(xx, yy, 2, markedcol); + swaplong(&yy[0], &yy[1]); + plotlines2d(xx, yy, 2, markedcol); } } } diff --git a/polymer/eduke32/source/m32vars.c b/polymer/eduke32/source/m32vars.c index ac8dc21a5..a643e367e 100644 --- a/polymer/eduke32/source/m32vars.c +++ b/polymer/eduke32/source/m32vars.c @@ -262,11 +262,11 @@ int32_t __fastcall Gv_GetVarN(register int32_t id) // 'N' for "no side-effects" int32_t __fastcall Gv_GetVarX(register int32_t id) { + register int32_t negateResult = !!(id&M32_FLAG_NEGATE); + if (id == M32_THISACTOR_VAR_ID) return vm.g_i; - register int32_t negateResult = !!(id&M32_FLAG_NEGATE); - if ((id & M32_BITS_MASK) == M32_FLAG_CONSTANT) { switch (id&3)