diff --git a/driver.c b/driver.c index 2b93e9c66b..2add0b8efd 100644 --- a/driver.c +++ b/driver.c @@ -457,6 +457,13 @@ static void init_filter(bool rgb32) return; } + struct retro_game_geometry *geom = &g_extern.system.av_info.geometry; + unsigned width = geom->max_width; + unsigned height = geom->max_height; + unsigned pow2_x = 0; + unsigned pow2_y = 0; + unsigned maxsize = 0; + g_extern.filter.psize = (void (*)(unsigned*, unsigned*))dylib_proc(g_extern.filter.lib, "filter_size"); g_extern.filter.prender = @@ -471,15 +478,11 @@ static void init_filter(bool rgb32) } g_extern.filter.active = true; - - struct retro_game_geometry *geom = &g_extern.system.av_info.geometry; - unsigned width = geom->max_width; - unsigned height = geom->max_height; g_extern.filter.psize(&width, &height); - unsigned pow2_x = next_pow2(width); - unsigned pow2_y = next_pow2(height); - unsigned maxsize = pow2_x > pow2_y ? pow2_x : pow2_y; + pow2_x = next_pow2(width); + pow2_y = next_pow2(height); + maxsize = pow2_x > pow2_y ? pow2_x : pow2_y; g_extern.filter.scale = maxsize / RARCH_SCALE_BASE; g_extern.filter.buffer = (uint32_t*)malloc(RARCH_SCALE_BASE * RARCH_SCALE_BASE * diff --git a/general.h b/general.h index 879bfd6a18..69e604526b 100644 --- a/general.h +++ b/general.h @@ -358,7 +358,7 @@ struct global // CPU filters only work on *XRGB1555*. We have to convert to XRGB1555 first. struct scaler_ctx scaler; - void *scaler_out; + uint16_t *scaler_out; } filter; msg_queue_t *msg_queue; diff --git a/gfx/context/glx_ctx.c b/gfx/context/glx_ctx.c index c1aee3f2e9..12e6e39119 100644 --- a/gfx/context/glx_ctx.c +++ b/gfx/context/glx_ctx.c @@ -237,6 +237,8 @@ static bool gfx_ctx_set_video_mode( sigemptyset(&sa.sa_mask); sigaction(SIGINT, &sa, NULL); sigaction(SIGTERM, &sa, NULL); + int x_off = 0; + int y_off = 0; bool windowed_full = g_settings.video.windowed_fullscreen; bool true_full = false; @@ -264,8 +266,6 @@ static bool gfx_ctx_set_video_mode( if (g_settings.video.monitor_index) g_screen = g_settings.video.monitor_index - 1; - int x_off = 0; - int y_off = 0; #ifdef HAVE_XINERAMA if (fullscreen || g_screen != 0) { diff --git a/gfx/context/x11_common.c b/gfx/context/x11_common.c index b0f7a02d2f..67cd53a9a0 100644 --- a/gfx/context/x11_common.c +++ b/gfx/context/x11_common.c @@ -199,13 +199,13 @@ static XineramaScreenInfo *x11_query_screens(Display *dpy, int *num_screens) { int major, minor; if (!XineramaQueryExtension(dpy, &major, &minor)) - return false; + return NULL; XineramaQueryVersion(dpy, &major, &minor); RARCH_LOG("[X11]: Xinerama version: %d.%d.\n", major, minor); if (!XineramaIsActive(dpy)) - return false; + return NULL; return XineramaQueryScreens(dpy, num_screens); } diff --git a/gfx/context/xegl_ctx.c b/gfx/context/xegl_ctx.c index bd6a94e8f9..cfa81b37a9 100644 --- a/gfx/context/xegl_ctx.c +++ b/gfx/context/xegl_ctx.c @@ -263,6 +263,8 @@ static bool gfx_ctx_set_video_mode( XVisualInfo *vi = NULL; bool windowed_full = g_settings.video.windowed_fullscreen; bool true_full = false; + int x_off = 0; + int y_off = 0; EGLint vid; if (!eglGetConfigAttrib(g_egl_dpy, g_config, EGL_NATIVE_VISUAL_ID, &vid)) @@ -292,8 +294,6 @@ static bool gfx_ctx_set_video_mode( if (g_settings.video.monitor_index) g_screen = g_settings.video.monitor_index - 1; - int x_off = 0; - int y_off = 0; #ifdef HAVE_XINERAMA if (fullscreen || g_screen != 0) {