mirror of
https://github.com/MonsterDruide1/OdysseyDecomp
synced 2026-04-23 09:04:21 +00:00
Merge edb656553c into 0f550e5aae
This commit is contained in:
commit
fc7df0ab1d
|
|
@ -154460,83 +154460,83 @@ Util/InputSeparator.o:
|
|||
label:
|
||||
- _ZN14InputSeparatorC1EPKN2al18IUseSceneObjHolderEb
|
||||
- _ZN14InputSeparatorC2EPKN2al18IUseSceneObjHolderEb
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x5535cc
|
||||
size: 12
|
||||
label: _ZN14InputSeparator5resetEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x5535d8
|
||||
size: 192
|
||||
label: _ZN14InputSeparator6updateEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x553698
|
||||
size: 80
|
||||
label: _ZN14InputSeparator21updateForSnapShotModeEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x5536e8
|
||||
size: 48
|
||||
label: _ZN14InputSeparator15isTriggerUiLeftEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x553718
|
||||
size: 64
|
||||
label: _ZN14InputSeparator13checkDominantEb
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x553758
|
||||
size: 48
|
||||
label: _ZN14InputSeparator16isTriggerUiRightEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x553788
|
||||
size: 52
|
||||
label: _ZN14InputSeparator13isTriggerUiUpEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x5537bc
|
||||
size: 52
|
||||
label: _ZN14InputSeparator15isTriggerUiDownEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x5537f0
|
||||
size: 48
|
||||
label: _ZN14InputSeparator12isHoldUiLeftEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x553820
|
||||
size: 48
|
||||
label: _ZN14InputSeparator13isHoldUiRightEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x553850
|
||||
size: 52
|
||||
label: _ZN14InputSeparator10isHoldUiUpEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x553884
|
||||
size: 52
|
||||
label: _ZN14InputSeparator12isHoldUiDownEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x5538b8
|
||||
size: 48
|
||||
label: _ZN14InputSeparator14isRepeatUiLeftEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x5538e8
|
||||
size: 48
|
||||
label: _ZN14InputSeparator15isRepeatUiRightEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x553918
|
||||
size: 52
|
||||
label: _ZN14InputSeparator12isRepeatUiUpEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x55394c
|
||||
size: 52
|
||||
label: _ZN14InputSeparator14isRepeatUiDownEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x553980
|
||||
size: 52
|
||||
label: _ZN14InputSeparator21isTriggerSnapShotModeEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x5539b4
|
||||
size: 48
|
||||
label: _ZN14InputSeparator44isTriggerIncrementPostProcessingFilterPresetEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x5539e4
|
||||
size: 48
|
||||
label: _ZN14InputSeparator44isTriggerDecrementPostProcessingFilterPresetEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
Util/IsoSurface.o:
|
||||
'.text':
|
||||
- offset: 0x553a14
|
||||
|
|
|
|||
123
src/Util/InputSeparator.cpp
Normal file
123
src/Util/InputSeparator.cpp
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
#include "Util/InputSeparator.h"
|
||||
|
||||
#include "Util/StageInputFunction.h"
|
||||
|
||||
InputSeparator::InputSeparator(const al::IUseSceneObjHolder* sceneObjHolder, bool isVertical)
|
||||
: mSceneObjHolder(sceneObjHolder), mIsVertical(isVertical) {}
|
||||
|
||||
void InputSeparator::reset() {
|
||||
mIsDominant = false;
|
||||
mDominantTimer = 0;
|
||||
}
|
||||
|
||||
void InputSeparator::update() {
|
||||
mIsDominant = false;
|
||||
|
||||
if (mDominantTimer > 0)
|
||||
mDominantTimer--;
|
||||
|
||||
if (mIsVertical) {
|
||||
if (rs::isHoldUiUp(mSceneObjHolder) || rs::isHoldUiDown(mSceneObjHolder)) {
|
||||
mIsDominant = true;
|
||||
mDominantTimer = mDominantBorder;
|
||||
}
|
||||
|
||||
if (rs::isTriggerUiUp(mSceneObjHolder) || rs::isTriggerUiDown(mSceneObjHolder))
|
||||
mDominantTimer = mDominantBorder;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (rs::isHoldUiRight(mSceneObjHolder) || rs::isHoldUiLeft(mSceneObjHolder)) {
|
||||
mIsDominant = true;
|
||||
mDominantTimer = mDominantBorder;
|
||||
}
|
||||
|
||||
if (rs::isTriggerUiRight(mSceneObjHolder) || rs::isTriggerUiLeft(mSceneObjHolder))
|
||||
mDominantTimer = mDominantBorder;
|
||||
}
|
||||
|
||||
void InputSeparator::updateForSnapShotMode() {
|
||||
mIsDominant = false;
|
||||
|
||||
if (mDominantTimer > 0)
|
||||
mDominantTimer--;
|
||||
|
||||
if (rs::isTriggerIncrementPostProcessingFilterPreset(mSceneObjHolder) ||
|
||||
rs::isTriggerDecrementPostProcessingFilterPreset(mSceneObjHolder))
|
||||
mDominantTimer = mDominantBorder;
|
||||
}
|
||||
|
||||
bool InputSeparator::isTriggerUiLeft() {
|
||||
return !checkDominant(false) && rs::isTriggerUiLeft(mSceneObjHolder);
|
||||
}
|
||||
|
||||
bool InputSeparator::checkDominant(bool isVertical) {
|
||||
if (mIsVertical != isVertical) {
|
||||
if (mIsDominant)
|
||||
return true;
|
||||
|
||||
if (mDominantTimer > 0)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool InputSeparator::isTriggerUiRight() {
|
||||
return !checkDominant(false) && rs::isTriggerUiRight(mSceneObjHolder);
|
||||
}
|
||||
|
||||
bool InputSeparator::isTriggerUiUp() {
|
||||
return !checkDominant(true) && rs::isTriggerUiUp(mSceneObjHolder);
|
||||
}
|
||||
|
||||
bool InputSeparator::isTriggerUiDown() {
|
||||
return !checkDominant(true) && rs::isTriggerUiDown(mSceneObjHolder);
|
||||
}
|
||||
|
||||
bool InputSeparator::isHoldUiLeft() {
|
||||
return !checkDominant(false) && rs::isHoldUiLeft(mSceneObjHolder);
|
||||
}
|
||||
|
||||
bool InputSeparator::isHoldUiRight() {
|
||||
return !checkDominant(false) && rs::isHoldUiRight(mSceneObjHolder);
|
||||
}
|
||||
|
||||
bool InputSeparator::isHoldUiUp() {
|
||||
return !checkDominant(true) && rs::isHoldUiUp(mSceneObjHolder);
|
||||
}
|
||||
|
||||
bool InputSeparator::isHoldUiDown() {
|
||||
return !checkDominant(true) && rs::isHoldUiDown(mSceneObjHolder);
|
||||
}
|
||||
|
||||
bool InputSeparator::isRepeatUiLeft() {
|
||||
return !checkDominant(false) && rs::isRepeatUiLeft(mSceneObjHolder);
|
||||
}
|
||||
|
||||
bool InputSeparator::isRepeatUiRight() {
|
||||
return !checkDominant(false) && rs::isRepeatUiRight(mSceneObjHolder);
|
||||
}
|
||||
|
||||
bool InputSeparator::isRepeatUiUp() {
|
||||
return !checkDominant(true) && rs::isRepeatUiUp(mSceneObjHolder);
|
||||
}
|
||||
|
||||
bool InputSeparator::isRepeatUiDown() {
|
||||
return !checkDominant(true) && rs::isRepeatUiDown(mSceneObjHolder);
|
||||
}
|
||||
|
||||
bool InputSeparator::isTriggerSnapShotMode() {
|
||||
return !checkDominant(true) && rs::isTriggerSnapShotMode(mSceneObjHolder);
|
||||
}
|
||||
|
||||
bool InputSeparator::isTriggerIncrementPostProcessingFilterPreset() {
|
||||
return !checkDominant(false) &&
|
||||
rs::isTriggerIncrementPostProcessingFilterPreset(mSceneObjHolder);
|
||||
}
|
||||
|
||||
bool InputSeparator::isTriggerDecrementPostProcessingFilterPreset() {
|
||||
return !checkDominant(false) &&
|
||||
rs::isTriggerDecrementPostProcessingFilterPreset(mSceneObjHolder);
|
||||
}
|
||||
41
src/Util/InputSeparator.h
Normal file
41
src/Util/InputSeparator.h
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
#pragma once
|
||||
|
||||
#include <basis/seadTypes.h>
|
||||
|
||||
namespace al {
|
||||
class IUseSceneObjHolder;
|
||||
} // namespace al
|
||||
|
||||
class InputSeparator {
|
||||
public:
|
||||
InputSeparator(const al::IUseSceneObjHolder* sceneObjHolder, bool isVertical);
|
||||
|
||||
void reset();
|
||||
void update();
|
||||
void updateForSnapShotMode();
|
||||
bool isTriggerUiLeft();
|
||||
bool checkDominant(bool isVertical);
|
||||
bool isTriggerUiRight();
|
||||
bool isTriggerUiUp();
|
||||
bool isTriggerUiDown();
|
||||
bool isHoldUiLeft();
|
||||
bool isHoldUiRight();
|
||||
bool isHoldUiUp();
|
||||
bool isHoldUiDown();
|
||||
bool isRepeatUiLeft();
|
||||
bool isRepeatUiRight();
|
||||
bool isRepeatUiUp();
|
||||
bool isRepeatUiDown();
|
||||
bool isTriggerSnapShotMode();
|
||||
bool isTriggerIncrementPostProcessingFilterPreset();
|
||||
bool isTriggerDecrementPostProcessingFilterPreset();
|
||||
|
||||
private:
|
||||
const al::IUseSceneObjHolder* mSceneObjHolder;
|
||||
bool mIsVertical;
|
||||
bool mIsDominant = false;
|
||||
s32 mDominantBorder = 8;
|
||||
s32 mDominantTimer = 0;
|
||||
};
|
||||
|
||||
static_assert(sizeof(InputSeparator) == 0x18);
|
||||
Loading…
Reference in a new issue