From f2ad835dde48348448646d5a52e600524d0bc7b9 Mon Sep 17 00:00:00 2001 From: Colin Miller Date: Mon, 21 Apr 2025 20:08:29 -0400 Subject: [PATCH 1/2] First 100% match for testing --- src/SB/Core/x/xBehaviour.h | 6 +++--- src/SB/Game/zWadNME.cpp | 9 ++++++--- src/SB/Game/zWadNME.h | 1 - 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/SB/Core/x/xBehaviour.h b/src/SB/Core/x/xBehaviour.h index cfa111b..9ea9513 100644 --- a/src/SB/Core/x/xBehaviour.h +++ b/src/SB/Core/x/xBehaviour.h @@ -226,9 +226,9 @@ struct xListItem_1 struct xGoal : xListItem_1, xFactoryInst { - xPsyche* psyche; + xPsyche* psyche; //0x18 en_GOALSTATE stat; - S32 flg_able; + S32 flg_able; //0x20 S32 (*fun_process)(xGoal*, void*, en_trantype*, F32, void*); void* cbdata; @@ -250,7 +250,7 @@ struct zNMEGoalCommon : xGoal S32 bul_entered : 1; S32 bul_resumed : 1; S32 bul_unused : 6; - }; + } flags; struct { S32 flg_info : 16; diff --git a/src/SB/Game/zWadNME.cpp b/src/SB/Game/zWadNME.cpp index e4c1c48..7d8fcdf 100644 --- a/src/SB/Game/zWadNME.cpp +++ b/src/SB/Game/zWadNME.cpp @@ -7,9 +7,12 @@ S32 zNMEGoalDentDamage::Exit(float, void*) S32 zNMEGoalDenDamage::Exit(float dt, void* ctxt) //POSSIBLY RIGHT, NEEDS DOUBLE CHECKED { - //something = -1.0f - dt = -1.0f; // NOT CORRECT, FOR TESTING + zNMEDennis* npc; + npc->spd_throttle = -1.0f; return 0; } -//TEST +S32 zNMEDennis::DfltVulnFlags() +{ + return 0xc07b0007; // HACKED TOGETHER FOR TESTING PURPOSES +} diff --git a/src/SB/Game/zWadNME.h b/src/SB/Game/zWadNME.h index 9c7e10a..1901ae0 100644 --- a/src/SB/Game/zWadNME.h +++ b/src/SB/Game/zWadNME.h @@ -302,7 +302,6 @@ struct zNMEDenToo : zNMEBoss S32 WannaPoolShadow(); }; -//zNMEGoalDenDamage : zNMEGoalCommon struct zNMEGoalDenDamage : zNMEGoalCommon { S32 GoalHandleMail(NMEMsg* mail); From 6f37d8c69dc25041d526bf7995105971b3b9d3fb Mon Sep 17 00:00:00 2001 From: Colin Miller Date: Mon, 21 Apr 2025 22:46:06 -0400 Subject: [PATCH 2/2] zParticleSystemWaterfall --- src/SB/Game/zParticleSystemWaterfall.cpp | 109 +++++++++ src/SB/Game/zParticleSystemWaterfall.h | 274 +++++++++++++++++++++++ 2 files changed, 383 insertions(+) create mode 100644 src/SB/Game/zParticleSystemWaterfall.h diff --git a/src/SB/Game/zParticleSystemWaterfall.cpp b/src/SB/Game/zParticleSystemWaterfall.cpp index e69de29..abcf743 100644 --- a/src/SB/Game/zParticleSystemWaterfall.cpp +++ b/src/SB/Game/zParticleSystemWaterfall.cpp @@ -0,0 +1,109 @@ +#include "zParticleSystemWaterfall.h" + +void zParticleGeneratorWaterfallSplash::deactivate() +{ + zParticleGenerator* pGen; + pGen->deactivate(); + locator.deactivate(); +} + +void zParticleGeneratorWaterfallSplash::activate() +{ + zParticleGenerator* pGen; + pGen->activate(); + locator.activate(*asset, attach_to); // Make const +} + +void zParticleGeneratorWaterfallSplash::reset() +{ + zParticleGenerator::reset(); + emitted = 0; + locator.restart(); + locator.deactivate(); + if (&flags != 0) // This arg needs fixed + { + locator.activate(*asset, attach_to); + } +} + +S32 zParticleSystemWaterfallSplash::get_asset_size() const +{ + return 56; // Calls for 0x38 +} + +void zParticleSystemWaterfallSplash::scene_enter() +{ + batch_group.create(); +} + +void zParticleGeneratorWaterfallMist::deactivate() +{ + zParticleGenerator* pGen; + pGen->deactivate(); + locator.deactivate(); +} + +void zParticleGeneratorWaterfallMist::activate() +{ + zParticleGenerator* pGen; + pGen->activate(); + locator.activate(*asset, attach_to); // Make const +} + +void zParticleGeneratorWaterfallMist::reset() +{ + zParticleGenerator::reset(); + emitted = 0; + locator.restart(); + locator.deactivate(); + if (&flags != 0) // This arg needs fixed + { + locator.activate(*asset, attach_to); + } +} + +S32 zParticleSystemWaterfallMist::get_asset_size() const +{ + return 52; // Calls for 0x34 +} + +void zParticleSystemWaterfallMist::scene_enter() +{ + batch_group.create(); +} + +void zParticleGeneratorWaterfall::deactivate() +{ + zParticleGenerator* pGen; + pGen->deactivate(); + locator.deactivate(); +} + +void zParticleGeneratorWaterfall::activate() +{ + zParticleGenerator* pGen; + pGen->activate(); + locator.activate(*asset, attach_to); // Make const +} + +void zParticleGeneratorWaterfall::reset() // 87% +{ + zParticleGenerator::reset(); + emitted = 0; + locator.restart(); + locator.deactivate(); + if (&flags != 0) // This arg needs fixed + { + locator.activate(*asset, attach_to); + } +} + +S32 zParticleSystemWaterfall::get_asset_size() const +{ + return 76; // Calls for 0x4c +} + +void zParticleSystemWaterfall::scene_enter() +{ + batch_group.create(); +} diff --git a/src/SB/Game/zParticleSystemWaterfall.h b/src/SB/Game/zParticleSystemWaterfall.h new file mode 100644 index 0000000..dbb704d --- /dev/null +++ b/src/SB/Game/zParticleSystemWaterfall.h @@ -0,0 +1,274 @@ +#ifndef ZPARTICLESYSTEMWATERFALL_H +#define ZPARTICLESYSTEMWATERFALL_H + +#include "xNME.h" + +struct _class_0 +{ + F32 yaw; + F32 pitch; + F32 roll; +}; + +struct attach_fixed_data +{ +}; + +struct attach_entity_data +{ + U32 entity; + U8 bone; + U8 pad1; + U8 pad2; + U8 pad3; +}; + +struct attach_entity_tag_data +{ + U32 entity; + xVec3 tag; +}; + +struct attach_data +{ + union + { + attach_fixed_data fixed; + attach_entity_data entity; + attach_entity_tag_data entity_tag; + }; +}; + +struct motion_none_data +{ +}; + +struct motion_spiral_data +{ + U8 flags; + U8 points; + U8 pad1; + U8 pad2; + F32 radius_inner; + F32 radius_outer; + F32 duration; + F32 frequency; +}; + +struct motion_data +{ + union + { + motion_none_data none; + motion_spiral_data spiral; + }; +}; + +struct volume_point_data +{ +}; + +struct volume_sphere_data +{ + F32 radius; +}; + +struct volume_circle_data +{ + F32 radius; + F32 arc_length; +}; + +struct volume_line_data +{ + U8 flags; + U8 pad1; + U8 pad2; + U8 pad3; + F32 radius; + F32 length; +}; + +struct volume_model_data +{ + U8 flags; + U8 exclude; + U8 pad1; + U8 pad2; + F32 expand; +}; + +struct volume_data +{ + union + { + volume_point_data point; + volume_sphere_data sphere; + volume_circle_data circle; + volume_line_data line; + volume_model_data model; + }; +}; + +struct zParticleAsset : xDynAsset +{ + U8 flags; + U8 attach_flags; + U8 motion_flags; + U8 volume_flags; + F32 rate; + U32 texture; + U8 attach_type; + U8 motion_type; + U8 volume_type; + U8 system_type; + xVec3 location; + _class_0 axis; + attach_data attach; + motion_data motion; + volume_data volume; +}; + +struct zParticleGenerator : xBase +{ + zParticleAsset* asset; + S32 flags; + + void activate(); + void deactivate(); + void reset(); + void perturb_dir(xVec3& dir, F32 angle); + xEnt* get_attach_entity(zParticleAsset& asset); + void event_handler(xBase* to, U32 event); +}; + +struct relative_ordering +{ + S32 other; + U8 before_other; +}; + +struct zParticleSystem +{ + S32 type; + S32 need; + zParticleGenerator** generators; + S32 generators_size; + S32 generators_active; + + void destroy_generator(); + void scene_exit(); + void setup(); + void reset(); + void pre_render(); + void render(); + relative_ordering* get_ordering(S32& size); + void scene_enter(); + void update(); +}; + +struct xParticleBatchGroup +{ + U8* elements; + S32 elements_size; + + void create(); +}; + +struct zParticleSystemWaterfall : zParticleSystem +{ + S32 unk; + xParticleBatchGroup batch_group; + + S32 get_asset_size() const; + void update(F32 dt); + void scene_enter(); + zParticleGenerator* create_generator(zParticleAsset& asset); +}; + +struct activity_data +{ +}; + +struct zParticleLocator +{ + activity_data* activity; + + void restart(); + void scene_enter(); + U8 activate(zParticleAsset& asset, xEnt* attach_to); + void deactivate(); +}; + +struct zParticleGeneratorWaterfall : zParticleGenerator +{ + S32 unk; + zParticleSystemWaterfall* system; + xEnt* attach_to; + F32 emitted; //0x24 + zParticleLocator locator; + S32 batch_id; + xVec3 vel_dir; + + void deactivate(); + void activate(); + void reset(); + void create(zParticleSystemWaterfall& system, zParticleAsset& asset); + void update(F32 dt); +}; + +struct zParticleSystemWaterfallMist : zParticleSystem +{ + S32 unk; + xParticleBatchGroup batch_group; + + S32 get_asset_size() const; + void update(F32 dt); + void scene_enter(); + zParticleGenerator* create_generator(zParticleAsset& asset); +}; + +struct zParticleGeneratorWaterfallMist : zParticleGenerator +{ + S32 unk; + zParticleSystemWaterfallMist* system; + xEnt* attach_to; + F32 emitted; + zParticleLocator locator; + S32 batch_id; + + void deactivate(); + void activate(); + void reset(); + void create(zParticleSystemWaterfallMist& system, zParticleAsset& asset); + void update(F32 dt); +}; + +struct zParticleSystemWaterfallSplash : zParticleSystem +{ + S32 unk; + xParticleBatchGroup batch_group; + + S32 get_asset_size() const; + void update(F32 dt); + void scene_enter(); + zParticleGenerator* create_generator(zParticleAsset& asset); +}; + +struct zParticleGeneratorWaterfallSplash : zParticleGenerator +{ + S32 unk; + zParticleSystemWaterfallSplash* system; + xEnt* attach_to; + F32 emitted; + zParticleLocator locator; + S32 batch_id; + + void deactivate(); + void activate(); + void reset(); + void create(zParticleSystemWaterfallSplash& system, zParticleAsset& asset); + void update(F32 dt); +}; + +#endif