d_particle equivalent (#2869)

This commit is contained in:
Max Roncace
2025-11-25 23:55:01 -05:00
committed by GitHub
parent e0f996e6c3
commit 2bff9b49b5
9 changed files with 134 additions and 126 deletions
+2 -4
View File
@@ -321,13 +321,11 @@ bool JPABaseParticle::canCreateChild(JPAEmitterWorkData* work) {
/* 80280548-80280568 27AE88 0020+00 0/0 3/3 0/0 .text
* getWidth__15JPABaseParticleCFPC14JPABaseEmitter */
f32 JPABaseParticle::getWidth(JPABaseEmitter const* emtr) const {
f32 scale = 2.0f * mParticleScaleX;
return scale * emtr->mpEmtrMgr->pWd->mGlobalPtclScl.x;
return mParticleScaleX * 2.0f * emtr->mpEmtrMgr->pWd->mGlobalPtclScl.x;
}
/* 80280568-80280588 27AEA8 0020+00 0/0 3/3 0/0 .text
* getHeight__15JPABaseParticleCFPC14JPABaseEmitter */
f32 JPABaseParticle::getHeight(JPABaseEmitter const* emtr) const {
f32 scale = 2.0f * mParticleScaleY;
return scale * emtr->mpEmtrMgr->pWd->mGlobalPtclScl.y;
return mParticleScaleY * 2.0f * emtr->mpEmtrMgr->pWd->mGlobalPtclScl.y;
}
+18 -14
View File
@@ -3,6 +3,15 @@
// Translation Unit: d/d_particle
//
// d_particle is odd in that it doesn't appear to include dolzel.pch.
// It uses ...data pooling, but weak data from the PCH (e.g. Z2Calc::cNullVec)
// isn't present like would be expected for a TU using pooling.
//
// Note that it _is_ possible that it does include the PCH and there's just some
// not-yet-understood behavior causing the weak data to be stripped anyway.
// Notably, TWW's version of this TU _does_ use the PCH, but it also includes
// weak data from it (unlike here).
#include "d/d_particle.h"
#include "d/d_jnt_col.h"
#include "JSystem/JKernel/JKRExpHeap.h"
@@ -140,7 +149,7 @@ static u8 struct_80450E9D;
/* 8004979C-800497B0 0440DC 0014+00 1/0 0/0 0/0 .text
* setup__19dPa_light8EcallBackFP14JPABaseEmitterPC4cXyzPC5csXyzSc */
//
//
void dPa_light8EcallBack::setup(JPABaseEmitter* param_0, cXyz const* param_1,
csXyz const* param_2, s8 param_3) {
param_0->setDrawTimes(2);
@@ -535,7 +544,7 @@ bool dPa_modelEcallBack::model_c::set(J3DModelData* param_0, dKy_tevstr_c const&
*(Arr*)&field_0x8.TevColor = *(Arr*)&param_1.TevColor;
*(int*)&field_0x8.TevKColor = *(int*)&param_1.TevKColor;
*(int*)&field_0x8.mLightInf = *(int*)&param_1.mLightInf;
field_0x8.mFogStartZ = param_1.mFogStartZ;
field_0x8.mFogEndZ = param_1.mFogEndZ;
field_0x8.pat_ratio = param_1.pat_ratio;
@@ -586,7 +595,7 @@ void dPa_modelEcallBack::model_c::setup() {
void dPa_modelEcallBack::model_c::cleanup() {
if (field_0x4 == NULL) {
return;
}
}
if (field_0x392 == 0) {
field_0x0->removeTexNoAnimator((J3DAnmTexPattern*)field_0x4);
@@ -660,10 +669,6 @@ void dPa_modelEcallBack::create(u8 param_0) {
struct_80450E9D = 0;
}
/* 8004AB88-8004ABC4 0454C8 003C+00 2/2 0/0 0/0 .text __dt__Q218dPa_modelEcallBack7model_cFv */
dPa_modelEcallBack::model_c::~model_c() {
}
/* 8004ABC4-8004AC00 045504 003C+00 1/1 0/0 0/0 .text remove__18dPa_modelEcallBackFv */
void dPa_modelEcallBack::remove() {
if (mModel != NULL) {
@@ -2109,7 +2114,6 @@ void dPa_light8PcallBack::draw(JPABaseEmitter* param_1, JPABaseParticle* param_2
/* 8004E6A8-8004ED44 048FE8 069C+00 1/0 0/0 0/0 .text
* draw__25dPa_gen_b_light8PcallBackFP14JPABaseEmitterP15JPABaseParticle */
// NONMATCHING - fpr regalloc
void dPa_gen_b_light8PcallBack::draw(JPABaseEmitter* param_1, JPABaseParticle* param_2) {
Mtx local_80;
JGeometry::TVec3<f32> local_8c;
@@ -2128,13 +2132,13 @@ void dPa_gen_b_light8PcallBack::draw(JPABaseEmitter* param_1, JPABaseParticle* p
f32 dVar9 = JMASSin(param_2->getRotateAngle());
f32 dVar10 = JMASCos(param_2->getRotateAngle());
param_1->getGlobalParticleScale(local_bc);
local_bc.x *= param_2->getWidth(param_1);
local_bc.y *= param_2->getHeight(param_1);
local_80[0][0] = dVar10 * local_bc.x;
local_80[0][1] = -dVar9 * local_bc.y;
f32 var_f29 = local_bc.x * param_2->getWidth(param_1);
f32 var_f28 = local_bc.y * param_2->getHeight(param_1);
local_80[0][0] = dVar10 * var_f29;
local_80[0][1] = -dVar9 * var_f28;
local_80[0][3] = local_8c.x;
local_80[1][0] = dVar9 * local_bc.x;
local_80[1][1] = dVar10 * local_bc.y;
local_80[1][0] = dVar9 * var_f29;
local_80[1][1] = dVar10 * var_f28;
local_80[1][3] = local_8c.y;
local_80[2][2] = 1.0f;
local_80[2][3] = local_8c.z;