From a9b56e78e26a82c7c14082efff17d54a27556a00 Mon Sep 17 00:00:00 2001 From: Sirius902 <3645979-Sirius902@users.noreply.gitlab.com> Date: Mon, 28 Mar 2022 14:11:37 -0700 Subject: [PATCH 1/3] Fix aiming items --- soh/src/overlays/actors/ovl_player_actor/z_player.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index d02788a8e..91fcf81ad 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -2321,10 +2321,10 @@ s32 func_8083501C(Player* this, GlobalContext* globalCtx) { if ((!Player_HoldsHookshot(this) || func_80834FBC(this)) && !func_80834758(globalCtx, this) && !func_80834F2C(this, globalCtx)) { return 0; - } - else - { - this->unk_6AD = 2; // OTRTODO: THIS IS A BAD IDEA BUT IT FIXES THE HORSE FIRST PERSON? + } else { + if (this->rideActor != NULL) { + this->unk_6AD = 2; // OTRTODO: THIS IS A BAD IDEA BUT IT FIXES THE HORSE FIRST PERSON? + } } return 1; @@ -14806,4 +14806,4 @@ void func_80853148(GlobalContext* globalCtx, Actor* actor) { this->naviActor->flags |= ACTOR_FLAG_8; func_80835EA4(globalCtx, 0xB); } -} \ No newline at end of file +} From 4a24b5afb432cd24c36e85db8c6e6bf17dedd04a Mon Sep 17 00:00:00 2001 From: Sirius902 <3645979-Sirius902@users.noreply.gitlab.com> Date: Mon, 28 Mar 2022 22:57:32 -0700 Subject: [PATCH 2/3] Use else if --- soh/src/overlays/actors/ovl_player_actor/z_player.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 91fcf81ad..8ce8f1ae0 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -2321,10 +2321,8 @@ s32 func_8083501C(Player* this, GlobalContext* globalCtx) { if ((!Player_HoldsHookshot(this) || func_80834FBC(this)) && !func_80834758(globalCtx, this) && !func_80834F2C(this, globalCtx)) { return 0; - } else { - if (this->rideActor != NULL) { - this->unk_6AD = 2; // OTRTODO: THIS IS A BAD IDEA BUT IT FIXES THE HORSE FIRST PERSON? - } + } else if (this->rideActor != NULL) { + this->unk_6AD = 2; // OTRTODO: THIS IS A BAD IDEA BUT IT FIXES THE HORSE FIRST PERSON? } return 1; From 5d967f8e8c822565cb755ef95446cf7daf2b0b63 Mon Sep 17 00:00:00 2001 From: Emil Lenngren Date: Thu, 31 Mar 2022 02:30:48 +0200 Subject: [PATCH 3/3] Don't crash if glClipControl is not available --- libultraship/libultraship/Lib/Fast3D/gfx_opengl.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libultraship/libultraship/Lib/Fast3D/gfx_opengl.cpp b/libultraship/libultraship/Lib/Fast3D/gfx_opengl.cpp index 52815bc1c..16e750d14 100644 --- a/libultraship/libultraship/Lib/Fast3D/gfx_opengl.cpp +++ b/libultraship/libultraship/Lib/Fast3D/gfx_opengl.cpp @@ -673,7 +673,11 @@ static void gfx_opengl_resize_framebuffer(int fb, uint32_t width, uint32_t heigh void gfx_opengl_set_framebuffer(int fb) { - glClipControl(GL_UPPER_LEFT, GL_NEGATIVE_ONE_TO_ONE); // Set origin to upper left corner, to match N64 and DX11 + if (GLEW_ARB_clip_control || GLEW_VERSION_4_5) { + // Set origin to upper left corner, to match N64 and DX11 + // If this function is not supported, the texture will be upside down :( + glClipControl(GL_UPPER_LEFT, GL_NEGATIVE_ONE_TO_ONE); + } glBindFramebuffer(GL_FRAMEBUFFER_EXT, fb); glDepthMask(GL_TRUE); @@ -687,7 +691,9 @@ void gfx_opengl_reset_framebuffer(void) glBindFramebuffer(GL_FRAMEBUFFER, 0); glBindFramebuffer(GL_FRAMEBUFFER_EXT, framebuffer); - glClipControl(GL_LOWER_LEFT, GL_NEGATIVE_ONE_TO_ONE); + if (GLEW_ARB_clip_control || GLEW_VERSION_4_5) { + glClipControl(GL_LOWER_LEFT, GL_NEGATIVE_ONE_TO_ONE); + } } void gfx_opengl_select_texture_fb(int fbID)