mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Create driver_ctl
This commit is contained in:
parent
47dbee7102
commit
f2911269d5
34
driver.c
34
driver.c
@ -45,18 +45,6 @@
|
||||
#define HASH_AUDIO_RESAMPLER_DRIVER 0xedcba9ecU
|
||||
#define HASH_RECORD_DRIVER 0x144cd2cfU
|
||||
|
||||
void driver_free(void)
|
||||
{
|
||||
video_driver_ctl(RARCH_DISPLAY_CTL_DESTROY, NULL);
|
||||
audio_driver_ctl(RARCH_AUDIO_CTL_DESTROY, NULL);
|
||||
input_driver_ctl(RARCH_INPUT_CTL_DESTROY, NULL);
|
||||
#ifdef HAVE_MENU
|
||||
menu_driver_ctl(RARCH_MENU_CTL_DESTROY, NULL);
|
||||
#endif
|
||||
location_driver_ctl(RARCH_LOCATION_CTL_DESTROY, NULL);
|
||||
camera_driver_ctl(RARCH_CAMERA_CTL_DESTROY, NULL);
|
||||
retro_uninit_libretro_cbs();
|
||||
}
|
||||
/**
|
||||
* find_driver_nonempty:
|
||||
* @label : string of driver type to be found.
|
||||
@ -472,3 +460,25 @@ void uninit_drivers(int flags)
|
||||
audio_driver_ctl(RARCH_AUDIO_CTL_DESTROY_DATA, NULL);
|
||||
}
|
||||
|
||||
bool driver_ctl(enum driver_ctl_state state, void *data)
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case RARCH_DRIVER_CTL_DEINIT:
|
||||
video_driver_ctl(RARCH_DISPLAY_CTL_DESTROY, NULL);
|
||||
audio_driver_ctl(RARCH_AUDIO_CTL_DESTROY, NULL);
|
||||
input_driver_ctl(RARCH_INPUT_CTL_DESTROY, NULL);
|
||||
#ifdef HAVE_MENU
|
||||
menu_driver_ctl(RARCH_MENU_CTL_DESTROY, NULL);
|
||||
#endif
|
||||
location_driver_ctl(RARCH_LOCATION_CTL_DESTROY, NULL);
|
||||
camera_driver_ctl(RARCH_CAMERA_CTL_DESTROY, NULL);
|
||||
retro_uninit_libretro_cbs();
|
||||
break;
|
||||
case RARCH_DRIVER_CTL_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
8
driver.h
8
driver.h
@ -172,6 +172,12 @@ enum
|
||||
DRIVERS_VIDEO_INPUT = 1 << 6
|
||||
};
|
||||
|
||||
enum driver_ctl_state
|
||||
{
|
||||
RARCH_DRIVER_CTL_NONE = 0,
|
||||
RARCH_DRIVER_CTL_DEINIT
|
||||
};
|
||||
|
||||
|
||||
/* TODO/FIXME - comment needs to be moved to each respective driver */
|
||||
|
||||
@ -286,7 +292,7 @@ bool driver_update_system_av_info(const void *data);
|
||||
**/
|
||||
int find_driver_index(const char * label, const char *drv);
|
||||
|
||||
void driver_free(void);
|
||||
bool driver_ctl(enum driver_ctl_state state, void *data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ void main_exit(void *args)
|
||||
|
||||
frontend_driver_shutdown(false);
|
||||
|
||||
driver_free();
|
||||
driver_ctl(RARCH_DRIVER_CTL_DEINIT, NULL);
|
||||
ui_companion_driver_free();
|
||||
frontend_driver_free();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user