diff --git a/Sources/Engine/Math/Float.cpp b/Sources/Engine/Math/Float.cpp old mode 100644 new mode 100755 index a1881c8..6c62b5f --- a/Sources/Engine/Math/Float.cpp +++ b/Sources/Engine/Math/Float.cpp @@ -17,17 +17,17 @@ with this program; if not, write to the Free Software Foundation, Inc., #include -#if (defined __GNU_INLINE__) -#define MCW_PC 0x0300 +#define MCW_PC 0x0300 #define _MCW_PC MCW_PC -#define _PC_24 0x0000 -#define _PC_53 0x0200 -#define _PC_64 0x0300 +#define _PC_24 0x0000 +#define _PC_53 0x0200 +#define _PC_64 0x0300 +// !!! FIXME: I'd like to remove any dependency on the FPU control word from the game, asap. --ryan. +#ifdef USE_PORTABLE_C +// Fake control87 for USE_PORTABLE_C version inline ULONG _control87(WORD newcw, WORD mask) { -// !!! FIXME: I'd like to remove any dependency on the FPU control word from the game, asap. --ryan. -#if defined(__x86_64__) || defined(__POWERPC__) || defined(__arm__) static WORD fpw=_PC_64; if (mask != 0) { @@ -35,7 +35,12 @@ inline ULONG _control87(WORD newcw, WORD mask) fpw |= (newcw & mask); } return(fpw); -#else +} + +#elif (defined __GNU_INLINE__) + +inline ULONG _control87(WORD newcw, WORD mask) +{ WORD fpw = 0; // get the current FPU control word... @@ -48,16 +53,10 @@ inline ULONG _control87(WORD newcw, WORD mask) __asm__ __volatile__ (" fldcw %0" : : "m" (fpw) : "memory"); } return(fpw); -#endif } // (for intel compiler...) #elif ((defined __MSVC_INLINE__) && (!defined _MSC_VER)) -#define MCW_PC 0x0300 -#define _MCW_PC MCW_PC -#define _PC_24 0x0000 -#define _PC_53 0x0200 -#define _PC_64 0x0300 inline ULONG _control87(WORD newcw, WORD mask) { diff --git a/Sources/Engine/Network/EMsgBuffer.cpp b/Sources/Engine/Network/EMsgBuffer.cpp old mode 100644 new mode 100755 index befe836..81b61fc --- a/Sources/Engine/Network/EMsgBuffer.cpp +++ b/Sources/Engine/Network/EMsgBuffer.cpp @@ -41,7 +41,7 @@ void AngleToUL(ANGLE3D &Angle,ULONG &ulResult) ubDir = (UBYTE) (AxisAngles(2)/90*127); ulResult = ulResult << 8; ulResult |= ubDir; - swAngle = (UWORD) (fRotAngle * 180); // after rounding, angle is precise up to 1/180 degrees (65536/360 ~ 180) + swAngle = (UWORD) (SWORD) (fRotAngle * 180); // after rounding, angle is precise up to 1/180 degrees (65536/360 ~ 180) ulResult = (ulResult << 16) | swAngle; }; diff --git a/Sources/EntitiesMP/Common/Particles.cpp b/Sources/EntitiesMP/Common/Particles.cpp old mode 100644 new mode 100755 index 9084eb3..1510fd7 --- a/Sources/EntitiesMP/Common/Particles.cpp +++ b/Sources/EntitiesMP/Common/Particles.cpp @@ -1731,7 +1731,7 @@ void Particles_FlameThrowerStart(const CPlacement3D &plPipe, FLOAT fStartTime, F FLOAT3D vCenter = plPipe.pl_PositionVector; FLOAT fPowerFactor = Clamp((fNow - fStartTime)/2.0f,0.0f,1.0f); - fPowerFactor *= Clamp(1+(fStopTime-fNow)/2.0f,0.0f,1.0f); + fPowerFactor *= Clamp(1.0f+(fStopTime-fNow)/2.0f,0.0f,1.0f); INDEX ctParticles = (INDEX) (FLOAT(CT_FTSPARKS) * fPowerFactor); ASSERT( ctParticles<=CT_MAX_PARTICLES_TABLE); FLOAT fHeight = 1.0f*fPowerFactor;