mirror of
https://github.com/libretro/RetroArch
synced 2025-03-23 10:20:57 +00:00
Cleanups
This commit is contained in:
parent
3b26263126
commit
02ac92b91d
@ -661,28 +661,16 @@ static void video_driver_filter_free(void)
|
|||||||
video_driver_state_out_rgb32 = false;
|
video_driver_state_out_rgb32 = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void video_driver_init_filter(enum retro_pixel_format colfmt)
|
static void video_driver_init_filter(enum retro_pixel_format colfmt,
|
||||||
|
struct retro_game_geometry *geom)
|
||||||
{
|
{
|
||||||
unsigned width, height, pow2_x, pow2_y, maxsize;
|
unsigned pow2_x, pow2_y, maxsize;
|
||||||
void *buf = NULL;
|
void *buf = NULL;
|
||||||
struct retro_game_geometry *geom = NULL;
|
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
struct retro_system_av_info *av_info = &video_driver_av_info;
|
unsigned width = geom->max_width;
|
||||||
|
unsigned height = geom->max_height;
|
||||||
|
|
||||||
/* Deprecated format. Gets pre-converted. */
|
video_driver_state_filter = rarch_softfilter_new(
|
||||||
if (colfmt == RETRO_PIXEL_FORMAT_0RGB1555)
|
|
||||||
colfmt = RETRO_PIXEL_FORMAT_RGB565;
|
|
||||||
|
|
||||||
if (av_info)
|
|
||||||
geom = (struct retro_game_geometry*)&av_info->geometry;
|
|
||||||
|
|
||||||
if (!geom)
|
|
||||||
return;
|
|
||||||
|
|
||||||
width = geom->max_width;
|
|
||||||
height = geom->max_height;
|
|
||||||
|
|
||||||
video_driver_state_filter = rarch_softfilter_new(
|
|
||||||
settings->paths.path_softfilter_plugin,
|
settings->paths.path_softfilter_plugin,
|
||||||
RARCH_SOFTFILTER_THREADS_AUTO, colfmt, width, height);
|
RARCH_SOFTFILTER_THREADS_AUTO, colfmt, width, height);
|
||||||
|
|
||||||
@ -901,13 +889,18 @@ static bool video_driver_init_internal(bool *video_is_threaded)
|
|||||||
unsigned max_dim, scale, width, height;
|
unsigned max_dim, scale, width, height;
|
||||||
video_viewport_t *custom_vp = NULL;
|
video_viewport_t *custom_vp = NULL;
|
||||||
const input_driver_t *tmp = NULL;
|
const input_driver_t *tmp = NULL;
|
||||||
const struct retro_game_geometry *geom = NULL;
|
|
||||||
rarch_system_info_t *system = NULL;
|
rarch_system_info_t *system = NULL;
|
||||||
static uint16_t dummy_pixels[32] = {0};
|
static uint16_t dummy_pixels[32] = {0};
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
struct retro_system_av_info *av_info = &video_driver_av_info;
|
struct retro_system_av_info *av_info = &video_driver_av_info;
|
||||||
|
struct retro_game_geometry *geom = (av_info) ?
|
||||||
|
&av_info->geometry : NULL;
|
||||||
|
|
||||||
video_driver_filter_free();
|
if (!geom)
|
||||||
|
{
|
||||||
|
RARCH_ERR("[Video]: AV geometry not initialized, cannot initialize video driver.\n");
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
if (!string_is_empty(settings->paths.path_softfilter_plugin))
|
if (!string_is_empty(settings->paths.path_softfilter_plugin))
|
||||||
{
|
{
|
||||||
@ -916,20 +909,19 @@ static bool video_driver_init_internal(bool *video_is_threaded)
|
|||||||
RARCH_WARN("Cannot use CPU filters when hardware rendering is used.\n");
|
RARCH_WARN("Cannot use CPU filters when hardware rendering is used.\n");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
video_driver_init_filter(video_driver_pix_fmt);
|
{
|
||||||
|
/* Deprecated format. Gets pre-converted. */
|
||||||
|
enum retro_pixel_format colfmt =
|
||||||
|
(video_driver_pix_fmt == RETRO_PIXEL_FORMAT_0RGB1555) ?
|
||||||
|
RETRO_PIXEL_FORMAT_RGB565 : video_driver_pix_fmt;
|
||||||
|
|
||||||
|
if (av_info && geom)
|
||||||
|
video_driver_init_filter(colfmt, geom);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
command_event(CMD_EVENT_SHADER_DIR_INIT, NULL);
|
command_event(CMD_EVENT_SHADER_DIR_INIT, NULL);
|
||||||
|
|
||||||
if (av_info)
|
|
||||||
geom = (const struct retro_game_geometry*)&av_info->geometry;
|
|
||||||
|
|
||||||
if (!geom)
|
|
||||||
{
|
|
||||||
RARCH_ERR("[Video]: AV geometry not initialized, cannot initialize video driver.\n");
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
max_dim = MAX(geom->max_width, geom->max_height);
|
max_dim = MAX(geom->max_width, geom->max_height);
|
||||||
scale = next_pow2(max_dim) / RARCH_SCALE_BASE;
|
scale = next_pow2(max_dim) / RARCH_SCALE_BASE;
|
||||||
scale = MAX(scale, 1);
|
scale = MAX(scale, 1);
|
||||||
@ -1750,6 +1742,7 @@ bool video_driver_get_prev_video_out(void)
|
|||||||
bool video_driver_init(bool *video_is_threaded)
|
bool video_driver_init(bool *video_is_threaded)
|
||||||
{
|
{
|
||||||
video_driver_lock_new();
|
video_driver_lock_new();
|
||||||
|
video_driver_filter_free();
|
||||||
return video_driver_init_internal(video_is_threaded);
|
return video_driver_init_internal(video_is_threaded);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -683,14 +683,15 @@ static bool video_shader_parse_imports(config_file_t *conf,
|
|||||||
*
|
*
|
||||||
* Returns: true (1) if successful, otherwise false (0).
|
* Returns: true (1) if successful, otherwise false (0).
|
||||||
**/
|
**/
|
||||||
bool video_shader_read_conf_cgp(config_file_t *conf, struct video_shader *shader)
|
bool video_shader_read_conf_cgp(config_file_t *conf,
|
||||||
|
struct video_shader *shader)
|
||||||
{
|
{
|
||||||
unsigned shaders, i;
|
unsigned i;
|
||||||
|
unsigned shaders = 0;
|
||||||
|
|
||||||
memset(shader, 0, sizeof(*shader));
|
memset(shader, 0, sizeof(*shader));
|
||||||
shader->type = RARCH_SHADER_CG;
|
shader->type = RARCH_SHADER_CG;
|
||||||
|
|
||||||
shaders = 0;
|
|
||||||
if (!config_get_uint(conf, "shaders", &shaders))
|
if (!config_get_uint(conf, "shaders", &shaders))
|
||||||
{
|
{
|
||||||
RARCH_ERR("Cannot find \"shaders\" param.\n");
|
RARCH_ERR("Cannot find \"shaders\" param.\n");
|
||||||
@ -1018,7 +1019,8 @@ enum rarch_shader_type video_shader_parse_type(const char *path,
|
|||||||
if (!path)
|
if (!path)
|
||||||
return fallback;
|
return fallback;
|
||||||
|
|
||||||
switch (msg_hash_to_file_type(msg_hash_calculate(path_get_extension(path))))
|
switch (msg_hash_to_file_type(
|
||||||
|
msg_hash_calculate(path_get_extension(path))))
|
||||||
{
|
{
|
||||||
case FILE_TYPE_SHADER_CG:
|
case FILE_TYPE_SHADER_CG:
|
||||||
case FILE_TYPE_SHADER_PRESET_CGP:
|
case FILE_TYPE_SHADER_PRESET_CGP:
|
||||||
|
@ -121,7 +121,7 @@ struct thread_packet
|
|||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
char msg[255];
|
char msg[128];
|
||||||
struct font_params params;
|
struct font_params params;
|
||||||
} osd_message;
|
} osd_message;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user