Fix uninitialized field causing occasional crash in d_camera::lockonCamera, fix wolf howling scissors

This commit is contained in:
CraftyBoss
2026-03-28 00:56:10 -04:00
parent d63ffe6030
commit ce12d168f0
2 changed files with 38 additions and 2 deletions
+10 -1
View File
@@ -4846,6 +4846,15 @@ bool dCamera_c::lockonCamera(s32 param_0) {
}
}
#if TARGET_PC
f32 sp194 = 1.0f;
if (mCurCamStyleTimer < lockon_change_timer && !lockon->field_0x2a) {
sp194 = dCamMath::rationalBezierRatio((f32)mCurCamStyleTimer / lockon_change_timer, 0.5f);
ang2 *= sp194;
} else if (mCurCamStyleTimer >= lockon_change_timer) {
lockon->field_0x2a = true;
}
#else
f32 sp194;
if (mCurCamStyleTimer < lockon_change_timer && !lockon->field_0x2a) {
sp194 = dCamMath::rationalBezierRatio((f32)mCurCamStyleTimer / lockon_change_timer, 0.5f);
@@ -4854,7 +4863,7 @@ bool dCamera_c::lockonCamera(s32 param_0) {
lockon->field_0x2a = true;
sp194 = 1.0f;
}
#endif
cSAngle ang3(mViewCache.mDirection.U().Inv() - ang1);
if (mCurCamStyleTimer != 0 && mCurCamStyleTimer < lockon_change_timer) {
+28 -1
View File
@@ -475,6 +475,10 @@ void dMsgScrnHowl_c::drawWave() {
s32 local_94 = 0;
Vec fVar12 = field_0x128;
Vec this_02 = field_0x140;
#if TARGET_PC // TODO: make this actually use the scissor
f32 fVar1 = 1;
f32 fVar2 = 1;
#else
f32 fVar1 = mDoGph_gInf_c::getWidthF() / FB_WIDTH;
f32 fVar2 = mDoGph_gInf_c::getHeightF() / FB_HEIGHT;
grafContext->scissor(
@@ -484,6 +488,8 @@ void dMsgScrnHowl_c::drawWave() {
32.0f + ((this_02.y - fVar12.y) + 2.0f)
);
grafContext->setScissor();
#endif
bool bVar5 = true;
if (field_0x2798 == 0) {
if (mPlotTime != field_0x212c) {
@@ -578,10 +584,17 @@ void dMsgScrnHowl_c::drawGuide() {
J2DGrafContext* grafContext = dComIfGp_getCurrentGrafPort();
Vec local_b0 = field_0x128;
Vec local_bc = field_0x140;
#if TARGET_PC
grafContext->scissor(
(local_b0.x - mDoGph_gInf_c::getMinXF()) / (mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth()),
field_0x2118, (local_bc.x - local_b0.x) / (mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth()),
field_0x2120);
#else
grafContext->scissor(
(local_b0.x - mDoGph_gInf_c::getMinXF()) / (mDoGph_gInf_c::getWidthF() / FB_WIDTH),
field_0x2118, (local_bc.x - local_b0.x) / (mDoGph_gInf_c::getWidthF() / FB_WIDTH),
field_0x2120);
#endif
grafContext->setScissor();
f32 local_cc = mpLineH[0]->getGlobalPosX();
s16 sVar12 = 0;
@@ -709,11 +722,19 @@ void dMsgScrnHowl_c::drawGuide2() {
}
Vec local_58 = field_0x128;
Vec local_64 = field_0x140;
f32 local_70 = mDoGph_gInf_c::getHeightF() / FB_HEIGHT;
#if TARGET_PC
f32 local_70 = mDoGph_gInf_c::getHeightF() / mDoGph_gInf_c::getHeight();
grafContext->scissor(
(local_58.x - mDoGph_gInf_c::getMinXF()) / (mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth()),
field_0x2118, (local_64.x - local_58.x) / (mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth()),
field_0x2120);
#else
f32 local_70 = mDoGph_gInf_c::getHeightF() / mDoGph_gInf_c::getHeight();
grafContext->scissor(
(local_58.x - mDoGph_gInf_c::getMinXF()) / (mDoGph_gInf_c::getWidthF() / FB_WIDTH),
field_0x2118, (local_64.x - local_58.x) / (mDoGph_gInf_c::getWidthF() / FB_WIDTH),
field_0x2120);
#endif
grafContext->setScissor();
f32 local_74 = mpLineH[0]->getGlobalPosX();
s16 local_134 = 0;
@@ -815,9 +836,15 @@ void dMsgScrnHowl_c::drawEffect() {
Vec vec1 = field_0x128;
Vec vec2 = field_0x140;
mDoGph_gInf_c::getHeightF();
#if TARGET_PC
grafContext->scissor(
(vec1.x - mDoGph_gInf_c::getMinXF()) / (mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth()), field_0x2118,
12.0f + ((vec2.x - vec1.x) / (mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth())), field_0x2120);
#else
grafContext->scissor(
(vec1.x - mDoGph_gInf_c::getMinXF()) / (mDoGph_gInf_c::getWidthF() / FB_WIDTH), field_0x2118,
12.0f + ((vec2.x - vec1.x) / (mDoGph_gInf_c::getWidthF() / FB_WIDTH)), field_0x2120);
#endif
grafContext->setScissor();
u8 timer = daAlink_getAlinkActorClass()->getWolfHowlMgrP()->getReleaseTimer();
u8 screenAlpha = mpScreen->search(MULTI_CHAR('line00'))->getAlpha();