vim - add RetroArch style conventions

This commit is contained in:
twinaphex 2018-09-15 17:43:34 +02:00
parent 2fc08ce394
commit f21493947d
2 changed files with 53 additions and 50 deletions

View File

@ -162,16 +162,15 @@ static bool switch_frame(void *data, const void *frame,
centerx = (1280-tgtw)/2; centerx = (1280-tgtw)/2;
centery = (720-tgth)/2; centery = (720-tgth)/2;
// clear image to black /* clear image to black */
for(y = 0; y < 720; y++) for(y = 0; y < 720; y++)
{ {
for(x = 0; x < 1280; x++) for(x = 0; x < 1280; x++)
{
sw->image[y*1280+x] = 0xFF000000; sw->image[y*1280+x] = 0xFF000000;
} }
}
if(width > 0 && height > 0) { if(width > 0 && height > 0)
{
if(sw->last_width != width || if(sw->last_width != width ||
sw->last_height != height) sw->last_height != height)
{ {
@ -189,7 +188,8 @@ static bool switch_frame(void *data, const void *frame,
sw->scaler.scaler_type = SCALER_TYPE_POINT; sw->scaler.scaler_type = SCALER_TYPE_POINT;
if(!scaler_ctx_gen_filter(&sw->scaler)) { if(!scaler_ctx_gen_filter(&sw->scaler))
{
RARCH_ERR("failed to generate scaler for main image\n"); RARCH_ERR("failed to generate scaler for main image\n");
return false; return false;
} }
@ -229,11 +229,9 @@ static bool switch_frame(void *data, const void *frame,
&video_info->osd_stat_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);
} }
}
#endif #endif
#if 0 #if 0
@ -248,14 +246,12 @@ static bool switch_frame(void *data, const void *frame,
RARCH_LOG("message: %s\n", msg); RARCH_LOG("message: %s\n", msg);
r = surface_dequeue_buffer(&sw->surface, &out_buffer); r = surface_dequeue_buffer(&sw->surface, &out_buffer);
if(r != RESULT_OK) { if(r != RESULT_OK)
return true; // just skip the frame return true; /* just skip the frame */
}
r = surface_wait_buffer(&sw->surface); r = surface_wait_buffer(&sw->surface);
if(r != RESULT_OK) { if(r != RESULT_OK)
return true; return true;
}
gfx_slow_swizzling_blit(out_buffer, sw->image, 1280, 720, 0, 0); gfx_slow_swizzling_blit(out_buffer, sw->image, 1280, 720, 0, 0);
r = surface_queue_buffer(&sw->surface); r = surface_queue_buffer(&sw->surface);
@ -349,6 +345,8 @@ static void switch_set_texture_frame(
sw->menu_texture.width != width || sw->menu_texture.width != width ||
sw->menu_texture.height != height) sw->menu_texture.height != height)
{ {
struct scaler_ctx *sctx;
int xsf, ysf, sf;
if (sw->menu_texture.pixels) if (sw->menu_texture.pixels)
free(sw->menu_texture.pixels); free(sw->menu_texture.pixels);
@ -359,9 +357,9 @@ static void switch_set_texture_frame(
return; return;
} }
int xsf = 1280 / width; xsf = 1280 / width;
int ysf = 720 / height; ysf = 720 / height;
int sf = xsf; sf = xsf;
if (ysf < sf) if (ysf < sf)
sf = ysf; sf = ysf;
@ -371,7 +369,7 @@ static void switch_set_texture_frame(
sw->menu_texture.tgtw = width * sf; sw->menu_texture.tgtw = width * sf;
sw->menu_texture.tgth = height * sf; sw->menu_texture.tgth = height * sf;
struct scaler_ctx *sctx = &sw->menu_texture.scaler; sctx = &sw->menu_texture.scaler;
scaler_ctx_gen_reset(sctx); scaler_ctx_gen_reset(sctx);
sctx->in_width = width; sctx->in_width = width;
@ -399,6 +397,9 @@ static void switch_set_texture_frame(
static void switch_set_texture_enable(void *data, bool enable, bool full_screen) 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)
return;
sw->menu_texture.enable = enable; sw->menu_texture.enable = enable;
sw->menu_texture.fullscreen = full_screen; sw->menu_texture.fullscreen = full_screen;
} }
@ -457,3 +458,5 @@ video_driver_t video_switch = {
#endif #endif
switch_get_poke_interface, switch_get_poke_interface,
}; };
/* vim: set ts=3 sw=3 */

View File

@ -773,4 +773,4 @@ video_driver_t video_switch = {
switch_get_poke_interface, switch_get_poke_interface,
}; };
/* vim: set ts=6 sw=6 sts=6: */ /* vim: set ts=3 sw=3 */