mirror of
https://github.com/libretro/RetroArch
synced 2025-03-03 13:14:04 +00:00
Add initial implementation for resolution switching for Win32
This commit is contained in:
parent
0eb8acd766
commit
d04f3c01a1
@ -60,6 +60,7 @@
|
|||||||
#include "../../verbosity.h"
|
#include "../../verbosity.h"
|
||||||
#include "../../lakka.h"
|
#include "../../lakka.h"
|
||||||
#include "../../wifi/wifi_driver.h"
|
#include "../../wifi/wifi_driver.h"
|
||||||
|
#include "../../gfx/video_display_server.h"
|
||||||
|
|
||||||
#include <net/net_http.h>
|
#include <net/net_http.h>
|
||||||
|
|
||||||
@ -4463,12 +4464,37 @@ static int action_ok_push_dropdown_item(const char *path,
|
|||||||
static int action_ok_push_dropdown_item_resolution(const char *path,
|
static int action_ok_push_dropdown_item_resolution(const char *path,
|
||||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||||
{
|
{
|
||||||
RARCH_LOG("dropdown: \n");
|
char str[100];
|
||||||
RARCH_LOG("path: %s \n", path);
|
char *pch = NULL;
|
||||||
RARCH_LOG("label: %s \n", label);
|
unsigned width = 0;
|
||||||
RARCH_LOG("type: %d \n", type);
|
unsigned height = 0;
|
||||||
RARCH_LOG("idx: %d \n", idx);
|
unsigned refreshrate = 0;
|
||||||
RARCH_LOG("entry_idx: %d \n", entry_idx);
|
|
||||||
|
snprintf(str, sizeof(str), "%s", path);
|
||||||
|
|
||||||
|
pch = strtok(str, "x");
|
||||||
|
if (pch)
|
||||||
|
width = strtoul(pch, NULL, 0);
|
||||||
|
pch = strtok(NULL, " ");
|
||||||
|
if (pch)
|
||||||
|
height = strtoul(pch, NULL, 0);
|
||||||
|
pch = strtok(NULL, "(");
|
||||||
|
if (pch)
|
||||||
|
refreshrate = strtoul(pch, NULL, 0);
|
||||||
|
|
||||||
|
if (video_display_server_set_resolution(width, height,
|
||||||
|
refreshrate, (float)refreshrate, 0))
|
||||||
|
{
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
|
video_monitor_set_refresh_rate((float)refreshrate);
|
||||||
|
|
||||||
|
settings->uints.video_fullscreen_x = width;
|
||||||
|
settings->uints.video_fullscreen_y = height;
|
||||||
|
|
||||||
|
/* TODO/FIXME - menu drivers like XMB don't rescale
|
||||||
|
* automatically */
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8333,7 +8333,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist
|
|||||||
for (i = 0; i < size; i++)
|
for (i = 0; i < size; i++)
|
||||||
{
|
{
|
||||||
char val_d[256], str[256];
|
char val_d[256], str[256];
|
||||||
snprintf(str, sizeof(str), "%dx%d (%dHz)", list[i].width, list[i].height, list[i].refreshrate);
|
snprintf(str, sizeof(str), "%dx%d (%d Hz)", list[i].width, list[i].height, list[i].refreshrate);
|
||||||
snprintf(val_d, sizeof(val_d), "%d", i);
|
snprintf(val_d, sizeof(val_d), "%d", i);
|
||||||
menu_entries_append_enum(info->list,
|
menu_entries_append_enum(info->list,
|
||||||
str,
|
str,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user