Float fest\!

This commit is contained in:
ptitSeb 2016-04-07 18:13:03 +02:00
parent 1f1291d2bc
commit f37df71029
28 changed files with 131 additions and 127 deletions

2
Sources/Engine/Base/ProgressHook.cpp Normal file → Executable file
View File

@ -49,7 +49,7 @@ void CallProgressHook_t(FLOAT fCompleted)
bTimeInitialized = TRUE; bTimeInitialized = TRUE;
} }
CTimerValue tvNow = _pTimer->GetHighPrecisionTimer(); CTimerValue tvNow = _pTimer->GetHighPrecisionTimer();
if ((tvNow-tvLastUpdate) > CTimerValue(net_fSendRetryWait*1.1)) { if ((tvNow-tvLastUpdate) > CTimerValue(net_fSendRetryWait*1.1f)) {
if (_pNetwork->ga_IsServer) { if (_pNetwork->ga_IsServer) {
// handle server messages // handle server messages
_cmiComm.Server_Update(); _cmiComm.Server_Update();

4
Sources/Engine/Math/Functions.h Normal file → Executable file
View File

@ -447,7 +447,11 @@ printf("CHECK THIS: %s:%d\n", __FILE__, __LINE__);
// square root (works with negative numbers) // square root (works with negative numbers)
#ifdef __arm__
inline FLOAT Sqrt( FLOAT x) { return sqrtf( ClampDn( x, 0.0f)); }
#else
inline FLOAT Sqrt( FLOAT x) { return (FLOAT)sqrt( ClampDn( x, 0.0f)); } inline FLOAT Sqrt( FLOAT x) { return (FLOAT)sqrt( ClampDn( x, 0.0f)); }
#endif

24
Sources/Engine/Math/Quaternion.h Normal file → Executable file
View File

@ -370,8 +370,8 @@ void Quaternion<Type>::FromEuler(const Vector<Type, 3> &a)
template<class Type> template<class Type>
Type Quaternion<Type>::EPS(Type orig) const Type Quaternion<Type>::EPS(Type orig) const
{ {
if ((orig <= 10e-6) && (orig >= -10e-6)) if ((orig <= 10e-6f) && (orig >= -10e-6f))
return(0.0); return(0.0f);
return(orig); return(orig);
} }
@ -384,9 +384,9 @@ void Quaternion<Type>::ToMatrix(Matrix<Type, 3, 3> &m) const
Type yy = 2*q_y*q_y; Type yz = 2*q_y*q_z; Type zz = 2*q_z*q_z; Type yy = 2*q_y*q_y; Type yz = 2*q_y*q_z; Type zz = 2*q_z*q_z;
Type wx = 2*q_w*q_x; Type wy = 2*q_w*q_y; Type wz = 2*q_w*q_z; Type wx = 2*q_w*q_x; Type wy = 2*q_w*q_y; Type wz = 2*q_w*q_z;
m(1,1) = EPS(1.0-(yy+zz)); m(1,2) = EPS(xy-wz); m(1,3) = EPS(xz+wy); m(1,1) = EPS(1.0f-(yy+zz));m(1,2) = EPS(xy-wz); m(1,3) = EPS(xz+wy);
m(2,1) = EPS(xy+wz); m(2,2) = EPS(1.0-(xx+zz)); m(2,3) = EPS(yz-wx); m(2,1) = EPS(xy+wz); m(2,2) = EPS(1.0f-(xx+zz));m(2,3) = EPS(yz-wx);
m(3,1) = EPS(xz-wy); m(3,2) = EPS(yz+wx); m(3,3) = EPS(1.0-(xx+yy)); m(3,1) = EPS(xz-wy); m(3,2) = EPS(yz+wx); m(3,3) = EPS(1.0f-(xx+yy));
} }
// conversion from matrix // conversion from matrix
@ -396,12 +396,12 @@ void Quaternion<Type>::FromMatrix(Matrix<Type, 3, 3> &m)
Type trace = m(1,1)+m(2,2)+m(3,3); Type trace = m(1,1)+m(2,2)+m(3,3);
Type root; Type root;
if ( trace > 0.0 ) if ( trace > 0.0f )
{ {
// |w| > 1/2, may as well choose w > 1/2 // |w| > 1/2, may as well choose w > 1/2
root = sqrt(trace+1.0); // 2w root = sqrt(trace+1.0f); // 2w
q_w = 0.5*root; q_w = 0.5f*root;
root = 0.5/root; // 1/(4w) root = 0.5f/root; // 1/(4w)
q_x = (m(3,2)-m(2,3))*root; q_x = (m(3,2)-m(2,3))*root;
q_y = (m(1,3)-m(3,1))*root; q_y = (m(1,3)-m(3,1))*root;
q_z = (m(2,1)-m(1,2))*root; q_z = (m(2,1)-m(1,2))*root;
@ -418,10 +418,10 @@ void Quaternion<Type>::FromMatrix(Matrix<Type, 3, 3> &m)
int j = next[i]; int j = next[i];
int k = next[j]; int k = next[j];
root = sqrt(m(i+1,i+1)-m(j+1,j+1)-m(k+1,k+1)+1.0); root = sqrt(m(i+1,i+1)-m(j+1,j+1)-m(k+1,k+1)+1.0f);
Type* quat[3] = { &q_x, &q_y, &q_z }; Type* quat[3] = { &q_x, &q_y, &q_z };
*quat[i] = 0.5*root; *quat[i] = 0.5f*root;
root = 0.5/root; root = 0.5f/root;
q_w = (m(k+1,j+1)-m(j+1,k+1))*root; q_w = (m(k+1,j+1)-m(j+1,k+1))*root;
*quat[j] = (m(j+1,i+1)+m(i+1,j+1))*root; *quat[j] = (m(j+1,i+1)+m(i+1,j+1))*root;
*quat[k] = (m(k+1,i+1)+m(i+1,k+1))*root; *quat[k] = (m(k+1,i+1)+m(i+1,k+1))*root;

2
Sources/Engine/Math/Vector.h Normal file → Executable file
View File

@ -234,7 +234,7 @@ template<class Type, int iDimensions>
__forceinline Vector<Type, iDimensions> &Vector<Type, iDimensions>::SafeNormalize(void) __forceinline Vector<Type, iDimensions> &Vector<Type, iDimensions>::SafeNormalize(void)
{ {
Type tLen = Length(); Type tLen = Length();
if (tLen<1E-6) { if (tLen<1E-6f) {
if (iDimensions==2) { if (iDimensions==2) {
*this = Vector(1,0); *this = Vector(1,0);
} else { } else {

4
Sources/Engine/Sound/SoundObject.h Normal file → Executable file
View File

@ -142,8 +142,8 @@ public:
// Set filter // Set filter
inline void SetFilter( FLOAT fLeftFilter, FLOAT fRightFilter) { // 1=no filter (>1=more bass) inline void SetFilter( FLOAT fLeftFilter, FLOAT fRightFilter) { // 1=no filter (>1=more bass)
ASSERT( (fLeftFilter >= 1) && (fRightFilter >= 1)); ASSERT( (fLeftFilter >= 1) && (fRightFilter >= 1));
so_spNew.sp_slLeftFilter = FloatToInt(32767.0/fLeftFilter); so_spNew.sp_slLeftFilter = FloatToInt(32767.0f/fLeftFilter);
so_spNew.sp_slRightFilter = FloatToInt(32767.0/fRightFilter); so_spNew.sp_slRightFilter = FloatToInt(32767.0f/fRightFilter);
}; };
// Set pitch shifting // Set pitch shifting
inline void SetPitch( FLOAT fPitch) { // 1.0 for normal (<1 = slower, >1 = faster playing) inline void SetPitch( FLOAT fPitch) { // 1.0 for normal (<1 = slower, >1 = faster playing)

2
Sources/EntitiesMP/AirElemental.es Normal file → Executable file
View File

@ -528,7 +528,7 @@ procedures:
m_fWindBlastFirePosEnd*m_fAttSizeCurrent, m_fWindBlastFirePosEnd*m_fAttSizeCurrent,
(FLOAT)m_iWind*0.25f); (FLOAT)m_iWind*0.25f);
ShootProjectile(PRT_AIRELEMENTAL_WIND, vFirePos, ShootProjectile(PRT_AIRELEMENTAL_WIND, vFirePos,
ANGLE3D(30.0f-m_iWind*10.0, 0.0f, 0.0f)); ANGLE3D(30.0f-m_iWind*10.0f, 0.0f, 0.0f));
m_iWind++; m_iWind++;
autowait(0.1f); autowait(0.1f);
} }

22
Sources/EntitiesMP/AmmoItem.es Normal file → Executable file
View File

@ -146,37 +146,37 @@ functions:
} }
switch (m_EaitType) { switch (m_EaitType) {
case AIT_SHELLS: case AIT_SHELLS:
Particles_Spiral(this, 1.0f*0.75, 1.0f*0.75, PT_STAR04, 4); Particles_Spiral(this, 1.0f*0.75f, 1.0f*0.75f, PT_STAR04, 4);
break; break;
case AIT_BULLETS: case AIT_BULLETS:
Particles_Spiral(this, 1.5f*0.75, 1.0f*0.75, PT_STAR04, 6); Particles_Spiral(this, 1.5f*0.75f, 1.0f*0.75f, PT_STAR04, 6);
break; break;
case AIT_ROCKETS: case AIT_ROCKETS:
Particles_Spiral(this, 1.5f*0.75, 1.25f*0.75, PT_STAR04, 6); Particles_Spiral(this, 1.5f*0.75f, 1.25f*0.75f, PT_STAR04, 6);
break; break;
case AIT_GRENADES: case AIT_GRENADES:
Particles_Spiral(this, 2.0f*0.75, 1.25f*0.75, PT_STAR04, 6); Particles_Spiral(this, 2.0f*0.75f, 1.25f*0.75f, PT_STAR04, 6);
break; break;
case AIT_ELECTRICITY: case AIT_ELECTRICITY:
Particles_Spiral(this, 1.5f*0.75, 1.125f*0.75, PT_STAR04, 6); Particles_Spiral(this, 1.5f*0.75f, 1.125f*0.75f, PT_STAR04, 6);
break; break;
case AIT_NUKEBALL: case AIT_NUKEBALL:
Particles_Spiral(this, 1.25f*0.75, 1.0f*0.75, PT_STAR04, 4); Particles_Spiral(this, 1.25f*0.75f, 1.0f*0.75f, PT_STAR04, 4);
break; break;
case AIT_IRONBALLS: case AIT_IRONBALLS:
Particles_Spiral(this, 2.0f*0.75, 1.25f*0.75, PT_STAR04, 8); Particles_Spiral(this, 2.0f*0.75f, 1.25f*0.75f, PT_STAR04, 8);
break; break;
case AIT_BACKPACK: case AIT_BACKPACK:
Particles_Spiral(this, 3.0f*0.5, 2.5f*0.5, PT_STAR04, 10); Particles_Spiral(this, 3.0f*0.5f, 2.5f*0.5f, PT_STAR04, 10);
break; break;
case AIT_SERIOUSPACK: case AIT_SERIOUSPACK:
Particles_Spiral(this, 3.0f*0.5, 2.5f*0.5, PT_STAR04, 10); Particles_Spiral(this, 3.0f*0.5f, 2.5f*0.5f, PT_STAR04, 10);
break; break;
case AIT_NAPALM: case AIT_NAPALM:
Particles_Spiral(this, 3.0f*0.5, 2.5f*0.5, PT_STAR04, 10); Particles_Spiral(this, 3.0f*0.5f, 2.5f*0.5f, PT_STAR04, 10);
break; break;
case AIT_SNIPERBULLETS: case AIT_SNIPERBULLETS:
Particles_Spiral(this, 1.5f*0.75, 1.25f*0.75, PT_STAR04, 6); Particles_Spiral(this, 1.5f*0.75f, 1.25f*0.75f, PT_STAR04, 6);
break; break;
} }
} }

2
Sources/EntitiesMP/AmmoPack.es Normal file → Executable file
View File

@ -90,7 +90,7 @@ functions:
return; return;
} }
Particles_Spiral(this, 3.0f*0.5, 2.5f*0.5, PT_STAR04, 10); Particles_Spiral(this, 3.0f*0.5f, 2.5f*0.5f, PT_STAR04, 10);
} }
/* Fill in entity statistics - for AI purposes only */ /* Fill in entity statistics - for AI purposes only */

