mirror of
https://github.com/zeldaret/ss
synced 2026-07-29 15:42:51 -04:00
Merge pull request #252 from robojumper/more_cursor_stuff
Cursor Cleanup
This commit is contained in:
+919
-153
File diff suppressed because it is too large
Load Diff
@@ -39,7 +39,7 @@ void dCsMgr_c::execute() {
|
||||
u32 mask = it->mCursorMask;
|
||||
|
||||
if (mask) {
|
||||
for (HitCheckList::Iterator chkIt = mList2.GetBeginIter(); chkIt != mList2.GetEndIter(); ++it) {
|
||||
for (HitCheckList::Iterator chkIt = mList2.GetBeginIter(); chkIt != mList2.GetEndIter(); ++chkIt) {
|
||||
if ((chkIt->mMask & mask) != 0) {
|
||||
bool hit = chkIt->checkHit(x, y);
|
||||
if (chkIt->checkOverrideCallback(hit)) {
|
||||
|
||||
+3
-3
@@ -7,8 +7,8 @@
|
||||
#include "d/d_cs_game.h"
|
||||
#include "d/d_gfx.h"
|
||||
#include "d/d_hbm.h"
|
||||
#include "d/d_pad_nav.h"
|
||||
#include "d/d_pad_manager.h"
|
||||
#include "d/d_pad_nav.h"
|
||||
#include "d/d_reset.h"
|
||||
#include "d/d_sc_game.h"
|
||||
#include "d/lyt/d_lyt_control_game.h"
|
||||
@@ -222,8 +222,8 @@ void beginPad_BR() {
|
||||
KPADEnableMplsAccRevise(0);
|
||||
KPADSetMplsAccReviseParam(0, 0.03f, 0.4f);
|
||||
|
||||
if ((dCsGame_c::GetInstance() && dCsGame_c::GetInstance()->fn_801BF5E0() && !ex.field_0x22D0) ||
|
||||
(dAcPy_c::GetLink() &&
|
||||
if ((dCsGame_c::GetInstance() != nullptr && dCsGame_c::GetInstance()->shouldDraw() && !ex.field_0x22D0) ||
|
||||
(dAcPy_c::GetLink() != nullptr &&
|
||||
dAcPy_c::GetLink()->checkActionFlagsCont(0x400 | 0x100 | 0x80 | 0x40 | 0x10 | 0x4 | 0x2 | 0x1) &&
|
||||
!dAcPy_c::GetLink()->vt_0x1C0() && !dLytMeter_c::GetMain()->getField_0x1377F()) ||
|
||||
ex.field_0x22CF) {
|
||||
|
||||
@@ -236,7 +236,7 @@ void dStageMgr_c::initializeState_SceneChangeSave() {
|
||||
if (LYT_SAVE_MGR != nullptr) {
|
||||
fn_80285600(LYT_SAVE_MGR, 3, 0);
|
||||
}
|
||||
dBase_c::s_NextExecuteControlFlags |= 1;
|
||||
dBase_c::s_NextExecuteControlFlags |= BASE_PROP_0x1;
|
||||
dSys_c::setFrameRate(2);
|
||||
}
|
||||
|
||||
@@ -252,8 +252,8 @@ void dStageMgr_c::executeState_SceneChangeSave() {
|
||||
}
|
||||
|
||||
void dStageMgr_c::finalizeState_SceneChangeSave() {
|
||||
dBase_c::s_NextExecuteControlFlags &= ~1;
|
||||
dBase_c::s_DrawControlFlags &= ~1;
|
||||
dBase_c::s_NextExecuteControlFlags &= ~BASE_PROP_0x1;
|
||||
dBase_c::s_DrawControlFlags &= ~BASE_PROP_0x1;
|
||||
}
|
||||
|
||||
void dStageMgr_c::initializeState_RestartSceneWait() {
|
||||
|
||||
@@ -163,8 +163,8 @@ bool dLytGameOver_c::remove() {
|
||||
mResAcc2.detach();
|
||||
mResAcc1.detach();
|
||||
|
||||
dBase_c::s_NextExecuteControlFlags &= ~0x200;
|
||||
dBase_c::s_DrawControlFlags &= ~0x200;
|
||||
dBase_c::s_NextExecuteControlFlags &= ~dBase_c::BASE_PROP_0x200;
|
||||
dBase_c::s_DrawControlFlags &= ~dBase_c::BASE_PROP_0x200;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -435,8 +435,8 @@ void dLytGameOverMgr_c::executeState_Select() {
|
||||
if (mTimer < 20) {
|
||||
mTimer++;
|
||||
if (mTimer == 20) {
|
||||
dBase_c::s_NextExecuteControlFlags |= 1;
|
||||
dBase_c::s_DrawControlFlags |= 1;
|
||||
dBase_c::s_NextExecuteControlFlags |= dBase_c::BASE_PROP_0x1;
|
||||
dBase_c::s_DrawControlFlags |= dBase_c::BASE_PROP_0x1;
|
||||
}
|
||||
}
|
||||
if (mMain.isChangingState() == true) {
|
||||
@@ -563,11 +563,11 @@ void dLytGameOverMgr_c::executeState_Select() {
|
||||
break;
|
||||
}
|
||||
case 100: {
|
||||
dBase_c::s_NextExecuteControlFlags &= ~0x1;
|
||||
dBase_c::s_DrawControlFlags &= ~0x1;
|
||||
dBase_c::s_NextExecuteControlFlags &= ~dBase_c::BASE_PROP_0x1;
|
||||
dBase_c::s_DrawControlFlags &= ~dBase_c::BASE_PROP_0x1;
|
||||
|
||||
dBase_c::s_NextExecuteControlFlags |= 0x200;
|
||||
dBase_c::s_DrawControlFlags |= 0x200;
|
||||
dBase_c::s_NextExecuteControlFlags |= dBase_c::BASE_PROP_0x200;
|
||||
dBase_c::s_DrawControlFlags |= dBase_c::BASE_PROP_0x200;
|
||||
|
||||
mStep++;
|
||||
break;
|
||||
|
||||
+11
-11
@@ -112,8 +112,8 @@ bool dLytPauseMain_c::remove() {
|
||||
mpPauseBack = nullptr;
|
||||
}
|
||||
|
||||
dBase_c::s_NextExecuteControlFlags &= ~0x1;
|
||||
dBase_c::s_DrawControlFlags &= ~0x1;
|
||||
dBase_c::s_NextExecuteControlFlags &= ~dBase_c::BASE_PROP_0x1;
|
||||
dBase_c::s_DrawControlFlags &= ~dBase_c::BASE_PROP_0x1;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -260,7 +260,7 @@ void dLytPauseMain_c::executeState_In() {
|
||||
}
|
||||
}
|
||||
void dLytPauseMain_c::finalizeState_In() {
|
||||
dBase_c::s_DrawControlFlags |= 0x1;
|
||||
dBase_c::s_DrawControlFlags |= dBase_c::BASE_PROP_0x1;
|
||||
}
|
||||
|
||||
void dLytPauseMain_c::initializeState_Wait() {
|
||||
@@ -462,7 +462,7 @@ void dLytPauseMain_c::finalizeState_GetDemo() {}
|
||||
void dLytPauseMain_c::initializeState_Out() {
|
||||
mPartStateChangeFlags = 0;
|
||||
mStep = 0;
|
||||
dBase_c::s_DrawControlFlags &= ~0x1;
|
||||
dBase_c::s_DrawControlFlags &= ~dBase_c::BASE_PROP_0x1;
|
||||
mpArrow->requestOut();
|
||||
}
|
||||
void dLytPauseMain_c::executeState_Out() {
|
||||
@@ -580,7 +580,7 @@ void dLytPauseMgr_c::executeState_None() {
|
||||
field_0x083A = true;
|
||||
mMain.requestIn();
|
||||
mStateMgr.changeState(StateID_In);
|
||||
dBase_c::s_NextExecuteControlFlags |= 0x1;
|
||||
dBase_c::s_NextExecuteControlFlags |= BASE_PROP_0x1;
|
||||
dLytMeter_c::GetInstance()->setMeterField_0x13750(3);
|
||||
dLytControlGame_c *lytControl = dLytControlGame_c::getInstance();
|
||||
if (lytControl->isPauseDemo()) {
|
||||
@@ -600,7 +600,7 @@ void dLytPauseMgr_c::executeState_In() {
|
||||
mStateMgr.changeState(StateID_GetDemo);
|
||||
} else {
|
||||
mStateMgr.changeState(StateID_Wait);
|
||||
dCsGame_c::GetInstance()->setCursorTypePointer();
|
||||
dCsGame_c::GetInstance()->pointerDefSet();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -629,7 +629,7 @@ void dLytPauseMgr_c::executeState_Wait() {
|
||||
dPad::ex_c::getInstance()->centerCursor(mPad::getCurrentCoreID(), true);
|
||||
}
|
||||
|
||||
dCsGame_c::GetInstance()->setCursorTypePointer();
|
||||
dCsGame_c::GetInstance()->pointerDefSet();
|
||||
|
||||
if (dPad::getDownTrig1() ||
|
||||
(dLytControlGame_c::getInstance()->getCurrentPauseDisp() != dLytPauseMgr_c::DISP_00_INVENTORY &&
|
||||
@@ -685,7 +685,7 @@ void dLytPauseMgr_c::executeState_Wait() {
|
||||
if (checkRing()) {
|
||||
if (mTimer >= 10) {
|
||||
mTimer = 0;
|
||||
dCsGame_c::GetInstance()->setCursorTypeNoneMaybe();
|
||||
dCsGame_c::GetInstance()->noneSet();
|
||||
mStateMgr.changeState(StateID_Ring);
|
||||
} else {
|
||||
mTimer++;
|
||||
@@ -715,7 +715,7 @@ void dLytPauseMgr_c::initializeState_Change() {
|
||||
}
|
||||
void dLytPauseMgr_c::executeState_Change() {
|
||||
if (!sInstance->getField_0x083E()) {
|
||||
dCsGame_c::GetInstance()->setCursorTypePointer();
|
||||
dCsGame_c::GetInstance()->pointerDefSet();
|
||||
}
|
||||
|
||||
if (mMain.isChangingState() == true) {
|
||||
@@ -817,8 +817,8 @@ void dLytPauseMgr_c::initializeState_Out() {
|
||||
}
|
||||
void dLytPauseMgr_c::executeState_Out() {
|
||||
if (mMain.isChangingState() == true) {
|
||||
dBase_c::s_NextExecuteControlFlags &= ~0x1;
|
||||
dBase_c::s_DrawControlFlags &= ~0x1;
|
||||
dBase_c::s_NextExecuteControlFlags &= ~dBase_c::BASE_PROP_0x1;
|
||||
dBase_c::s_DrawControlFlags &= ~dBase_c::BASE_PROP_0x1;
|
||||
mStateMgr.changeState(StateID_None);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -996,7 +996,7 @@ bool dLytMeterMain_c::remove() {
|
||||
void dLytMeterMain_c::fn_800D5290() {
|
||||
dLytMeter_c *meter = dLytMeter_c::GetInstance();
|
||||
|
||||
if (dLytMap_c::GetInstance() != nullptr && !dLytMap_c::GetInstance()->unkMeterCheck()) {
|
||||
if (dLytMap_c::GetInstance() != nullptr && !dLytMap_c::GetInstance()->isSomeMapFieldEq2Or4Or5Or6()) {
|
||||
meter->setFlags(METER_BTN_PLUS);
|
||||
}
|
||||
|
||||
|
||||
@@ -856,7 +856,7 @@ void dJEffManager_c::execute() {
|
||||
sMassObjEmitters[i].execute();
|
||||
}
|
||||
|
||||
if ((dBase_c::s_ExecuteControlFlags & 0x6F9) == 0) {
|
||||
if ((dBase_c::s_ExecuteControlFlags & (dBase_c::BASE_PROP_UNK_PARTICLE_1)) == 0) {
|
||||
for (int i = 0; i < 12; i++) {
|
||||
dParticle::mgr_c::GetInstance()->calc(i);
|
||||
}
|
||||
@@ -886,8 +886,7 @@ void dJEffManager_c::draw() {
|
||||
bool dJEffManager_c::shouldBePaused(dBase_c *owner) {
|
||||
return owner != nullptr && !owner->checkBaseProperty(dBase_c::BASE_PROP_0x4) &&
|
||||
(EventManager::isInEvent() || owner->checkProcControl(fBase_c::DISABLE_EXECUTE) ||
|
||||
// TODO execute control flags
|
||||
(owner->s_ExecuteControlFlags & 0x6fb));
|
||||
(owner->s_ExecuteControlFlags & dBase_c::BASE_PROP_UNK_PARTICLE_2));
|
||||
}
|
||||
|
||||
void dJEffManager_c::draw(const JPADrawInfo *info, u32 groupId) {
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
#include "toBeSorted/d_emitter_callbacks.h"
|
||||
#include "JSystem/JParticle/JPAEmitter.h"
|
||||
#include "common.h"
|
||||
#include "m/m_vec.h"
|
||||
|
||||
dEmitterCallbackCursorTrail_c::dEmitterCallbackCursorTrail_c(u32 a, f32 b) : field_0x10(b), field_0x14(a) {
|
||||
// TODO - TList
|
||||
}
|
||||
|
||||
static void fn_8002B9D0(mVec3_c &newPos, const mVec3_c&, const mVec3_c&, const mVec3_c&, const mVec3_c&, f32) {
|
||||
// TODO - ...
|
||||
// Probably cubic B-Spline interpolation?
|
||||
}
|
||||
|
||||
void dEmitterCallbackCursorTrail_c::executeAfter(JPABaseEmitter *emitter) {
|
||||
mVec3_c newPos;
|
||||
mVec3_c pos;
|
||||
mVec3_c v2;
|
||||
mVec3_c v1;
|
||||
|
||||
emitter->getGlobalTranslation(pos);
|
||||
|
||||
if (!emitter->checkStatus(JPAEmtrStts_StopCalc) && emitter->mMaxFrame == 0) {
|
||||
v1 = (pos - posNMinus1) * 0.5f;
|
||||
v2 = (posNMinus1 - posNMinus2) * 0.5f;
|
||||
f32 dist = pos.distance(posNMinus1);
|
||||
dist = dist * 0.1f * field_0x10;
|
||||
if (field_0x14 != 0 && dist > field_0x14) {
|
||||
dist = field_0x14;
|
||||
}
|
||||
|
||||
if (dist > 1.0f) {
|
||||
f32 f, step;
|
||||
step = 1.0f / dist;
|
||||
for (f = step; f < 1.0f; f += step) {
|
||||
fn_8002B9D0(newPos, posNMinus1, v2, v1, pos, f);
|
||||
JPABaseParticle *ptc = emitter->createParticle();
|
||||
if (ptc != nullptr) {
|
||||
ptc->setOffsetPosition(newPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (emitter->getUserWork() == 0) {
|
||||
posNMinus2 = posNMinus1;
|
||||
posNMinus1 = pos;
|
||||
}
|
||||
}
|
||||
|
||||
void dEmitterCallbackCursorTrail_c::create(JPABaseEmitter *emitter) {
|
||||
emitter->getGlobalTranslation(posNMinus1);
|
||||
posNMinus2 = posNMinus1;
|
||||
}
|
||||
|
||||
void dEmitterCallbackCursorTrail_c::vt_0x20(f32 x, f32 y) {
|
||||
posNMinus2.x += x;
|
||||
posNMinus2.z += y;
|
||||
posNMinus1.x += x;
|
||||
posNMinus1.z += y;
|
||||
}
|
||||
Reference in New Issue
Block a user