Implement proper frame delay and VRR for IS Nitro Emulator

This commit is contained in:
Lorenzooone
2024-08-25 09:37:30 +02:00
parent 718294ba02
commit 6f56918f3f
17 changed files with 565 additions and 135 deletions

View File

@@ -0,0 +1,39 @@
#ifndef __ISNMENU_HPP
#define __ISNMENU_HPP
#include "OptionSelectionMenu.hpp"
#include <chrono>
#include "TextRectangle.hpp"
#include "sfml_gfx_structs.hpp"
#include "display_structs.hpp"
#include "capture_structs.hpp"
enum ISNitroMenuOutAction{
ISN_MENU_NO_ACTION,
ISN_MENU_BACK,
ISN_MENU_DELAY,
ISN_MENU_TYPE_DEC,
ISN_MENU_TYPE_INC,
};
class ISNitroMenu : public OptionSelectionMenu {
public:
ISNitroMenu(bool font_load_success, sf::Font &text_font);
~ISNitroMenu();
void prepare(float scaling_factor, int view_size_x, int view_size_y, CaptureStatus* capture_status);
void insert_data();
ISNitroMenuOutAction selected_index = ISNitroMenuOutAction::ISN_MENU_NO_ACTION;
void reset_output_option();
protected:
bool is_option_selectable(int index, int action);
bool is_option_inc_dec(int index);
void set_output_option(int index, int action);
int get_num_options();
std::string get_string_option(int index, int action);
void class_setup();
private:
int *options_indexes;
int num_enabled_options;
};
#endif

View File

@@ -7,6 +7,7 @@
#include "TextRectangle.hpp"
#include "sfml_gfx_structs.hpp"
#include "display_structs.hpp"
#include "capture_structs.hpp"
enum MainMenuOutAction{
MAIN_MENU_NO_ACTION,
@@ -24,6 +25,7 @@ enum MainMenuOutAction{
MAIN_MENU_EXTRA_SETTINGS,
MAIN_MENU_SHUTDOWN,
MAIN_MENU_SHORTCUT_SETTINGS,
MAIN_MENU_ISN_SETTINGS,
};
class MainMenu : public OptionSelectionMenu {
@@ -31,7 +33,7 @@ public:
MainMenu(bool font_load_success, sf::Font &text_font);
~MainMenu();
void prepare(float scaling_factor, int view_size_x, int view_size_y, bool connected);
void insert_data(ScreenType s_type, bool is_fullscreen, bool mono_app_mode, bool enable_shortcuts);
void insert_data(ScreenType s_type, bool is_fullscreen, bool mono_app_mode, bool enable_shortcuts, CaptureConnectionType cc_type, bool connected);
MainMenuOutAction selected_index = MainMenuOutAction::MAIN_MENU_NO_ACTION;
void reset_output_option();
protected: