summaryrefslogtreecommitdiff
path: root/src/d/d_cs_base.cpp
diff options
context:
space:
mode:
authorrobojumper <robojumper@gmail.com>2025-08-01 11:26:25 +0200
committerrobojumper <robojumper@gmail.com>2025-08-02 09:20:02 +0200
commitd153cbc0ede10dd24a32e89faf81c8fb839ee23a (patch)
tree5a71a813845573051b1cafe0f91397f92261925d /src/d/d_cs_base.cpp
parent415873f7b34faa42ead43e620c591842dadee68e (diff)
Other cleanup
Diffstat (limited to 'src/d/d_cs_base.cpp')
-rw-r--r--src/d/d_cs_base.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/d/d_cs_base.cpp b/src/d/d_cs_base.cpp
index 30fc60f1..b16fddf4 100644
--- a/src/d/d_cs_base.cpp
+++ b/src/d/d_cs_base.cpp
@@ -24,9 +24,9 @@ dCsBase_c::dCsBase_c()
mCsVelocity(0.0f, 0.0f),
field_0x700(0),
mAlpha(0),
- field_0x703(0),
- field_0x704(0),
- field_0x705(0) {
+ mVisible(false),
+ mDrawDirectly(false),
+ mCalibrationPointCenterEnabled(false) {
sInstance = this;
}
@@ -58,7 +58,7 @@ int dCsBase_c::create() {
field_0x700 = 0;
mAlpha = 0;
- field_0x703 = 0;
+ mVisible = false;
return SUCCEEDED;
}
@@ -74,7 +74,10 @@ int dCsBase_c::execute() {
mVec2_c dpdPosScreen = dPad::ex_c::getInstance()->getDpdPosScreen();
u8 oldAlpha = mAlpha;
bool bIsInBounds = false;
- if (field_0x705 == 1) {
+ if (mCalibrationPointCenterEnabled == true) {
+ // If we're in the initial "cursor center" process at startup or when manually calibrating,
+ // we need to make sure to only take the raw pointer inputs into account (transforming them
+ // to screen coordinates of course)
mVec2_c dpdPos = mPad::getDpdRawPos();
dpdPosScreen.x = dGfx_c::getWidth4x3F() * 0.5f * (1.f + dpdPos.x) + dGfx_c::getWidth4x3LeftF();
dpdPosScreen.y = dGfx_c::getCurrentScreenHeightF() * -0.5f * (1.f + dpdPos.y) + dGfx_c::getCurrentScreenTopF();
@@ -112,11 +115,11 @@ int dCsBase_c::execute() {
}
int dCsBase_c::draw() {
- if (field_0x704 == 1) {
+ if (mDrawDirectly == true) {
return SUCCEEDED;
}
- if (field_0x703 && dPadNav::isPointerVisible() && mAlpha) {
+ if (mVisible && dPadNav::isPointerVisible() && mAlpha != 0) {
nw4r::lyt::Pane *p = mpCurrLyt->getLayout()->GetRootPane();
nw4r::math::VEC3 pos;
pos.x = mCsPosition.x;
@@ -140,11 +143,11 @@ int dCsBase_c::update() {
}
bool dCsBase_c::drawDirectly() {
- if (field_0x704 != 1) {
+ if (mDrawDirectly != true) {
return true;
}
- if (field_0x703 && dPadNav::isPointerVisible() && mAlpha) {
+ if (mVisible && dPadNav::isPointerVisible() && mAlpha != 0) {
nw4r::lyt::Pane *p = mpCurrLyt->getLayout()->GetRootPane();
nw4r::math::VEC3 pos;
pos.x = mCsPosition.x;