mirror of
https://github.com/libretro/RetroArch
synced 2025-02-20 15:40:44 +00:00
(PS3/Wii) Reimplement video resolution code
This commit is contained in:
parent
ad75d00bd4
commit
de44911092
@ -355,9 +355,8 @@ static bool gfx_ctx_ps3_bind_api(void *data,
|
||||
return api == GFX_CTX_OPENGL_API || GFX_CTX_OPENGL_ES_API;
|
||||
}
|
||||
|
||||
static void gx_ctx_ps3_get_video_output_size(void *data, unsigned *width, unsigned *height)
|
||||
static void gfx_ctx_ps3_get_video_output_size(void *data, unsigned *width, unsigned *height)
|
||||
{
|
||||
unsigned width, height;
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
if (!global)
|
||||
@ -365,6 +364,17 @@ static void gx_ctx_ps3_get_video_output_size(void *data, unsigned *width, unsign
|
||||
|
||||
gfx_ctx_ps3_get_resolution(global->console.screen.resolutions.current.id,
|
||||
width, height);
|
||||
|
||||
if (*width == 720 && *height == 576)
|
||||
{
|
||||
if (global->console.screen.pal_enable)
|
||||
global->console.screen.pal60_enable = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
global->console.screen.pal_enable = false;
|
||||
global->console.screen.pal60_enable = false;
|
||||
}
|
||||
}
|
||||
|
||||
static void gfx_ctx_ps3_get_video_output_prev(void *data)
|
||||
|
@ -666,15 +666,20 @@ bool video_driver_set_rotation(unsigned rotation)
|
||||
}
|
||||
|
||||
|
||||
void video_driver_set_video_mode(unsigned width,
|
||||
bool video_driver_set_video_mode(unsigned width,
|
||||
unsigned height, bool fullscreen)
|
||||
{
|
||||
driver_t *driver = driver_get_ptr();
|
||||
const video_poke_interface_t *poke = video_driver_get_poke_ptr(driver);
|
||||
|
||||
if (poke && poke->set_video_mode)
|
||||
{
|
||||
poke->set_video_mode(driver->video_data,
|
||||
width, height, fullscreen);
|
||||
return true;
|
||||
}
|
||||
|
||||
return gfx_ctx_set_video_mode(driver->video_context_data, width, height, fullscreen);
|
||||
}
|
||||
|
||||
bool video_driver_get_video_output_size(unsigned *width, unsigned *height)
|
||||
@ -1130,14 +1135,14 @@ bool video_driver_ctl(enum rarch_display_ctl_state state, void *data)
|
||||
poke->get_video_output_next(driver->video_data);
|
||||
return true;
|
||||
}
|
||||
return gfx_ctx_get_video_output_next(driver->video_data);
|
||||
return gfx_ctx_get_video_output_next(driver->video_context_data);
|
||||
case RARCH_DISPLAY_CTL_GET_PREV_VIDEO_OUT:
|
||||
if (poke && poke->get_video_output_prev)
|
||||
{
|
||||
poke->get_video_output_prev(driver->video_data);
|
||||
return true;
|
||||
}
|
||||
return gfx_ctx_get_video_output_next(driver->video_data);
|
||||
return gfx_ctx_get_video_output_next(driver->video_context_data);
|
||||
case RARCH_DISPLAY_CTL_INIT:
|
||||
return init_video();
|
||||
case RARCH_DISPLAY_CTL_DEINIT:
|
||||
|
@ -299,7 +299,7 @@ bool video_driver_set_shader(enum rarch_shader_type type,
|
||||
|
||||
bool video_driver_set_rotation(unsigned rotation);
|
||||
|
||||
void video_driver_set_video_mode(unsigned width,
|
||||
bool video_driver_set_video_mode(unsigned width,
|
||||
unsigned height, bool fullscreen);
|
||||
|
||||
bool video_driver_get_video_output_size(
|
||||
|
@ -1833,39 +1833,23 @@ static int action_ok_help_load_content(const char *path,
|
||||
static int action_ok_video_resolution(const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
#ifdef __CELLOS_LV2__
|
||||
if (global->console.screen.resolutions.list[
|
||||
global->console.screen.resolutions.current.idx] ==
|
||||
CELL_VIDEO_OUT_RESOLUTION_576)
|
||||
{
|
||||
if (global->console.screen.pal_enable)
|
||||
global->console.screen.pal60_enable = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
global->console.screen.pal_enable = false;
|
||||
global->console.screen.pal60_enable = false;
|
||||
}
|
||||
|
||||
event_command(EVENT_CMD_REINIT);
|
||||
#else
|
||||
unsigned width = 0;
|
||||
unsigned height = 0;
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
if (video_driver_get_video_output_size(&width, &height))
|
||||
{
|
||||
char msg[PATH_MAX_LENGTH] = {0};
|
||||
|
||||
#ifdef __CELLOS_LV2__
|
||||
event_command(EVENT_CMD_REINIT);
|
||||
#else
|
||||
video_driver_set_video_mode(width, height, true);
|
||||
global->console.screen.resolutions.width = width;
|
||||
global->console.screen.resolutions.height = height;
|
||||
|
||||
snprintf(msg, sizeof(msg),"Applying: %dx%d\n START to reset",width, height);
|
||||
#endif
|
||||
snprintf(msg, sizeof(msg),"Applying: %dx%d\n START to reset", width, height);
|
||||
menu_display_msg_queue_push(msg, 1, 100, true);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1679,7 +1679,9 @@ static int menu_displaylist_parse_load_content_settings(menu_displaylist_info_t
|
||||
{
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
global_t *global = global_get_ptr();
|
||||
#ifdef HAVE_CHEEVOS
|
||||
settings_t *settings = config_get_ptr();
|
||||
#endif
|
||||
if (!menu)
|
||||
return -1;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user