diff --git a/core/cfg/option.h b/core/cfg/option.h index 2d017a725..49d4c15d9 100644 --- a/core/cfg/option.h +++ b/core/cfg/option.h @@ -418,8 +418,10 @@ extern Option RenderToTextureBuffer; extern Option TranslucentPolygonDepthMask; extern Option ModifierVolumes; constexpr bool Clipping = true; +#ifndef LIBRETRO extern Option TextureUpscale; extern Option MaxFilteredTextureSize; +#endif extern Option ExtraDepthScale; extern Option CustomTextures; extern Option DumpTextures; diff --git a/shell/libretro/libretro_core_options.h b/shell/libretro/libretro_core_options.h index ca163ba9c..6b62a505d 100644 --- a/shell/libretro/libretro_core_options.h +++ b/shell/libretro/libretro_core_options.h @@ -450,13 +450,13 @@ struct retro_core_option_v2_definition option_defs_us[] = { NULL, "video", { - { "off", "disabled" }, - { "2x", NULL }, - { "4x", NULL }, - { "6x", NULL }, + { "1", "disabled" }, + { "2", "2x" }, + { "4", "4x" }, + { "6", "6x" }, { NULL, NULL }, }, - "off", + "1", }, {/* TODO: needs clarification */ CORE_OPTION_NAME "_texupscale_max_filtered_texture_size", diff --git a/shell/libretro/option.cpp b/shell/libretro/option.cpp index a5d8363b1..a9729096c 100644 --- a/shell/libretro/option.cpp +++ b/shell/libretro/option.cpp @@ -60,8 +60,8 @@ Option ShowFPS(""); Option RenderToTextureBuffer(CORE_OPTION_NAME "_enable_rttb"); Option TranslucentPolygonDepthMask(""); Option ModifierVolumes(CORE_OPTION_NAME "_volume_modifier_enable", true); -Option TextureUpscale(CORE_OPTION_NAME "_texupscale", 1); -Option MaxFilteredTextureSize(CORE_OPTION_NAME "_texupscale_max_filtered_texture_size", 256); +IntOption TextureUpscale(CORE_OPTION_NAME "_texupscale", 1); +IntOption MaxFilteredTextureSize(CORE_OPTION_NAME "_texupscale_max_filtered_texture_size", 256); Option ExtraDepthScale("", 1.f); Option CustomTextures(CORE_OPTION_NAME "_custom_textures"); Option DumpTextures(CORE_OPTION_NAME "_dump_textures"); diff --git a/shell/libretro/option_lr.h b/shell/libretro/option_lr.h index df692bc1f..15e1525ab 100644 --- a/shell/libretro/option_lr.h +++ b/shell/libretro/option_lr.h @@ -61,6 +61,7 @@ private: template friend class Option; + friend class IntOption; }; // Missing in C++11 @@ -182,4 +183,21 @@ protected: Settings& settings; }; +// Uses the setting value converted to int instead of the value index +class IntOption : public Option { +public: + IntOption(const std::string& name, int defaultValue = 0) + : Option(name, defaultValue) + { + } + + void load() override { + retro_variable var { name.c_str() }; + if (settings.retroEnv(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value != nullptr) + set(atoi(var.value)); + } +}; + extern Option PowerVR2Filter; +extern IntOption TextureUpscale; +extern IntOption MaxFilteredTextureSize;