Skip to content

Commit

Permalink
CActor fixes, nearly matched
Browse files Browse the repository at this point in the history
  • Loading branch information
Antidote committed Jan 19, 2025
1 parent 32a88ad commit 9e53708
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 18 deletions.
2 changes: 1 addition & 1 deletion include/Kyoto/Graphics/CModelFlags.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class CModelFlags {
return CModelFlags(*this, GetOtherFlags() | kF_DepthGreater);
}

ETrans GetTrans() const { return static_cast< ETrans >(x0_blendMode); }
char GetTrans() const { return static_cast< ETrans >(x0_blendMode); }
int GetShaderSet() const { return x1_matSetIdx; }
uint GetOtherFlags() const { return x2_flags; }
CColor GetColor() const { return x4_color; }
Expand Down
8 changes: 4 additions & 4 deletions include/MetroidPrime/CActorParameters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ class CActorParameters {
rstl::pair< CAssetId, CAssetId > x44_xrayAssets;
rstl::pair< CAssetId, CAssetId > x4c_thermalAssets;
CVisorParameters x54_visor;
uchar x58_24_useGlobalRenderTime : 1;
uchar x58_25_thermalHeat : 1;
uchar x58_26_forceRenderUnsorted : 1;
uchar x58_27_noSortThermal : 1;
bool x58_24_useGlobalRenderTime : 1;
bool x58_25_thermalHeat : 1;
bool x58_26_forceRenderUnsorted : 1;
bool x58_27_noSortThermal : 1;
float x5c_fadeInTime;
float x60_fadeOutTime;
float x64_thermalMag;
Expand Down
4 changes: 3 additions & 1 deletion include/MetroidPrime/CAnimData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ class CAnimData {
const TLockedToken< CSkinnedModel >& GetModelData() const { return xd8_modelData; }

void SetIsAnimating(bool v) { x220_24_animating = v; }
void SetParticleEffectState(const rstl::string& name, const bool active, CStateManager& mgr);
void SetParticleEffectState(const rstl::string& name, const bool active, CStateManager& mgr) {
x120_particleDB.SetParticleEffectState(name, active, mgr);
}

int GetCharacterIndex() const { return x204_charIdx; }
float GetAverageVelocity(int idx) const;
Expand Down
2 changes: 1 addition & 1 deletion include/MetroidPrime/CArchitectureQueue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class CArchitectureQueue {
public:
void Push(const CArchitectureMessage& msg) { x0_queue.push_back(msg); }
void Push(const CArchitectureMessage& msg);// { x0_queue.push_back(msg); }
CArchitectureMessage Pop() {
CArchitectureMessage result = *x0_queue.begin();
x0_queue.pop_front();
Expand Down
11 changes: 6 additions & 5 deletions include/MetroidPrime/Weapons/WeaponTypes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ enum EWeaponType {
};

class CWeaponMode {
EWeaponType x0_weaponType;
bool x4_24_charged : 1;
bool x4_25_comboed : 1;
bool x4_26_instantKill : 1;

public:
explicit CWeaponMode(EWeaponType type = kWT_None, const bool charged = false,
const bool comboed = false, const bool instaKill = false)
Expand All @@ -52,6 +47,12 @@ class CWeaponMode {
static CWeaponMode Power() { return CWeaponMode(kWT_Power); }
static CWeaponMode Bomb() { return CWeaponMode(kWT_Bomb); }
static CWeaponMode PowerBomb() { return CWeaponMode(kWT_PowerBomb); }

private:
EWeaponType x0_weaponType;
bool x4_24_charged : 1;
bool x4_25_comboed : 1;
bool x4_26_instantKill : 1;
};

#endif // _WEAPONTYPES
1 change: 1 addition & 0 deletions src/Dolphin/gx/GXLight.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "dolphin/gx.h"
#include "dolphin/gx/GXPriv.h"
#include <math.h>

extern float cosf(float x);
extern float sqrtf(float x);
Expand Down
12 changes: 6 additions & 6 deletions src/MetroidPrime/CActor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -816,13 +816,13 @@ void CActor::SetDrawShadow(bool enabled) {

// TODO nonmatching
bool CActor::CanDrawStatic() const {
if (!GetActive() || !HasModelData() || static_cast< char >(xb4_drawFlags.GetTrans()) > 4)
if (!GetActive() || !HasModelData() || xb4_drawFlags.GetTrans() > 4) {
return false;
}
if (GetModelData()->IsNull() || GetModelData()->HasAnimation()) {
return false;

if (HasModelData() && GetAnimationData() == nullptr)
return true;

return false;
}
return true;
}

void CActor::UpdateSfxEmitters() {
Expand Down

0 comments on commit 9e53708

Please sign in to comment.