Introduction
Although the ParticleSystem Rewrite is a huge change, it doesn't take that many changes to the code to fit in. Most of the work is just copy-and-pasting the ParticleSystem folder over.
So merging the rewrite in here, is a simple matter of following these five steps.
Before merging, make sure you have downloaded a copy of the latest version of the ParticleSystem Rewrite in a seperate folder.
Removing the old ParticleSystem
This is really simple, just delete the following files in source/T3D/fx from your engine's folder.
- particle.h
- particle.cpp
- particleEmitter.h
- particleEmitter.cpp
- particleEmitterNode.h
- particleEmitterNode.cpp
Adding the new ParticleSystem
Again, a really simple step, copy the source/T3D/fx/ParticleSystem folder from the ParticleSystem Rewrite folder, and into the source/T3D/fx folder in your engine's folder.
Updating references
This is the big step, you have to update the references, so they use the new interfaces and include the correct files.
This is the list of the files:
- T3D/debris.cpp
- T3D/debris.h
- T3D/fx/explosion.cpp
- T3D/fx/explosion.h
- T3D/fx/precipitation.cpp
- T3D/fx/splash.cpp
- T3D/fx/splash.h
- T3D/player.cpp
- T3D/player.h
- T3D/projectile.cpp
- T3D/projectile.h
- T3D/rigidShape.cpp
- T3D/rigidShape.h
- T3D/shapeBase.cpp
- T3D/shapeBase.h
- T3D/shapeImage.cpp
- T3D/vehicles/flyingVehicle.cpp
- T3D/vehicles/flyingVehicle.h
- T3D/vehicles/hoverVehicle.cpp
- T3D/vehicles/hoverVehicle.h
- T3D/vehicles/vehicle.cpp
- T3D/vehicles/vehicle.h
- T3D/vehicles/wheeledVehicle.cpp
- T3D/vehicles/wheeledVehicle.h
- console/consoleTypes.h
- environment/river.cpp
- environment/river.h
- forest/forestWindMgr.cpp
You can find the commit showing all the changes on GitHub
Add support for abstract ConObjects
This has been submitted as a PR, but untill it's accepted (hopefully) you'll have to implement this change:
#1206
Making the tsShape's MeshEmitter-ready
This final step is simply to allow the meshEmitter to emit particles on tsShapes.
Changes to T3D/tsStatic.h
First, we want to add an include to the file such that we can get to the psMeshInterface:
Now, we want the TSStatic class to inherit this interface such that the MeshEmitter can interact with it:
The getShapeInstance already matches one of the functions in the interface, so make this function virtual since it's inherited from the interface now.
Finally add declarations for the new functions, inherited from the interface:
Changes to T3D/tsStatic.cpp
Now we just need to implement the transformVertex function in the cpp file, so simply add this function anywhere you want in tsStatic.cpp: