Fix build

This commit is contained in:
Henrique Gemignani Passos Lima 2022-11-25 22:52:18 +02:00
parent edbfd0d305
commit 07ea1b3d0a
No known key found for this signature in database
GPG Key ID: E224F951761145F8
5 changed files with 70 additions and 24 deletions

View File

@ -3898,11 +3898,11 @@ __ct__10CGunWeaponFUi11EWeaponType9TUniqueId14EMaterialTypesRC9CVector3f:
/* 801BD2BC 001BA21C 90 1E 01 44 */ stw r0, 0x144(r30)
/* 801BD2C0 001BA220 48 00 01 29 */ bl GetWeaponIndex__F11EWeaponType
/* 801BD2C4 001BA224 80 8D A0 64 */ lwz r4, gpSimplePool@sda21(r13)
/* 801BD2C8 001BA228 3C A0 80 3D */ lis r5, lbl_803D17A0@ha
/* 801BD2C8 001BA228 3C A0 80 3D */ lis r5, skBeamXferNames@ha
/* 801BD2CC 001BA22C 54 60 10 3A */ slwi r0, r3, 2
/* 801BD2D0 001BA230 38 61 00 08 */ addi r3, r1, 8
/* 801BD2D4 001BA234 81 84 00 00 */ lwz r12, 0(r4)
/* 801BD2D8 001BA238 38 A5 17 A0 */ addi r5, r5, lbl_803D17A0@l
/* 801BD2D8 001BA238 38 A5 17 A0 */ addi r5, r5, skBeamXferNames@l
/* 801BD2DC 001BA23C 7C A5 00 2E */ lwzx r5, r5, r0
/* 801BD2E0 001BA240 81 8C 00 10 */ lwz r12, 0x10(r12)
/* 801BD2E4 001BA244 7D 89 03 A6 */ mtctr r12
@ -4085,8 +4085,8 @@ skFrozenNames:
.4byte lbl_803D18A7
.4byte lbl_803D189E
.global lbl_803D17A0
lbl_803D17A0:
.global skBeamXferNames
skBeamXferNames:
# ROM: 0x3CE7A0
.4byte lbl_803D18C9
.4byte lbl_803D18D3

View File

@ -0,0 +1,26 @@
#ifndef _CVERTEXMORPHEFFECT
#define _CVERTEXMORPHEFFECT
#include "Kyoto/Math/CUnitVector3f.hpp"
#include "Kyoto/Math/CVector3f.hpp"
#include "rstl/vector.hpp"
class CRandom16;
class CVertexMorphEffect {
public:
~CVertexMorphEffect() {}
private:
CUnitVector3f x0_dir;
CVector3f xc_pos;
float x18_duration;
float x1c_elapsed;
float x20_diagExtent;
CRandom16& x24_random;
rstl::vector< uint > x28_indices;
rstl::vector< float > x38_floats;
};
#endif // _CVERTEXMORPHEFFECT

View File

@ -0,0 +1,21 @@
#ifndef _CDEPENDENCYGROUP
#define _CDEPENDENCYGROUP
#include "Kyoto/SObjectTag.hpp"
#include "rstl/vector.hpp"
class CInputStream;
class CDependencyGroup {
public:
explicit CDependencyGroup(CInputStream& in);
void ReadFromStream(CInputStream& in);
const rstl::vector< SObjectTag >& GetObjectTagVector() const { return x0_objectTags; }
private:
rstl::vector< SObjectTag > x0_objectTags;
};
#endif // _CDEPENDENCYGROUP

View File

@ -32,7 +32,7 @@ bool are_tokens_ready(const rstl::vector< CToken >&);
CAssetId get_asset_id_from_name(const char* name);
void lock_tokens(rstl::vector< CToken >&);
void unlock_tokens(rstl::vector< CToken >&);
CPlayerState::EPlayerSuit get_current_suit(const CStateManager& mgr);
int get_current_suit(const CStateManager& mgr);
} // namespace NWeaponTypes

View File

@ -52,7 +52,7 @@ const char* skSuitArmNames[] = {
"FusionArm", "FusionArmG", "FusionArmV", "FusionArmP",
};
const int skAnimTypeList[] = {
int skAnimTypeList[] = {
0, 4, 1, 2, 3, 5, 6, 7, 8, 9, 10,
};
@ -75,11 +75,10 @@ CPlayerState::EBeamId GetWeaponIndex(EWeaponType type) {
CGunWeapon::CGunWeapon(CAssetId ancsId, EWeaponType type, TUniqueId playerId,
EMaterialTypes playerMaterial, const CVector3f& scale)
: x4_scale(scale)
, x104_gunCharacter(gpSimplePool->GetObj(SObjectTag('ANCS', ancsId)))
, x13c_armCharacter(gpSimplePool->GetObj(skSuitArmNames[0]))
, x160_xferEffect(gpSimplePool->GetObj(skBeamXferNames[size_t(GetWeaponIndex(type))]))
, x160_xferEffect(gpSimplePool->GetObj(skBeamXferNames[GetWeaponIndex(type)]))
, x1bc_rainSplashGenerator(nullptr)
, x1c0_weaponType(type)
, x1c4_playerId(playerId)
@ -587,6 +586,20 @@ void CGunWeapon::LoadFxIdle(float dt, CStateManager& mgr) {
}
}
void CGunWeapon::LoadAnimations() {
NWeaponTypes::get_token_vector(*x10_solidModelData->GetAnimationData(), 0, 15, x10c_anims, true);
}
bool CGunWeapon::IsAnimsLoaded() const {
for (rstl::vector< CToken >::const_iterator it = x10c_anims.begin(); it != x10c_anims.end();
++it) {
if (!it->IsLoaded()) {
return false;
}
}
return true;
}
void CGunWeapon::LockTokens(CStateManager& mgr) {
AsyncLoadSuitArm(mgr);
NWeaponTypes::lock_tokens(x12c_deps);
@ -628,22 +641,8 @@ void CGunWeapon::UnLoadFidget() { x100_gunController->UnLoadFidget(); }
bool CGunWeapon::IsFidgetLoaded() { return x100_gunController->IsFidgetLoaded(); }
void CGunWeapon::LoadAnimations() {
NWeaponTypes::get_token_vector(*x10_solidModelData->GetAnimationData(), 0, 15, x10c_anims, true);
}
bool CGunWeapon::IsAnimsLoaded() const {
for (rstl::vector< CToken >::const_iterator it = x10c_anims.begin(); it != x10c_anims.end();
++it) {
if (!it->IsLoaded()) {
return false;
}
}
return true;
}
void CGunWeapon::AsyncLoadSuitArm(CStateManager& mgr) {
CPlayerState::EPlayerSuit suit = NWeaponTypes::get_current_suit(mgr);
int suit = NWeaponTypes::get_current_suit(mgr);
xb0_suitArmModelData = rstl::optional_object_null();
x13c_armCharacter = gpSimplePool->GetObj(skSuitArmNames[suit]);
x13c_armCharacter.Lock();
@ -654,7 +653,7 @@ void CGunWeapon::LoadSuitArm(CStateManager& mgr) {
if (!x13c_armCharacter.IsLoaded()) {
return;
}
CPlayerState::EPlayerSuit suit = NWeaponTypes::get_current_suit(mgr);
int suit = NWeaponTypes::get_current_suit(mgr);
const CAssetId armId = NWeaponTypes::get_asset_id_from_name(skSuitArmNames[suit]);
xb0_suitArmModelData = CStaticRes(armId, x4_scale);
xb0_suitArmModelData->SetSortThermal(true);