Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Core/GameEngine/Include/Common/GameDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@
#define PRESERVE_RETAIL_SCRIPTED_CAMERA (1) // Retain scripted camera behavior present in retail Generals 1.08 and Zero Hour 1.04
#endif

#ifndef PRESERVE_RETAIL_PARTICLES
#define PRESERVE_RETAIL_PARTICLES (1) // Preserve original look of particles present in retail Generals 1.08 and Zero Hour 1.04
#endif

#ifndef RETAIL_COMPATIBLE_CRC
#define RETAIL_COMPATIBLE_CRC (1) // Game is expected to be CRC compatible with retail Generals 1.08, Zero Hour 1.04
#endif
Expand Down
13 changes: 11 additions & 2 deletions Core/GameEngine/Source/GameClient/System/ParticleSys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1190,6 +1190,15 @@ ParticleSystem::ParticleSystem( const ParticleSystemTemplate *sysTemplate,
m_particleType = sysTemplate->m_particleType;
m_particleTypeName = sysTemplate->m_particleTypeName;

#if PRESERVE_RETAIL_PARTICLES
// TheSuperHackers @info Hack to allow isUsingSmudge() functionality with retail smudge particles

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be good to put behind PRESERVE_RETAIL_PARTICLES after #2709. Or an adjacent define.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that going to get merged soon? If not can i grab the define section from it and add it to this PR.

Looking to get this merged so i can rebase the particle optimisation PR off it as it helps clean up some of the code there.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you can grab the PRESERVE_RETAIL_PARTICLES for this change.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, this can be squash merged, the seperate PR's are just to make it easier to review.

// The retail data template for smudge particles is not correctly configured with the smudge particle type
if (m_particleType != ParticleType::SMUDGE && m_particleTypeName.startsWithNoCase("SMUDGE."))
{
m_particleType = ParticleType::SMUDGE;
}
#endif

m_isStopped = false;

// set up slave particle system, if any
Expand Down Expand Up @@ -3023,8 +3032,8 @@ void ParticleSystemManager::update()
if (sys->isUsingDrawables())
continue;

// temporary hack that checks if texture name starts with "SMUD" - if so, we can assume it's a smudge type
if (/*sys->isUsingSmudge()*/ *((DWORD *)sys->getParticleTypeName().str()) == 0x44554D53)
// Handle smudge type particles
if (sys->isUsingSmudge())
{
for (Particle *p = sys->getFirstParticle(); p; p = p->m_systemNext)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,31 +156,31 @@ void W3DParticleSystemManager::doParticles(RenderInfoClass &rinfo)
if (sys->isUsingDrawables())
continue;

//temporary hack that checks if texture name starts with "SMUD" - if so, we can assume it's a smudge type
if (/*sys->isUsingSmudge()*/ *((DWORD *)sys->getParticleTypeName().str()) == 0x44554D53)
// Handle smudge type particles
if (sys->isUsingSmudge())
{
if (drawSmudge)
if (!drawSmudge)
continue;

for (Particle *p = sys->getFirstParticle(); p; p = p->m_systemNext)
{
for (Particle *p = sys->getFirstParticle(); p; p = p->m_systemNext)
{
const Coord3D *pos = p->getPosition();
Real psize = p->getSize();
const Coord3D *pos = p->getPosition();
Real psize = p->getSize();

//Cull particle to edges of screen and terrain.
if (WWMath::Fabs( pos->x - bcX ) > ( beX + psize ) )
continue;
//Cull particle to edges of screen and terrain.
if (WWMath::Fabs( pos->x - bcX ) > ( beX + psize ) )
continue;

if (WWMath::Fabs( pos->y - bcY ) > ( beY + psize ) )
continue;
if (WWMath::Fabs( pos->y - bcY ) > ( beY + psize ) )
continue;

if (WWMath::Fabs( pos->z - bcZ ) > ( beZ + psize ) )
continue;
if (WWMath::Fabs( pos->z - bcZ ) > ( beZ + psize ) )
continue;

if (Smudge *smudge = TheSmudgeManager->findSmudge(p))
{
// The particle is in view. Draw the smudge!
smudge->m_draw = true;
}
if (Smudge *smudge = TheSmudgeManager->findSmudge(p))
{
// The particle is in view. Draw the smudge!
smudge->m_draw = true;
}
}
continue;
Comment thread
Caball009 marked this conversation as resolved.
Expand Down
Loading