20
Sources/EntitiesMP/ArmorItem.es Normal file → Executable file
View File

@ -131,22 +131,22 @@ functions:
} }
switch (m_EaitType) { switch (m_EaitType) {
case ARIT_SHARD: case ARIT_SHARD:
Particles_Emanate(this, 0.75f*0.75, 0.75f*0.75, PT_STAR04, 8, 7.0f); Particles_Emanate(this, 0.75f*0.75f, 0.75f*0.75f, PT_STAR04, 8, 7.0f);
break; break;
case ARIT_SMALL: case ARIT_SMALL:
Particles_Emanate(this, 1.0f*0.75, 1.0f*0.75, PT_STAR04, 32, 7.0f); Particles_Emanate(this, 1.0f*0.75f, 1.0f*0.75f, PT_STAR04, 32, 7.0f);
break; break;
case ARIT_MEDIUM: case ARIT_MEDIUM:
Particles_Emanate(this, 1.5f*0.75, 1.5f*0.75, PT_STAR04, 64, 7.0f); Particles_Emanate(this, 1.5f*0.75f, 1.5f*0.75f, PT_STAR04, 64, 7.0f);
break; break;
case ARIT_STRONG: case ARIT_STRONG:
Particles_Emanate(this, 2.0f*0.75, 1.25f*0.75, PT_STAR04, 96, 7.0f); Particles_Emanate(this, 2.0f*0.75f, 1.25f*0.75f, PT_STAR04, 96, 7.0f);
break; break;
case ARIT_SUPER: case ARIT_SUPER:
Particles_Emanate(this, 2.5f*0.75, 1.5f*0.75, PT_STAR04, 128, 7.0f); Particles_Emanate(this, 2.5f*0.75f, 1.5f*0.75f, PT_STAR04, 128, 7.0f);
break; break;
case ARIT_HELM: case ARIT_HELM:
Particles_Emanate(this, 0.875f*0.75, 0.875f*0.75, PT_STAR04, 16, 7.0f); Particles_Emanate(this, 0.875f*0.75f, 0.875f*0.75f, PT_STAR04, 16, 7.0f);
break; break;
} }
} }
@ -162,8 +162,8 @@ functions:
m_strDescription.PrintF("Shard - H:%g T:%g", m_fValue, m_fRespawnTime); m_strDescription.PrintF("Shard - H:%g T:%g", m_fValue, m_fRespawnTime);
// set appearance // set appearance
AddItem(MODEL_1, TEXTURE_1, 0, TEX_SPEC_MEDIUM, 0); AddItem(MODEL_1, TEXTURE_1, 0, TEX_SPEC_MEDIUM, 0);
AddFlare(MODEL_FLARE, TEXTURE_FLARE, FLOAT3D(0,0.4f,0), FLOAT3D(1.0,1.0,0.3f) ); AddFlare(MODEL_FLARE, TEXTURE_FLARE, FLOAT3D(0,0.4f,0), FLOAT3D(1.0f,1.0f,0.3f) );
StretchItem(FLOAT3D(0.75f*0.75, 0.75f*0.75, 0.75f*0.75)); StretchItem(FLOAT3D(0.75f*0.75f, 0.75f*0.75f, 0.75f*0.75f));
m_iSoundComponent = SOUND_SHARD; m_iSoundComponent = SOUND_SHARD;
break; break;
case ARIT_SMALL: case ARIT_SMALL:
@ -223,8 +223,8 @@ functions:
m_strDescription.PrintF("Helm - H:%g T:%g", m_fValue, m_fRespawnTime); m_strDescription.PrintF("Helm - H:%g T:%g", m_fValue, m_fRespawnTime);
// set appearance // set appearance
AddItem(MODEL_5, TEXTURE_5, 0, TEX_SPEC_MEDIUM, 0); AddItem(MODEL_5, TEXTURE_5, 0, TEX_SPEC_MEDIUM, 0);
AddFlare(MODEL_FLARE, TEXTURE_FLARE, FLOAT3D(0,0.5f,0), FLOAT3D(1.5,1.5,0.4f) ); AddFlare(MODEL_FLARE, TEXTURE_FLARE, FLOAT3D(0,0.5f,0), FLOAT3D(1.5f,1.5f,0.4f) );
StretchItem(FLOAT3D(0.875f*0.75, 0.875f*0.75, 0.875f*0.75)); StretchItem(FLOAT3D(0.875f*0.75f, 0.875f*0.75f, 0.875f*0.75f));
m_iSoundComponent = SOUND_HELM; m_iSoundComponent = SOUND_HELM;
break; break;
} }

2
Sources/EntitiesMP/Beast.es Normal file → Executable file
View File

@ -357,7 +357,7 @@ procedures:
autowait(0.51f); autowait(0.51f);
ShootProjectile(PRT_BEAST_PROJECTILE, FLOAT3D( 0.0f, 1.5f*BEAST_STRETCH, 0.0f), ShootProjectile(PRT_BEAST_PROJECTILE, FLOAT3D( 0.0f, 1.5f*BEAST_STRETCH, 0.0f),
ANGLE3D(AngleDeg((FRnd()-0.5)*30.0f), AngleDeg(FRnd()*10.0f), 0)); ANGLE3D(AngleDeg((FRnd()-0.5f)*30.0f), AngleDeg(FRnd()*10.0f), 0));
autowait(0.3f); autowait(0.3f);
} }

2
Sources/EntitiesMP/CannonBall.es Normal file → Executable file
View File

@ -225,7 +225,7 @@ functions:
FLOAT fSpeedRatio = Min( en_vCurrentTranslationAbsolute.Length()/140.0f, 1.0f); FLOAT fSpeedRatio = Min( en_vCurrentTranslationAbsolute.Length()/140.0f, 1.0f);
INDEX ctFireParticles = INDEX( (Max( fSpeedRatio-0.5f, 0.0f)*2.0f)*128); INDEX ctFireParticles = INDEX( (Max( fSpeedRatio-0.5f, 0.0f)*2.0f)*128);
//CPrintF("fSpeedRatio=%g, ctFireParticles=%d\n", fSpeedRatio, ctFireParticles); //CPrintF("fSpeedRatio=%g, ctFireParticles=%d\n", fSpeedRatio, ctFireParticles);
if( _pTimer->GetLerpedCurrentTick()-m_fStartTime>0.075) if( _pTimer->GetLerpedCurrentTick()-m_fStartTime>0.075f)
{ {
Particles_BeastBigProjectileTrail( this, 2.0f, 1.0f, 0.75f, ctFireParticles); Particles_BeastBigProjectileTrail( this, 2.0f, 1.0f, 0.75f, ctFireParticles);
} }

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

