diff --git a/include/Menus/ScalingRatioMenu.hpp b/include/Menus/ScalingRatioMenu.hpp index ed3198d..46f0b74 100755 --- a/include/Menus/ScalingRatioMenu.hpp +++ b/include/Menus/ScalingRatioMenu.hpp @@ -18,13 +18,14 @@ enum ScalingRatioMenuOutAction{ SCALING_RATIO_MENU_ALGO_INC, SCALING_RATIO_MENU_ALGO_DEC, SCALING_RATIO_MENU_FORCE_SAME_SCALING, + SCALING_RATIO_MENU_CHANGE_RATIO_CYCLING, }; class ScalingRatioMenu : public OptionSelectionMenu { public: ScalingRatioMenu(TextRectanglePool* text_pool); ~ScalingRatioMenu(); - void prepare(float scaling_factor, int view_size_x, int view_size_y, ScreenInfo *info); + void prepare(float scaling_factor, int view_size_x, int view_size_y, ScreenInfo *info, bool do_ratio_cycling); void insert_data(); ScalingRatioMenuOutAction selected_index = ScalingRatioMenuOutAction::SCALING_RATIO_MENU_NO_ACTION; void reset_output_option(); diff --git a/include/display_structs.hpp b/include/display_structs.hpp index 95b2de9..aaa2059 100755 --- a/include/display_structs.hpp +++ b/include/display_structs.hpp @@ -91,6 +91,7 @@ struct DisplayData { bool last_connected_ds; bool interleaved_3d; bool force_disable_mouse; + bool do_ratio_cycling; }; struct ExtraButtonShortcuts { diff --git a/include/frontend.hpp b/include/frontend.hpp index 2dd9056..e02cc62 100755 --- a/include/frontend.hpp +++ b/include/frontend.hpp @@ -339,6 +339,7 @@ private: void second_screen_3d_match_bottom_pos_change(); void devices_allowed_change(PossibleCaptureDevices device); void input_video_data_format_request_change(bool positive); + void change_ratio_cycle(); bool add_new_cc_key(std::string key, CaptureConnectionType conn_type, bool discriminator); bool query_reset_request(); void reset_held_times(bool force = true); diff --git a/source/Menus/ScalingRatioMenu.cpp b/source/Menus/ScalingRatioMenu.cpp index 30c141c..5fa5c99 100755 --- a/source/Menus/ScalingRatioMenu.cpp +++ b/source/Menus/ScalingRatioMenu.cpp @@ -38,11 +38,17 @@ static const ScalingRatioMenuOptionInfo force_same_scaling_option = { .is_inc = false, .dec_str = "", .inc_str = "", .inc_out_action = SCALING_RATIO_MENU_NO_ACTION, .out_action = SCALING_RATIO_MENU_FORCE_SAME_SCALING}; +static const ScalingRatioMenuOptionInfo ratio_cycle_option = { +.base_name = "Disable Ratios Cycle", .false_name = "Enable Ratios Cycle", +.is_inc = false, .dec_str = "", .inc_str = "", .inc_out_action = SCALING_RATIO_MENU_NO_ACTION, +.out_action = SCALING_RATIO_MENU_CHANGE_RATIO_CYCLING}; + static const ScalingRatioMenuOptionInfo* pollable_options[] = { &ratio_option, &top_fill_option, &bot_fill_option, &ratio_algo_option, +&ratio_cycle_option, &force_same_scaling_option, }; @@ -126,7 +132,7 @@ std::string ScalingRatioMenu::setTextOptionDualPercentage(int index, float value return this->get_string_option(index, DEFAULT_ACTION) + ": " + get_float_str_decimals(value_1, 1) + " - " + get_float_str_decimals(value_2, 1); } -void ScalingRatioMenu::prepare(float menu_scaling_factor, int view_size_x, int view_size_y, ScreenInfo *info) { +void ScalingRatioMenu::prepare(float menu_scaling_factor, int view_size_x, int view_size_y, ScreenInfo *info, bool do_ratio_cycling) { int num_pages = this->get_num_pages(); if(this->future_data.page >= num_pages) this->future_data.page = num_pages - 1; @@ -153,6 +159,9 @@ void ScalingRatioMenu::prepare(float menu_scaling_factor, int view_size_x, int v case SCALING_RATIO_MENU_FORCE_SAME_SCALING: this->labels[index]->setText(this->setTextOptionBool(real_index, info->force_same_scaling)); break; + case SCALING_RATIO_MENU_CHANGE_RATIO_CYCLING: + this->labels[index]->setText(this->setTextOptionBool(real_index, do_ratio_cycling)); + break; default: break; } diff --git a/source/WindowScreen_Menu.cpp b/source/WindowScreen_Menu.cpp index 2211b84..c0be51e 100755 --- a/source/WindowScreen_Menu.cpp +++ b/source/WindowScreen_Menu.cpp @@ -466,8 +466,13 @@ void WindowScreen::force_same_scaling_change() { this->future_operations.call_screen_settings_update = true; } +void WindowScreen::change_ratio_cycle() { + this->display_data->do_ratio_cycling = !this->display_data->do_ratio_cycling; + this->print_notification_on_off("Ratio Cycling", this->display_data->do_ratio_cycling); +} + void WindowScreen::ratio_change(bool top_priority, bool cycle) { - this->prepare_size_ratios(top_priority, !top_priority, cycle); + this->prepare_size_ratios(top_priority, !top_priority, cycle || this->display_data->do_ratio_cycling); this->future_operations.call_screen_settings_update = true; } @@ -2152,6 +2157,9 @@ void WindowScreen::poll(bool do_everything) { case SCALING_RATIO_MENU_FORCE_SAME_SCALING: this->force_same_scaling_change(); break; + case SCALING_RATIO_MENU_CHANGE_RATIO_CYCLING: + this->change_ratio_cycle(); + break; default: break; } @@ -2773,7 +2781,7 @@ void WindowScreen::prepare_menu_draws(int view_size_x, int view_size_y) { this->license_menu->prepare(menu_scaling_factor, view_size_x, view_size_y); break; case SCALING_RATIO_MENU_TYPE: - this->scaling_ratio_menu->prepare(menu_scaling_factor, view_size_x, view_size_y, &this->loaded_info); + this->scaling_ratio_menu->prepare(menu_scaling_factor, view_size_x, view_size_y, &this->loaded_info, this->display_data->do_ratio_cycling); break; case ISN_MENU_TYPE: this->is_nitro_menu->prepare(menu_scaling_factor, view_size_x, view_size_y, this->capture_status); diff --git a/source/cc3dsfs.cpp b/source/cc3dsfs.cpp index 55483f1..87deedf 100755 --- a/source/cc3dsfs.cpp +++ b/source/cc3dsfs.cpp @@ -185,6 +185,11 @@ static bool load(const std::string path, const std::string name, ScreenInfo &top continue; } + if(key == "do_ratio_cycling") { + display_data.do_ratio_cycling = std::stoi(value); + continue; + } + if(key == "request_low_bw_format") { capture_status->request_low_bw_format = std::stoi(value); continue; @@ -361,6 +366,7 @@ static bool save(const std::string path, const std::string name, const std::stri file << save_screen_info("top_", top_info); file << "requested_3d=" << capture_status->requested_3d << std::endl; file << "interleaved_3d=" << display_data.interleaved_3d << std::endl; + file << "do_ratio_cyclng=" << display_data.do_ratio_cycling << std::endl; file << "request_low_bw_format=" << capture_status->request_low_bw_format << std::endl; file << "last_connected_ds=" << display_data.last_connected_ds << std::endl; file << "is_screen_capture_type=" << capture_status->capture_type << std::endl; diff --git a/source/frontend.cpp b/source/frontend.cpp index 8b02212..8312cca 100755 --- a/source/frontend.cpp +++ b/source/frontend.cpp @@ -526,6 +526,7 @@ void insert_basic_color_profiles(std::vector &c void reset_display_data(DisplayData* display_data) { display_data->last_connected_ds = false; display_data->interleaved_3d = false; + display_data->do_ratio_cycling = false; } void reset_input_data(InputData* input_data) {