Added "Small Screen Position" feature

* error checking for layout value from older config

* rename enum and update aspect ratio code

* rewrite LargeFrameLayout to support multiple positions

* add settings for smallscreenposition, fix minsize function

* fixed framebuffer from res scale (screenshots)

* add desktop UI for small screen position

* small screen position submenu on desktop

* fix int-float conversion warning

* rename Above and Below to hopefully fix linux issue

* Add Small Screen Position Setting to android settings menu

* fix sliders to work with floats, mostly

* fix android slider textinput ui

* change None enums in settings and cam_params

* Apply clang-format-18

* SettingsAdapter.kt: Make more null pointer exception resistant

* Updated license headers

* Code formatting nitpicks

* fix bug in main.ui that was hiding menu

* replace default layout with a special call to LargeFrame (like SideBySide does)

* fix bug when "large screen" is actually narrower

* edit documentation for LargeScreenLayout

* update PortraitTopFullFrameLayout to use LargeFrameLayout

* fix unary minus on unsigned int bug

* Applied formatting correction

* Added `const`s where appropriate

* android: Add mention of the bottom-right small screen position being the default

* review fixes + more constants

* refactor all Upright calculations to a reverseLayout method, simplifying code and reducing bugs

* Removed stray extra newline

* SettingsAdapter.kt: Fixed some strange indentation

* Removed unnecessary `if` in favour of direct value usage

---------

Co-authored-by: Reg Tiangha <rtiangha@users.noreply.github.com>
Co-authored-by: OpenSauce04 <opensauce04@gmail.com>
This commit is contained in:
David Griswold
2024-10-29 14:22:51 -07:00
committed by OpenSauce04
parent 0a3cb3a4dc
commit 43c4d3981d
29 changed files with 780 additions and 454 deletions

View File

@@ -40,7 +40,7 @@ std::string_view GetGraphicsAPIName(GraphicsAPI api) {
std::string_view GetTextureFilterName(TextureFilter filter) {
switch (filter) {
case TextureFilter::None:
case TextureFilter::NoFilter:
return "None";
case TextureFilter::Anime4K:
return "Anime4K";
@@ -113,6 +113,7 @@ void LogSettings() {
log_setting("Layout_SwapScreen", values.swap_screen.GetValue());
log_setting("Layout_UprightScreen", values.upright_screen.GetValue());
log_setting("Layout_LargeScreenProportion", values.large_screen_proportion.GetValue());
log_setting("Layout_SmallScreenPosition", values.small_screen_position.GetValue());
log_setting("Utility_DumpTextures", values.dump_textures.GetValue());
log_setting("Utility_CustomTextures", values.custom_textures.GetValue());
log_setting("Utility_PreloadTextures", values.preload_textures.GetValue());
@@ -204,6 +205,7 @@ void RestoreGlobalState(bool is_powered_on) {
values.swap_screen.SetGlobal(true);
values.upright_screen.SetGlobal(true);
values.large_screen_proportion.SetGlobal(true);
values.small_screen_position.SetGlobal(true);
values.bg_red.SetGlobal(true);
values.bg_green.SetGlobal(true);
values.bg_blue.SetGlobal(true);

View File

@@ -53,6 +53,20 @@ enum class PortraitLayoutOption : u32 {
PortraitCustomLayout,
};
/** Defines where the small screen will appear relative to the large screen
* when in Large Screen mode
*/
enum class SmallScreenPosition : u32 {
TopRight,
MiddleRight,
BottomRight,
TopLeft,
MiddleLeft,
BottomLeft,
AboveLarge,
BelowLarge
};
enum class StereoRenderOption : u32 {
Off = 0,
SideBySide = 1,
@@ -77,7 +91,7 @@ enum class AudioEmulation : u32 {
};
enum class TextureFilter : u32 {
None = 0,
NoFilter = 0,
Anime4K = 1,
Bicubic = 2,
ScaleForce = 3,
@@ -481,7 +495,7 @@ struct Values {
Setting<bool> use_shader_jit{true, "use_shader_jit"};
SwitchableSetting<u32, true> resolution_factor{1, 0, 10, "resolution_factor"};
SwitchableSetting<double, true> frame_limit{100, 0, 1000, "frame_limit"};
SwitchableSetting<TextureFilter> texture_filter{TextureFilter::None, "texture_filter"};
SwitchableSetting<TextureFilter> texture_filter{TextureFilter::NoFilter, "texture_filter"};
SwitchableSetting<TextureSampling> texture_sampling{TextureSampling::GameControlled,
"texture_sampling"};
SwitchableSetting<u16, true> delay_game_render_thread_us{0, 0, 16000,
@@ -492,6 +506,8 @@ struct Values {
SwitchableSetting<bool> upright_screen{false, "upright_screen"};
SwitchableSetting<float, true> large_screen_proportion{4.f, 1.f, 16.f,
"large_screen_proportion"};
SwitchableSetting<SmallScreenPosition> small_screen_position{SmallScreenPosition::BottomRight,
"small_screen_position"};
Setting<u16> custom_top_x{0, "custom_top_x"};
Setting<u16> custom_top_y{0, "custom_top_y"};
Setting<u16> custom_top_width{800, "custom_top_width"};