summaryrefslogtreecommitdiffstats
path: root/src/render
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/render/Draw.cpp1
-rw-r--r--src/render/Draw.h4
-rw-r--r--src/render/Particle.cpp12
-rw-r--r--src/render/Particle.h2
-rw-r--r--src/render/WaterLevel.cpp6
5 files changed, 13 insertions, 12 deletions
diff --git a/src/render/Draw.cpp b/src/render/Draw.cpp
index beb3443d..862fc024 100644
--- a/src/render/Draw.cpp
+++ b/src/render/Draw.cpp
@@ -11,6 +11,7 @@ float CDraw::ms_fAspectRatio = DEFAULT_ASPECT_RATIO;
float &CDraw::ms_fNearClipZ = *(float*)0x8E2DC4;
float &CDraw::ms_fFarClipZ = *(float*)0x9434F0;
float &CDraw::ms_fFOV = *(float*)0x5FBC6C;
+float &CDraw::ms_fLODDistance = *(float*)0x8F2C30;
uint8 &CDraw::FadeValue = *(uint8*)0x95CD68;
uint8 &CDraw::FadeRed = *(uint8*)0x95CD90;
diff --git a/src/render/Draw.h b/src/render/Draw.h
index 75b2b75f..50e1e294 100644
--- a/src/render/Draw.h
+++ b/src/render/Draw.h
@@ -16,7 +16,8 @@ private:
static float &ms_fNearClipZ;
static float &ms_fFarClipZ;
static float &ms_fFOV;
- static float ms_fLODDistance; // unused
+public:
+ static float &ms_fLODDistance; // set but unused?
#ifdef ASPECT_RATIO_SCALE
// we use this variable to scale a lot of 2D elements
@@ -24,7 +25,6 @@ private:
static float ms_fAspectRatio;
#endif
-public:
static uint8 &FadeValue;
static uint8 &FadeRed;
static uint8 &FadeGreen;
diff --git a/src/render/Particle.cpp b/src/render/Particle.cpp
index 23e23f93..e2db55c7 100644
--- a/src/render/Particle.cpp
+++ b/src/render/Particle.cpp
@@ -1261,7 +1261,7 @@ void CParticle::Update()
nil,
particle->m_fSize, color, particle->m_nRotationStep, 0, 0, 0);
- PlayOneShotScriptObject(_SOUND_BULLET_SHELL_HIT_GROUND_1, particle->m_vecPosition);
+ PlayOneShotScriptObject(_SCRSOUND_BULLET_SHELL_HIT_GROUND_1, particle->m_vecPosition);
}
break;
@@ -1280,7 +1280,7 @@ void CParticle::Update()
nil,
particle->m_fSize, color, 0, 0, 0, 0);
- PlayOneShotScriptObject(_SOUND_BULLET_SHELL_HIT_GROUND_2, particle->m_vecPosition);
+ PlayOneShotScriptObject(_SCRSOUND_BULLET_SHELL_HIT_GROUND_2, particle->m_vecPosition);
}
break;
@@ -1410,13 +1410,11 @@ void CParticle::Update()
if ( particle->m_fCurrentZRadius != 0.0f )
{
- int32 nSinCosIndex = particle->m_nCurrentZRotation % (SIN_COS_TABLE_SIZE - 1);
+ int32 nRot = particle->m_nCurrentZRotation % (SIN_COS_TABLE_SIZE - 1);
- float fX = (m_CosTable[nSinCosIndex] - m_SinTable[nSinCosIndex])
- * particle->m_fCurrentZRadius;
+ float fX = (Cos(nRot) - Sin(nRot)) * particle->m_fCurrentZRadius;
- float fY = (m_SinTable[nSinCosIndex] + m_CosTable[nSinCosIndex])
- * particle->m_fCurrentZRadius;
+ float fY = (Sin(nRot) + Cos(nRot)) * particle->m_fCurrentZRadius;
moveStep -= particle->m_vecParticleMovementOffset;
diff --git a/src/render/Particle.h b/src/render/Particle.h
index eaacf2f5..4e41ea2d 100644
--- a/src/render/Particle.h
+++ b/src/render/Particle.h
@@ -60,6 +60,8 @@ public:
static float (&m_SinTable)[SIN_COS_TABLE_SIZE];
static float (&m_CosTable)[SIN_COS_TABLE_SIZE];
+ static float Sin(int32 value) { return m_SinTable[value]; }
+ static float Cos(int32 value) { return m_CosTable[value]; }
static void ReloadConfig();
static void Initialise();
diff --git a/src/render/WaterLevel.cpp b/src/render/WaterLevel.cpp
index 247b9f3d..48e8f83b 100644
--- a/src/render/WaterLevel.cpp
+++ b/src/render/WaterLevel.cpp
@@ -731,10 +731,10 @@ CWaterLevel::RenderWater()
float fAngle = CGeneral::GetRandomNumberInRange(90.0f, 150.0f);
- int32 nSinCosIdx = CGeneral::GetRandomNumber() % CParticle::SIN_COS_TABLE_SIZE-1;
+ int32 nRot = CGeneral::GetRandomNumber() % CParticle::SIN_COS_TABLE_SIZE-1;
- float fCos = CParticle::m_CosTable[nSinCosIdx];
- float fSin = CParticle::m_SinTable[nSinCosIdx];
+ float fCos = CParticle::Cos(nRot);
+ float fSin = CParticle::Sin(nRot);
vecPos.x += (fCos - fSin) * fAngle;
vecPos.y += (fSin + fCos) * fAngle;