@ -1405,13 +1405,13 @@ FLOAT GetGameDamageMultiplier(void)
{ {
FLOAT fGameDamageMultiplier = 1.0f; FLOAT fGameDamageMultiplier = 1.0f;
FLOAT fExtraStrength = GetSP()->sp_fExtraEnemyStrength; FLOAT fExtraStrength = GetSP()->sp_fExtraEnemyStrength;
if (fExtraStrength>0) { if (fExtraStrength>0.0f) {
fGameDamageMultiplier*=1.0f/(1+fExtraStrength); fGameDamageMultiplier*=1.0f/(1.0f+fExtraStrength);
} }
FLOAT fExtraStrengthPerPlayer = GetSP()->sp_fExtraEnemyStrengthPerPlayer; FLOAT fExtraStrengthPerPlayer = GetSP()->sp_fExtraEnemyStrengthPerPlayer;
if (fExtraStrengthPerPlayer>0) { if (fExtraStrengthPerPlayer>0.0f) {
INDEX ctPlayers = _pNetwork->ga_sesSessionState.GetPlayersCount(); INDEX ctPlayers = _pNetwork->ga_sesSessionState.GetPlayersCount();
fGameDamageMultiplier*=1.0f/(1+fExtraStrengthPerPlayer*ClampDn(((FLOAT) ctPlayers)-1.0f, 0.0f)); fGameDamageMultiplier*=1.0f/(1.0f+fExtraStrengthPerPlayer*ClampDn(((FLOAT) ctPlayers)-1.0f, 0.0f));
} }
if (GetSP()->sp_gdGameDifficulty==CSessionProperties::GD_TOURIST) { if (GetSP()->sp_gdGameDifficulty==CSessionProperties::GD_TOURIST) {
fGameDamageMultiplier *= 2.0f; fGameDamageMultiplier *= 2.0f;

View File

@ -824,14 +824,14 @@ void Particles_GrenadeTrail(CEntity *pen)
pvPos2 = &plp->GetPosition(iPos); pvPos2 = &plp->GetPosition(iPos);
for (INDEX iInter=0; iInter<GRENADE_TRAIL_INTERPOSITIONS; iInter++) for (INDEX iInter=0; iInter<GRENADE_TRAIL_INTERPOSITIONS; iInter++)
{ {
FLOAT fAngle = iParticle*4.0f*180/iParticlesLiving; FLOAT fAngle = iParticle*4.0f*180.0f/iParticlesLiving;
FLOAT3D vPos = Lerp(*pvPos1, *pvPos2, iInter*1.0f/GRENADE_TRAIL_INTERPOSITIONS); FLOAT3D vPos = Lerp(*pvPos1, *pvPos2, iInter*1.0f/GRENADE_TRAIL_INTERPOSITIONS);
FLOAT fRatio = FLOAT(iParticle)/iParticlesLiving+fSeconds; FLOAT fRatio = FLOAT(iParticle)/iParticlesLiving+fSeconds;
FLOAT fSize = iParticle*0.3f/iParticlesLiving+0.1f; FLOAT fSize = iParticle*0.3f/iParticlesLiving+0.1f;
vPos(2) += iParticle*1.0f/iParticlesLiving; vPos(2) += iParticle*1.0f/iParticlesLiving;
vPos(1) += FLOAT(sin(fRatio*1.264*PI))*0.05f; vPos(1) += FLOAT(sin(fRatio*1.264f*PI))*0.05f;
vPos(2) += FLOAT(sin(fRatio*0.704*PI))*0.05f; vPos(2) += FLOAT(sin(fRatio*0.704f*PI))*0.05f;
vPos(3) += FLOAT(sin(fRatio*0.964*PI))*0.05f; vPos(3) += FLOAT(sin(fRatio*0.964f*PI))*0.05f;
UBYTE ub = 255-(UBYTE)((ULONG)iParticle*255/iParticlesLiving); UBYTE ub = 255-(UBYTE)((ULONG)iParticle*255/iParticlesLiving);
Particle_RenderSquare( vPos, fSize, fAngle, RGBToColor(ub,ub,ub)|ub); Particle_RenderSquare( vPos, fSize, fAngle, RGBToColor(ub,ub,ub)|ub);
iParticle++; iParticle++;
@ -894,14 +894,14 @@ void Particles_LavaTrail(CEntity *pen)
pvPos2 = &plp->GetPosition(iPos); pvPos2 = &plp->GetPosition(iPos);
for (INDEX iInter=0; iInter<LAVA_TRAIL_INTERPOSITIONS; iInter++) for (INDEX iInter=0; iInter<LAVA_TRAIL_INTERPOSITIONS; iInter++)
{ {
FLOAT fAngle = iParticle*4.0f*180/iParticlesLiving; FLOAT fAngle = iParticle*4.0f*180.0f/iParticlesLiving;
FLOAT3D vPos = Lerp(*pvPos1, *pvPos2, iInter*1.0f/LAVA_TRAIL_INTERPOSITIONS); FLOAT3D vPos = Lerp(*pvPos1, *pvPos2, iInter*1.0f/LAVA_TRAIL_INTERPOSITIONS);
FLOAT fRatio = FLOAT(iParticle)/iParticlesLiving+fSeconds; FLOAT fRatio = FLOAT(iParticle)/iParticlesLiving+fSeconds;
FLOAT fSize = iParticle*3.0f/iParticlesLiving+0.5f; FLOAT fSize = iParticle*3.0f/iParticlesLiving+0.5f;
vPos(2) += iParticle*1.0f/iParticlesLiving; vPos(2) += iParticle*1.0f/iParticlesLiving;
vPos(1) += FLOAT(sin(fRatio*1.264*PI))*0.05f; vPos(1) += FLOAT(sin(fRatio*1.264f*PI))*0.05f;
vPos(2) += FLOAT(sin(fRatio*0.704*PI))*0.05f; vPos(2) += FLOAT(sin(fRatio*0.704f*PI))*0.05f;
vPos(3) += FLOAT(sin(fRatio*0.964*PI))*0.05f; vPos(3) += FLOAT(sin(fRatio*0.964f*PI))*0.05f;
COLOR col = pTD->GetTexel(PIX(FLOAT(iParticle)/iParticlesLiving*8*1024), 0); COLOR col = pTD->GetTexel(PIX(FLOAT(iParticle)/iParticlesLiving*8*1024), 0);
Particle_RenderSquare( vPos, fSize, fAngle, col); Particle_RenderSquare( vPos, fSize, fAngle, col);
iParticle++; iParticle++;
@ -939,15 +939,15 @@ void Particles_LavaBombTrail(CEntity *pen, FLOAT fSizeMultiplier)
if( *pvPos1 == *pvPos2) continue; if( *pvPos1 == *pvPos2) continue;
for (INDEX iInter=0; iInter<LAVA_BOMB_TRAIL_INTERPOSITIONS; iInter++) for (INDEX iInter=0; iInter<LAVA_BOMB_TRAIL_INTERPOSITIONS; iInter++)
{ {
FLOAT fAngle = iParticle*4.0f*180/iParticlesLiving; FLOAT fAngle = iParticle*4.0f*180.0f/iParticlesLiving;
FLOAT3D vPos = Lerp(*pvPos1, *pvPos2, iInter*1.0f/LAVA_BOMB_TRAIL_INTERPOSITIONS); FLOAT3D vPos = Lerp(*pvPos1, *pvPos2, iInter*1.0f/LAVA_BOMB_TRAIL_INTERPOSITIONS);
FLOAT fRatio = FLOAT(iParticle)/iParticlesLiving+fSeconds; FLOAT fRatio = FLOAT(iParticle)/iParticlesLiving+fSeconds;
FLOAT fSize = (iParticle*1.0f/iParticlesLiving+1.0f) * fSizeMultiplier; FLOAT fSize = (iParticle*1.0f/iParticlesLiving+1.0f) * fSizeMultiplier;
fSize += afStarsPositions[iRnd][0]*0.75f*fSizeMultiplier; fSize += afStarsPositions[iRnd][0]*0.75f*fSizeMultiplier;
vPos(2) += iParticle*1.0f/iParticlesLiving; vPos(2) += iParticle*1.0f/iParticlesLiving;
vPos(1) += FLOAT(sin(fRatio*1.264*PI))*0.05f; vPos(1) += FLOAT(sin(fRatio*1.264f*PI))*0.05f;
vPos(2) += FLOAT(sin(fRatio*0.704*PI))*0.05f; vPos(2) += FLOAT(sin(fRatio*0.704f*PI))*0.05f;
vPos(3) += FLOAT(sin(fRatio*0.964*PI))*0.05f; vPos(3) += FLOAT(sin(fRatio*0.964f*PI))*0.05f;
COLOR col = pTD->GetTexel(PIX(FLOAT(iParticle)/iParticlesLiving*8*1024), 0); COLOR col = pTD->GetTexel(PIX(FLOAT(iParticle)/iParticlesLiving*8*1024), 0);
Particle_RenderSquare( vPos, fSize, fAngle, col); Particle_RenderSquare( vPos, fSize, fAngle, col);
iParticle++; iParticle++;
@ -983,14 +983,14 @@ void Particles_BeastProjectileDebrisTrail(CEntity *pen, FLOAT fSizeMultiplier)
pvPos2 = &plp->GetPosition(iPos); pvPos2 = &plp->GetPosition(iPos);
for (INDEX iInter=0; iInter<BEAST_PROJECTILE_DEBRIS_TRAIL_INTERPOSITIONS; iInter++) for (INDEX iInter=0; iInter<BEAST_PROJECTILE_DEBRIS_TRAIL_INTERPOSITIONS; iInter++)
{ {
FLOAT fAngle = iParticle*4.0f*180/iParticlesLiving; FLOAT fAngle = iParticle*4.0f*180.0f/iParticlesLiving;
FLOAT3D vPos = Lerp(*pvPos1, *pvPos2, iInter*1.0f/BEAST_PROJECTILE_DEBRIS_TRAIL_INTERPOSITIONS); FLOAT3D vPos = Lerp(*pvPos1, *pvPos2, iInter*1.0f/BEAST_PROJECTILE_DEBRIS_TRAIL_INTERPOSITIONS);
FLOAT fRatio = FLOAT(iParticle)/iParticlesLiving+fSeconds; FLOAT fRatio = FLOAT(iParticle)/iParticlesLiving+fSeconds;
FLOAT fSize = ((iParticle*iParticle+1.0f)/iParticlesLiving+2.0f) * fSizeMultiplier; FLOAT fSize = ((iParticle*iParticle+1.0f)/iParticlesLiving+2.0f) * fSizeMultiplier;
vPos(2) += iParticle*1.0f/iParticlesLiving; vPos(2) += iParticle*1.0f/iParticlesLiving;
vPos(1) += FLOAT(sin(fRatio*1.264*PI))*0.05f; vPos(1) += FLOAT(sin(fRatio*1.264f*PI))*0.05f;
vPos(2) += FLOAT(sin(fRatio*0.704*PI))*0.05f; vPos(2) += FLOAT(sin(fRatio*0.704f*PI))*0.05f;
vPos(3) += FLOAT(sin(fRatio*0.964*PI))*0.05f; vPos(3) += FLOAT(sin(fRatio*0.964f*PI))*0.05f;
COLOR col = pTD->GetTexel(PIX(FLOAT(iParticle)/iParticlesLiving*8*1024), 0); COLOR col = pTD->GetTexel(PIX(FLOAT(iParticle)/iParticlesLiving*8*1024), 0);
Particle_RenderSquare( vPos, fSize, fAngle, col); Particle_RenderSquare( vPos, fSize, fAngle, col);
iParticle++; iParticle++;
@ -1645,15 +1645,15 @@ void Particles_FlameThrower(const CPlacement3D &plLeader, const CPlacement3D &pl
// calculate parameters of hermit spline // calculate parameters of hermit spline
FLOAT ft3x=dx1+dx2+2.0f*x1-2.0f*x2; FLOAT ft3x=dx1+dx2+2.0f*x1-2.0f*x2;
FLOAT ft2x=-2.0f*dx1-dx2-3.0*(x1-x2); FLOAT ft2x=-2.0f*dx1-dx2-3.0f*(x1-x2);
FLOAT ft1x=dx1; FLOAT ft1x=dx1;
FLOAT ft0x=x1; FLOAT ft0x=x1;
FLOAT ft3y=dy1+dy2+2.0f*y1-2.0f*y2; FLOAT ft3y=dy1+dy2+2.0f*y1-2.0f*y2;
FLOAT ft2y=-2.0f*dy1-dy2-3.0*(y1-y2); FLOAT ft2y=-2.0f*dy1-dy2-3.0f*(y1-y2);
FLOAT ft1y=dy1; FLOAT ft1y=dy1;
FLOAT ft0y=y1; FLOAT ft0y=y1;
FLOAT ft3z=dz1+dz2+2.0f*z1-2.0f*z2; FLOAT ft3z=dz1+dz2+2.0f*z1-2.0f*z2;
FLOAT ft2z=-2.0f*dz1-dz2-3.0*(z1-z2); FLOAT ft2z=-2.0f*dz1-dz2-3.0f*(z1-z2);
FLOAT ft1z=dz1; FLOAT ft1z=dz1;
FLOAT ft0z=z1; FLOAT ft0z=z1;
@ -1799,20 +1799,20 @@ void Particles_ShooterFlame(const CPlacement3D &plEnd, const CPlacement3D &plSta
INDEX iRndFact = 2*i*FloatToInt(fTime*8.0f)+2; INDEX iRndFact = 2*i*FloatToInt(fTime*8.0f)+2;
// size // size
FLOAT fSize = 0.05 + 1.0*fTime; FLOAT fSize = 0.05f + 1.0f*fTime;
// angle // angle
FLOAT fAngle = fTime*180.0f*afStarsPositions[iRndFact][0]; FLOAT fAngle = fTime*180.0f*afStarsPositions[iRndFact][0];
// transparency // transparency
UBYTE ub = 255; UBYTE ub = 255;
if (fTime>1.0f) ub = 0; if (fTime>1.0f) ub = 0;
else if(fTime>0.6f) ub = (UBYTE) ((1.0-fTime)*(1.0/0.4)*255); else if(fTime>0.6f) ub = (UBYTE) ((1.0-fTime)*(1.0f/0.4f)*255);
// color with a bit of red tint before the burnout // color with a bit of red tint before the burnout
COLOR col = RGBToColor(192, 192, 192); COLOR col = RGBToColor(192, 192, 192);
if (fTime>0.95f) col = RGBToColor(192, 0, 0); if (fTime>0.95f) col = RGBToColor(192, 0, 0);
else if (fTime>0.4) col = RGBToColor(192, (UBYTE) ((1.0-fTime)*(1.0/0.6)*100+92), (UBYTE) ((1.0-fTime)*(1.0/0.6)*112+80)); else if (fTime>0.4f) col = RGBToColor(192, (UBYTE) ((1.0-fTime)*(1.0f/0.6f)*100+92), (UBYTE) ((1.0f-fTime)*(1.0f/0.6f)*112+80));
vPos(1) += afStarsPositions[iRndFact][0]*fTime; vPos(1) += afStarsPositions[iRndFact][0]*fTime;
vPos(2) += afStarsPositions[iRndFact][1]*fTime + 0.25*fTime*fTime; vPos(2) += afStarsPositions[iRndFact][1]*fTime + 0.25f*fTime*fTime;
vPos(3) += afStarsPositions[iRndFact][2]*fTime; vPos(3) += afStarsPositions[iRndFact][2]*fTime;
Particle_RenderSquare( vPos, fSize, fAngle, col|ub); Particle_RenderSquare( vPos, fSize, fAngle, col|ub);
@ -2147,10 +2147,10 @@ void Particles_DamageSmoke( CEntity *pen, FLOAT tmStarted, FLOATaabbox3D boxOwne
vPos(2) += ((afStarsPositions[iRnd2+4][1]+0.5f)*2.0f+1.5f)*fT+boxOwner.Size()(2)*0.0025f; vPos(2) += ((afStarsPositions[iRnd2+4][1]+0.5f)*2.0f+1.5f)*fT+boxOwner.Size()(2)*0.0025f;
COLOR col = C_dGRAY|UBYTE(64.0f*fRatio); COLOR col = C_dGRAY|UBYTE(64.0f*fRatio);
FLOAT fRotation = afStarsPositions[iRnd2+5][0]*360+fT*200.0f*afStarsPositions[iRnd2+3][0]; FLOAT fRotation = afStarsPositions[iRnd2+5][0]*360.0f+fT*200.0f*afStarsPositions[iRnd2+3][0];
FLOAT fSize = FLOAT fSize =
0.025f*fDamage+ 0.025f*fDamage+
(afStarsPositions[iRnd2+6][2]+0.5f)*0.075 + (afStarsPositions[iRnd2+6][2]+0.5f)*0.075f +
(0.15f+(afStarsPositions[iRnd2+2][1]+0.5f)*0.075f*fBoxSize)*fT; (0.15f+(afStarsPositions[iRnd2+2][1]+0.5f)*0.075f*fBoxSize)*fT;
Particle_RenderSquare( vPos, fSize, fRotation, col); Particle_RenderSquare( vPos, fSize, fRotation, col);
} }
@ -2253,7 +2253,7 @@ void Particles_DustFall(CEntity *pen, FLOAT tmStarted, FLOAT3D vStretch)
COLOR col = HSVToColor(ubRndH,ubRndS,ubRndV)|UBYTE(fRndBlend*fPower); COLOR col = HSVToColor(ubRndH,ubRndS,ubRndV)|UBYTE(fRndBlend*fPower);
FLOAT fRotation = afStarsPositions[iRnd][0]*360+fT*360.0f*afStarsPositions[iRnd][0]*fSpeed; FLOAT fRotation = afStarsPositions[iRnd][0]*360+fT*360.0f*afStarsPositions[iRnd][0]*fSpeed;
FLOAT fSize = FLOAT fSize =
0.75f+(afStarsPositions[iRnd][2]+0.5f)*0.25 + // static size 0.75f+(afStarsPositions[iRnd][2]+0.5f)*0.25f + // static size
(0.4f+(afStarsPositions[iRnd][1]+0.5f)*0.4f)*fT; // dinamic size (0.4f+(afStarsPositions[iRnd][1]+0.5f)*0.4f)*fT; // dinamic size
fSize*=fSizeRatio; fSize*=fSizeRatio;
Particle_RenderSquare( vPos, fSize*fStretch*0.2f, fRotation, col); Particle_RenderSquare( vPos, fSize*fStretch*0.2f, fRotation, col);
@ -3380,13 +3380,13 @@ void Particles_SandFlow( CEntity *pen, FLOAT fStretchAll, FLOAT fSize, FLOAT fHe
FLOAT fBirthTime = fNow-(fT*SANDFLOW_TOTAL_TIME); FLOAT fBirthTime = fNow-(fT*SANDFLOW_TOTAL_TIME);
if( (fBirthTime<fStartTime) || (fBirthTime>fStopTime+2.0f) ) continue; if( (fBirthTime<fStartTime) || (fBirthTime>fStopTime+2.0f) ) continue;
FLOAT fFade; FLOAT fFade;
if (fT>(1.0f-SANDFLOW_FADE_OUT)) fFade=(1-fT)*(1/SANDFLOW_FADE_OUT); if (fT>(1.0f-SANDFLOW_FADE_OUT)) fFade=(1.0f-fT)*(1.0f/SANDFLOW_FADE_OUT);
else fFade=1.0f; else fFade=1.0f;
fFade *= (CT_SANDFLOW_TRAIL-iTrail)*(1.0f/CT_SANDFLOW_TRAIL); fFade *= (CT_SANDFLOW_TRAIL-iTrail)*(1.0f/CT_SANDFLOW_TRAIL);
FLOAT3D vPos = vCenter + FLOAT3D vPos = vCenter +
vX*(afStarsPositions[iStar][0]*fStretchAll*fPowerFactor+fHeight*fT) + vX*(afStarsPositions[iStar][0]*fStretchAll*fPowerFactor+fHeight*fT) +
vY*(fT*fT*-5.0f+(afStarsPositions[iStar][1]*fPowerFactor*0.1)) + vY*(fT*fT*-5.0f+(afStarsPositions[iStar][1]*fPowerFactor*0.1f)) +
vZ*(afStarsPositions[iStar][2]*fPowerFactor*fT*fStretchAll); vZ*(afStarsPositions[iStar][2]*fPowerFactor*fT*fStretchAll);
COLOR colSand = pTD->GetTexel( FloatToInt(fT*2048), 0); COLOR colSand = pTD->GetTexel( FloatToInt(fT*2048), 0);
@ -3684,7 +3684,7 @@ void Particles_BulletSpray(INDEX iRndBase, FLOAT3D vSource, FLOAT3D vGDir, enum
void MakeBaseFromVector(const FLOAT3D &vY, FLOAT3D &vX, FLOAT3D &vZ) void MakeBaseFromVector(const FLOAT3D &vY, FLOAT3D &vX, FLOAT3D &vZ)
{ {
// if the plane is mostly horizontal // if the plane is mostly horizontal
if (Abs(vY(2))>0.5) { if (Abs(vY(2))>0.5f) {
// use cross product of +x axis and plane normal as +s axis // use cross product of +x axis and plane normal as +s axis
vX = FLOAT3D(1.0f, 0.0f, 0.0f)*vY; vX = FLOAT3D(1.0f, 0.0f, 0.0f)*vY;
// if the plane is mostly vertical // if the plane is mostly vertical
@ -5653,10 +5653,10 @@ void Particles_Leaves(CEntity *penTree, FLOATaabbox3D boxSize, FLOAT3D vSource,
Particle_SetTexturePart( 256, 256, iFrame, 0); Particle_SetTexturePart( 256, 256, iFrame, 0);
FLOAT fFade=CalculateRatio( fRatio, 0, 1, 0, 0.2f); FLOAT fFade=CalculateRatio( fRatio, 0, 1, 0, 0.2f);
INDEX iRnd1=(INDEX(iSpray+tmStarted*12356.789))%CT_MAX_PARTICLES_TABLE; INDEX iRnd1=(INDEX(iSpray+tmStarted*12356.789f))%CT_MAX_PARTICLES_TABLE;
INDEX iRnd2=(INDEX(iSpray+tmStarted*21341.789))%CT_MAX_PARTICLES_TABLE; INDEX iRnd2=(INDEX(iSpray+tmStarted*21341.789f))%CT_MAX_PARTICLES_TABLE;
INDEX iRnd3=(INDEX(iSpray+tmStarted*52672.789))%CT_MAX_PARTICLES_TABLE; INDEX iRnd3=(INDEX(iSpray+tmStarted*52672.789f))%CT_MAX_PARTICLES_TABLE;
INDEX iRnd4=(INDEX(iSpray+tmStarted*83652.458))%CT_MAX_PARTICLES_TABLE; INDEX iRnd4=(INDEX(iSpray+tmStarted*83652.458f))%CT_MAX_PARTICLES_TABLE;
FLOAT3D vLaunchSpeed= FLOAT3D( FLOAT3D vLaunchSpeed= FLOAT3D(
afStarsPositions[iRnd1][0]*2.0f, afStarsPositions[iRnd1][0]*2.0f,
(afStarsPositions[iRnd1][1]+1.0f)*3.0f, (afStarsPositions[iRnd1][1]+1.0f)*3.0f,

6
Sources/EntitiesMP/EnemyBase.es Normal file → Executable file
View File

@ -650,14 +650,14 @@ functions:
FLOAT fKickDamage = fNewDamage; FLOAT fKickDamage = fNewDamage;
if( (dmtType == DMT_EXPLOSION) || (dmtType == DMT_IMPACT) || (dmtType == DMT_CANNONBALL_EXPLOSION) ) if( (dmtType == DMT_EXPLOSION) || (dmtType == DMT_IMPACT) || (dmtType == DMT_CANNONBALL_EXPLOSION) )
{ {
fKickDamage*=1.5; fKickDamage*=1.5f;
} }
if (dmtType==DMT_DROWNING || dmtType==DMT_CLOSERANGE || dmtType==DMT_CHAINSAW) { if (dmtType==DMT_DROWNING || dmtType==DMT_CLOSERANGE || dmtType==DMT_CHAINSAW) {
fKickDamage /= 10; fKickDamage /= 10.0f;
} }
if (dmtType==DMT_BURNING) if (dmtType==DMT_BURNING)
{ {
fKickDamage /= 100000; fKickDamage /= 100000.0f;
UBYTE ubR, ubG, ubB, ubA; UBYTE ubR, ubG, ubB, ubA;
FLOAT fColorFactor=fNewDamage/m_fMaxHealth*255.0f; FLOAT fColorFactor=fNewDamage/m_fMaxHealth*255.0f;
ColorToRGBA(m_colBurning, ubR, ubG, ubB, ubA); ColorToRGBA(m_colBurning, ubR, ubG, ubB, ubA);

8
Sources/EntitiesMP/EnvironmentParticlesHolder.es Normal file → Executable file
View File

@ -209,10 +209,10 @@ procedures:
SetModel(MODEL_ENVIRONMENT_PARTICLES_HOLDER); SetModel(MODEL_ENVIRONMENT_PARTICLES_HOLDER);
SetModelMainTexture(TEXTURE_ENVIRONMENT_PARTICLES_HOLDER); SetModelMainTexture(TEXTURE_ENVIRONMENT_PARTICLES_HOLDER);
m_tmRainStart = 1e5-1.0f; m_tmRainStart = 1e5f-1.0f;
m_tmRainEnd = 1e5; m_tmRainEnd = 1e5f;
m_tmSnowStart = 1e5-1.0f; m_tmSnowStart = 1e5f-1.0f;
m_tmSnowEnd = 1e5; m_tmSnowEnd = 1e5f;
switch(m_eptType) { switch(m_eptType) {
case EPTH_GROWTH: case EPTH_GROWTH:

12
Sources/EntitiesMP/ExotechLarva.es Normal file → Executable file
View File

@ -883,7 +883,7 @@ functions:
ESpawnEffect eSpawnEffect; ESpawnEffect eSpawnEffect;
eSpawnEffect.colMuliplier = C_WHITE|CT_OPAQUE; eSpawnEffect.colMuliplier = C_WHITE|CT_OPAQUE;
eSpawnEffect.betType = BET_CANNON; eSpawnEffect.betType = BET_CANNON;
eSpawnEffect.vStretch = FLOAT3D(m_fStretch*0.5, m_fStretch*0.5, m_fStretch*0.5); eSpawnEffect.vStretch = FLOAT3D(m_fStretch*0.5f, m_fStretch*0.5f, m_fStretch*0.5f);
CEntityPointer penExplosion = CreateEntity(CPlacement3D(m_vLeftLaserTarget, CEntityPointer penExplosion = CreateEntity(CPlacement3D(m_vLeftLaserTarget,
ANGLE3D(0.0f, 0.0f, 0.0f)), CLASS_BASIC_EFFECT); ANGLE3D(0.0f, 0.0f, 0.0f)), CLASS_BASIC_EFFECT);
penExplosion->Initialize(eSpawnEffect); penExplosion->Initialize(eSpawnEffect);
@ -908,7 +908,7 @@ functions:
ESpawnEffect eSpawnEffect; ESpawnEffect eSpawnEffect;
eSpawnEffect.colMuliplier = C_WHITE|CT_OPAQUE; eSpawnEffect.colMuliplier = C_WHITE|CT_OPAQUE;
eSpawnEffect.betType = BET_CANNON; eSpawnEffect.betType = BET_CANNON;
eSpawnEffect.vStretch = FLOAT3D(m_fStretch*0.5, m_fStretch*0.5, m_fStretch*0.5); eSpawnEffect.vStretch = FLOAT3D(m_fStretch*0.5f, m_fStretch*0.5f, m_fStretch*0.5f);
CEntityPointer penExplosion = CreateEntity(CPlacement3D(m_vLeftLaserTarget, CEntityPointer penExplosion = CreateEntity(CPlacement3D(m_vLeftLaserTarget,
ANGLE3D(0.0f, 0.0f, 0.0f)), CLASS_BASIC_EFFECT); ANGLE3D(0.0f, 0.0f, 0.0f)), CLASS_BASIC_EFFECT);
penExplosion->Initialize(eSpawnEffect); penExplosion->Initialize(eSpawnEffect);
@ -1000,7 +1000,7 @@ procedures:
ESpawnEffect eSpawnEffect; ESpawnEffect eSpawnEffect;
eSpawnEffect.colMuliplier = C_WHITE|CT_OPAQUE; eSpawnEffect.colMuliplier = C_WHITE|CT_OPAQUE;
eSpawnEffect.betType = BET_CANNON; eSpawnEffect.betType = BET_CANNON;
eSpawnEffect.vStretch = FLOAT3D(m_fStretch*0.5, m_fStretch*0.5, m_fStretch*0.5); eSpawnEffect.vStretch = FLOAT3D(m_fStretch*0.5f, m_fStretch*0.5f, m_fStretch*0.5f);
CEntityPointer penExplosion = CreateEntity(pl, CLASS_BASIC_EFFECT); CEntityPointer penExplosion = CreateEntity(pl, CLASS_BASIC_EFFECT);
penExplosion->Initialize(eSpawnEffect); penExplosion->Initialize(eSpawnEffect);
autowait(FRnd()*0.25f+0.15f); autowait(FRnd()*0.25f+0.15f);
@ -1023,7 +1023,7 @@ procedures:
ESpawnEffect eSpawnEffect; ESpawnEffect eSpawnEffect;
eSpawnEffect.colMuliplier = C_WHITE|CT_OPAQUE; eSpawnEffect.colMuliplier = C_WHITE|CT_OPAQUE;
eSpawnEffect.betType = BET_CANNON; eSpawnEffect.betType = BET_CANNON;
eSpawnEffect.vStretch = FLOAT3D(m_fStretch*1.5,m_fStretch*1.5,m_fStretch*1.5); eSpawnEffect.vStretch = FLOAT3D(m_fStretch*1.5f,m_fStretch*1.5f,m_fStretch*1.5f);
CEntityPointer penExplosion = CreateEntity(pl, CLASS_BASIC_EFFECT); CEntityPointer penExplosion = CreateEntity(pl, CLASS_BASIC_EFFECT);
penExplosion->Initialize(eSpawnEffect); penExplosion->Initialize(eSpawnEffect);
eSpawnEffect.betType = BET_ROCKET; eSpawnEffect.betType = BET_ROCKET;
@ -1063,7 +1063,7 @@ procedures:
// randomize explosion position and size // randomize explosion position and size
CPlacement3D plExplosion; CPlacement3D plExplosion;
plExplosion.pl_OrientationAngle = ANGLE3D(0.0f, 0.0f, 0.0f); plExplosion.pl_OrientationAngle = ANGLE3D(0.0f, 0.0f, 0.0f);
plExplosion.pl_PositionVector = FLOAT3D(FRnd()*2.0-1.0f, FRnd()*3.0-1.5f+LARVA_HANDLE_TRANSLATE, FRnd()*2.0-1.0f)*m_fStretch + GetPlacement().pl_PositionVector; plExplosion.pl_PositionVector = FLOAT3D(FRnd()*2.0f-1.0f, FRnd()*3.0f-1.5f+LARVA_HANDLE_TRANSLATE, FRnd()*2.0f-1.0f)*m_fStretch + GetPlacement().pl_PositionVector;
FLOAT vExpSize = (FRnd()*0.7f+0.7f)*m_fStretch; FLOAT vExpSize = (FRnd()*0.7f+0.7f)*m_fStretch;
ESpawnEffect eSpawnEffect; ESpawnEffect eSpawnEffect;
@ -1289,7 +1289,7 @@ procedures:
m_bRechargedAtLeastOnce = TRUE; m_bRechargedAtLeastOnce = TRUE;
} }
SetHealth(ClampUp(GetHealth()+m_fRechargePerSecond, m_fMaxHealth*m_fMaxRechargedHealth)); SetHealth(ClampUp(GetHealth()+m_fRechargePerSecond, m_fMaxHealth*m_fMaxRechargedHealth));
if (GetHealth()>m_fMaxHealth*0.95) { if (GetHealth()>m_fMaxHealth*0.95f) {
m_ltTarget = LT_ENEMY; m_ltTarget = LT_ENEMY;
m_bRecharging = FALSE; m_bRecharging = FALSE;
// deactivate beam // deactivate beam

2
Sources/EntitiesMP/ExotechLarvaBattery.es Normal file → Executable file
View File

@ -125,7 +125,7 @@ functions:
RemoveAttachment(WALLCHARGER_ATTACHMENT_LIGHT); RemoveAttachment(WALLCHARGER_ATTACHMENT_LIGHT);
GetModelObject()->PlayAnim(WALLCHARGER_ANIM_DAMAGE01, AOF_SMOOTHCHANGE|AOF_NORESTART); GetModelObject()->PlayAnim(WALLCHARGER_ANIM_DAMAGE01, AOF_SMOOTHCHANGE|AOF_NORESTART);
SpawnExplosions(); SpawnExplosions();
} else if (fNewHealth<=0.33*m_fMaxHealth && fLastHealth>0.33*m_fMaxHealth) { } else if (fNewHealth<=0.33f*m_fMaxHealth && fLastHealth>0.33f*m_fMaxHealth) {
RemoveAttachment(WALLCHARGER_ATTACHMENT_PLASMA); RemoveAttachment(WALLCHARGER_ATTACHMENT_PLASMA);
GetModelObject()->PlayAnim(WALLCHARGER_ANIM_DAMAGE02, AOF_SMOOTHCHANGE|AOF_NORESTART); GetModelObject()->PlayAnim(WALLCHARGER_ANIM_DAMAGE02, AOF_SMOOTHCHANGE|AOF_NORESTART);
SpawnExplosions(); SpawnExplosions();

2
Sources/EntitiesMP/Fish.es Normal file → Executable file
View File

@ -212,7 +212,7 @@ functions:
if( fTimePassed > 0.25f) if( fTimePassed > 0.25f)
{ {
// calculate light dying factor // calculate light dying factor
fDieFactor = 1.0-(ClampUp(fTimePassed-0.25f,0.5f)/0.5f); fDieFactor = 1.0f-(ClampUp(fTimePassed-0.25f,0.5f)/0.5f);
} }
// adjust light fx // adjust light fx
FLOAT fR = 0.7f+0.1f*(FLOAT(rand())/RAND_MAX); FLOAT fR = 0.7f+0.1f*(FLOAT(rand())/RAND_MAX);

2
Sources/EntitiesMP/Flame.es Normal file → Executable file
View File

@ -277,7 +277,7 @@ procedures:
} }
// if the plane is mostly horizontal // if the plane is mostly horizontal
if (Abs(plPlane(2))>0.5) { if (Abs(plPlane(2))>0.5f) {
// use cross product of +x axis and plane normal as +s axis // use cross product of +x axis and plane normal as +s axis
vU = FLOAT3D(1.0f, 0.0f, 0.0f)*m_vPlaneNormal; vU = FLOAT3D(1.0f, 0.0f, 0.0f)*m_vPlaneNormal;
// if the plane is mostly vertical // if the plane is mostly vertical

8
Sources/EntitiesMP/Player.es Normal file → Executable file
View File

@ -2936,14 +2936,14 @@ functions:
FLOAT fKickDamage = fDamageAmmount; FLOAT fKickDamage = fDamageAmmount;
if( (dmtType == DMT_EXPLOSION) || (dmtType == DMT_IMPACT) || (dmtType == DMT_CANNONBALL_EXPLOSION) ) if( (dmtType == DMT_EXPLOSION) || (dmtType == DMT_IMPACT) || (dmtType == DMT_CANNONBALL_EXPLOSION) )
{ {
fKickDamage*=1.5; fKickDamage*=1.5f;
} }
if (dmtType==DMT_DROWNING || dmtType==DMT_CLOSERANGE) { if (dmtType==DMT_DROWNING || dmtType==DMT_CLOSERANGE) {
fKickDamage /= 10; fKickDamage /= 10.0f;
} }
if (dmtType==DMT_CHAINSAW) if (dmtType==DMT_CHAINSAW)
{ {
fKickDamage /= 10; fKickDamage /= 10.0f;
} }
// get passed time since last damage // get passed time since last damage
@ -4744,7 +4744,7 @@ functions:
mDesired = en_mRotation*(mDesired*!en_mRotation); mDesired = en_mRotation*(mDesired*!en_mRotation);
FLOATmatrix3D mForced = !mDesired*mCurr*!mLast; // = aCurr-aLast-aDesired; FLOATmatrix3D mForced = !mDesired*mCurr*!mLast; // = aCurr-aLast-aDesired;
ANGLE3D aForced; DecomposeRotationMatrixNoSnap(aForced, mForced); ANGLE3D aForced; DecomposeRotationMatrixNoSnap(aForced, mForced);
if (aForced.MaxNorm()<1E-2) { if (aForced.MaxNorm()<1E-2f) {
aForced = ANGLE3D(0,0,0); aForced = ANGLE3D(0,0,0);
} }
FLOATquat3D qForced; qForced.FromEuler(aForced); FLOATquat3D qForced; qForced.FromEuler(aForced);

2
Sources/EntitiesMP/PlayerView.es Normal file → Executable file
View File

@ -171,7 +171,7 @@ functions:
if (bFollowCrossHair) { if (bFollowCrossHair) {
FLOAT3D vTarget = vBase-ppw->m_vRayHit; FLOAT3D vTarget = vBase-ppw->m_vRayHit;
FLOAT fLen = vTarget.Length(); FLOAT fLen = vTarget.Length();
if (fLen>0.01) { if (fLen>0.01f) {
vTarget/=fLen; vTarget/=fLen;
} else { } else {
vTarget = FLOAT3D(0,1,0); vTarget = FLOAT3D(0,1,0);

4
Sources/EntitiesMP/PlayerWeapons.es Normal file → Executable file
View File

@ -1962,7 +1962,7 @@ functions:
FLOAT3D vToTarget = penClosest->GetPlacement().pl_PositionVector - m_penPlayer->GetPlacement().pl_PositionVector; FLOAT3D vToTarget = penClosest->GetPlacement().pl_PositionVector - m_penPlayer->GetPlacement().pl_PositionVector;
FLOAT3D vTargetHeading = FLOAT3D(0.0, 0.0, -1.0f)*penClosest->GetRotationMatrix(); FLOAT3D vTargetHeading = FLOAT3D(0.0, 0.0, -1.0f)*penClosest->GetRotationMatrix();
vToTarget.Normalize(); vTargetHeading.Normalize(); vToTarget.Normalize(); vTargetHeading.Normalize();
if (vToTarget%vTargetHeading>0.64279) //CosFast(50.0f) if (vToTarget%vTargetHeading>0.64279f) //CosFast(50.0f)
{ {
PrintCenterMessage(this, m_penPlayer, TRANS("Backstab!"), 4.0f, MSS_NONE); PrintCenterMessage(this, m_penPlayer, TRANS("Backstab!"), 4.0f, MSS_NONE);
fDamage *= 4.0f; fDamage *= 4.0f;
@ -4336,7 +4336,7 @@ procedures:
} }
} }
autowait(GetSP()->sp_bCooperative ? 0.5f : 0.375); autowait(GetSP()->sp_bCooperative ? 0.5f : 0.375f);
/* drop shell */ /* drop shell */
/* add one empty bullet shell */ /* add one empty bullet shell */

10
Sources/EntitiesMP/PowerUpItem.es Normal file → Executable file
View File

@ -157,7 +157,7 @@ functions:
m_strDescription.PrintF("Invisibility"); m_strDescription.PrintF("Invisibility");
AddItem( MODEL_INVISIB, TEXTURE_REFLECTION_METAL, 0, TEXTURE_SPECULAR_STRONG, 0); // set appearance AddItem( MODEL_INVISIB, TEXTURE_REFLECTION_METAL, 0, TEXTURE_SPECULAR_STRONG, 0); // set appearance
AddFlare( MODEL_FLARE, TEXTURE_FLARE, FLOAT3D(0,0.2f,0), FLOAT3D(1,1,0.3f) ); // add flare AddFlare( MODEL_FLARE, TEXTURE_FLARE, FLOAT3D(0,0.2f,0), FLOAT3D(1,1,0.3f) ); // add flare
StretchItem( FLOAT3D(1.0f*0.75f, 1.0f*0.75f, 1.0f*0.75)); StretchItem( FLOAT3D(1.0f*0.75f, 1.0f*0.75f, 1.0f*0.75f));
break; break;
case PUIT_INVULNER: case PUIT_INVULNER:
StartModelAnim( ITEMHOLDER_ANIM_SMALLOSCILATION, AOF_LOOPING|AOF_NORESTART); StartModelAnim( ITEMHOLDER_ANIM_SMALLOSCILATION, AOF_LOOPING|AOF_NORESTART);
@ -166,7 +166,7 @@ functions:
m_strDescription.PrintF("Invulnerability"); m_strDescription.PrintF("Invulnerability");
AddItem( MODEL_INVULNER, TEXTURE_REFLECTION_GOLD, TEXTURE_REFLECTION_METAL, TEXTURE_SPECULAR_MEDIUM, 0); // set appearance AddItem( MODEL_INVULNER, TEXTURE_REFLECTION_GOLD, TEXTURE_REFLECTION_METAL, TEXTURE_SPECULAR_MEDIUM, 0); // set appearance
AddFlare( MODEL_FLARE, TEXTURE_FLARE, FLOAT3D(0,0.2f,0), FLOAT3D(1,1,0.3f) ); // add flare AddFlare( MODEL_FLARE, TEXTURE_FLARE, FLOAT3D(0,0.2f,0), FLOAT3D(1,1,0.3f) ); // add flare
StretchItem( FLOAT3D(1.0f*0.75f, 1.0f*0.75f, 1.0f*0.75)); StretchItem( FLOAT3D(1.0f*0.75f, 1.0f*0.75f, 1.0f*0.75f));
break; break;
case PUIT_DAMAGE: case PUIT_DAMAGE:
StartModelAnim( ITEMHOLDER_ANIM_SMALLOSCILATION, AOF_LOOPING|AOF_NORESTART); StartModelAnim( ITEMHOLDER_ANIM_SMALLOSCILATION, AOF_LOOPING|AOF_NORESTART);
@ -175,7 +175,7 @@ functions:
m_strDescription.PrintF("SeriousDamage"); m_strDescription.PrintF("SeriousDamage");
AddItem( MODEL_DAMAGE, TEXTURE_DAMAGE, 0, TEXTURE_SPECULAR_STRONG, 0); // set appearance AddItem( MODEL_DAMAGE, TEXTURE_DAMAGE, 0, TEXTURE_SPECULAR_STRONG, 0); // set appearance
AddFlare( MODEL_FLARE, TEXTURE_FLARE, FLOAT3D(0,0.2f,0), FLOAT3D(1,1,0.3f) ); // add flare AddFlare( MODEL_FLARE, TEXTURE_FLARE, FLOAT3D(0,0.2f,0), FLOAT3D(1,1,0.3f) ); // add flare
StretchItem( FLOAT3D(1.0f*0.75f, 1.0f*0.75f, 1.0f*0.75)); StretchItem( FLOAT3D(1.0f*0.75f, 1.0f*0.75f, 1.0f*0.75f));
break; break;
case PUIT_SPEED: case PUIT_SPEED:
StartModelAnim( ITEMHOLDER_ANIM_SMALLOSCILATION, AOF_LOOPING|AOF_NORESTART); StartModelAnim( ITEMHOLDER_ANIM_SMALLOSCILATION, AOF_LOOPING|AOF_NORESTART);
@ -184,7 +184,7 @@ functions:
m_strDescription.PrintF("SeriousSpeed"); m_strDescription.PrintF("SeriousSpeed");
AddItem( MODEL_SPEED, TEXTURE_SPEED, 0, 0, 0); // set appearance AddItem( MODEL_SPEED, TEXTURE_SPEED, 0, 0, 0); // set appearance
AddFlare( MODEL_FLARE, TEXTURE_FLARE, FLOAT3D(0,0.2f,0), FLOAT3D(1,1,0.3f) ); // add flare AddFlare( MODEL_FLARE, TEXTURE_FLARE, FLOAT3D(0,0.2f,0), FLOAT3D(1,1,0.3f) ); // add flare
StretchItem( FLOAT3D(1.0f*0.75f, 1.0f*0.75f, 1.0f*0.75)); StretchItem( FLOAT3D(1.0f*0.75f, 1.0f*0.75f, 1.0f*0.75f));
break; break;
case PUIT_BOMB: case PUIT_BOMB:
StartModelAnim( ITEMHOLDER_ANIM_SMALLOSCILATION, AOF_LOOPING|AOF_NORESTART); StartModelAnim( ITEMHOLDER_ANIM_SMALLOSCILATION, AOF_LOOPING|AOF_NORESTART);
@ -193,7 +193,7 @@ functions:
m_strDescription.PrintF("Serious Bomb!"); m_strDescription.PrintF("Serious Bomb!");
AddItem( MODEL_BOMB, TEXTURE_BOMB, 0, 0, 0); // set appearance AddItem( MODEL_BOMB, TEXTURE_BOMB, 0, 0, 0); // set appearance
AddFlare( MODEL_FLARE, TEXTURE_FLARE, FLOAT3D(0,0.2f,0), FLOAT3D(1,1,0.3f) ); // add flare AddFlare( MODEL_FLARE, TEXTURE_FLARE, FLOAT3D(0,0.2f,0), FLOAT3D(1,1,0.3f) ); // add flare
StretchItem( FLOAT3D(1.0f*3.0f, 1.0f*3.0f, 1.0f*3.0)); StretchItem( FLOAT3D(1.0f*3.0f, 1.0f*3.0f, 1.0f*3.0f));
break; break;
} }
}; };

10
Sources/EntitiesMP/Projectile.es Normal file → Executable file
View File

@ -1658,7 +1658,7 @@ void LavamanBombExplosion(void)
{ {
FLOAT fHeading = (FRnd()-0.5f)*180.0f; FLOAT fHeading = (FRnd()-0.5f)*180.0f;
FLOAT fPitch = 10.0f+FRnd()*40.0f; FLOAT fPitch = 10.0f+FRnd()*40.0f;
FLOAT fSpeed = 10.0+FRnd()*50.0f; FLOAT fSpeed = 10.0f+FRnd()*50.0f;
// launch // launch
CPlacement3D pl = GetPlacement(); CPlacement3D pl = GetPlacement();
@ -1961,7 +1961,7 @@ void BeastProjectileExplosion(void)
for( INDEX iDebris=0; iDebris<2; iDebris++) for( INDEX iDebris=0; iDebris<2; iDebris++)
{ {
FLOAT fPitch = 10.0f+FRnd()*10.0f; FLOAT fPitch = 10.0f+FRnd()*10.0f;
FLOAT fSpeed = 5.0+FRnd()*20.0f; FLOAT fSpeed = 5.0f+FRnd()*20.0f;
// launch // launch
CPlacement3D pl = GetPlacement(); CPlacement3D pl = GetPlacement();
@ -2019,7 +2019,7 @@ void BeastBigProjectileExplosion(void)
{ {
FLOAT fHeading = (FRnd()-0.5f)*180.0f; FLOAT fHeading = (FRnd()-0.5f)*180.0f;
FLOAT fPitch = 10.0f+FRnd()*40.0f; FLOAT fPitch = 10.0f+FRnd()*40.0f;
FLOAT fSpeed = 10.0+FRnd()*50.0f; FLOAT fSpeed = 10.0f+FRnd()*50.0f;
// launch // launch
CPlacement3D pl = GetPlacement(); CPlacement3D pl = GetPlacement();
@ -2258,7 +2258,7 @@ void DevilGuidedProjectileExplosion(void)
{ {
FLOAT fHeading = (FRnd()-0.5f)*180.0f; FLOAT fHeading = (FRnd()-0.5f)*180.0f;
FLOAT fPitch = 10.0f+FRnd()*40.0f; FLOAT fPitch = 10.0f+FRnd()*40.0f;
FLOAT fSpeed = 10.0+FRnd()*50.0f; FLOAT fSpeed = 10.0f+FRnd()*50.0f;
// launch // launch
CPlacement3D pl = GetPlacement(); CPlacement3D pl = GetPlacement();
@ -3371,7 +3371,7 @@ procedures:
((CProjectile*)&*etouch.penOther)->m_prtType==m_prtType)); ((CProjectile*)&*etouch.penOther)->m_prtType==m_prtType));
bHit &= !IsOfClass(etouch.penOther, "Demon"); bHit &= !IsOfClass(etouch.penOther, "Demon");
FLOAT3D vTrans = en_vCurrentTranslationAbsolute; FLOAT3D vTrans = en_vCurrentTranslationAbsolute;
bHit &= Abs(vTrans.Normalize() % FLOAT3D(etouch.plCollision)) > 0.35; bHit &= Abs(vTrans.Normalize() % FLOAT3D(etouch.plCollision)) > 0.35f;
if (bHit) { if (bHit) {
ProjectileTouch(etouch.penOther); ProjectileTouch(etouch.penOther);

2
Sources/EntitiesMP/Shooter.es Normal file → Executable file
View File

@ -278,7 +278,7 @@ procedures:
// possible random wait // possible random wait
if (m_fRndBeginWait>0.0f) if (m_fRndBeginWait>0.0f)
{ {
FLOAT fRndWait = FRnd()*m_fRndBeginWait+0.05; FLOAT fRndWait = FRnd()*m_fRndBeginWait+0.05f;
autowait(fRndWait); autowait(fRndWait);
} }

4
Sources/EntitiesMP/Summoner.es Normal file → Executable file
View File

@ -564,7 +564,7 @@ functions:
//CPrintF("FIRE DISABLED -> too much fuss\n"); //CPrintF("FIRE DISABLED -> too much fuss\n");
m_bFireOK = FALSE; m_bFireOK = FALSE;
// enable firing only when very little fuss // enable firing only when very little fuss
} else if (m_fFuss<0.4*m_fMaxCurrentFuss) { } else if (m_fFuss<0.4f*m_fMaxCurrentFuss) {
//CPrintF("FIRE ENABLE -> fuss more then %f\n", 0.4*m_fMaxCurrentFuss); //CPrintF("FIRE ENABLE -> fuss more then %f\n", 0.4*m_fMaxCurrentFuss);
m_bFireOK = TRUE; m_bFireOK = TRUE;
// but if significant damage since last spawn, enable firing anyway // but if significant damage since last spawn, enable firing anyway
@ -922,7 +922,7 @@ procedures:
} }
if (iEnemyCount<6) { if (iEnemyCount<6) {
fToSpawn = (6.0 - (FLOAT)iEnemyCount)/2.0f; fToSpawn = (6.0f - (FLOAT)iEnemyCount)/2.0f;
} else { } else {
fToSpawn = 1.0f; fToSpawn = 1.0f;
} }

24
Sources/EntitiesMP/WorldSettingsController.es Normal file → Executable file
View File

@ -29,16 +29,16 @@ properties:
3 FLOAT m_tmLightningStart = -1.0f, // lightning start time 3 FLOAT m_tmLightningStart = -1.0f, // lightning start time
4 FLOAT m_fLightningPower = 1.0f, // lightning power 4 FLOAT m_fLightningPower = 1.0f, // lightning power
5 FLOAT m_tmStormEnd = -1.0f, // storm end time 5 FLOAT m_tmStormEnd = -1.0f, // storm end time
6 FLOAT m_tmPyramidPlatesStart = 1e6, // time when pyramid plates blend started 6 FLOAT m_tmPyramidPlatesStart = 1e6f, // time when pyramid plates blend started
7 FLOAT m_tmActivatedPlate1 = 1e6, // time when plate 1 has been activated 7 FLOAT m_tmActivatedPlate1 = 1e6f, // time when plate 1 has been activated
8 FLOAT m_tmDeactivatedPlate1 = 1e6, // time when plate 1 has been deactivated 8 FLOAT m_tmDeactivatedPlate1 = 1e6f, // time when plate 1 has been deactivated
9 FLOAT m_tmActivatedPlate2 = 1e6, // time when plate 2 has been activated 9 FLOAT m_tmActivatedPlate2 = 1e6f, // time when plate 2 has been activated
10 FLOAT m_tmDeactivatedPlate2 = 1e6, // time when plate 2 has been deactivated 10 FLOAT m_tmDeactivatedPlate2 = 1e6f, // time when plate 2 has been deactivated
11 FLOAT m_tmActivatedPlate3 = 1e6, // time when plate 3 has been activated 11 FLOAT m_tmActivatedPlate3 = 1e6f, // time when plate 3 has been activated
12 FLOAT m_tmDeactivatedPlate3 = 1e6, // time when plate 3 has been deactivated 12 FLOAT m_tmDeactivatedPlate3 = 1e6f, // time when plate 3 has been deactivated
13 FLOAT m_tmActivatedPlate4 = 1e6, // time when plate 4 has been activated 13 FLOAT m_tmActivatedPlate4 = 1e6f, // time when plate 4 has been activated
14 FLOAT m_tmDeactivatedPlate4 = 1e6, // time when plate 4 has been deactivated 14 FLOAT m_tmDeactivatedPlate4 = 1e6f, // time when plate 4 has been deactivated
15 FLOAT m_tmPyramidMorphRoomActivated = 1e6, // time when pyramid morph room has been activated 15 FLOAT m_tmPyramidMorphRoomActivated = 1e6f, // time when pyramid morph room has been activated
20 FLOAT m_tmShakeStarted = -1.0f, // time when shaking started 20 FLOAT m_tmShakeStarted = -1.0f, // time when shaking started
21 FLOAT3D m_vShakePos = FLOAT3D(0,0,0), // shake position 21 FLOAT3D m_vShakePos = FLOAT3D(0,0,0), // shake position
@ -207,8 +207,8 @@ procedures:
SetModel(MODEL_WORLD_SETTINGS_CONTROLLER); SetModel(MODEL_WORLD_SETTINGS_CONTROLLER);
SetModelMainTexture(TEXTURE_WORLD_SETTINGS_CONTROLLER); SetModelMainTexture(TEXTURE_WORLD_SETTINGS_CONTROLLER);
m_tmStormStart = 1e5-1.0f; m_tmStormStart = 1e5f-1.0f;
m_tmStormEnd = 1e5; m_tmStormEnd = 1e5f;
// do nothing // do nothing
return; return;

2
Sources/GameMP/CompModels.cpp Normal file → Executable file
View File

@ -969,7 +969,7 @@ void RenderMessageModel(CDrawPort *pdp, const CTString &strModel)
apr = pr; apr = pr;
BeginModelRenderingView(apr, pdp); BeginModelRenderingView(apr, pdp);
rm.rm_vLightDirection = _vLightDir; rm.rm_vLightDirection = _vLightDir;
const FLOAT fDistance = 1+ 10*(1/(_fMsgAppearFade+0.01) - 1/(1+0.01)); const FLOAT fDistance = 1.0f+ 10.f*(1.0f/(_fMsgAppearFade+0.01f) - 1.0f/(1.0f+0.01f));
// if model needs floor // if model needs floor
if( _bHasFloor) { if( _bHasFloor) {