Skip to content
Browse files

(RARCH_CONSOLE) Get rid of video_stop_func

  • Loading branch information...
1 parent 1e22908 commit 34619412bcf486841017586b6db498de69045b80 @twinaphex twinaphex committed
Showing with 38 additions and 54 deletions.
  1. +0 −3 driver.c
  2. +0 −1 driver.h
  3. +0 −1 driver_funcs.h
  4. +23 −5 frontend/menu/rmenu.c
  5. +3 −9 gfx/gl.c
  6. +0 −2 gfx/null.c
  7. +0 −2 gfx/thread_wrapper.c
  8. +12 −17 gx/gx_video.c
  9. +0 −2 psp1/psp1_video.c
  10. +0 −2 vita/vita_video.c
  11. +0 −10 xdk/xdk_d3d.cpp
View
3 driver.c
@@ -343,9 +343,6 @@ void global_uninit_drivers(void)
{
if (driver.video_data)
{
-#ifdef RARCH_CONSOLE
- driver.video->stop();
-#endif
driver.video_data = NULL;
}
View
1 driver.h
@@ -368,7 +368,6 @@ typedef struct video_driver
#if defined(HAVE_RMENU) || defined(HAVE_RGUI)
void (*start)(void);
- void (*stop)(void);
void (*restart)(void);
#endif
View
1 driver_funcs.h
@@ -122,7 +122,6 @@ static inline bool input_key_pressed_func(int key)
#define video_free_func() MAKENAME_VIDEO(_free)(driver.video_data)
#define video_set_nonblock_state_func(state) MAKENAME_VIDEO(_set_nonblock_state)(driver.video_data, state)
#define video_set_rotation_func(rotation) MAKENAME_VIDEO(_set_rotation)(driver.video_data, rotation)
-#define video_stop_func() MAKENAME_VIDEO(_stop)()
#define video_start_func() MAKENAME_VIDEO(_start)()
#define video_set_shader_func(type, path) MAKENAME_VIDEO(_set_shader)(driver.video_data, type, path)
#define video_xml_shader_func(path) driver.video->xml_shader(driver.video_data, path)
View
28 frontend/menu/rmenu.c
@@ -912,6 +912,17 @@ static bool osk_callback_enter_filename_init(void *data)
#endif
#endif
+static void rgui_init_textures(void)
+{
+#ifdef HAVE_MENU_PANEL
+ texture_image_load("D:\\Media\\menuMainRomSelectPanel.png", menu_panel);
+#endif
+ texture_image_load(g_extern.menu_texture_path, menu_texture);
+
+ if (driver.video_poke && driver.video_poke->set_texture_frame)
+ driver.video_poke->set_texture_frame(driver.video_data, menu_texture->pixels,
+ true, menu_texture->width, menu_texture->height, 1.0f);
+}
static int set_setting_action(uint8_t menu_type, unsigned switchvalue, uint64_t input)
{
@@ -939,7 +950,9 @@ static int set_setting_action(uint8_t menu_type, unsigned switchvalue, uint64_t
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_VIDEO_PAL_VSYNC_BLOCK);
}
+
driver.video->restart();
+ rgui_init_textures();
}
break;
case SETTING_PAL60_MODE:
@@ -959,6 +972,7 @@ static int set_setting_action(uint8_t menu_type, unsigned switchvalue, uint64_t
}
driver.video->restart();
+ rgui_init_textures();
}
}
@@ -968,7 +982,9 @@ static int set_setting_action(uint8_t menu_type, unsigned switchvalue, uint64_t
{
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE);
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_VIDEO_PAL_VSYNC_BLOCK);
+
driver.video->restart();
+ rgui_init_textures();
}
}
break;
@@ -1110,14 +1126,19 @@ static int set_setting_action(uint8_t menu_type, unsigned switchvalue, uint64_t
if ((input & (1ULL << DEVICE_NAV_LEFT)) || (input & (1ULL << DEVICE_NAV_RIGHT)) || (input & (1ULL << DEVICE_NAV_B)))
{
settings_set(1ULL << S_TRIPLE_BUFFERING);
+
driver.video->restart();
+ rgui_init_textures();
}
if (input & (1ULL << DEVICE_NAV_START))
{
settings_set(1ULL << S_DEF_TRIPLE_BUFFERING);
if (!(g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE)))
+ {
driver.video->restart();
+ rgui_init_textures();
+ }
}
break;
case SETTING_DEFAULT_VIDEO_ALL:
@@ -3162,6 +3183,7 @@ int rgui_iterate(rgui_handle_t *rgui)
return -1;
}
+
rgui_handle_t *rgui_init(void)
{
rgui_handle_t *rgui = (rgui_handle_t*)calloc(1, sizeof(*rgui));
@@ -3171,14 +3193,10 @@ rgui_handle_t *rgui_init(void)
menu_texture = (struct texture_image*)calloc(1, sizeof(*menu_texture));
#ifdef HAVE_MENU_PANEL
menu_panel = (struct texture_image*)calloc(1, sizeof(*menu_panel));
- texture_image_load("D:\\Media\\menuMainRomSelectPanel.png", menu_panel);
#endif
- texture_image_load(g_extern.menu_texture_path, menu_texture);
+ rgui_init_textures();
- if (driver.video_poke && driver.video_poke->set_texture_frame)
- driver.video_poke->set_texture_frame(driver.video_data, menu_texture->pixels,
- true, menu_texture->width, menu_texture->height, 1.0f);
#ifdef HAVE_OSKUTIL
oskutil_params *osk = &g_extern.console.misc.oskutil_handle;
View
12 gfx/gl.c
@@ -2097,13 +2097,6 @@ static void gl_start(void)
gl->font_ctx = gl_font_init_first(gl, g_settings.video.font_path, g_settings.video.font_size);
}
-static void gl_stop(void)
-{
- void *data = driver.video_data;
- driver.video_data = NULL;
- gl_free(data);
-}
-
static void gl_restart(void)
{
gl_t *gl = (gl_t*)driver.video_data;
@@ -2111,7 +2104,9 @@ static void gl_restart(void)
if (!gl)
return;
- gl_stop();
+ void *data = driver.video_data;
+ driver.video_data = NULL;
+ gl_free(data);
#ifdef HAVE_CG
gl_cg_invalidate_context();
#endif
@@ -2405,7 +2400,6 @@ const video_driver_t video_gl = {
#if defined(HAVE_RGUI) || defined(HAVE_RMENU)
gl_start,
- gl_stop,
gl_restart,
#endif
gl_set_rotation,
View
2 gfx/null.c
@@ -65,7 +65,6 @@ static void null_gfx_free(void *data)
#ifdef RARCH_CONSOLE
static void null_gfx_start(void) {}
static void null_gfx_restart(void) {}
-static void null_gfx_stop(void) {}
#endif
const video_driver_t video_null = {
@@ -80,7 +79,6 @@ const video_driver_t video_null = {
#ifdef RARCH_CONSOLE
null_gfx_start,
- null_gfx_stop,
null_gfx_restart,
#endif
};
View
2 gfx/thread_wrapper.c
@@ -706,7 +706,6 @@ static void thread_get_poke_interface(void *data, const video_poke_interface_t *
// all stubs for now, might not have to implement them unless we want to port this to consoles
static void thread_start(void) {}
static void thread_stop(void) {}
-static void thread_restart(void) {}
#endif
static const video_driver_t video_thread = {
@@ -721,7 +720,6 @@ static const video_driver_t video_thread = {
#if defined(HAVE_RMENU) || defined(HAVE_RGUI)
thread_start,
thread_stop,
- thread_restart,
#endif
thread_set_rotation,
thread_viewport_info,
View
29 gx/gx_video.c
@@ -416,22 +416,6 @@ static void gx_efb_screenshot(void)
#endif
-static void gx_stop(void)
-{
-#ifdef TAKE_EFB_SCREENSHOT_ON_EXIT
- gx_efb_screenshot();
-#endif
- GX_DrawDone();
- GX_AbortFrame();
- GX_Flush();
- VIDEO_SetBlack(true);
- VIDEO_Flush();
- VIDEO_WaitVSync();
-
- for (unsigned i = 0; i < 2; i++)
- free(MEM_K1_TO_K0(g_framebuf[i]));
-}
-
static void gx_restart(void)
{
}
@@ -1017,6 +1001,18 @@ static bool gx_focus(void *data)
static void gx_free(void *data)
{
(void)data;
+#ifdef TAKE_EFB_SCREENSHOT_ON_EXIT
+ gx_efb_screenshot();
+#endif
+ GX_DrawDone();
+ GX_AbortFrame();
+ GX_Flush();
+ VIDEO_SetBlack(true);
+ VIDEO_Flush();
+ VIDEO_WaitVSync();
+
+ for (unsigned i = 0; i < 2; i++)
+ free(MEM_K1_TO_K0(g_framebuf[i]));
}
static void gx_set_rotation(void *data, unsigned orientation)
@@ -1093,7 +1089,6 @@ const video_driver_t video_gx = {
.set_rotation = gx_set_rotation,
.viewport_info = gx_viewport_info,
.start = gx_start,
- .stop = gx_stop,
.restart = gx_restart,
.poke_interface = gx_get_poke_interface,
};
View
2 psp1/psp1_video.c
@@ -181,7 +181,6 @@ static void psp_free(void *data)
#ifdef RARCH_CONSOLE
static void psp_start(void) {}
static void psp_restart(void) {}
-static void psp_stop(void) {}
#endif
static void psp_set_rotation(void *data, unsigned rotation)
@@ -200,7 +199,6 @@ const video_driver_t video_psp1 = {
#ifdef RARCH_CONSOLE
psp_start,
- psp_stop,
psp_restart,
NULL,
NULL,
View
2 vita/vita_video.c
@@ -515,7 +515,6 @@ static void vita_gfx_free(void *data)
#ifdef RARCH_CONSOLE
static void vita_gfx_start(void) {}
static void vita_gfx_restart(void) {}
-static void vita_gfx_stop(void) {}
#endif
const video_driver_t video_vita = {
@@ -530,7 +529,6 @@ const video_driver_t video_vita = {
#ifdef RARCH_CONSOLE
vita_gfx_start,
- vita_gfx_stop,
vita_gfx_restart,
#endif
};
View
10 xdk/xdk_d3d.cpp
@@ -1168,15 +1168,6 @@ static void xdk_d3d_start(void)
d3d->font_ctx = d3d_font_init_first(d3d, g_settings.video.font_path, 0 /* font size - fixed/unused */);
}
-static void xdk_d3d_stop(void)
-{
- void *data = driver.video_data;
-
- xdk_d3d_free(data);
-
- driver.video_data = NULL;
-}
-
static void xdk_d3d_restart(void)
{
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data;
@@ -1213,7 +1204,6 @@ const video_driver_t video_xdk_d3d = {
xdk_d3d_free,
"xdk_d3d",
xdk_d3d_start,
- xdk_d3d_stop,
xdk_d3d_restart,
xdk_d3d_set_rotation,
NULL, /* viewport_info */

0 comments on commit 3461941

Please sign in to comment.
Something went wrong with that request. Please try again.