add camera bugfix option in macbeth

This commit is contained in:
Sonic Dreamcaster 2024-11-24 17:53:22 -03:00
parent bda925b33f
commit 288504039f
2 changed files with 19 additions and 7 deletions

View File

@ -3803,8 +3803,8 @@ void Macbeth_MaFallingBoulder_Update(MaFallingBoulder* this) {
} }
Macbeth_MaBoulder_Spawn(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, Macbeth_MaBoulder_Spawn(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z,
(RAND_FLOAT(2.0f) + 20.0f) * (s32) this->iwork[4], 0.0f, (RAND_FLOAT(2.0f) + 20.0f) * (s32) this->iwork[4], 0.0f, (s32) this->iwork[4] * -34.0f,
(s32) this->iwork[4] * -34.0f, 0.0f, 2, 3); 0.0f, 2, 3);
Object_Kill(&this->obj, this->sfxSource); Object_Kill(&this->obj, this->sfxSource);
} }
} }
@ -6991,14 +6991,19 @@ void Macbeth_LevelComplete2(Player* player) {
Math_SmoothStepToF(&gCsCamEyeX, player->pos.x - 2000.0f, 0.1f, D_ctx_80177A48[8], 0.0f); Math_SmoothStepToF(&gCsCamEyeX, player->pos.x - 2000.0f, 0.1f, D_ctx_80177A48[8], 0.0f);
gCsCamEyeZ -= 1.0f; gCsCamEyeZ -= 1.0f;
} }
//! @BUG: The following condition is always true: //! @BUG: The following condition is always true:
// if ((gCsFrameCount >= 2120) || (gCsFrameCount < 2175)) { // if ((gCsFrameCount >= 2120) || (gCsFrameCount < 2175)) {
if (CVarGetInteger("gMaCameraFix", 0) == 1) {
// LTODO: Fixed the bug, maybe have an option for it if ((gCsFrameCount >= 2120) && (gCsFrameCount < 2175)) {
if ((gCsFrameCount >= 2120) && (gCsFrameCount < 2175)) { Math_SmoothStepToF(&gCsCamAtY, player->pos.y + 70.0f, 0.1f, 8.0f, 0.0f);
Math_SmoothStepToF(&gCsCamAtY, player->pos.y + 70.0f, 0.1f, 8.0f, 0.0f); }
} else {
if ((gCsFrameCount >= 2120) || (gCsFrameCount < 2175)) {
Math_SmoothStepToF(&gCsCamAtY, player->pos.y + 70.0f, 0.1f, 8.0f, 0.0f);
}
} }
if (gCsFrameCount == 2120) { if (gCsFrameCount == 2120) {
D_ctx_80177A48[0] = 0.0f; D_ctx_80177A48[0] = 0.0f;
} }

View File

@ -426,6 +426,13 @@ void DrawEnhancementsMenu() {
ImGui::EndMenu(); ImGui::EndMenu();
} }
if (UIWidgets::BeginMenu("Fixes")) {
UIWidgets::CVarCheckbox("Macbeth: Level ending cutscene camera fix", "gMaCameraFix", {
.tooltip = "Fixes a camera bug found in the code of the game"
});
ImGui::EndMenu();
}
ImGui::EndMenu(); ImGui::EndMenu();
} }