From ceeddca348d51e9e59ec53c5434785a7c2ec39f4 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Sat, 4 Feb 2023 01:18:12 -0800 Subject: [PATCH] Match and link CParticleGen Former-commit-id: 25f0b7229b5c9cd4ec2822ae9a6638dfca16520d --- asm/Kyoto/Particles/CParticleDataFactory.s | 37 ++++++++++++++++++++++ asm/Kyoto/Particles/CParticleGen.s | 37 ---------------------- configure.py | 2 +- include/Kyoto/Particles/CParticleGen.hpp | 2 +- include/rstl/list.hpp | 4 ++- src/Kyoto/Particles/CParticleGen.cpp | 5 +++ 6 files changed, 47 insertions(+), 40 deletions(-) create mode 100644 src/Kyoto/Particles/CParticleGen.cpp diff --git a/asm/Kyoto/Particles/CParticleDataFactory.s b/asm/Kyoto/Particles/CParticleDataFactory.s index 3d6f976a..201fd922 100644 --- a/asm/Kyoto/Particles/CParticleDataFactory.s +++ b/asm/Kyoto/Particles/CParticleDataFactory.s @@ -26,6 +26,43 @@ lbl_803D7918: .asciz "??(??)" .balign 4 +.section .data +.balign 8 + +.global __vt__12CParticleGen +__vt__12CParticleGen: + # ROM: 0x3EAD08 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte SetGeneratorRate__12CParticleGenFf + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte GetGeneratorRate__12CParticleGenCFv + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte AddModifier__12CParticleGenFP5CWarp + .4byte 0 + .section .text .global CreateTexture__Fi diff --git a/asm/Kyoto/Particles/CParticleGen.s b/asm/Kyoto/Particles/CParticleGen.s index f1126d61..2bd739a2 100644 --- a/asm/Kyoto/Particles/CParticleGen.s +++ b/asm/Kyoto/Particles/CParticleGen.s @@ -1,42 +1,5 @@ .include "macros.inc" -.section .data -.balign 8 - -.global __vt__12CParticleGen -__vt__12CParticleGen: - # ROM: 0x3EAD08 - .4byte 0 - .4byte 0 - .4byte 0 - .4byte 0 - .4byte 0 - .4byte 0 - .4byte 0 - .4byte 0 - .4byte 0 - .4byte 0 - .4byte 0 - .4byte 0 - .4byte 0 - .4byte SetGeneratorRate__12CParticleGenFf - .4byte 0 - .4byte 0 - .4byte 0 - .4byte 0 - .4byte 0 - .4byte 0 - .4byte 0 - .4byte GetGeneratorRate__12CParticleGenCFv - .4byte 0 - .4byte 0 - .4byte 0 - .4byte 0 - .4byte 0 - .4byte 0 - .4byte AddModifier__12CParticleGenFP5CWarp - .4byte 0 - .section .text, "ax" .global AddModifier__12CParticleGenFP5CWarp diff --git a/configure.py b/configure.py index 50cf80d2..80b3834b 100755 --- a/configure.py +++ b/configure.py @@ -585,7 +585,7 @@ LIBS = [ ["Kyoto/Particles/CIntElement", True], ["Kyoto/Particles/CModVectorElement", False], ["Kyoto/Particles/CParticleDataFactory", False], - "Kyoto/Particles/CParticleGen", + ["Kyoto/Particles/CParticleGen", True], ["Kyoto/Particles/CParticleGlobals", True], "Kyoto/Particles/CParticleSwoosh", "Kyoto/Particles/CParticleSwooshDataFactory", diff --git a/include/Kyoto/Particles/CParticleGen.hpp b/include/Kyoto/Particles/CParticleGen.hpp index b2a56197..d3995420 100644 --- a/include/Kyoto/Particles/CParticleGen.hpp +++ b/include/Kyoto/Particles/CParticleGen.hpp @@ -46,7 +46,7 @@ public: virtual uint Get4CharId() const = 0; private: - rstl::list< rstl::pair > x4_modifiersList; + rstl::list< CWarp* > x4_modifiersList; }; #endif // _CPARTICLEGEN diff --git a/include/rstl/list.hpp b/include/rstl/list.hpp index aa06eb6b..c29d233f 100644 --- a/include/rstl/list.hpp +++ b/include/rstl/list.hpp @@ -69,7 +69,9 @@ private: }; node* create_node(node* prev, node* next, const T& val) { - node* n = new node(prev, next); + node* n; + x0_allocator.allocate(n, 1); + new(n) node(prev, next); construct(n->get_value(), val); return n; } diff --git a/src/Kyoto/Particles/CParticleGen.cpp b/src/Kyoto/Particles/CParticleGen.cpp new file mode 100644 index 00000000..79aa169f --- /dev/null +++ b/src/Kyoto/Particles/CParticleGen.cpp @@ -0,0 +1,5 @@ +#include "Kyoto/Particles/CParticleGen.hpp" + +void CParticleGen::AddModifier(CWarp* warp) { + x4_modifiersList.push_back(warp); +}