Wii: Expose stretch configuration in settings

This commit is contained in:
Vicki Pfau 2018-09-29 12:07:43 -07:00
parent eabdbe97ea
commit 46953b2791
2 changed files with 52 additions and 2 deletions

View File

@ -113,6 +113,7 @@ Misc:
- mGUI: Add SGB border configuration option
- mGUI: Add support for different settings types
- Wii: Disable use of strtof_l (fixes mgba.io/i/1106)
- Wii: Expose stretch configuration in settings
0.7 beta 1: (2018-09-24)
- Initial beta for 0.7

View File

@ -469,9 +469,49 @@ int main(int argc, char* argv[]) {
"Bilinear (pixelated)",
},
.nStates = 3
}
},
{
.title = "Horizontal stretch",
.data = "stretchWidth",
.submenu = 0,
.state = 7,
.validStates = (const char*[]) {
"1/2x", "0.6x", "1/3x", "0.7x", "1/4x", "0.8x", "0.9x", "1.0x"
},
.stateMappings = (const struct GUIVariant[]) {
GUI_V_F(0.5f),
GUI_V_F(0.6f),
GUI_V_F(1.f / 3.f),
GUI_V_F(0.7f),
GUI_V_F(0.75f),
GUI_V_F(0.8f),
GUI_V_F(0.9f),
GUI_V_F(1.0f),
},
.nStates = 8
},
{
.title = "Vertical stretch",
.data = "stretchHeight",
.submenu = 0,
.state = 6,
.validStates = (const char*[]) {
"1/2x", "0.6x", "1/3x", "0.7x", "1/4x", "0.8x", "0.9x", "1.0x"
},
.stateMappings = (const struct GUIVariant[]) {
GUI_V_F(0.5f),
GUI_V_F(0.6f),
GUI_V_F(1.f / 3.f),
GUI_V_F(0.7f),
GUI_V_F(0.75f),
GUI_V_F(0.8f),
GUI_V_F(0.9f),
GUI_V_F(1.0f),
},
.nStates = 8
},
},
.nConfigExtra = 3,
.nConfigExtra = 5,
.setup = _setup,
.teardown = 0,
.gameLoaded = _gameLoaded,
@ -517,6 +557,15 @@ int main(int argc, char* argv[]) {
_mapKey(&runner.params.keyMap, CLASSIC_INPUT, WPAD_CLASSIC_BUTTON_LEFT, GUI_INPUT_LEFT);
_mapKey(&runner.params.keyMap, CLASSIC_INPUT, WPAD_CLASSIC_BUTTON_RIGHT, GUI_INPUT_RIGHT);
float stretch = 0;
if (mCoreConfigGetFloatValue(&runner.config, "stretchWidth", &stretch)) {
wStretch = fminf(1.0f, fmaxf(0.5f, stretch));
}
if (mCoreConfigGetFloatValue(&runner.config, "stretchHeight", &stretch)) {
hStretch = fminf(1.0f, fmaxf(0.5f, stretch));
}
if (argc > 1) {
size_t i;
for (i = 0; runner.keySources[i].id; ++i) {