change the approach to wii resolution changing, this is more stable

This commit is contained in:
radius 2015-07-06 16:07:33 -05:00
parent eadaad57da
commit 2aa7c46e78
4 changed files with 32 additions and 4 deletions

View File

@ -165,7 +165,7 @@ enum
GX_RESOLUTIONS_LAST,
};
static unsigned menu_current_gx_resolution = GX_RESOLUTIONS_640_480;
static unsigned menu_current_gx_resolution = GX_RESOLUTIONS_448_448;
unsigned menu_gx_resolutions[GX_RESOLUTIONS_LAST][2] = {
{ 512, 192 },
@ -474,7 +474,7 @@ static void setup_video_mode(void *data)
VIDEO_GetPreferredMode(&gx_mode);
global_t *global = global_get_ptr();
gx_set_video_mode(data, global->console.screen.resolutions.width, global->console.screen.resolutions.height, true);
gx_set_video_mode(data, 0, 0, true);
}
static void init_texture(void *data, unsigned width, unsigned height)

View File

@ -1328,7 +1328,7 @@ static int action_ok_load_state(const char *path,
if (generic_action_ok_command(EVENT_CMD_LOAD_STATE) == -1)
return -1;
return generic_action_ok_command(EVENT_CMD_RESUME);
}
}
static int action_ok_save_state(const char *path,
@ -1711,6 +1711,10 @@ static int action_ok_video_resolution(const char *path,
video_driver_set_video_mode(width, height, true);
global->console.screen.resolutions.width = width;
global->console.screen.resolutions.height = height;
char msg[PATH_MAX_LENGTH] = {0};
snprintf(msg, sizeof(msg),"Applying: %dx%d\n START to reset",width, height);
rarch_main_msg_queue_push(msg, 1, 100, true);
}
#endif

View File

@ -270,9 +270,20 @@ static int action_start_video_resolution(const char *path,
global_t *global = global_get_ptr();
(void)global;
(void)width;
(void)height;
video_driver_set_video_mode(640, 480, true);
if (video_driver_get_video_output_size(&width, &height))
{
video_driver_set_video_mode(width, height, true);
global->console.screen.resolutions.width = width;
global->console.screen.resolutions.height = height;
char msg[PATH_MAX_LENGTH] = {0};
snprintf(msg, sizeof(msg),"Resetting to: %dx%d",width, height);
rarch_main_msg_queue_push(msg, 1, 100, true);
}
return 0;
}

View File

@ -1266,6 +1266,19 @@ int rarch_main_init(int argc, char *argv[])
event_command(EVENT_CMD_VIDEO_SET_ASPECT_RATIO);
video_driver_set_aspect_ratio(settings->video.aspect_ratio_idx);
}
unsigned width = 0, height = 0;
(void)width;
(void)height;
width = global->console.screen.resolutions.width;
height = global->console.screen.resolutions.height;
video_driver_set_video_mode(width, height, true);
char msg[PATH_MAX_LENGTH] = {0};
snprintf(msg, sizeof(msg),"Resolution: %dx%d",width, height);
rarch_main_msg_queue_push(msg, 1, 100, true);
}
#endif