mirror of
https://github.com/projectPiki/pikmin2.git
synced 2024-11-23 13:29:55 +00:00
PSMainSide_CreaturePrm closer
This commit is contained in:
parent
1742a03950
commit
22e92ba7af
@ -171,9 +171,9 @@
|
||||
### <section id="sysCommonU">sysCommonU</section>
|
||||
| File | Size (bytes) | File | Size (bytes) |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysCommonU/geomIntersection.cpp">geomIntersection.cpp</a> | 11238 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysCommonU/geomTraceMove.cpp">geomTraceMove.cpp</a> | 14985 |
|
||||
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysCommonU/geomIntersection.cpp">geomIntersection.cpp</a> | 10969 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysCommonU/geomTraceMove.cpp">geomTraceMove.cpp</a> | 14985 |
|
||||
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysCommonU/sysMath.cpp">sysMath.cpp</a> | 26371 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysCommonU/camera.cpp">camera.cpp</a> | 26973 |
|
||||
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysCommonU/geomOBBTree.cpp">geomOBBTree.cpp</a> | 82131 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysCommonU/geometry.cpp">geometry.cpp</a> | 104351 |
|
||||
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysCommonU/geomOBBTree.cpp">geomOBBTree.cpp</a> | 82131 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysCommonU/geometry.cpp">geometry.cpp</a> | 98859 |
|
||||
|
||||
### <section id="sysGCU">sysGCU</section>
|
||||
| File | Size (bytes) | File | Size (bytes) |
|
||||
@ -193,7 +193,7 @@
|
||||
### <section id="utilityU">utilityU</section>
|
||||
| File | Size (bytes) | File | Size (bytes) |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_CreaturePrm.cpp">PSMainSide_CreaturePrm.cpp</a> | 4148 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_ObjCalc.cpp">PSMainSide_ObjCalc.cpp</a> | 7679 |
|
||||
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_CreaturePrm.cpp">PSMainSide_CreaturePrm.cpp</a> | 4179 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_ObjCalc.cpp">PSMainSide_ObjCalc.cpp</a> | 7679 |
|
||||
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_Sound.cpp">PSMainSide_Sound.cpp</a> | 11782 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_TrackMap.cpp">PSMainSide_TrackMap.cpp</a> | 17107 |
|
||||
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_BossMgr.cpp">PSMainSide_BossMgr.cpp</a> | 17562 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_Director.cpp">PSMainSide_Director.cpp</a> | 28380 |
|
||||
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_DirectorMgr.cpp">PSMainSide_DirectorMgr.cpp</a> | 28495 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_Se.cpp">PSMainSide_Se.cpp</a> | 45066 |
|
||||
|
@ -6,11 +6,7 @@
|
||||
|
||||
namespace PSM {
|
||||
struct CreaturePrm : public PSSystem::SingletonBase<CreaturePrm> {
|
||||
CreaturePrm()
|
||||
: PSSystem::SingletonBase<CreaturePrm>(this)
|
||||
{
|
||||
mPersp.set(1.0f, 400.0f, 0.8f, 700.0f, 0.0f);
|
||||
}
|
||||
CreaturePrm() { mPersp.set(1.0f, 400.0f, 0.8f, 700.0f, 0.0f); }
|
||||
|
||||
virtual ~CreaturePrm() { } // _08 (weak)
|
||||
|
||||
|
@ -21,15 +21,39 @@ enum THP_ID {
|
||||
};
|
||||
|
||||
struct THPDemoDinamics {
|
||||
f32 _00;
|
||||
f32 mBaseVolumeModifier;
|
||||
f32 _04;
|
||||
f32 _08;
|
||||
bool mEnableDyn;
|
||||
char* mName;
|
||||
|
||||
inline f32 calcDinamic(f32 input)
|
||||
{
|
||||
BOOL isNegative = (input < 0.0f) ? TRUE : FALSE;
|
||||
|
||||
f32 calc = input;
|
||||
if (isNegative) {
|
||||
calc = -1.0f * calc;
|
||||
}
|
||||
|
||||
if (calc < _04) {
|
||||
input = _08;
|
||||
calc = calc * (input / _04);
|
||||
input = (input > calc) ? _08 : (calc < 0.0f) ? calc : 0.0f;
|
||||
} else {
|
||||
calc = (calc - 1.0f) * ((_08 - 1.0f) / (_04 - 1.0f)) + 1.0f;
|
||||
input = (calc < 1.0f) ? calc : (calc > _08) ? _08 : 1.0f;
|
||||
}
|
||||
|
||||
if (isNegative) {
|
||||
input = -1.0f * input;
|
||||
}
|
||||
return input;
|
||||
}
|
||||
};
|
||||
|
||||
struct THPDinamicsProc {
|
||||
THPDinamicsProc(); // inlined/unused
|
||||
THPDinamicsProc() { mDemoInfo = nullptr; }
|
||||
|
||||
void setSetting(THP_ID id);
|
||||
void setSetting(THPDemoDinamics* dyn);
|
||||
|
@ -3,9 +3,8 @@
|
||||
|
||||
namespace PSM {
|
||||
|
||||
static CreaturePrm sInsReal;
|
||||
|
||||
// THPDinamicsProc sTHPDinamicsProc;
|
||||
THPDinamicsProc sTHPDinamicsProc;
|
||||
CreaturePrm sInsReal;
|
||||
|
||||
// clang-format off
|
||||
THPDemoDinamics sTHPDemoDinamics[THP_COUNT]
|
||||
@ -49,7 +48,7 @@ void THPDinamicsProc::setSetting(THPDemoDinamics* dyn)
|
||||
P2ASSERTLINE(125, dyn);
|
||||
P2ASSERTBOUNDSLINE2(126, 0.0f, dyn->_04, 1.0f);
|
||||
P2ASSERTBOUNDSLINE2(127, 0.0f, dyn->_08, 1.0f);
|
||||
P2ASSERTLINE(128, dyn->_00 > 0.0f);
|
||||
P2ASSERTLINE(128, dyn->mBaseVolumeModifier > 0.0f);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -59,11 +58,10 @@ void THPDinamicsProc::setSetting(THPDemoDinamics* dyn)
|
||||
f32 THPDinamicsProc::dinamics(f32 input)
|
||||
{
|
||||
P2ASSERTLINE(137, mDemoInfo);
|
||||
THPDemoDinamics* info = mDemoInfo;
|
||||
if (info->mEnableDyn) {
|
||||
// nasty
|
||||
}
|
||||
return input * info->_00;
|
||||
|
||||
f32 volume = (mDemoInfo->mEnableDyn) ? mDemoInfo->calcDinamic(input) : input;
|
||||
return volume * mDemoInfo->mBaseVolumeModifier;
|
||||
|
||||
/*
|
||||
stwu r1, -0x20(r1)
|
||||
mflr r0
|
||||
|
Loading…
Reference in New Issue
Block a user