d_a_e_sm (chu chu) start (#117)

* d_a_e_sm (chu chu) start

* progress, includes LightParam addition in BlurPaletteMgr

* oops - TBox Progress I guess

* dAcEsm_c::actorExecute and Particle Resource data moved

* step in symbols map

* Update blur_and_palette_manager.h

* m_angle cleanup pass

* Last explicit_zero_data Fixes #69

* add mQuat_c ctor
This commit is contained in:
Elijah Thomas
2025-05-18 18:24:58 -04:00
committed by GitHub
parent d19aad44d1
commit 9d68802507
63 changed files with 3809 additions and 516 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ int dAcEhb_leaf_c::create() {
case 2: mType = 2; break;
case 3:
case 4:
case 5: rotation.z = -0x8000; break;
case 5: rotation.z.set(-0x8000); break;
default: break;
}
File diff suppressed because it is too large Load Diff
+1 -9
View File
@@ -16,12 +16,6 @@ SPECIAL_ACTOR_PROFILE(NPC_SLTK, dAcNpcSltk_c, fProfile::NPC_SLTK, 0x63, 0, 0);
STATE_VIRTUAL_DEFINE(dAcNpcSltk_c, Wait);
#pragma explicit_zero_data on
int rot0 = 0;
int rot1 = 0;
int rot2 = 0;
#pragma explicit_zero_data off
int dAcNpcSltk_c::create() {
return dAcBase_c::create();
}
@@ -50,9 +44,7 @@ int dAcNpcSltk_c::actorCreate() {
}
}
rotation.x = rot0;
rotation.y = rot1;
rotation.z = rot2;
rotation.set(0, 0, 0);
field_0x758 = getParam2() * 100;
field_0x75C = getParam3() * 100;
+4 -9
View File
@@ -106,10 +106,6 @@ ok:
return true;
}
#pragma explicit_zero_data on
static u32 rotX_init = 0;
#pragma explicit_zero_data off
int dAcODungeonShip_c::create() {
if (!StoryflagManager::sInstance->getCounterOrFlag(271)) {
return FAILED;
@@ -158,7 +154,7 @@ int dAcODungeonShip_c::create() {
clearActorProperty(0x1);
mAppearEventFromParam = (params >> 0x18);
field_0x849 = rotation.x;
rotation.x = rotX_init;
rotation.x = 0;
updateMatrix();
mBg.Move();
return SUCCEEDED;
@@ -171,9 +167,6 @@ int dAcODungeonShip_c::doDelete() {
return SUCCEEDED;
}
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_682_;
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_683_;
int dAcODungeonShip_c::actorExecute() {
field_0x850++;
field_0x86C++;
@@ -196,7 +189,9 @@ int dAcODungeonShip_c::actorExecute() {
mAnmMatClr.play();
mMdl.calc(false);
if (field_0x8D8) {
mEffects[0].createContinuousEffect(PARTICLE_RESOURCE_ID_MAPPING_682_, position, &rotation, nullptr, nullptr, nullptr);
mEffects[0].createContinuousEffect(
PARTICLE_RESOURCE_ID_MAPPING_682_, position, &rotation, nullptr, nullptr, nullptr
);
}
if (field_0x8D9) {
+1 -1
View File
@@ -155,7 +155,7 @@ UNKTYPE dAcOivyRope_c::fn_256_4C80(UNKTYPE) {}
UNKTYPE dAcOivyRope_c::fn_256_4CA0(UNKTYPE) {}
int dAcOivyRope_c::createBase() {
rotation.set(0, 0, 0);
rotation = 0;
f32 temp = 2000.f - 750.f;
mDistance = 2000.f;
mOldDistance = 2000.f;
+1 -2
View File
@@ -174,7 +174,7 @@ void dAcOSeatSword_c::registerInEvent() {
vec.rotY(rotation.y);
vec += position;
player->setPosRot(vec, ang, 0, 1, 0);
mField_0x7E8 = 0;
mField_0x7E8.set(0);
updateSwordMdl();
}
}
@@ -212,7 +212,6 @@ void dAcOSeatSword_c::initializeState_Get() {
void dAcOSeatSword_c::executeState_Get() {}
void dAcOSeatSword_c::finalizeState_Get() {}
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_76_;
void dAcOSeatSword_c::actorExecuteCommon() {
if (checkPlayerHasSword()) {
return;
+3 -2
View File
@@ -127,7 +127,8 @@ void dAcOTowerGearD101_c::initTransform() {
mMdl.setLocalMtx(field_0x3C4);
}
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_585_;
void dAcOTowerGearD101_c::playVisualEffect() {
mEffects.createContinuousEffect(PARTICLE_RESOURCE_ID_MAPPING_585_, field_0x3F4, &rotation, nullptr, nullptr, nullptr);
mEffects.createContinuousEffect(
PARTICLE_RESOURCE_ID_MAPPING_572_, field_0x3F4, &rotation, nullptr, nullptr, nullptr
);
}
+1 -2
View File
@@ -593,11 +593,10 @@ void dAcOTowerHandD101_c::executeState_RemainOpen() {
}
void dAcOTowerHandD101_c::finalizeState_RemainOpen() {}
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_573;
void dAcOTowerHandD101_c::initializeState_Close() {
mMdl.getAnm().setPlayState(m3d::PLAY_MODE_1);
mMdl.setRate(getCloseRate());
mEffects.createEffect(PARTICLE_RESOURCE_ID_MAPPING_573, position, nullptr, nullptr, nullptr, nullptr);
mEffects.createEffect(PARTICLE_RESOURCE_ID_MAPPING_573_, position, nullptr, nullptr, nullptr, nullptr);
playSound(0xC0C);
}
void dAcOTowerHandD101_c::executeState_Close() {
+3 -9
View File
@@ -40,11 +40,6 @@ void float_ordering() {
f32 f[] = {15.f, .4f, .4f, 5.f};
}
#pragma explicit_zero_data on
u8 dAcOtubo_c::sUnk0 = 1;
u32 dAcOtubo_c::sUnk1 = 0;
#pragma explicit_zero_data off
SPECIAL_ACTOR_PROFILE(OBJ_TUBO, dAcOtubo_c, fProfile::OBJ_TUBO, 0x194, 0, 130);
STATE_DEFINE(dAcOtubo_c, Wait);
@@ -449,7 +444,6 @@ void dAcOtubo_c::finalizeState_Rebirth() {
setActorProperty(0x1);
}
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_109_, PARTICLE_RESOURCE_ID_MAPPING_209_;
extern "C" void fn_80022BE0(void *, const mVec3_c &);
void dAcOtubo_c::destroy() {
@@ -637,7 +631,7 @@ void dAcOtubo_c::attemptDestroy() {
}
if (mObjAcch.ChkWallHit(nullptr) && sLib::absDiff(mAcchCir.GetWallAngleY(), angle.y) > mAng::deg2short(70.f)) {
attemptDestroyOnWall(&sUnk1, &sUnk0);
attemptDestroyOnWall();
angle.y = mAcchCir.GetWallAngleY();
forwardSpeed *= 0.5f;
return;
@@ -681,8 +675,8 @@ void dAcOtubo_c::attemptDestroy() {
}
}
void dAcOtubo_c::attemptDestroyOnWall(u32 *, const u8 *unk) {
if (*unk && sLib::absDiff(mAcchCir.GetWallAngleY(), angle.y) > mAng::deg2short(70.f) && 15.f < forwardSpeed) {
void dAcOtubo_c::attemptDestroyOnWall(const u32 &param0, const bool &param1) {
if (param1 && sLib::absDiff(mAcchCir.GetWallAngleY(), angle.y) > mAng::deg2short(70.f) && 15.f < forwardSpeed) {
destroy();
}
}
+2 -3
View File
@@ -18,10 +18,11 @@
#include "m/m_vec.h"
#include "s/s_Math.h"
#include "toBeSorted/blur_and_palette_manager.h"
#include "toBeSorted/dowsing_target.h"
#include "toBeSorted/d_emitter.h"
#include "toBeSorted/dowsing_target.h"
#include "toBeSorted/small_sound_mgr.h"
void float_ordering() {
const f32 arr[] = {5.f, 15.f, 7.f, 0.5f, 0.1f};
}
@@ -261,8 +262,6 @@ bool dAcOTumbleWeed_c::checkInvalidGround() const {
code == POLY_ATTR_SAND_DEEP_SLOW;
}
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_743_;
void dAcOTumbleWeed_c::doBreak() {
playSound(SE_TWeed_CUT);
mVec3_c pos = getPosition();
+1 -2
View File
@@ -48,8 +48,7 @@ int dAcOutajimaIsland_c::actorCreate() {
s32 v = getParm2() * 30;
field_0x5BC = mAng::fromDeg(v);
field_0x5BE.x = field_0x5BC;
field_0x5BE.z = 0x88;
field_0x5BE.y = 0x88;
field_0x5BE.y = field_0x5BE.z = mAng(0x88);
movePlatforms();
CREATE_ALLOCATOR(dAcOutajimaIsland_c);
+1 -1
View File
@@ -16,7 +16,7 @@ int dTgDowsing_c::create() {
}
mUntriggerStoryFlag = getUntriggerStoryFlag();
mTriggerStoryFlag = getTriggerStoryFlag();
rotation.z = 0;
rotation.z.set(0);
bool doThing = getDowsingOptionNum() <= DOWSING_MAX && (1 << getDowsingOptionNum() & 0xC3F) != 0;
mDowsingTarget.initialize(!doThing ? DowsingTarget::SLOT_QUEST : DowsingTarget::SLOT_STORY_EVENT, 0, nullptr, 0);
+2 -7
View File
@@ -8,12 +8,6 @@
#include "m/m_angle.h"
#include "s/s_Math.h"
#pragma explicit_zero_data on
static u32 initialRotX = 0;
static u32 initialRotY = 0;
static u32 initialRotZ = 0;
#pragma explicit_zero_data off
SPECIAL_ACTOR_PROFILE(GEKO_TAG, dTgGekoTag, fProfile::GEKO_TAG, 0xEE, 0, 0);
STATE_DEFINE(dTgGekoTag, Wait);
@@ -74,7 +68,8 @@ void dTgGekoTag::doExecute() {
gekoParmTmp = (gekoParmTmp & 0xFFFF00FF) | (params & 0xFF00);
u32 gekoParm = gekoParmTmp | ((mGekoParam != 0 ? 3 : 1) << 16);
mAng3_c gekoRot = mAng3_c(initialRotX, initialRotY, initialRotZ);
mAng3_c gekoRot;
gekoRot.clear();
gekoRot.y = cM::rndF(65535.0f);
int numFullGekoRefs = 0;
for (int i = 0; i < mNumGeko; i++) {
+2 -9
View File
@@ -14,9 +14,6 @@
SPECIAL_ACTOR_PROFILE(TAG_REACTION, dTgReaction_c, fProfile::TAG_REACTION, 0x0151, 0, 0);
STATE_DEFINE(dTgReaction_c, Wait);
#pragma explicit_zero_data on
const u32 fZero = 0;
#pragma explicit_zero_data off
const f32 dTgReaction_c::sRadius = 100.0f;
const f32 dTgReaction_c::sHeight = 100.0f;
@@ -29,10 +26,6 @@ dCcD_SrcCyl dTgReaction_c::sCcSrc = {
};
// clang-format on
#pragma explicit_zero_data on
static u32 initialRotX = 0;
#pragma explicit_zero_data off
bool dTgReaction_c::createHeap() {
return true;
}
@@ -55,8 +48,8 @@ int dTgReaction_c::create() {
}
field_0x4E0 = rotation.x & 0xFF;
angle.x = initialRotX;
rotation.x = angle.x;
rotation.x = angle.x = 0;
if (field_0x4E0 < 0xFF && !SceneflagManager::sInstance->checkBoolFlag(roomid, field_0x4E0)) {
return FAILED;
}
+6 -14
View File
@@ -1,28 +1,20 @@
#include "d/t/d_t_ship_window.h"
#include "toBeSorted/event_manager.h"
#include "d/flag/sceneflag_manager.h"
#include "toBeSorted/event_manager.h"
SPECIAL_ACTOR_PROFILE(TAG_SHIP_WINDOW, dTgShipWindow_c, fProfile::TAG_SHIP_WINDOW, 0x0228, 0, 0);
STATE_DEFINE(dTgShipWindow_c, On);
STATE_DEFINE(dTgShipWindow_c, Off);
// sDefaultRotX got placed in .data despite being zero.
// There is a handy pragma for this but it's probably not
// the correct solution.
#pragma explicit_zero_data on
u32 dTgShipWindow_c::sDefaultRotX = 0;
#pragma explicit_zero_data off
int dTgShipWindow_c::create() {
mInitialStateFlag = params & 0xFF;
mOutputStateFlagBase = (params >> 8) & 0xFF;
mOffEventId = (params >> 16) & 0xFF;
mOnEventId = (params >> 24) & 0xFF;
mAlwaysPlayEvent = rotation.x & 1;
rotation.x = sDefaultRotX;
rotation.x = 0;
if (SceneflagManager::sInstance->checkBoolFlag(roomid, mInitialStateFlag)) {
SceneflagManager::sInstance->setFlag(roomid, mOutputStateFlagBase);
mStateMgr.changeState(StateID_On);
@@ -75,8 +67,8 @@ void dTgShipWindow_c::executeState_Off() {
}
if ((mHasPlayedOffEvent == 0 || mAlwaysPlayEvent == 0) &&
(mOutputStateFlagBase >= 0xFF || !SceneflagManager::sInstance->checkBoolFlag(roomid, mOutputStateFlagBase + 1)
)) {
(mOutputStateFlagBase >= 0xFF ||
!SceneflagManager::sInstance->checkBoolFlag(roomid, mOutputStateFlagBase + 1))) {
if (mOffEventId != 0xFF) {
{
// this works but I don't like it
@@ -115,8 +107,8 @@ void dTgShipWindow_c::executeState_On() {
}
if ((mHasPlayedOnEvent == 0 || mAlwaysPlayEvent == 0) &&
(mOutputStateFlagBase >= 0xFF || !SceneflagManager::sInstance->checkBoolFlag(roomid, mOutputStateFlagBase + 2)
)) {
(mOutputStateFlagBase >= 0xFF ||
!SceneflagManager::sInstance->checkBoolFlag(roomid, mOutputStateFlagBase + 2))) {
if (mOnEventId != 0xFF) {
{
// this works but I don't like it
+4 -11
View File
@@ -1,19 +1,12 @@
#include "d/t/d_t_sw_area.h"
#include "d/a/d_a_player.h"
#include "toBeSorted/area_math.h"
#include "d/flag/sceneflag_manager.h"
#include "d/flag/storyflag_manager.h"
#include "toBeSorted/area_math.h"
SPECIAL_ACTOR_PROFILE(SW_AREA_TAG, dTgSwArea_c, fProfile::SW_AREA_TAG, 0x292, 0, 0);
// sDefaultRotX got placed in .data despite being zero.
// There is a handy pragma for this but it's probably not
// the correct solution.
#pragma explicit_zero_data on
u32 dTgSwArea_c::sDefaultRotX = 0;
u32 dTgSwArea_c::sDefaultRotZ = 0;
#pragma explicit_zero_data off
int dTgSwArea_c::create() {
setSceneflag = getSetSceneflag();
unsetSceneflag = getUnsetSceneflag();
@@ -21,8 +14,8 @@ int dTgSwArea_c::create() {
setStoryflag = getSetStoryflag();
unsetStoryflag = getUnsetStoryflag();
rotation.x = sDefaultRotX;
rotation.z = sDefaultRotZ;
rotation.x = 0;
rotation.z = 0;
matrixCreateFromPosRotYScale(area, position, rotation.y, mScale, nullptr, 0.0f);
return SUCCEEDED;
+20 -21
View File
@@ -12,8 +12,10 @@
#include "d/d_stage.h"
#include "d/flag/enemyflag_manager.h"
#include "egg/core/eggAllocator.h"
#include "egg/math/eggMath.h"
#include "f/f_base.h"
#include "f/f_list_nd.h"
#include "m/m_angle.h"
#include "m/m_vec.h"
#include "toBeSorted/event.h"
#include "toBeSorted/event_manager.h"
@@ -359,13 +361,15 @@ dAcBase_c *dAcBase_c::findActor(char *objName, dAcBase_c *parent) {
// searches for actor based on groupType
// 8002d0a0
FORCE_INLINE dAcBase_c *findActor(dAcBase_c *parent) {
dAcBase_c *foundActor;
if (!parent) {
return (dAcBase_c *)fManager_c::searchBaseByGroupType(2, nullptr);
foundActor = (dAcBase_c *)fManager_c::searchBaseByGroupType(dBase_c::ACTOR, nullptr);
} else if (parent->group_type == 2) {
foundActor = (dAcBase_c *)fManager_c::searchBaseByGroupType(dBase_c::ACTOR, parent);
} else {
foundActor = nullptr;
}
if (parent->group_type == 2) {
return (dAcBase_c *)fManager_c::searchBaseByGroupType(2, parent);
}
return nullptr;
return foundActor;
}
// control flow sucks ;-;
@@ -374,11 +378,7 @@ FORCE_INLINE dAcBase_c *findActor(dAcBase_c *parent) {
dAcBase_c *dAcBase_c::searchActor(dAcBase_c *parent) {
dAcBase_c *foundActor = ::findActor(parent);
if (!foundActor) {
return (dAcBase_c *)fManager_c::searchBaseByGroupType(STAGE, parent);
}
return foundActor;
return foundActor ? foundActor : (dAcBase_c *)fManager_c::searchBaseByGroupType(STAGE, parent);
}
// 8002d130
@@ -420,22 +420,21 @@ bool dAcBase_c::getDistanceToActor(dAcBase_c *actor, f32 distThresh, f32 *outDis
bool dAcBase_c::getDistanceAndAngleToActor(
dAcBase_c *actor, f32 distThresh, s16 yAngle, s16 xAngle, f32 *outDist, s16 *outDiffAngleY, s16 *outDiffAngleX
) {
f32 distSquared = 3.402823e+38f;
s32 angleToActorY, angleToActorX;
f32 distSquared = EGG::Math<f32>::epsilon();
bool isWithinRange = false;
angleToActorY = 0;
angleToActorX = 0;
mAng angleToActorY(0), angleToActorX(0);
if (actor != nullptr) {
distSquared = PSVECSquareDistance(position, actor->position);
angleToActorY = cLib::targetAngleY(position, actor->position);
angleToActorX = cLib::targetAngleX(position, actor->position);
angleToActorY.set(cLib::targetAngleY(position, actor->position));
angleToActorX.set(cLib::targetAngleX(position, actor->position));
// These casts are nuts wild ^^'
if ((distSquared <= distThresh * distThresh) && (labs(s16(rotation.y.mVal - (s16)angleToActorY)) <= yAngle) &&
(labs(s16(rotation.x.mVal - (s16)angleToActorX)) <= xAngle)) {
isWithinRange = true;
if ((distSquared <= distThresh * distThresh)) {
if ((labs(mAng(rotation.y.diff(angleToActorY))) <= yAngle) &&
(labs(mAng(rotation.x.diff(angleToActorX))) <= xAngle)) {
isWithinRange = true;
}
}
}
@@ -513,7 +512,7 @@ void dAcBase_c::FUN_8002d7d0() {}
void dAcBase_c::FUN_8002d7f0() {}
void dAcBase_c::FUN_8002d810() {}
void dAcBase_c::FUN_8002d830() {}
void dAcBase_c::FUN_8002d860() {}
void dAcBase_c::FUN_8002d860(UNKWORD) {}
// 8002d880
SoundSource *dAcBase_c::getSoundSource() {
-2
View File
@@ -17,8 +17,6 @@
#include "toBeSorted/d_emitter.h"
#include "toBeSorted/small_sound_mgr.h"
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_394_;
void dAcOInsect_c::kill() {
dJEffManager_c::spawnEffect(PARTICLE_RESOURCE_ID_MAPPING_394_, position, nullptr, nullptr, nullptr, nullptr, 0, 0);
playSound(SE_Insect_DISAPPEAR);
+6 -4
View File
@@ -145,8 +145,6 @@ int dAcOsw_c::doDelete() {
return SUCCEEDED;
}
extern "C" u16 PARTICLE_RESOURCE_ID_MAPPING_754_;
int dAcOsw_c::actorExecute() {
mStateMgr.executeState();
if (mCanBeSeen) {
@@ -154,7 +152,9 @@ int dAcOsw_c::actorExecute() {
if (field_0x5A0.field_0x00 <= 0.0f) {
if (mScale.x >= 1.0f) {
if (!mHidden) {
dJEffManager_c::spawnEffect(PARTICLE_RESOURCE_ID_MAPPING_754_, position, &rotation, nullptr, nullptr, nullptr, 0, 0);
dJEffManager_c::spawnEffect(
PARTICLE_RESOURCE_ID_MAPPING_754_, position, &rotation, nullptr, nullptr, nullptr, 0, 0
);
playSound(SE_TIMESLIP_TIMESLIP_REV);
mHidden = true;
}
@@ -167,7 +167,9 @@ int dAcOsw_c::actorExecute() {
} else {
if (mScale.x <= 0.0f) {
if (!mShown) {
dJEffManager_c::spawnEffect(PARTICLE_RESOURCE_ID_MAPPING_754_, position, &rotation, nullptr, nullptr, nullptr, 0, 0);
dJEffManager_c::spawnEffect(
PARTICLE_RESOURCE_ID_MAPPING_754_, position, &rotation, nullptr, nullptr, nullptr, 0, 0
);
playSound(SE_TIMESLIP_TIMESLIP);
mShown = true;
}
+33 -32
View File
@@ -17,6 +17,7 @@
#include "d/flag/sceneflag_manager.h"
#include "d/flag/storyflag_manager.h"
#include "d/flag/tboxflag_manager.h"
#include "d/t/d_t_siren.h"
#include "m/m3d/m_fanm.h"
#include "m/m3d/m_scnleaf.h"
#include "m/m_mtx.h"
@@ -785,13 +786,9 @@ f32 dAcTbox_c::getSomeRate() {
bool dAcTbox_c::isValidGroupIndex(int idx) {
return 0 <= idx && idx < 15;
}
extern "C" void *SIREN_TAG;
extern "C" bool hasCollectedAllTears(void *SIREN_TAG);
bool dAcTbox_c::hasCollectedAllTears() {
if (SIREN_TAG == nullptr) {
return false;
}
return ::hasCollectedAllTears(SIREN_TAG);
return dTgSiren_c::hasCollectedAllTears();
}
bool dAcTbox_c::getGroundHeight(f32 *height, const mVec3_c &pos) {
@@ -945,9 +942,7 @@ bool dAcTbox_c::createHeap() {
fn_8026B380(fxPos);
mMtx_c fxTransform;
fxTransform.transS(fxPos);
// TODO address calculations here, otherwise this function
// matches surprisingly well
fxTransform.ZXYrotM(rotation.x, rotation.y, rotation.z);
fxTransform.ZXYrotM(GetRotation());
mOpenFxMdl.setLocalMtx(fxTransform);
mOpenFxMdl.setScale(fn_8026B3C0());
}
@@ -988,8 +983,8 @@ int dAcTbox_c::create() {
case 3: field_0x120A = 3; break;
default: field_0x120A = 3; break;
}
rotation.z = 0;
rotation.x = 0;
rotation.z.set(0);
rotation.x.set(0);
// This part of the code checks if there's another chest with similar properties
// and only keeps one of them.
@@ -1102,7 +1097,6 @@ int dAcTbox_c::create() {
field_0x0D48.addCc(mCcD2, s4);
}
field_0x0D48.SetStts(mStts);
// TODO figure out the right fields
mCcD1.SetTg_0x4C(-1);
mCcD2.SetTg_0x4C(-1);
mMdl1.setAnm(sAnmNames[mVariant], m3d::PLAY_MODE_4);
@@ -1151,14 +1145,13 @@ int dAcTbox_c::create() {
field_0x11EC = 1.0f;
field_0x11FC = 0;
field_0x4E8.r = 0;
field_0x4E8.g = 0;
field_0x4E8.b = 0;
mLightInfo.mClr.r = 0;
mLightInfo.mClr.g = 0;
mLightInfo.mClr.b = 0;
field_0x4EC = 0.0f;
field_0x4DC.x = position.x;
field_0x4DC.z = position.z;
field_0x4DC.y = position.y + 100.0f;
mLightInfo.SetScale(0.f);
mLightInfo.SetPosition(position);
mLightInfo.mPos.y += 100.0f;
return SUCCEEDED;
}
@@ -1933,7 +1926,6 @@ void dAcTbox_c::executeState_LoadArchive() {
}
void dAcTbox_c::finalizeState_LoadArchive() {}
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_209_;
extern "C" const bool isPouchItem(u16);
extern "C" dAcItem_c *giveItem3(u16 item, s32);
@@ -2239,22 +2231,22 @@ void dAcTbox_c::unsetShouldCloseFlag() {
void dAcTbox_c::fn_8026D370() {
if (isNotSmall()) {
field_0x11F0 = 1;
BlurAndPaletteManager::GetInstance().fn_800223A0(&field_0x4DC);
BlurAndPaletteManager::GetInstance().fn_800223A0(&mLightInfo);
}
}
void dAcTbox_c::fn_8026D3C0() {
if (mAnmChr.isStop() && mAnmTexSrt1.isStop(0) && mAnmMatClr2.isStop(0)) {
field_0x11F0 = 0;
BlurAndPaletteManager::GetInstance().fn_80022440(&field_0x4DC);
BlurAndPaletteManager::GetInstance().fn_80022440(&mLightInfo);
} else {
mAnmChr.play();
mAnmTexSrt1.play();
mAnmMatClr2.play();
field_0x4E8.r = 0xAA;
field_0x4E8.g = 0x96;
field_0x4E8.b = 0x96;
field_0x4EC = 125.0f;
mLightInfo.mClr.r = 0xAA;
mLightInfo.mClr.g = 0x96;
mLightInfo.mClr.b = 0x96;
mLightInfo.SetScale(125.0f);
}
}
@@ -2373,10 +2365,10 @@ void dAcTbox_c::unregisterDowsing() {
}
}
extern "C" u16 PARTICLE_RESOURCE_ID_MAPPING_208_;
void dAcTbox_c::spawnAppearEffect() {
dJEffManager_c::spawnEffect(PARTICLE_RESOURCE_ID_MAPPING_208_, position, &rotation, nullptr, nullptr, nullptr, 0, 0);
dJEffManager_c::spawnEffect(
PARTICLE_RESOURCE_ID_MAPPING_208_, position, &rotation, nullptr, nullptr, nullptr, 0, 0
);
}
bool dAcTbox_c::checkIsClear() const {
@@ -2393,17 +2385,26 @@ bool dAcTbox_c::checkIsClear() const {
mVec3_c(-50.0f, 500.0f, -50.0f),
};
mVec3_c points[4];
mVec3_c *offs = offsets;
mVec3_c *pnt = points;
for (u32 i = 0; i <= 3; i++) {
fn_8026DAD0(&offsets[i], &points[i]);
fn_8026DAD0(offs, pnt);
offs++;
pnt++;
}
static const int fsIdxes[] = {0, 0, 1, 1};
bool isClear = true;
for (u32 i = 0; isClear && i <= 3;) {
u32 i = 0;
const int *idx = fsIdxes;
while (isClear && i <= 3) {
// @bug should this be points[i] instead?
if (isBelowGroundAtPos(fs[fsIdxes[i]], points[0])) {
if (isBelowGroundAtPos(fs[*idx], points[0])) {
isClear = false;
} else {
i++;
idx++;
}
}
-2
View File
@@ -60,8 +60,6 @@ int dAcOwaterSpout_c::draw() {
return SUCCEEDED;
}
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_213_;
void dAcOwaterSpout_c::initializeState_Wait() {
if (params == 1) {
return;
+1 -4
View File
@@ -30,10 +30,7 @@ bool cM3dGPla::getCrossYLessD(const mVec3_c &point, f32 *out) const {
mAng cM3dGPla::GetAngle(mAng ang) const {
mAng angleY = GetAngleY();
angleY = angleY - ang;
return cM::atan2s(GetXZDist() * angleY.cos(), mNormal.y);
return cM::atan2s(GetXZDist() * mAng(angleY - ang).cos(), mNormal.y);
}
mAng cM3dGPla::GetNegativeAngle(mAng ang) const {
+11 -7
View File
@@ -9,8 +9,16 @@
SPECIAL_BASE_PROFILE(C_BASE, dCsBase_c, fProfile::C_BASE, 0x2C0, 0x06F9);
dCsBase_c::dCsBase_c()
: mpCurrLyt(nullptr), field_0x6F0(0.0f), field_0x6F4(0.0f), field_0x6F8(0.0f), field_0x6FC(0.0f), field_0x700(0),
field_0x702(0), field_0x703(0), field_0x704(0), field_0x705(0) {
: mpCurrLyt(nullptr),
field_0x6F0(0.0f),
field_0x6F4(0.0f),
field_0x6F8(0.0f),
field_0x6FC(0.0f),
field_0x700(0),
field_0x702(0),
field_0x703(0),
field_0x704(0),
field_0x705(0) {
sInstance = this;
}
@@ -28,10 +36,6 @@ static const char *sLytNames[] = {
"P1_Cat.brlyt",
};
#pragma explicit_zero_data on
int dCsBase_c::sfield0x700Init = 0;
#pragma explicit_zero_data off
int dCsBase_c::create() {
void *data = LayoutArcManager::GetInstance()->getLoadedData("cursor");
mResAcc.attach(data, "arc");
@@ -51,7 +55,7 @@ int dCsBase_c::create() {
field_0x6F8 = 0.0f;
field_0x6FC = 0.0f;
field_0x700 = sfield0x700Init;
field_0x700 = 0;
field_0x702 = 0;
field_0x703 = 0;
+15 -23
View File
@@ -14,8 +14,8 @@
#include "nw4r/lyt/lyt_group.h"
#include "nw4r/math/math_types.h"
#include "sized_string.h"
#include "toBeSorted/dowsing_target.h"
#include "toBeSorted/d_emitter.h"
#include "toBeSorted/dowsing_target.h"
#include "toBeSorted/file_manager.h"
#include "toBeSorted/small_sound_mgr.h"
@@ -395,16 +395,14 @@ void dLytMeterDowsing_c::executeState_Wait() {
mStateMgr.changeState(StateID_DemoMove);
} else if (field_0x5505 != 0) {
mStateMgr.changeState(StateID_MenuSelectingIn);
} else if (field_0x550A != 0 &&
(!dLytMeter_c::GetMain()->fn_800D5380(0) || dLytMeter_c::GetMain()->fn_800D5650() ||
dLytMeter_c::GetMain()->fn_800D5680())) {
} else if (field_0x550A != 0 && (!dLytMeter_c::GetMain()->fn_800D5380(0) || dLytMeter_c::GetMain()->fn_800D5650() ||
dLytMeter_c::GetMain()->fn_800D5680())) {
mStateMgr.changeState(StateID_Reset);
} else if (!dLytMeter_c::GetInstance()->checkAllFlags(METER_BTN_C)) {
mStateMgr.changeState(StateID_ToUnuse);
} else if (dLytMeter_c::GetInstance()->getMeterField_0x1377F() != 0 && field_0x550A == 0 &&
dLytMeter_c::GetMain()->fn_800D5380(0) && !dLytMeter_c::GetMain()->fn_800D5650() &&
!dLytMeter_c::GetMain()->fn_800D5680() &&
getSelectedDowsingSlot() != DowsingTarget::SLOT_LOOK &&
!dLytMeter_c::GetMain()->fn_800D5680() && getSelectedDowsingSlot() != DowsingTarget::SLOT_LOOK &&
getSelectedDowsingSlot() != DowsingTarget::SLOT_NONE &&
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_C) == 0x52) {
mAnm[DOWSING_ANIM_IN].setBackwardsOnce();
@@ -553,9 +551,8 @@ void dLytMeterDowsing_c::initializeState_ToUse() {
mAnm[DOWSING_ANIM_INPUT_0].setAnimEnable(true);
if (FileManager::GetInstance()->getDowsingSlotIdx() != 8 &&
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_C) == 0x52 &&
dLytMeter_c::GetMain()->fn_800D5380(0) && !dLytMeter_c::GetMain()->fn_800D5650() &&
!dLytMeter_c::GetMain()->fn_800D5680()) {
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_C) == 0x52 && dLytMeter_c::GetMain()->fn_800D5380(0) &&
!dLytMeter_c::GetMain()->fn_800D5650() && !dLytMeter_c::GetMain()->fn_800D5680()) {
mAnm[DOWSING_ANIM_RESET].setAnimEnable(true);
mAnm[DOWSING_ANIM_RESET].setBackwardsOnce();
mAnm[DOWSING_ANIM_RESET].setToStart();
@@ -563,9 +560,8 @@ void dLytMeterDowsing_c::initializeState_ToUse() {
}
void dLytMeterDowsing_c::executeState_ToUse() {
if (FileManager::GetInstance()->getDowsingSlotIdx() != 8 &&
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_C) == 0x52 &&
dLytMeter_c::GetMain()->fn_800D5380(0) && !dLytMeter_c::GetMain()->fn_800D5650() &&
!dLytMeter_c::GetMain()->fn_800D5680()) {
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_C) == 0x52 && dLytMeter_c::GetMain()->fn_800D5380(0) &&
!dLytMeter_c::GetMain()->fn_800D5650() && !dLytMeter_c::GetMain()->fn_800D5680()) {
if (mAnm[DOWSING_ANIM_INPUT_0].isStop2()) {
if (!mAnm[DOWSING_ANIM_RESET].isEnabled() || mAnm[DOWSING_ANIM_RESET].isStop2()) {
mStateMgr.changeState(StateID_Wait);
@@ -598,9 +594,8 @@ void dLytMeterDowsing_c::initializeState_ToUnuse() {
mAnm[DOWSING_ANIM_INPUT_0].setAnimEnable(true);
if (FileManager::GetInstance()->getDowsingSlotIdx() != 8 &&
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_C) == 0x52 &&
dLytMeter_c::GetMain()->fn_800D5380(0) && !dLytMeter_c::GetMain()->fn_800D5650() &&
!dLytMeter_c::GetMain()->fn_800D5680()) {
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_C) == 0x52 && dLytMeter_c::GetMain()->fn_800D5380(0) &&
!dLytMeter_c::GetMain()->fn_800D5650() && !dLytMeter_c::GetMain()->fn_800D5680()) {
mAnm[DOWSING_ANIM_RESET].setAnimEnable(true);
mAnm[DOWSING_ANIM_RESET].setForwardOnce();
mAnm[DOWSING_ANIM_RESET].setToStart();
@@ -636,8 +631,7 @@ void dLytMeterDowsing_c::executeState_Unuse() {
mLyt.calc();
mAnm[DOWSING_ANIM_INPUT_0].setAnimEnable(false);
mStateMgr.changeState(StateID_DemoMove);
} else if (!dLytMeter_c::GetMain()->fn_800D5680() &&
dLytMeter_c::GetInstance()->getMeterField_0x13774() == 0 &&
} else if (!dLytMeter_c::GetMain()->fn_800D5680() && dLytMeter_c::GetInstance()->getMeterField_0x13774() == 0 &&
dLytMeter_c::GetInstance()->checkAllFlags(METER_BTN_C)) {
if (field_0x54D8 <= 0) {
mStateMgr.changeState(StateID_ToUse);
@@ -707,7 +701,7 @@ void dLytMeterDowsing_c::initializeState_DemoMove() {
mAnm[i + DOWSING_ANIM_ITEM_ONOFF_OFFSET].setAnimEnable(false);
}
}
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_970_;
void dLytMeterDowsing_c::executeState_DemoMove() {
mDemoFrame++;
if (mDemoFrame == 15) {
@@ -1015,8 +1009,7 @@ bool dLytMeterDowsing_c::execute() {
}
if (mAnm[DOWSING_ANIM_CALL].isEnabled()) {
mAnm[DOWSING_ANIM_CALL].play();
if (dLytMeter_c::GetInstance()->checkAllFlags(METER_BTN_C) &&
mAnm[DOWSING_ANIM_CALL].getFrame() == 1.0f) {
if (dLytMeter_c::GetInstance()->checkAllFlags(METER_BTN_C) && mAnm[DOWSING_ANIM_CALL].getFrame() == 1.0f) {
SmallSoundManager::GetInstance()->playSound(SE_S_C_BUTTON_BLINK);
}
}
@@ -1119,9 +1112,8 @@ void dLytMeterDowsing_c::fn_800FE110() {
void dLytMeterDowsing_c::fn_800FE220() {
if (getSelectedDowsingSlot() != DowsingTarget::SLOT_NONE &&
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_C) == 0x52 &&
dLytMeter_c::GetMain()->fn_800D5380(0) && !dLytMeter_c::GetMain()->fn_800D5650() &&
!dLytMeter_c::GetMain()->fn_800D5680()) {
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_C) == 0x52 && dLytMeter_c::GetMain()->fn_800D5380(0) &&
!dLytMeter_c::GetMain()->fn_800D5650() && !dLytMeter_c::GetMain()->fn_800D5680()) {
mAnm[DOWSING_ANIM_RESET].setAnimEnable(true);
mAnm[DOWSING_ANIM_RESET].setForwardOnce();
mAnm[DOWSING_ANIM_RESET].setToStart();
+1 -1
View File
@@ -282,7 +282,7 @@ void dLytMeterHeart_c::realizeHeartsState() {
}
}
}
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_972_;
void dLytMeterHeart_c::executeInternal() {
if (mEffectHeartIdx >= 0) {
nw4r::math::MTX34 mtx = mpHeartPanes[mEffectHeartIdx]->GetGlobalMtx();
+5 -5
View File
@@ -1393,7 +1393,7 @@ void dLytMeterItemSelect_c::initializeState_DemoMove() {
SmallSoundManager::GetInstance()->playSound(SE_S_GET_ITEM_SET);
}
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_740_;
void dLytMeterItemSelect_c::executeState_DemoMove() {
mDemoMoveTimer++;
if (mDemoMoveTimer == 15) {
@@ -1410,7 +1410,9 @@ void dLytMeterItemSelect_c::executeState_DemoMove() {
nw4r::math::MTX34 mtx = mpPanes[i + ITEM_SELECT_PANE_ICON_OFFSET]->GetGlobalMtx();
mVec3_c pos(mtx._03, mtx._13, 0.0f);
dJEffManager_c::spawnUIEffect(PARTICLE_RESOURCE_ID_MAPPING_740_, pos, nullptr, nullptr, nullptr, nullptr);
dJEffManager_c::spawnUIEffect(
PARTICLE_RESOURCE_ID_MAPPING_740_, pos, nullptr, nullptr, nullptr, nullptr
);
if (mIsBocoburinLocked[i]) {
mIsBocoburinLocked[i] = false;
@@ -2237,7 +2239,6 @@ bool dLytMeterItemSelect_c::execute() {
return true;
}
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_717_;
void dLytMeterItemSelect_c::fn_800EF580() {
nw4r::math::MTX34 mtx = mpPanes[11]->GetGlobalMtx();
mVec3_c pos(mtx._03, mtx._13, 0.0f);
@@ -2481,8 +2482,7 @@ bool dLytMeterItemSelect_c::fn_800F0030() const {
if (!StoryflagManager::sInstance->getCounterOrFlag(58) &&
!(EventManager::isInEvent() && EventManager::isCurrentEvent("ItemGetGorgeous")) ||
(mpOwnerPane == nullptr || !mpOwnerPane->IsVisible() || dLytMeter_c::GetMain()->fn_800D5650() ||
dLytMeter_c::GetMain()->fn_800D5680() ||
!dLytMeter_c::GetMain()->getItemSelectNotHiddenByAreaCaption())) {
dLytMeter_c::GetMain()->fn_800D5680() || !dLytMeter_c::GetMain()->getItemSelectNotHiddenByAreaCaption())) {
// If we don't have a B-Wheel and we're not currently in the ItemGetGorgeous event,
// or (random other conditions), return false
return false;
+5 -5
View File
@@ -7,6 +7,7 @@
#include "d/lyt/d_lyt_control_game.h"
#include "d/lyt/d_lyt_util_items.h"
#include "d/lyt/meter/d_lyt_meter.h"
#include "m/m_angle.h"
#include "nw4r/lyt/lyt_group.h"
#include "nw4r/math/math_types.h"
#include "sized_string.h"
@@ -520,7 +521,7 @@ void dLytMeterMinusBtn_c::executeState_Unuse() {
}
}
void dLytMeterMinusBtn_c::finalizeState_Unuse() {}
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_971_;
void dLytMeterMinusBtn_c::initializeState_DemoMove() {
mDemoFrame = 0;
mSlotToDemo = -1;
@@ -767,7 +768,7 @@ bool dLytMeterMinusBtn_c::build(d2d::ResAccIf_c *resAcc) {
}
for (s32 i = 0; i < 4; i++) {
mEffectsRot[i].setR(0);
mEffectsRot[i] = 0;
mSlotForEffect[i] = -1;
mEffects[i].init(dLytControlGame_c::getInstance());
}
@@ -1004,7 +1005,7 @@ bool dLytMeterMinusBtn_c::demoRelated(s32 arg) {
field_0x4E8C = arg;
mDemoFrame = 0;
for (s32 i = 0; i < 4; i++) {
mEffectsRot[i].setR(0);
mEffectsRot[i].set(0);
mSlotForEffect[i] = -1;
}
mArrowRotation = 0.0f;
@@ -1038,8 +1039,7 @@ bool dLytMeterMinusBtn_c::fn_800F7600() const {
bool dLytMeterMinusBtn_c::fn_800F7760() const {
if (!StoryflagManager::sInstance->getCounterOrFlag(30) ||
(mpOwnerPane == nullptr || !mpOwnerPane->IsVisible() || dLytMeter_c::GetMain()->fn_800D5650() ||
dLytMeter_c::GetMain()->fn_800D5680() ||
!dLytMeter_c::GetMain()->getMinusBtnNotHiddenByAreaCaption())) {
dLytMeter_c::GetMain()->fn_800D5680() || !dLytMeter_c::GetMain()->getMinusBtnNotHiddenByAreaCaption())) {
return false;
}
+1 -5
View File
@@ -382,9 +382,6 @@ void LytMeterTimerPart1_c::initColors() {
}
}
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_135_;
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_136_;
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_137_;
void LytMeterTimerPart1_c::createEffect(s32 fruitIndex) {
nw4r::math::MTX34 mtx = mpPanes[fruitIndex]->GetGlobalMtx();
mVec3_c pos;
@@ -993,7 +990,6 @@ void LytMeterTimerPart2_c::initColors() {
}
}
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_174_;
void LytMeterTimerPart2_c::createSingleFruitEffect() {
nw4r::math::MTX34 mtx = mpPane->GetGlobalMtx();
mVec3_c pos;
@@ -1005,7 +1001,7 @@ void LytMeterTimerPart2_c::createSingleFruitEffect() {
&mColors2[TIMER_02_COLOR_01_00]
);
}
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_206_;
void LytMeterTimerPart2_c::createFruitCompleteEffect() {
nw4r::math::MTX34 mtx = mpPane->GetGlobalMtx();
mVec3_c pos;
+1 -1
View File
@@ -3,7 +3,7 @@
#include "math.h"
/** 80575c08 */
mAng3_c mAng3_c::Zero = mAng3_c(0, 0, 0);
mAng3_c mAng3_c::Zero(0, 0, 0);
const f32 mAng::sHalfCircleDeg = 360.0f / 2;
const f32 mAng::sAngToDeg = 360.0f / (1 << 16);
+2 -2
View File
@@ -418,8 +418,8 @@ void AttentionGroup::fn_800964B0() {
extern "C" f32 lbl_8057CD9C;
f32 AttentionManager::targetScore(dAcObjBase_c *target, dAcObjBase_c *origin) {
s32 angle = cLib::targetAngleY(target->position, origin->position);
f32 viewAngle = fabsf(lbl_8057CD9C * (s16)(angle - origin->rotation.y.mVal));
s16 angle = cLib::targetAngleY(target->position, origin->position) - origin->rotation.y.mVal;
f32 viewAngle = fabsf(angle * lbl_8057CD9C);
if (viewAngle > 0.5f) {
return viewAngle;
}
-15
View File
@@ -701,7 +701,6 @@ void dMassObjEmitter_c::remove() {
}
extern "C" u32 sNumMassObjEmitters; // should be const?
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_119_;
extern "C" dMassObjEmitter_c *CURRENT_EFFECT_MANAGER_INIT;
const u32 dJEffManager_c::moreInts[] = {3, 5, 7, 8, 12, 13, 14, 1, 9, 11};
@@ -1206,18 +1205,6 @@ s32 dJEffManager_c::polyAttrsToGroundEffectIdx(s32 polyAttr0, s32 polyAttr1) {
return result;
}
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_89_;
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_90_;
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_87_;
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_88_;
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_429_;
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_416_;
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_417_;
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_418_;
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_419_;
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_893_;
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_894_;
dEmitterBase_c *dJEffManager_c::spawnGroundEffect(
const mVec3_c &pos, u8 polyAttr0, u8 polyAttr1, const mVec3_c &v1, s32 unk, f32 scale, f32 groundHeightMaybe
) {
@@ -1262,8 +1249,6 @@ void dWaterEffect_c::init(dAcObjBase_c *base, f32 height, f32 scale, f32 f3) {
mDepth = f3;
}
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_91_;
extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_127_;
void dWaterEffect_c::execute(f32 water, f32 ground) {
dAcObjBase_c *ac = getActor();
bool b = getActorGroundPos(ac) < water && ground < water;