mirror of
https://github.com/libretro/RetroArch
synced 2025-02-21 18:40:09 +00:00
Cleanups
This commit is contained in:
parent
240a2fee63
commit
8eeb612493
@ -25,7 +25,8 @@ static bool android_display_server_set_window_opacity(void *data, unsigned opaci
|
|||||||
static bool android_display_server_set_window_progress(void *data, int progress, bool finished) { return true; }
|
static bool android_display_server_set_window_progress(void *data, int progress, bool finished) { return true; }
|
||||||
static uint32_t android_display_server_get_flags(void *data) { return 0; }
|
static uint32_t android_display_server_get_flags(void *data) { return 0; }
|
||||||
|
|
||||||
static void android_display_server_set_screen_orientation(enum rotation rotation)
|
static void android_display_server_set_screen_orientation(void *data,
|
||||||
|
enum rotation rotation)
|
||||||
{
|
{
|
||||||
JNIEnv *env = jni_thread_getenv();
|
JNIEnv *env = jni_thread_getenv();
|
||||||
|
|
||||||
|
@ -383,7 +383,7 @@ static void *win32_display_server_get_resolution_list(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if _WIN32_WINNT >= 0x0500
|
#if _WIN32_WINNT >= 0x0500
|
||||||
enum rotation win32_display_server_get_screen_orientation(void)
|
enum rotation win32_display_server_get_screen_orientation(void *data)
|
||||||
{
|
{
|
||||||
DEVMODE dm = {0};
|
DEVMODE dm = {0};
|
||||||
enum rotation rotation;
|
enum rotation rotation;
|
||||||
@ -410,7 +410,8 @@ enum rotation win32_display_server_get_screen_orientation(void)
|
|||||||
return rotation;
|
return rotation;
|
||||||
}
|
}
|
||||||
|
|
||||||
void win32_display_server_set_screen_orientation(enum rotation rotation)
|
void win32_display_server_set_screen_orientation(void *data,
|
||||||
|
enum rotation rotation)
|
||||||
{
|
{
|
||||||
DEVMODE dm = {0};
|
DEVMODE dm = {0};
|
||||||
|
|
||||||
|
@ -65,16 +65,12 @@ typedef struct
|
|||||||
#ifdef HAVE_XRANDR
|
#ifdef HAVE_XRANDR
|
||||||
static Display* x11_display_server_open_display(void)
|
static Display* x11_display_server_open_display(void)
|
||||||
{
|
{
|
||||||
Display *dpy = g_x11_dpy;
|
Display *dpy = g_x11_dpy;
|
||||||
|
x11_display_server_using_global_dpy = (dpy != NULL);
|
||||||
|
|
||||||
if (dpy)
|
/* SDL might use X11 but doesn't use g_x11_dpy, so open it manually */
|
||||||
x11_display_server_using_global_dpy = true;
|
if (!dpy)
|
||||||
else
|
dpy = XOpenDisplay(0);
|
||||||
{
|
|
||||||
/* SDL might use X11 but doesn't use g_x11_dpy, so open it manually */
|
|
||||||
dpy = XOpenDisplay(0);
|
|
||||||
x11_display_server_using_global_dpy = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return dpy;
|
return dpy;
|
||||||
}
|
}
|
||||||
@ -88,7 +84,8 @@ static void x11_display_server_close_display(Display *dpy)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool x11_display_server_set_resolution(void *data,
|
static bool x11_display_server_set_resolution(void *data,
|
||||||
unsigned width, unsigned height, int int_hz, float hz, int center, int monitor_index, int xoffset, int padjust)
|
unsigned width, unsigned height, int int_hz, float hz,
|
||||||
|
int center, int monitor_index, int xoffset, int padjust)
|
||||||
{
|
{
|
||||||
int m;
|
int m;
|
||||||
int screen;
|
int screen;
|
||||||
@ -312,7 +309,8 @@ static bool x11_display_server_set_resolution(void *data,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void x11_display_server_set_screen_orientation(enum rotation rotation)
|
static void x11_display_server_set_screen_orientation(void *data,
|
||||||
|
enum rotation rotation)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
XRRScreenResources *screen = NULL;
|
XRRScreenResources *screen = NULL;
|
||||||
@ -403,7 +401,7 @@ static void x11_display_server_set_screen_orientation(enum rotation rotation)
|
|||||||
XCloseDisplay(dpy);
|
XCloseDisplay(dpy);
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum rotation x11_display_server_get_screen_orientation(void)
|
static enum rotation x11_display_server_get_screen_orientation(void *data)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
XRRScreenConfiguration *config = NULL;
|
XRRScreenConfiguration *config = NULL;
|
||||||
|
@ -53,8 +53,8 @@ typedef struct video_display_server
|
|||||||
void *(*get_resolution_list)(void *data,
|
void *(*get_resolution_list)(void *data,
|
||||||
unsigned *size);
|
unsigned *size);
|
||||||
const char *(*get_output_options)(void *data);
|
const char *(*get_output_options)(void *data);
|
||||||
void (*set_screen_orientation)(enum rotation rotation);
|
void (*set_screen_orientation)(void *data, enum rotation rotation);
|
||||||
enum rotation (*get_screen_orientation)(void);
|
enum rotation (*get_screen_orientation)(void *data);
|
||||||
uint32_t (*get_flags)(void *data);
|
uint32_t (*get_flags)(void *data);
|
||||||
const char *ident;
|
const char *ident;
|
||||||
} video_display_server_t;
|
} video_display_server_t;
|
||||||
|
14
retroarch.c
14
retroarch.c
@ -31518,32 +31518,28 @@ void video_display_server_set_screen_orientation(enum rotation rotation)
|
|||||||
|
|
||||||
RARCH_LOG("[Video]: Setting screen orientation to %d.\n", rotation);
|
RARCH_LOG("[Video]: Setting screen orientation to %d.\n", rotation);
|
||||||
p_rarch->current_screen_orientation = rotation;
|
p_rarch->current_screen_orientation = rotation;
|
||||||
current_display_server->set_screen_orientation(rotation);
|
current_display_server->set_screen_orientation(p_rarch->current_display_server_data, rotation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool video_display_server_can_set_screen_orientation(void)
|
bool video_display_server_can_set_screen_orientation(void)
|
||||||
{
|
{
|
||||||
if (current_display_server && current_display_server->set_screen_orientation)
|
return (current_display_server && current_display_server->set_screen_orientation);
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum rotation video_display_server_get_screen_orientation(void)
|
enum rotation video_display_server_get_screen_orientation(void)
|
||||||
{
|
{
|
||||||
|
struct rarch_state *p_rarch = &rarch_st;
|
||||||
if (current_display_server && current_display_server->get_screen_orientation)
|
if (current_display_server && current_display_server->get_screen_orientation)
|
||||||
return current_display_server->get_screen_orientation();
|
return current_display_server->get_screen_orientation(p_rarch->current_display_server_data);
|
||||||
return ORIENTATION_NORMAL;
|
return ORIENTATION_NORMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool video_display_server_get_flags(gfx_ctx_flags_t *flags)
|
bool video_display_server_get_flags(gfx_ctx_flags_t *flags)
|
||||||
{
|
{
|
||||||
struct rarch_state *p_rarch = &rarch_st;
|
struct rarch_state *p_rarch = &rarch_st;
|
||||||
if (!current_display_server || !current_display_server->get_flags)
|
if (!flags || !current_display_server || !current_display_server->get_flags)
|
||||||
return false;
|
return false;
|
||||||
if (!flags)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
flags->flags = current_display_server->get_flags(
|
flags->flags = current_display_server->get_flags(
|
||||||
p_rarch->current_display_server_data);
|
p_rarch->current_display_server_data);
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user