summaryrefslogtreecommitdiffstats
path: root/src/render/Particle.cpp
diff options
context:
space:
mode:
authorFire-Head <Fire-Head@users.noreply.github.com>2020-04-23 10:24:03 +0200
committerFire-Head <Fire-Head@users.noreply.github.com>2020-04-23 10:24:03 +0200
commit75acd781909378ba0395b0c52acee464c8221e72 (patch)
tree7d23d2b6d59190f873aba4d176f3e076fd290b35 /src/render/Particle.cpp
parentMerge pull request #483 from Fire-Head/master (diff)
downloadre3-75acd781909378ba0395b0c52acee464c8221e72.tar
re3-75acd781909378ba0395b0c52acee464c8221e72.tar.gz
re3-75acd781909378ba0395b0c52acee464c8221e72.tar.bz2
re3-75acd781909378ba0395b0c52acee464c8221e72.tar.lz
re3-75acd781909378ba0395b0c52acee464c8221e72.tar.xz
re3-75acd781909378ba0395b0c52acee464c8221e72.tar.zst
re3-75acd781909378ba0395b0c52acee464c8221e72.zip
Diffstat (limited to '')
-rw-r--r--src/render/Particle.cpp42
1 files changed, 22 insertions, 20 deletions
diff --git a/src/render/Particle.cpp b/src/render/Particle.cpp
index 0388e779..c855c860 100644
--- a/src/render/Particle.cpp
+++ b/src/render/Particle.cpp
@@ -12,9 +12,6 @@
#include "ParticleObject.h"
#include "Particle.h"
-#ifdef TOGGLEABLE_BETA_FEATURES
-bool CParticle::bEnableBannedParticles = false;
-#endif
#define MAX_PARTICLES_ON_SCREEN (1000)
@@ -388,8 +385,12 @@ void CParticle::Initialise()
gpFlame5Tex = RwTextureRead("flame5", nil);
+#ifdef FIX_BUGS
+ gpFlame5Raster = RwTextureGetRaster(gpFlame5Tex);
+#else
gpFlame5Raster = RwTextureGetRaster(gpFlame1Tex); // copy-paste bug ?
-
+#endif
+
gpRainDropSmallTex = RwTextureRead("rainsmall", nil);
gpRainDropSmallRaster = RwTextureGetRaster(gpRainDropSmallTex);
@@ -767,9 +768,8 @@ CParticle *CParticle::AddParticle(tParticleType type, CVector const &vecPos, CVe
{
if ( CTimer::GetIsPaused() )
return NULL;
-#ifdef TOGGLEABLE_BETA_FEATURES
- if(!bEnableBannedParticles)
-#endif
+
+#ifdef PC_PARTICLE
if ( ( type == PARTICLE_ENGINE_SMOKE
|| type == PARTICLE_ENGINE_SMOKE2
|| type == PARTICLE_ENGINE_STEAM
@@ -782,6 +782,7 @@ CParticle *CParticle::AddParticle(tParticleType type, CVector const &vecPos, CVe
{
return nil;
}
+#endif
CParticle *pParticle = m_pUnusedListHead;
@@ -853,6 +854,7 @@ CParticle *CParticle::AddParticle(tParticleType type, CVector const &vecPos, CVe
pParticle->m_nRotation = nRotation;
+// PC only
if ( pParticle->m_nRotation >= 360 )
pParticle->m_nRotation -= 360;
else if ( pParticle->m_nRotation < 0 )
@@ -1348,12 +1350,13 @@ void CParticle::Update()
particle->m_nAlpha = clamp(particle->m_nAlpha - psystem->m_nFadeAlphaAmount,
0, 255);
-
+#ifdef PC_PARTICLE
if ( particle->m_nAlpha == 0 )
{
bRemoveParticle = true;
continue;
}
+#endif
}
else
++particle->m_nFadeAlphaTimer;
@@ -1448,18 +1451,15 @@ void CParticle::Render()
for ( int32 i = 0; i < MAX_PARTICLES; i++ )
{
tParticleSystemData *psystem = &mod_ParticleSystemManager.m_aParticles[i];
-
+#ifdef PC_PARTICLE
bool particleBanned = false;
-
+#endif
CParticle *particle = psystem->m_pParticles;
RwRaster **frames = psystem->m_ppRaster;
-
+#ifdef PC_PARTICLE
tParticleType type = psystem->m_Type;
-#ifdef TOGGLEABLE_BETA_FEATURES
- if (!bEnableBannedParticles)
-#endif
if ( type == PARTICLE_ENGINE_SMOKE
|| type == PARTICLE_ENGINE_SMOKE2
|| type == PARTICLE_ENGINE_STEAM
@@ -1471,7 +1471,8 @@ void CParticle::Render()
{
particleBanned = true;
}
-
+#endif
+
if ( particle )
{
if ( (flags & DRAW_OPAQUE) != (psystem->Flags & DRAW_OPAQUE)
@@ -1512,10 +1513,11 @@ void CParticle::Render()
while ( particle != nil )
{
bool canDraw = true;
+#ifdef PC_PARTICLE
if ( particle->m_nAlpha == 0 )
canDraw = false;
-
+#endif
if ( canDraw && psystem->m_nFinalAnimationFrame != 0 && frames != nil )
{
RwRaster *curFrame = frames[particle->m_nCurrentFrame];
@@ -1538,7 +1540,7 @@ void CParticle::Render()
particle->m_fSize * 63.0f,
particle->m_Color,
particle->m_nColorIntensity,
- (float)particle->m_nRotation,
+ (float)particle->m_nRotation, //DEGTORAD((float)particle->m_nRotation) ps2
particle->m_nAlpha);
}
else
@@ -1564,8 +1566,10 @@ void CParticle::Render()
if ( CSprite::CalcScreenCoors(particle->m_vecPosition, coors, &w, &h, true) )
{
+#ifdef PC_PARTICLE
if ( (!particleBanned || SCREEN_WIDTH * fParticleScaleLimit >= w)
&& SCREEN_HEIGHT * fParticleScaleLimit >= h )
+#endif
{
if ( particle->m_nRotation != 0 )
{
@@ -1576,7 +1580,7 @@ void CParticle::Render()
particle->m_Color.blue,
particle->m_nColorIntensity,
1.0f / coors.z,
- float(particle->m_nRotation),
+ float(particle->m_nRotation), // DEGTORAD((float)particle->m_nRotation) ps2
particle->m_nAlpha);
}
else if ( psystem->Flags & SCREEN_TRAIL )
@@ -1601,7 +1605,6 @@ void CParticle::Render()
fTrailLength = fDist;
- //Float fRot = Atan2( vecDist.x / fDist, Sqrt(1.0f - vecDist.x / fDist * (vecDist.x / fDist)) );
float fRot = Asin(vecDist.x / fDist);
fRotation = fRot;
@@ -1653,7 +1656,6 @@ void CParticle::Render()
fTrailLength = fDist;
- //Float fRot = Atan2(vecDist.x / fDist, Sqrt(1.0f - vecDist.x / fDist * (vecDist.x / fDist)));
float fRot = Asin(vecDist.x / fDist);
fRotation = fRot;