This commit is contained in:
twinaphex 2018-09-12 21:50:11 +02:00
parent 0158bbe4aa
commit 7428fef4bc

View File

@ -114,14 +114,10 @@ void gfx_slow_swizzling_blit(uint32_t *buffer, uint32_t *image, int w, int h, in
uint8_t src_a = ((pixel & 0xFF000000) >> 24); uint8_t src_a = ((pixel & 0xFF000000) >> 24);
if (src_a > 0) if (src_a > 0)
{
pixel &= 0x00FFFFFF; pixel &= 0x00FFFFFF;
}
else else
{
pixel = dst; pixel = dst;
} }
}
dest_line[offs_x] = pixel; dest_line[offs_x] = pixel;
@ -152,7 +148,6 @@ static void *switch_init(const video_info_t *video,
const input_driver_t **input, void **input_data) const input_driver_t **input, void **input_data)
{ {
void *switchinput = NULL; void *switchinput = NULL;
switch_video_t *sw = (switch_video_t *)calloc(1, sizeof(*sw)); switch_video_t *sw = (switch_video_t *)calloc(1, sizeof(*sw));
if (!sw) if (!sw)
return NULL; return NULL;
@ -200,12 +195,16 @@ static void *switch_init(const video_info_t *video,
return sw; return sw;
} }
static void switch_update_viewport(switch_video_t *sw, video_frame_info_t *video_info) static void switch_update_viewport(switch_video_t *sw,
video_frame_info_t *video_info)
{ {
settings_t *settings = config_get_ptr();
int x = 0; int x = 0;
int y = 0; int y = 0;
float desired_aspect = 0.0f;
float width = sw->vp.full_width; float width = sw->vp.full_width;
float height = sw->vp.full_height; float height = sw->vp.full_height;
if (sw->o_size) if (sw->o_size)
{ {
width = sw->o_width; width = sw->o_width;
@ -219,10 +218,9 @@ static void switch_update_viewport(switch_video_t *sw, video_frame_info_t *video
return; return;
} }
settings_t *settings = config_get_ptr(); desired_aspect = video_driver_get_aspect_ratio();
float desired_aspect = video_driver_get_aspect_ratio();
// We crash if >1.0f /* We crash if >1.0f */
printf("[Video] Aspect: %f\n", desired_aspect); printf("[Video] Aspect: %f\n", desired_aspect);
/*if (desired_aspect > 1.8f) /*if (desired_aspect > 1.8f)
desired_aspect = 1.7778f; desired_aspect = 1.7778f;
@ -460,11 +458,9 @@ static bool switch_frame(void *data, const void *frame,
struct font_params *osd_params = (struct font_params *)&video_info->osd_stat_params; struct font_params *osd_params = (struct font_params *)&video_info->osd_stat_params;
if (osd_params) if (osd_params)
{
font_driver_render_msg(video_info, NULL, video_info->stat_text, font_driver_render_msg(video_info, NULL, video_info->stat_text,
(const struct font_params *)&video_info->osd_stat_params); (const struct font_params *)&video_info->osd_stat_params);
} }
}
if (msg) if (msg)
font_driver_render_msg(video_info, NULL, msg, NULL); font_driver_render_msg(video_info, NULL, msg, NULL);
@ -561,13 +557,9 @@ static void switch_set_texture_frame(
sw->menu_texture.height != height) sw->menu_texture.height != height)
{ {
if (sw->menu_texture.pixels) if (sw->menu_texture.pixels)
{
realloc(sw->menu_texture.pixels, sz); realloc(sw->menu_texture.pixels, sz);
}
else else
{
sw->menu_texture.pixels = malloc(sz); sw->menu_texture.pixels = malloc(sz);
}
if (!sw->menu_texture.pixels) if (!sw->menu_texture.pixels)
{ {
@ -621,9 +613,7 @@ static void switch_set_texture_enable(void *data, bool enable, bool full_screen)
switch_video_t *sw = data; switch_video_t *sw = data;
if (!sw->menu_texture.enable && enable) if (!sw->menu_texture.enable && enable)
{
gfxConfigureResolution(sw->vp.full_width, sw->vp.full_height); gfxConfigureResolution(sw->vp.full_width, sw->vp.full_height);
}
else if (!enable && sw->menu_texture.enable && sw->smooth) else if (!enable && sw->menu_texture.enable && sw->smooth)
{ {
clear_screen(sw); clear_screen(sw);