mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-11-26 04:05:53 +01:00
Merge branch 'master' of git://github.com/ptitSeb/Serious-Engine into ptitSeb-master
Conflicts: Sources/Engine/Math/Float.cpp
This commit is contained in:
commit
e2e6f41582
27
Sources/Engine/Math/Float.cpp
Normal file → Executable file
27
Sources/Engine/Math/Float.cpp
Normal file → Executable file
|
@ -17,17 +17,17 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
|
||||||
#include <Engine/Math/Float.h>
|
#include <Engine/Math/Float.h>
|
||||||
|
|
||||||
#if (defined __GNU_INLINE__)
|
#define MCW_PC 0x0300
|
||||||
#define MCW_PC 0x0300
|
|
||||||
#define _MCW_PC MCW_PC
|
#define _MCW_PC MCW_PC
|
||||||
#define _PC_24 0x0000
|
#define _PC_24 0x0000
|
||||||
#define _PC_53 0x0200
|
#define _PC_53 0x0200
|
||||||
#define _PC_64 0x0300
|
#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)
|
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;
|
static WORD fpw=_PC_64;
|
||||||
if (mask != 0)
|
if (mask != 0)
|
||||||
{
|
{
|
||||||
|
@ -35,7 +35,12 @@ inline ULONG _control87(WORD newcw, WORD mask)
|
||||||
fpw |= (newcw & mask);
|
fpw |= (newcw & mask);
|
||||||
}
|
}
|
||||||
return(fpw);
|
return(fpw);
|
||||||
#else
|
}
|
||||||
|
|
||||||
|
#elif (defined __GNU_INLINE__)
|
||||||
|
|
||||||
|
inline ULONG _control87(WORD newcw, WORD mask)
|
||||||
|
{
|
||||||
WORD fpw = 0;
|
WORD fpw = 0;
|
||||||
|
|
||||||
// get the current FPU control word...
|
// get the current FPU control word...
|
||||||
|
@ -48,16 +53,10 @@ inline ULONG _control87(WORD newcw, WORD mask)
|
||||||
__asm__ __volatile__ (" fldcw %0" : : "m" (fpw) : "memory");
|
__asm__ __volatile__ (" fldcw %0" : : "m" (fpw) : "memory");
|
||||||
}
|
}
|
||||||
return(fpw);
|
return(fpw);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// (for intel compiler...)
|
// (for intel compiler...)
|
||||||
#elif ((defined __MSVC_INLINE__) && (!defined _MSC_VER))
|
#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)
|
inline ULONG _control87(WORD newcw, WORD mask)
|
||||||
{
|
{
|
||||||
|
|
2
Sources/Engine/Network/EMsgBuffer.cpp
Normal file → Executable file
2
Sources/Engine/Network/EMsgBuffer.cpp
Normal file → Executable file
|
@ -41,7 +41,7 @@ void AngleToUL(ANGLE3D &Angle,ULONG &ulResult)
|
||||||
ubDir = (UBYTE) (AxisAngles(2)/90*127);
|
ubDir = (UBYTE) (AxisAngles(2)/90*127);
|
||||||
ulResult = ulResult << 8;
|
ulResult = ulResult << 8;
|
||||||
ulResult |= ubDir;
|
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;
|
ulResult = (ulResult << 16) | swAngle;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
2
Sources/EntitiesMP/Common/Particles.cpp
Normal file → Executable file
2
Sources/EntitiesMP/Common/Particles.cpp
Normal file → Executable file
|
@ -1731,7 +1731,7 @@ void Particles_FlameThrowerStart(const CPlacement3D &plPipe, FLOAT fStartTime, F
|
||||||
FLOAT3D vCenter = plPipe.pl_PositionVector;
|
FLOAT3D vCenter = plPipe.pl_PositionVector;
|
||||||
|
|
||||||
FLOAT fPowerFactor = Clamp((fNow - fStartTime)/2.0f,0.0f,1.0f);
|
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);
|
INDEX ctParticles = (INDEX) (FLOAT(CT_FTSPARKS) * fPowerFactor);
|
||||||
ASSERT( ctParticles<=CT_MAX_PARTICLES_TABLE);
|
ASSERT( ctParticles<=CT_MAX_PARTICLES_TABLE);
|
||||||
FLOAT fHeight = 1.0f*fPowerFactor;
|
FLOAT fHeight = 1.0f*fPowerFactor;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user