From d8ec6b996ec44fc89878e5b46373e2231b9c0ba5 Mon Sep 17 00:00:00 2001 From: Llennpie Date: Fri, 14 Oct 2022 15:00:19 -0400 Subject: [PATCH] Small QOL fixes --- src/saturn/imgui/saturn_imgui_settings.cpp | 11 ++++---- src/saturn/saturn.cpp | 29 +++++++++++++++++++++- src/saturn/saturn.h | 5 ++++ 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/src/saturn/imgui/saturn_imgui_settings.cpp b/src/saturn/imgui/saturn_imgui_settings.cpp index 4140c0dd..070d51d9 100644 --- a/src/saturn/imgui/saturn_imgui_settings.cpp +++ b/src/saturn/imgui/saturn_imgui_settings.cpp @@ -163,8 +163,11 @@ void ssettings_imgui_update() { imgui_bundled_tooltip("Enable/disable this if your game speed is too fast or slow."); const char* fps_limits[] = { "30", "60" }; - if (ImGui::Combo("FPS###fps_limits", (int*)&configFps60, fps_limits, IM_ARRAYSIZE(fps_limits))) + if (ImGui::Combo("FPS###fps_limits", (int*)&configFps60, fps_limits, IM_ARRAYSIZE(fps_limits))) { configWindow.settings_changed = true; + is_anim_playing = false; + is_anim_paused = false; + } ImGui::Checkbox("Anti-aliasing", &configWindow.enable_antialias); imgui_bundled_tooltip("Enables/disables anti-aliasing with OpenGL."); @@ -255,10 +258,8 @@ void ssettings_imgui_update() { ImGui::Dummy(ImVec2(0, 5)); } #ifdef DISCORDRPC - if (has_discord_init) { - ImGui::Checkbox("Discord Activity Status", &configDiscordRPC); - imgui_bundled_tooltip("Enables/disables Discord Rich Presence. Requires restart."); - } + ImGui::Checkbox("Discord Activity Status", &configDiscordRPC); + imgui_bundled_tooltip("Enables/disables Discord Rich Presence. Requires restart."); #endif const char* mThemeSettings[] = { "Legacy", "Moon", "Half-Life", "Movie Maker", "Dear" }; ImGui::Combo("Theme", (int*)&configEditorTheme, mThemeSettings, IM_ARRAYSIZE(mThemeSettings)); diff --git a/src/saturn/saturn.cpp b/src/saturn/saturn.cpp index f24bb236..ecb6ab85 100644 --- a/src/saturn/saturn.cpp +++ b/src/saturn/saturn.cpp @@ -26,6 +26,7 @@ int camera_view_move_y; bool enable_head_rotations = false; bool enable_shadows = true; bool enable_dust_particles = false; +bool enable_torso_rotation = true; bool can_fall_asleep = false; int saturnModelState = 0; bool linkMarioScale; @@ -53,6 +54,10 @@ bool is_chroma_keying = false; bool prev_quicks[3]; int lastCourseNum = -1; +bool mcamera_is_keyframe; +bool mcamera_playing; +int mcam_timer; + extern "C" { #include "game/camera.h" #include "game/area.h" @@ -90,7 +95,7 @@ void saturn_update() { // Keybinds - if (accept_text_input) { + if (accept_text_input && mario_exists) { if (gPlayer1Controller->buttonPressed & U_JPAD) camera_frozen = !camera_frozen; if (gPlayer1Controller->buttonPressed & D_JPAD) showMenu = !showMenu; if (gPlayer1Controller->buttonPressed & L_JPAD) { @@ -202,10 +207,32 @@ void saturn_update() { } } + // Keyframes + + if (mcamera_playing) { + if (mcam_timer < (60 * 10)) { + mcam_timer++; + } else { + mcam_timer = 0; + } + } + + //s16 pitch, yaw; + //f32 thisDist; + //vec3f_get_dist_and_angle(gCamera->focus, gCamera->pos, &thisDist, &pitch, &yaw); + //camera_approach_f32_symmetric_bool(&thisDist, 150.f, 7.f); + //vec3f_set_dist_and_angle(c->focus, c->pos, dist, pitch, yaw); + //update_camera_yaw(c); + // Misc mario_exists = (gMarioState->action != ACT_UNINITIALIZED & sCurrPlayMode != 2 & mario_loaded); + if (!mario_exists) { + is_anim_playing = false; + is_anim_paused = false; + } + switch(saturnModelState) { case 0: scrollModelState = 0; break; case 1: scrollModelState = 0x200; break; // Metal Cap diff --git a/src/saturn/saturn.h b/src/saturn/saturn.h index e322c375..7108c8c8 100644 --- a/src/saturn/saturn.h +++ b/src/saturn/saturn.h @@ -26,6 +26,7 @@ extern int current_eye_state; extern bool enable_head_rotations; extern bool enable_shadows; extern bool enable_dust_particles; +extern bool enable_torso_rotation; extern bool can_fall_asleep; extern int saturnModelState; extern bool linkMarioScale; @@ -52,6 +53,10 @@ extern unsigned int chromaKeyColorB; extern u16 gChromaKeyColor; extern u16 gChromaKeyBackground; +extern bool mcamera_is_keyframe; +extern bool mcamera_playing; +extern int mcam_timer; + extern SDL_Scancode saturn_key_to_scancode(unsigned int key[]); #ifdef __cplusplus