Merge branch 'ptitSeb-master'

This commit is contained in:
Ryan C. Gordon 2016-04-06 23:28:22 -04:00
commit d6800ca42a
3 changed files with 15 additions and 16 deletions

19
Sources/Engine/Math/Float.cpp Normal file → Executable file
View File

@ -17,17 +17,17 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <Engine/Math/Float.h>
#if (defined __GNU_INLINE__)
#define MCW_PC 0x0300
#define _MCW_PC MCW_PC
#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)
{

2
Sources/Engine/Network/EMsgBuffer.cpp Normal file → Executable file
View File

@ -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;
};

2
Sources/EntitiesMP/Common/Particles.cpp Normal file → Executable file
View File

@ -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;