mirror of
https://github.com/Lorenzooone/cc3dsfs.git
synced 2026-09-11 18:15:24 -05:00
Add Color Correction Menu
Some checks are pending
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linux32 flags:32 name:Linux GCC 32 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linux64 flags:64 name:Linux GCC x64 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linuxarm32 flags:arm32 name:Linux GCC ARM 32 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linuxarm64 flags:arm64 name:Linux GCC ARM 64 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:macos name:macOS Apple Silicon os:macos-14]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:win32 flags:-A Win32 name:Windows VS2022 Win32 os:windows-2022]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:win64 flags:-A x64 name:Windows VS2022 x64 os:windows-2022]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:winarm64 flags:-A ARM64 name:Windows VS2022 ARM os:windows-2022]) (push) Waiting to run
CD / Create Pi Mono Setup (push) Blocked by required conditions
CD / Publishing (push) Blocked by required conditions
Some checks are pending
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linux32 flags:32 name:Linux GCC 32 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linux64 flags:64 name:Linux GCC x64 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linuxarm32 flags:arm32 name:Linux GCC ARM 32 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linuxarm64 flags:arm64 name:Linux GCC ARM 64 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:macos name:macOS Apple Silicon os:macos-14]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:win32 flags:-A Win32 name:Windows VS2022 Win32 os:windows-2022]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:win64 flags:-A x64 name:Windows VS2022 x64 os:windows-2022]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:winarm64 flags:-A ARM64 name:Windows VS2022 ARM os:windows-2022]) (push) Waiting to run
CD / Create Pi Mono Setup (push) Blocked by required conditions
CD / Publishing (push) Blocked by required conditions
This commit is contained in:
@@ -119,6 +119,7 @@ void WindowScreen::init_menus() {
|
||||
this->input_menu = new InputMenu(this->font_load_success, this->text_font);
|
||||
this->audio_device_menu = new AudioDeviceMenu(this->font_load_success, this->text_font);
|
||||
this->separator_menu = new SeparatorMenu(this->font_load_success, this->text_font);
|
||||
this->color_correction_menu = new ColorCorrectionMenu(this->font_load_success, this->text_font);
|
||||
}
|
||||
|
||||
void WindowScreen::destroy_menus() {
|
||||
@@ -145,6 +146,7 @@ void WindowScreen::destroy_menus() {
|
||||
delete this->input_menu;
|
||||
delete this->audio_device_menu;
|
||||
delete this->separator_menu;
|
||||
delete this->color_correction_menu;
|
||||
}
|
||||
|
||||
void WindowScreen::set_close(int ret_val) {
|
||||
@@ -299,6 +301,22 @@ void WindowScreen::par_value_change(int new_par_value, bool is_top) {
|
||||
}
|
||||
}
|
||||
|
||||
void WindowScreen::color_correction_value_change(int new_color_correction_value) {
|
||||
int color_correction_index = new_color_correction_value % this->possible_color_profiles.size();
|
||||
if(color_correction_index < 0)
|
||||
color_correction_index = 0;
|
||||
std::string setting_name = "Color Correction: ";
|
||||
bool updated = false;
|
||||
if(this->m_info.top_color_correction != color_correction_index)
|
||||
updated = true;
|
||||
this->m_info.top_color_correction = color_correction_index;
|
||||
if(this->m_info.bot_color_correction != color_correction_index)
|
||||
updated = true;
|
||||
this->m_info.bot_color_correction = color_correction_index;
|
||||
if(updated)
|
||||
this->print_notification(setting_name + this->possible_color_profiles[color_correction_index]->name);
|
||||
}
|
||||
|
||||
void WindowScreen::offset_change(float &value, float change) {
|
||||
if(change >= 1.0)
|
||||
return;
|
||||
@@ -1115,6 +1133,18 @@ void WindowScreen::setup_separator_menu(bool reset_data) {
|
||||
}
|
||||
}
|
||||
|
||||
void WindowScreen::setup_color_correction_menu(bool reset_data) {
|
||||
if(!this->can_setup_menu())
|
||||
return;
|
||||
if(this->curr_menu != COLOR_CORRECTION_MENU_TYPE) {
|
||||
this->curr_menu = COLOR_CORRECTION_MENU_TYPE;
|
||||
if(reset_data)
|
||||
this->color_correction_menu->reset_data();
|
||||
this->color_correction_menu->insert_data(&this->possible_color_profiles);
|
||||
this->last_menu_change_time = std::chrono::high_resolution_clock::now();
|
||||
}
|
||||
}
|
||||
|
||||
void WindowScreen::update_save_menu() {
|
||||
if(this->curr_menu == SAVE_MENU_TYPE) {
|
||||
this->curr_menu = DEFAULT_MENU_TYPE;
|
||||
@@ -2073,6 +2103,10 @@ void WindowScreen::poll(bool do_everything) {
|
||||
case VIDEO_EFFECTS_MENU_FRAME_BLENDING_DEC:
|
||||
this->frame_blending_mode_change(false);
|
||||
break;
|
||||
case VIDEO_EFFECTS_MENU_COLOR_CORRECTION_MENU:
|
||||
this->setup_color_correction_menu();
|
||||
done = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -2178,6 +2212,23 @@ void WindowScreen::poll(bool do_everything) {
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case COLOR_CORRECTION_MENU_TYPE:
|
||||
if(this->color_correction_menu->poll(event_data)) {
|
||||
switch(this->color_correction_menu->selected_index) {
|
||||
case COLORCORRECTION_MENU_BACK:
|
||||
this->setup_video_effects_menu(false);
|
||||
done = true;
|
||||
break;
|
||||
case COLORCORRECTION_MENU_NO_ACTION:
|
||||
break;
|
||||
default:
|
||||
this->color_correction_value_change(this->color_correction_menu->selected_index);
|
||||
break;
|
||||
}
|
||||
this->color_correction_menu->reset_output_option();
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -2457,6 +2508,9 @@ void WindowScreen::prepare_menu_draws(int view_size_x, int view_size_y) {
|
||||
case SEPARATOR_MENU_TYPE:
|
||||
this->separator_menu->prepare(this->loaded_info.menu_scaling_factor, view_size_x, view_size_y, &this->loaded_info);
|
||||
break;
|
||||
case COLOR_CORRECTION_MENU_TYPE:
|
||||
this->color_correction_menu->prepare(this->loaded_info.menu_scaling_factor, view_size_x, view_size_y, this->loaded_info.top_color_correction);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -2539,6 +2593,9 @@ void WindowScreen::execute_menu_draws() {
|
||||
case SEPARATOR_MENU_TYPE:
|
||||
this->separator_menu->draw(this->loaded_info.menu_scaling_factor, this->m_win);
|
||||
break;
|
||||
case COLOR_CORRECTION_MENU_TYPE:
|
||||
this->color_correction_menu->draw(this->loaded_info.menu_scaling_factor, this->m_win);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user