Make the software compatible with lower end hardware
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 -DCMAKE_PARALLEL_MSVC=TRUE 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 -DCMAKE_PARALLEL_MSVC=TRUE 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 -DCMAKE_PARALLEL_MSVC=TRUE 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:
Lorenzooone
2025-04-27 01:29:22 +02:00
parent 33660b3ef7
commit 64dec0a515
68 changed files with 846 additions and 296 deletions

View File

@@ -14,7 +14,7 @@
class ActionSelectionMenu : public OptionSelectionMenu {
public:
ActionSelectionMenu(bool font_load_success, sf::Font &text_font);
ActionSelectionMenu(TextRectanglePool* text_pool);
~ActionSelectionMenu();
void prepare(float scaling_factor, int view_size_x, int view_size_y, PossibleWindowCommands curr_cmd);
void insert_data(std::vector<const WindowCommand*> &possible_actions);

View File

@@ -14,7 +14,7 @@
class AudioDeviceMenu : public OptionSelectionMenu {
public:
AudioDeviceMenu(bool font_load_success, sf::Font &text_font);
AudioDeviceMenu(TextRectanglePool* text_pool);
~AudioDeviceMenu();
void prepare(float scaling_factor, int view_size_x, int view_size_y, const audio_output_device_data curr_device_data);
void insert_data(std::vector<std::string>* possible_devices);

View File

@@ -26,7 +26,7 @@ enum AudioMenuOutAction{
class AudioMenu : public OptionSelectionMenu {
public:
AudioMenu(bool font_load_success, sf::Font &text_font);
AudioMenu(TextRectanglePool* text_pool);
~AudioMenu();
void prepare(float scaling_factor, int view_size_x, int view_size_y, AudioData *audio_data);
void insert_data();

View File

@@ -20,7 +20,7 @@ enum BFIMenuOutAction{
class BFIMenu : public OptionSelectionMenu {
public:
BFIMenu(bool font_load_success, sf::Font &text_font);
BFIMenu(TextRectanglePool* text_pool);
~BFIMenu();
void prepare(float scaling_factor, int view_size_x, int view_size_y, ScreenInfo *info);
void insert_data();

View File

@@ -13,7 +13,7 @@
class ColorCorrectionMenu : public OptionSelectionMenu {
public:
ColorCorrectionMenu(bool font_load_success, sf::Font &text_font);
ColorCorrectionMenu(TextRectanglePool* text_pool);
~ColorCorrectionMenu();
void setup_title(std::string added_name);
void prepare(float scaling_factor, int view_size_x, int view_size_y, int current_crop);

View File

@@ -9,7 +9,7 @@
class ConnectionMenu : public OptionSelectionMenu {
public:
ConnectionMenu(bool font_load_success, sf::Font &text_font);
ConnectionMenu(TextRectanglePool* text_pool);
~ConnectionMenu();
void prepare(float scaling_factor, int view_size_x, int view_size_y);
void insert_data(std::vector<CaptureDevice> *devices_list);

View File

@@ -13,7 +13,7 @@
class CropMenu : public OptionSelectionMenu {
public:
CropMenu(bool font_load_success, sf::Font &text_font);
CropMenu(TextRectanglePool* text_pool);
~CropMenu();
void prepare(float scaling_factor, int view_size_x, int view_size_y, int current_crop);
void insert_data(std::vector<const CropData*>* possible_crops);

View File

@@ -18,7 +18,7 @@ enum ExtraSettingsMenuOutAction{
class ExtraSettingsMenu : public OptionSelectionMenu {
public:
ExtraSettingsMenu(bool font_load_success, sf::Font &text_font);
ExtraSettingsMenu(TextRectanglePool* text_pool);
~ExtraSettingsMenu();
void prepare(float scaling_factor, int view_size_x, int view_size_y);
void insert_data(ScreenType s_type, bool is_fullscreen);

View File

@@ -18,7 +18,7 @@ struct FileData {
class FileConfigMenu : public OptionSelectionMenu {
public:
FileConfigMenu(bool font_load_success, sf::Font &text_font);
FileConfigMenu(TextRectanglePool* text_pool);
~FileConfigMenu();
void setup_title(std::string added_name);
void prepare(float scaling_factor, int view_size_x, int view_size_y);

View File

@@ -25,7 +25,7 @@ enum ISNitroMenuOutAction{
class ISNitroMenu : public OptionSelectionMenu {
public:
ISNitroMenu(bool font_load_success, sf::Font &text_font);
ISNitroMenu(TextRectanglePool* text_pool);
~ISNitroMenu();
void prepare(float scaling_factor, int view_size_x, int view_size_y, CaptureStatus* capture_status);
void insert_data(CaptureDevice* device);

View File

@@ -21,7 +21,7 @@ enum InputMenuOutAction{
class InputMenu : public OptionSelectionMenu {
public:
InputMenu(bool font_load_success, sf::Font &text_font);
InputMenu(TextRectanglePool* text_pool);
~InputMenu();
void prepare(float scaling_factor, int view_size_x, int view_size_y, InputData* input_data);
void insert_data(bool enabled_shortcuts, bool enabled_extra_buttons);

View File

@@ -15,7 +15,7 @@ enum LicenseMenuOutAction{
class LicenseMenu : public OptionSelectionMenu {
public:
LicenseMenu(bool font_load_success, sf::Font &text_font);
LicenseMenu(TextRectanglePool* text_pool);
~LicenseMenu();
void prepare(float scaling_factor, int view_size_x, int view_size_y);
void insert_data();

View File

@@ -24,7 +24,7 @@ enum Main3DMenuOutAction{
class Main3DMenu : public OptionSelectionMenu {
public:
Main3DMenu(bool font_load_success, sf::Font &text_font);
Main3DMenu(TextRectanglePool* text_pool);
~Main3DMenu();
void prepare(float menu_scaling_factor, int view_size_x, int view_size_y, ScreenInfo *info, DisplayData* display_data, CaptureStatus* status);
void insert_data(ScreenType stype);

View File

@@ -32,7 +32,7 @@ enum MainMenuOutAction{
class MainMenu : public OptionSelectionMenu {
public:
MainMenu(bool font_load_success, sf::Font &text_font);
MainMenu(TextRectanglePool* text_pool);
~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, CaptureDevice* device, bool connected);

View File

@@ -23,7 +23,7 @@ enum OffsetMenuOutAction{
class OffsetMenu : public OptionSelectionMenu {
public:
OffsetMenu(bool font_load_success, sf::Font &text_font);
OffsetMenu(TextRectanglePool* text_pool);
~OffsetMenu();
void prepare(float scaling_factor, int view_size_x, int view_size_y, ScreenInfo *info);
void insert_data();

View File

@@ -5,6 +5,7 @@
#include <chrono>
#include "TextRectangle.hpp"
#include "TextRectanglePool.hpp"
#include "event_structs.hpp"
#define BACK_X_OUTPUT_OPTION -1
@@ -50,7 +51,7 @@ protected:
int single_option_multiplier;
int get_num_pages();
void initialize(bool font_load_success, sf::Font &text_font);
void initialize(TextRectanglePool* text_pool);
void prepare_options();
void base_prepare(float menu_scaling_factor, int view_size_x, int view_size_y);
std::string setTextOptionInt(int index, int value);

View File

@@ -13,7 +13,7 @@
class PARMenu : public OptionSelectionMenu {
public:
PARMenu(bool font_load_success, sf::Font &text_font);
PARMenu(TextRectanglePool* text_pool);
~PARMenu();
void setup_title(std::string added_name);
void prepare(float scaling_factor, int view_size_x, int view_size_y, int current_crop);

View File

@@ -5,6 +5,7 @@
#include <chrono>
#include "TextRectangle.hpp"
#include "TextRectanglePool.hpp"
#include "display_structs.hpp"
#include "event_structs.hpp"
@@ -19,7 +20,7 @@ enum RelPosMenuOutAction{
class RelativePositionMenu {
public:
RelativePositionMenu();
RelativePositionMenu(bool font_load_success, sf::Font &text_font);
RelativePositionMenu(TextRectanglePool* text_pool);
virtual ~RelativePositionMenu();
bool poll(SFEvent &event_data);
void draw(float scaling_factor, sf::RenderTarget &window);
@@ -57,12 +58,13 @@ protected:
sf::Color menu_color;
std::string title;
void initialize(bool font_load_success, sf::Font &text_font);
void initialize(TextRectanglePool* text_pool);
void prepare_options();
void base_prepare(float menu_scaling_factor, int view_size_x, int view_size_y);
void prepare_text_slices(int x_multiplier, int x_divisor, int y_multiplier, int y_divisor, int index, float text_scaling_factor, bool center = false);
virtual bool is_option_selectable(int index);
virtual bool is_option_drawable(int index);
virtual void set_output_option(int index);
virtual std::string get_string_option(int index);
virtual void class_setup();

View File

@@ -13,7 +13,7 @@
class ResolutionMenu : public OptionSelectionMenu {
public:
ResolutionMenu(bool font_load_success, sf::Font &text_font);
ResolutionMenu(TextRectanglePool* text_pool);
~ResolutionMenu();
void prepare(float scaling_factor, int view_size_x, int view_size_y, int fullscreen_mode_width, int fullscreen_mode_height);
void insert_data(std::vector<sf::VideoMode>* possible_resolutions, const sf::VideoMode &desktop_resolution);

View File

@@ -21,7 +21,7 @@ enum RotationMenuOutAction{
class RotationMenu : public OptionSelectionMenu {
public:
RotationMenu(bool font_load_success, sf::Font &text_font);
RotationMenu(TextRectanglePool* text_pool);
~RotationMenu();
void prepare(float scaling_factor, int view_size_x, int view_size_y, ScreenInfo *info);
void insert_data();

View File

@@ -22,7 +22,7 @@ enum ScalingRatioMenuOutAction{
class ScalingRatioMenu : public OptionSelectionMenu {
public:
ScalingRatioMenu(bool font_load_success, sf::Font &text_font);
ScalingRatioMenu(TextRectanglePool* text_pool);
~ScalingRatioMenu();
void prepare(float scaling_factor, int view_size_x, int view_size_y, ScreenInfo *info);
void insert_data();

View File

@@ -20,7 +20,7 @@ enum SecondScreen3DRelPosMenuOutAction{
class SecondScreen3DRelativePositionMenu : public RelativePositionMenu {
public:
SecondScreen3DRelativePositionMenu(bool font_load_success, sf::Font &text_font);
SecondScreen3DRelativePositionMenu(TextRectanglePool* text_pool);
~SecondScreen3DRelativePositionMenu();
std::chrono::time_point<std::chrono::high_resolution_clock> last_input_processed_time;
void reset_output_option();
@@ -29,6 +29,7 @@ public:
SecondScreen3DRelPosMenuOutAction selected_index = SecondScreen3DRelPosMenuOutAction::SECOND_SCREEN_3D_REL_POS_MENU_NO_ACTION;
SecondScreen3DRelativePosition selected_confirm_value = SECOND_SCREEN_3D_REL_POS_END;
protected:
bool is_option_drawable(int index);
bool is_option_selectable(int index);
void set_output_option(int index);
std::string get_string_option(int index);

View File

@@ -23,7 +23,7 @@ enum SeparatorMenuOutAction{
class SeparatorMenu : public OptionSelectionMenu {
public:
SeparatorMenu(bool font_load_success, sf::Font &text_font);
SeparatorMenu(TextRectanglePool* text_pool);
~SeparatorMenu();
void prepare(float scaling_factor, int view_size_x, int view_size_y, ScreenInfo *info);
void insert_data(bool is_fullscreen);

View File

@@ -13,7 +13,7 @@
class ShortcutMenu : public OptionSelectionMenu {
public:
ShortcutMenu(bool font_load_success, sf::Font &text_font);
ShortcutMenu(TextRectanglePool* text_pool);
~ShortcutMenu();
void prepare(float scaling_factor, int view_size_x, int view_size_y);
void insert_data(std::vector<std::string> &shortcut_names);

View File

@@ -16,7 +16,7 @@ enum StatusMenuOutAction{
class StatusMenu : public OptionSelectionMenu {
public:
StatusMenu(bool font_load_success, sf::Font &text_font);
StatusMenu(TextRectanglePool* text_pool);
~StatusMenu();
void prepare(float scaling_factor, int view_size_x, int view_size_y, double in_fps, double poll_fps, double draw_fps, CaptureStatus* capture_status);
void insert_data();

View File

@@ -20,7 +20,7 @@ enum VideoEffectsMenuOutAction{
class VideoEffectsMenu : public OptionSelectionMenu {
public:
VideoEffectsMenu(bool font_load_success, sf::Font &text_font);
VideoEffectsMenu(TextRectanglePool* text_pool);
~VideoEffectsMenu();
void prepare(float scaling_factor, int view_size_x, int view_size_y, ScreenInfo *info);
void insert_data();

View File

@@ -46,7 +46,7 @@ enum VideoMenuOutAction{
class VideoMenu : public OptionSelectionMenu {
public:
VideoMenu(bool font_load_success, sf::Font &text_font);
VideoMenu(TextRectanglePool* text_pool);
~VideoMenu();
void prepare(float scaling_factor, int view_size_x, int view_size_y, ScreenInfo *info, ScreenType screen_type);
void insert_data(ScreenType s_type, bool is_fullscreen, bool can_have_titlebar);

View File

@@ -0,0 +1,20 @@
#ifndef __TEXTRECTANGLEPOOL_HPP
#define __TEXTRECTANGLEPOOL_HPP
#include "TextRectangle.hpp"
class TextRectanglePool {
public:
TextRectanglePool(bool font_load_success, sf::Font *text_font);
~TextRectanglePool();
void request_num_text_rectangles(int num_wanted_text_rectangles);
TextRectangle* get_text_rectangle(int index);
private:
bool font_load_success;
sf::Font *text_font;
int num_loaded_text_rectangles;
TextRectangle** text_rectangles_list;
};
#endif

View File

@@ -46,17 +46,18 @@ struct PACKED RGB83DSVideoInputData_3D {
uint8_t screen_data[IN_VIDEO_SIZE_3DS_3D][3];
};
#define OLD_DS_PIXEL_B_BITS 5
#define OLD_DS_PIXEL_G_BITS 6
#define OLD_DS_PIXEL_R_BITS 5
#define OLD_DS_PIXEL_G_BITS 6
#define OLD_DS_PIXEL_B_BITS 5
struct PACKED USBOldDSPixelData {
uint16_t b : OLD_DS_PIXEL_B_BITS;
uint16_t g : OLD_DS_PIXEL_G_BITS;
// The internal order needs to be reversed... This is so confusing...
struct PACKED ALIGNED(2) USBOldDSPixelData {
uint16_t r : OLD_DS_PIXEL_R_BITS;
uint16_t g : OLD_DS_PIXEL_G_BITS;
uint16_t b : OLD_DS_PIXEL_B_BITS;
};
struct PACKED USBOldDSVideoInputData {
struct PACKED ALIGNED(2) USBOldDSVideoInputData {
USBOldDSPixelData screen_data[IN_VIDEO_SIZE_DS];
};
@@ -64,10 +65,11 @@ struct PACKED USBOldDSVideoInputData {
#define OPTIMIZE_3DS_PIXEL_G_BITS 6
#define OPTIMIZE_3DS_PIXEL_B_BITS 5
struct PACKED USB5653DSOptimizePixelData {
uint16_t r : OPTIMIZE_3DS_PIXEL_R_BITS;
uint16_t g : OPTIMIZE_3DS_PIXEL_G_BITS;
// The internal order needs to be reversed... This is so confusing...
struct PACKED ALIGNED(2) USB5653DSOptimizePixelData {
uint16_t b : OPTIMIZE_3DS_PIXEL_B_BITS;
uint16_t g : OPTIMIZE_3DS_PIXEL_G_BITS;
uint16_t r : OPTIMIZE_3DS_PIXEL_R_BITS;
};
struct PACKED USB8883DSOptimizePixelData {
@@ -100,22 +102,22 @@ struct PACKED USB3DSOptimizeHeaderSoundData {
USB3DSOptimizeSingleSoundData samples[2];
};
struct PACKED USB5653DSOptimizeInputColumnData {
struct PACKED ALIGNED(16) USB5653DSOptimizeInputColumnData {
USB3DSOptimizeHeaderSoundData header_sound;
USB5653DSOptimizePixelData pixel[HEIGHT_3DS][2];
};
struct PACKED USB5653DSOptimizeInputColumnData3D {
struct PACKED ALIGNED(16) USB5653DSOptimizeInputColumnData3D {
USB3DSOptimizeHeaderSoundData header_sound;
USB5653DSOptimizePixelData pixel[HEIGHT_3DS][3];
};
struct PACKED USB8883DSOptimizeInputColumnData {
struct PACKED ALIGNED(16) USB8883DSOptimizeInputColumnData {
USB3DSOptimizeHeaderSoundData header_sound;
USB8883DSOptimizePixelData pixel[HEIGHT_3DS][2];
};
struct PACKED USB8883DSOptimizeInputColumnData3D {
struct PACKED ALIGNED(16) USB8883DSOptimizeInputColumnData3D {
USB3DSOptimizeHeaderSoundData header_sound;
USB8883DSOptimizePixelData pixel[HEIGHT_3DS][3];
};
@@ -124,7 +126,7 @@ struct PACKED ISNitroEmulatorVideoInputData {
uint8_t screen_data[IN_VIDEO_SIZE_DS][3];
};
struct PACKED ISTWLCaptureVideoInputData {
struct PACKED ALIGNED(2) ISTWLCaptureVideoInputData {
USBOldDSPixelData screen_data[IN_VIDEO_SIZE_DS];
uint8_t bit_6_rb_screen_data[(IN_VIDEO_SIZE_DS >> 3) * 2];
};

View File

@@ -6,4 +6,6 @@
bool convertVideoToOutput(VideoOutputData *p_out, const bool is_big_endian, CaptureDataSingleBuffer* data_buffer, CaptureStatus* status, bool interleaved_3d);
bool convertAudioToOutput(std::int16_t *p_out, uint64_t &n_samples, uint16_t &last_buffer_index, const bool is_big_endian, CaptureDataSingleBuffer* data_buffer, CaptureStatus* status);
void manualConvertOutputToRGB(VideoOutputData* src, VideoOutputData* dst, size_t pos_x_data, size_t pos_y_data, size_t width, size_t height, InputVideoDataType video_data_type);
#endif

View File

@@ -111,10 +111,59 @@ struct SharedData {
InputData input_data;
};
struct ALIGNED(8) VideoOutputData {
uint8_t screen_data[MAX_IN_VIDEO_SIZE][3];
#pragma pack(push, 1)
// The internal order needs to be reversed... This is so confusing...
struct PACKED ALIGNED(2) VideoPixelRGB16 {
uint16_t b : 5;
uint16_t g : 6;
uint16_t r : 5;
};
// The internal order needs to be reversed... This is so confusing...
struct PACKED ALIGNED(2) VideoPixelBGR16 {
uint16_t r : 5;
uint16_t g : 6;
uint16_t b : 5;
};
struct PACKED VideoPixelRGB {
uint8_t r;
uint8_t g;
uint8_t b;
};
struct PACKED VideoPixelBGR {
uint8_t b;
uint8_t g;
uint8_t r;
};
struct PACKED ALIGNED(16) VideoOutputDataRGB16 {
VideoPixelRGB16 screen_data[MAX_IN_VIDEO_SIZE];
};
struct PACKED ALIGNED(16) VideoOutputDataBGR16 {
VideoPixelBGR16 screen_data[MAX_IN_VIDEO_SIZE];
};
struct PACKED ALIGNED(16) VideoOutputDataRGB {
VideoPixelRGB screen_data[MAX_IN_VIDEO_SIZE];
};
struct PACKED ALIGNED(16) VideoOutputDataBGR {
VideoPixelBGR screen_data[MAX_IN_VIDEO_SIZE];
};
union PACKED ALIGNED(16) VideoOutputData {
VideoOutputDataRGB16 rgb16_video_output_data;
VideoOutputDataBGR16 bgr16_video_output_data;
VideoOutputDataRGB rgb_video_output_data;
VideoOutputDataBGR bgr_video_output_data;
};
#pragma pack(pop)
struct CropData {
int top_width;
int top_height;

View File

@@ -11,6 +11,7 @@
#include "audio_data.hpp"
#include "capture_structs.hpp"
#include "TextRectangle.hpp"
#include "TextRectanglePool.hpp"
#include "sfml_gfx_structs.hpp"
#include "ConnectionMenu.hpp"
#include "MainMenu.hpp"
@@ -52,11 +53,19 @@ struct FPSArray {
int index;
};
struct OutTextData {
std::string full_text;
std::string small_text;
std::string preamble_name = NAME;
bool consumed = true;
TextKind kind;
};
class WindowScreen {
public:
ScreenInfo m_info;
WindowScreen(ScreenType stype, CaptureStatus* capture_status, DisplayData* display_data, SharedData* shared_data, AudioData* audio_data, ConsumerMutex *draw_lock, bool created_proper_folder);
WindowScreen(ScreenType stype, CaptureStatus* capture_status, DisplayData* display_data, SharedData* shared_data, AudioData* audio_data, ConsumerMutex *draw_lock, bool created_proper_folder, bool disable_frame_blending);
~WindowScreen();
void build();
@@ -76,6 +85,7 @@ public:
void update_save_menu();
void print_notification(std::string text, TextKind kind = TEXT_KIND_NORMAL);
void process_own_out_text_data(bool print_to_notification = true);
int load_data();
int save_data();
bool open_capture();
@@ -103,6 +113,9 @@ private:
const PARData *par;
bool divide_3d_par;
};
OutTextData own_out_text_data;
InputVideoDataType last_update_texture_data_type;
bool use_texture_software_based_conv;
bool created_proper_folder;
CaptureStatus* capture_status;
std::string win_title;
@@ -119,7 +132,6 @@ private:
bool m_prepare_quit;
bool m_scheduled_split;
int ret_val;
bool font_load_success;
double frame_time;
DisplayData* display_data;
SharedData* shared_data;
@@ -190,7 +202,12 @@ private:
std::chrono::time_point<std::chrono::high_resolution_clock> last_menu_change_time;
int curr_frame_texture_pos = 0;
sf::Texture in_tex;
int num_frames_to_blend;
sf::Texture full_in_tex;
bool shared_texture_available;
sf::Texture top_l_in_tex;
sf::Texture top_r_in_tex;
sf::Texture bot_in_tex;
sf::Font text_font;
@@ -212,6 +229,7 @@ private:
sf::VideoMode curr_desk_mode;
TextRectangle* notification;
TextRectanglePool* text_rectangle_pool;
ConsumerMutex display_lock;
ConsumerMutex *draw_lock;
@@ -230,6 +248,10 @@ private:
void free_ownership_of_window(bool is_main_thread);
void resize_in_rect(sf::RectangleShape &in_rect, int start_x, int start_y, int width, int height);
int get_pos_x_screen_inside_data(bool is_top, bool is_second = false);
int get_pos_y_screen_inside_data(bool is_top, bool is_second = false);
int get_pos_x_screen_inside_in_tex(bool is_top, bool is_second = false);
int get_pos_y_screen_inside_in_tex(bool is_top, bool is_second = false);
int get_screen_corner_modifier_x(int rotation, int width);
int get_screen_corner_modifier_y(int rotation, int height);
void print_notification_on_off(std::string base_text, bool value);
@@ -286,6 +308,10 @@ private:
void prepare_screen_rendering();
bool window_needs_work();
void window_factory(bool is_main_thread);
void opengl_error_out(std::string error_base, std::string error_str);
void opengl_error_check(std::string error_base);
bool single_update_texture(unsigned int m_texture, InputVideoDataType video_data_type, size_t pos_x_data, size_t pos_y_data, size_t width, size_t height, bool manually_converted);
void execute_single_update_texture(bool &manually_converted, bool do_full, bool is_top = false, bool is_second = false);
void update_texture();
int _choose_base_input_shader(bool is_top);
int _choose_color_emulation_shader(bool is_top);
@@ -371,32 +397,44 @@ struct FrontendData {
bool reload;
};
void ConsumeOutText(OutTextData &out_text_data, bool update_consumed = true);
void UpdateOutText(OutTextData &out_text_data, std::string full_text, std::string small_text, TextKind kind);
void FPSArrayInit(FPSArray *array);
void FPSArrayDestroy(FPSArray *array);
void FPSArrayInsertElement(FPSArray *array, double frame_time);
void insert_basic_crops(std::vector<const CropData*> &crop_vector, ScreenType s_type, bool is_ds, bool allow_game_specific);
void insert_basic_pars(std::vector<const PARData*> &par_vector);
void insert_basic_color_profiles(std::vector<const ShaderColorEmulationData*> &color_profiles_vector);
void reset_display_data(DisplayData *display_data);
void reset_input_data(InputData* input_data);
void reset_shared_data(SharedData* shared_data);
void reset_fullscreen_info(ScreenInfo &info);
void sanitize_enabled_info(ScreenInfo &top_bot_info, ScreenInfo &top_info, ScreenInfo &bot_info);
void override_set_data_to_screen_info(override_win_data &override_win, ScreenInfo &info);
void reset_screen_info(ScreenInfo &info);
bool load_screen_info(std::string key, std::string value, std::string base, ScreenInfo &info);
std::string save_screen_info(std::string base, const ScreenInfo &info);
const PARData* get_base_par();
void get_par_size(int &width, int &height, float multiplier_factor, const PARData *correction_factor, bool divide_3d_par);
void get_par_size(float &width, float &height, float multiplier_factor, const PARData *correction_factor, bool divide_3d_par);
SecondScreen3DRelativePosition get_second_screen_pos(ScreenInfo* info, ScreenType stype);
void update_output(FrontendData* frontend_data, double frame_time = 0.0, VideoOutputData *out_buf = NULL);
void update_connected_3ds_ds(FrontendData* frontend_data, const CaptureDevice &old_cc_device, const CaptureDevice &new_cc_device);
void update_connected_specific_settings(FrontendData* frontend_data, const CaptureDevice &cc_device);
void screen_display_thread(WindowScreen *screen);
std::string get_name_non_int_mode(NonIntegerScalingModes input);
std::string get_name_frame_blending_mode(FrameBlendingMode input);
std::string get_name_input_colorspace_mode(InputColorspaceMode input);
bool is_input_data_valid(InputData* input_data, bool consider_buttons);
void default_sleep(float wanted_ms = -1);
#endif

View File

@@ -70,6 +70,13 @@
#define MAX_IN_VIDEO_SIZE (MAX_IN_VIDEO_WIDTH * MAX_IN_VIDEO_HEIGHT)
#define MAX_IN_VIDEO_BPP_SIZE IN_VIDEO_BPP_SIZE_3DS
#define MAX_IN_VIDEO_WIDTH_TOP IN_VIDEO_WIDTH_DS
#define MAX_IN_VIDEO_HEIGHT_TOP (TOP_WIDTH_3DS + TOP_WIDTH_3DS)
#define MAX_IN_VIDEO_WIDTH_SINGLE_TOP IN_VIDEO_WIDTH_DS
#define MAX_IN_VIDEO_HEIGHT_SINGLE_TOP TOP_WIDTH_3DS
#define MAX_IN_VIDEO_WIDTH_BOTTOM IN_VIDEO_WIDTH_DS
#define MAX_IN_VIDEO_HEIGHT_BOTTOM BOT_WIDTH_3DS
// 1096 is the value when things are ideal. However, it can actually happen that the transfer isn't 100% on time.
// When that happens, a bit more audio data may get transfered. It's a ton on O3DS when Windows underprioritizes USB...
// In general, it should be less than * 2, but you never know. For now, go for safety at x16...