mirror of
https://github.com/libretro/RetroArch
synced 2025-02-06 09:40:06 +00:00
(gfx/drivers) Cleanups
This commit is contained in:
parent
34a44983a0
commit
7197b58ed6
@ -400,7 +400,7 @@ static bool dispmanx_gfx_frame(void *data, const void *frame, unsigned width,
|
|||||||
|
|
||||||
if (_dispvars->menu_active)
|
if (_dispvars->menu_active)
|
||||||
{
|
{
|
||||||
char buf[128];
|
char buf[128] = {0};
|
||||||
video_monitor_get_fps(buf, sizeof(buf), NULL, 0);
|
video_monitor_get_fps(buf, sizeof(buf), NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,11 +181,11 @@ static INLINE unsigned align_common(unsigned i, unsigned j)
|
|||||||
/* Find the index of a compatible DRM device. */
|
/* Find the index of a compatible DRM device. */
|
||||||
static int exynos_get_device_index(void)
|
static int exynos_get_device_index(void)
|
||||||
{
|
{
|
||||||
char buf[32];
|
|
||||||
int fd;
|
int fd;
|
||||||
drmVersionPtr ver;
|
drmVersionPtr ver;
|
||||||
int index = 0;
|
char buf[32] = {0};
|
||||||
bool found = false;
|
int index = 0;
|
||||||
|
bool found = false;
|
||||||
|
|
||||||
while (!found)
|
while (!found)
|
||||||
{
|
{
|
||||||
@ -584,16 +584,16 @@ static void exynos_g2d_free(struct exynos_data *pdata)
|
|||||||
|
|
||||||
static int exynos_open(struct exynos_data *pdata)
|
static int exynos_open(struct exynos_data *pdata)
|
||||||
{
|
{
|
||||||
char buf[32];
|
|
||||||
unsigned i;
|
unsigned i;
|
||||||
int fd = -1;
|
int fd = -1;
|
||||||
|
char buf[32] = {0};
|
||||||
struct exynos_drm *drm = NULL;
|
struct exynos_drm *drm = NULL;
|
||||||
struct exynos_fliphandler *fliphandler = NULL;
|
struct exynos_fliphandler *fliphandler = NULL;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
int devidx = exynos_get_device_index();
|
int devidx = exynos_get_device_index();
|
||||||
|
|
||||||
if (pdata)
|
if (pdata)
|
||||||
pdata->fd = -1;
|
pdata->fd = -1;
|
||||||
|
|
||||||
if (devidx != -1)
|
if (devidx != -1)
|
||||||
snprintf(buf, sizeof(buf), "/dev/dri/card%d", devidx);
|
snprintf(buf, sizeof(buf), "/dev/dri/card%d", devidx);
|
||||||
@ -1439,7 +1439,8 @@ static bool exynos_gfx_frame(void *data, const void *frame, unsigned width,
|
|||||||
|
|
||||||
if (settings->fps_show)
|
if (settings->fps_show)
|
||||||
{
|
{
|
||||||
char buffer[128], buffer_fps[128];
|
char buffer[128] = {0};
|
||||||
|
char buffer_fps[128] = {0};
|
||||||
video_monitor_get_fps(buffer, sizeof(buffer),
|
video_monitor_get_fps(buffer, sizeof(buffer),
|
||||||
settings->fps_show ? buffer_fps : NULL, sizeof(buffer_fps));
|
settings->fps_show ? buffer_fps : NULL, sizeof(buffer_fps));
|
||||||
rarch_main_msg_queue_push(buffer_fps, 1, 1, false);
|
rarch_main_msg_queue_push(buffer_fps, 1, 1, false);
|
||||||
|
@ -213,10 +213,10 @@ static bool gl_check_fbo_proc(gl_t *gl)
|
|||||||
static bool gl_shader_init(gl_t *gl)
|
static bool gl_shader_init(gl_t *gl)
|
||||||
{
|
{
|
||||||
enum rarch_shader_type type;
|
enum rarch_shader_type type;
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
const shader_backend_t *backend = NULL;
|
const shader_backend_t *backend = NULL;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
const char *shader_path = (settings->video.shader_enable && *settings->video.shader_path) ?
|
const char *shader_path = (settings->video.shader_enable && *settings->video.shader_path) ?
|
||||||
settings->video.shader_path : NULL;
|
settings->video.shader_path : NULL;
|
||||||
|
|
||||||
|
|
||||||
@ -2142,8 +2142,9 @@ static void DEBUG_CALLBACK_TYPE gl_debug_cb(GLenum source, GLenum type,
|
|||||||
GLuint id, GLenum severity, GLsizei length,
|
GLuint id, GLenum severity, GLsizei length,
|
||||||
const GLchar *message, void *userParam)
|
const GLchar *message, void *userParam)
|
||||||
{
|
{
|
||||||
const char *src, *typestr;
|
const char *src = NULL;
|
||||||
gl_t *gl = (gl_t*)userParam; /* Useful for debugger. */
|
const char **typestr = NULL;
|
||||||
|
gl_t *gl = (gl_t*)userParam; /* Useful for debugger. */
|
||||||
|
|
||||||
(void)gl;
|
(void)gl;
|
||||||
(void)id;
|
(void)id;
|
||||||
|
@ -981,7 +981,7 @@ static void gx_blit_line(unsigned x, unsigned y, const char *message)
|
|||||||
for (unsigned i = 0; i < FONT_WIDTH; i++)
|
for (unsigned i = 0; i < FONT_WIDTH; i++)
|
||||||
{
|
{
|
||||||
GXColor c;
|
GXColor c;
|
||||||
uint8_t rem = 1 << ((i + j * FONT_WIDTH) & 7);
|
uint8_t rem = 1 << ((i + j * FONT_WIDTH) & 7);
|
||||||
unsigned offset = (i + j * FONT_WIDTH) >> 3;
|
unsigned offset = (i + j * FONT_WIDTH) >> 3;
|
||||||
bool col = (bitmap_bin[FONT_OFFSET((unsigned char) *message) + offset] & rem);
|
bool col = (bitmap_bin[FONT_OFFSET((unsigned char) *message) + offset] & rem);
|
||||||
|
|
||||||
@ -1029,11 +1029,12 @@ static bool gx_frame(void *data, const void *frame,
|
|||||||
unsigned width, unsigned height, unsigned pitch,
|
unsigned width, unsigned height, unsigned pitch,
|
||||||
const char *msg)
|
const char *msg)
|
||||||
{
|
{
|
||||||
char fps_txt[128], fps_text_buf[128];
|
char fps_txt[128] = {0};
|
||||||
gx_video_t *gx = (gx_video_t*)data;
|
char fps_text_buf[128] = {0};
|
||||||
|
gx_video_t *gx = (gx_video_t*)data;
|
||||||
struct __gx_regdef *__gx = (struct __gx_regdef*)__gxregs;
|
struct __gx_regdef *__gx = (struct __gx_regdef*)__gxregs;
|
||||||
u8 clear_efb = GX_FALSE;
|
u8 clear_efb = GX_FALSE;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
RARCH_PERFORMANCE_INIT(gx_frame);
|
RARCH_PERFORMANCE_INIT(gx_frame);
|
||||||
RARCH_PERFORMANCE_START(gx_frame);
|
RARCH_PERFORMANCE_START(gx_frame);
|
||||||
@ -1124,9 +1125,12 @@ static bool gx_frame(void *data, const void *frame,
|
|||||||
|
|
||||||
if (settings->fps_show)
|
if (settings->fps_show)
|
||||||
{
|
{
|
||||||
char mem1_txt[128];
|
char mem1_txt[128] = {0};
|
||||||
unsigned x = 15;
|
char mem2_txt[128] = {0};
|
||||||
unsigned y = 35;
|
unsigned x = 15;
|
||||||
|
unsigned y = 35;
|
||||||
|
|
||||||
|
(void)mem2_txt;
|
||||||
|
|
||||||
gx_blit_line(x, y, fps_text_buf);
|
gx_blit_line(x, y, fps_text_buf);
|
||||||
y += FONT_HEIGHT * (gx->double_strike ? 1 : 2);
|
y += FONT_HEIGHT * (gx->double_strike ? 1 : 2);
|
||||||
@ -1135,7 +1139,6 @@ static bool gx_frame(void *data, const void *frame,
|
|||||||
gx_blit_line(x, y, mem1_txt);
|
gx_blit_line(x, y, mem1_txt);
|
||||||
#ifdef HW_RVL
|
#ifdef HW_RVL
|
||||||
y += FONT_HEIGHT * (gx->double_strike ? 1 : 2);
|
y += FONT_HEIGHT * (gx->double_strike ? 1 : 2);
|
||||||
char mem2_txt[128];
|
|
||||||
snprintf(mem2_txt, sizeof(mem2_txt), "MEM2: %8d / %8d",
|
snprintf(mem2_txt, sizeof(mem2_txt), "MEM2: %8d / %8d",
|
||||||
gx_mem2_used(), gx_mem2_total());
|
gx_mem2_used(), gx_mem2_total());
|
||||||
gx_blit_line(x, y, mem2_txt);
|
gx_blit_line(x, y, mem2_txt);
|
||||||
|
@ -85,9 +85,9 @@ typedef struct omapfb_data
|
|||||||
|
|
||||||
static const char *omapfb_get_fb_device(void)
|
static const char *omapfb_get_fb_device(void)
|
||||||
{
|
{
|
||||||
static char fbname[12];
|
static char fbname[12] = {0};
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
const int fbidx = settings->video.monitor_index;
|
const int fbidx = settings->video.monitor_index;
|
||||||
|
|
||||||
if (fbidx == 0)
|
if (fbidx == 0)
|
||||||
return "/dev/fb0";
|
return "/dev/fb0";
|
||||||
@ -173,7 +173,9 @@ static int omapfb_detect_screen(omapfb_data_t *pdata)
|
|||||||
int w, h;
|
int w, h;
|
||||||
FILE *f;
|
FILE *f;
|
||||||
int fb_id, overlay_id = -1, display_id = -1;
|
int fb_id, overlay_id = -1, display_id = -1;
|
||||||
char buff[64], manager_name[64], display_name[64];
|
char buff[64] = {0};
|
||||||
|
char manager_name[64] = {0};
|
||||||
|
char display_name[64] = {0};
|
||||||
|
|
||||||
/* Find out the native screen resolution, which is needed to
|
/* Find out the native screen resolution, which is needed to
|
||||||
* properly center the scaled image data. */
|
* properly center the scaled image data. */
|
||||||
|
@ -466,9 +466,10 @@ error:
|
|||||||
static bool psp_frame(void *data, const void *frame,
|
static bool psp_frame(void *data, const void *frame,
|
||||||
unsigned width, unsigned height, unsigned pitch, const char *msg)
|
unsigned width, unsigned height, unsigned pitch, const char *msg)
|
||||||
{
|
{
|
||||||
static char fps_txt[128], fps_text_buf[128];
|
static char fps_txt[128] = {0};
|
||||||
psp1_video_t *psp = (psp1_video_t*)data;
|
static char fps_text_buf[128] = {0};
|
||||||
settings_t *settings = config_get_ptr();
|
psp1_video_t *psp = (psp1_video_t*)data;
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
#ifdef DISPLAY_FPS
|
#ifdef DISPLAY_FPS
|
||||||
static uint64_t currentTick,lastTick;
|
static uint64_t currentTick,lastTick;
|
||||||
static float fps=0.0;
|
static float fps=0.0;
|
||||||
|
@ -92,7 +92,7 @@ static void sdl2_init_font(sdl2_video_t *vid, const char *font_path,
|
|||||||
{
|
{
|
||||||
int i, r, g, b;
|
int i, r, g, b;
|
||||||
SDL_Color colors[256];
|
SDL_Color colors[256];
|
||||||
SDL_Surface *tmp;
|
SDL_Surface *tmp = NULL;
|
||||||
SDL_Palette *pal = NULL;
|
SDL_Palette *pal = NULL;
|
||||||
const struct font_atlas *atlas = NULL;
|
const struct font_atlas *atlas = NULL;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
@ -479,9 +479,9 @@ static void check_window(sdl2_video_t *vid)
|
|||||||
static bool sdl2_gfx_frame(void *data, const void *frame, unsigned width,
|
static bool sdl2_gfx_frame(void *data, const void *frame, unsigned width,
|
||||||
unsigned height, unsigned pitch, const char *msg)
|
unsigned height, unsigned pitch, const char *msg)
|
||||||
{
|
{
|
||||||
char buf[128];
|
char buf[128] = {0};
|
||||||
sdl2_video_t *vid = (sdl2_video_t*)data;
|
sdl2_video_t *vid = (sdl2_video_t*)data;
|
||||||
driver_t *driver = driver_get_ptr();
|
driver_t *driver = driver_get_ptr();
|
||||||
|
|
||||||
if (vid->should_resize)
|
if (vid->should_resize)
|
||||||
sdl_refresh_viewport(vid);
|
sdl_refresh_viewport(vid);
|
||||||
|
@ -348,7 +348,7 @@ static void sdl_gfx_check_window(sdl_video_t *vid)
|
|||||||
static bool sdl_gfx_frame(void *data, const void *frame, unsigned width,
|
static bool sdl_gfx_frame(void *data, const void *frame, unsigned width,
|
||||||
unsigned height, unsigned pitch, const char *msg)
|
unsigned height, unsigned pitch, const char *msg)
|
||||||
{
|
{
|
||||||
char buf[128];
|
char buf[128] = {0};
|
||||||
sdl_video_t *vid = (sdl_video_t*)data;
|
sdl_video_t *vid = (sdl_video_t*)data;
|
||||||
|
|
||||||
if (!frame)
|
if (!frame)
|
||||||
|
@ -795,7 +795,8 @@ static bool sunxi_gfx_frame(void *data, const void *frame, unsigned width,
|
|||||||
|
|
||||||
if (_dispvars->menu_active)
|
if (_dispvars->menu_active)
|
||||||
{
|
{
|
||||||
char buf[128];
|
char buf[128] = {0};
|
||||||
|
|
||||||
video_monitor_get_fps(buf, sizeof(buf), NULL, 0);
|
video_monitor_get_fps(buf, sizeof(buf), NULL, 0);
|
||||||
ioctl(_dispvars->sunxi_disp->fd_fb, FBIO_WAITFORVSYNC, 0);
|
ioctl(_dispvars->sunxi_disp->fd_fb, FBIO_WAITFORVSYNC, 0);
|
||||||
return true;
|
return true;
|
||||||
|
@ -408,7 +408,8 @@ static void *xv_init(const video_info_t *video,
|
|||||||
const input_driver_t **input, void **input_data)
|
const input_driver_t **input, void **input_data)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
char buf[128], buf_fps[128];
|
char buf[128] = {0};
|
||||||
|
char buf_fps[128] = {0};
|
||||||
struct sigaction sa = {{0}};
|
struct sigaction sa = {{0}};
|
||||||
XSetWindowAttributes attributes = {0};
|
XSetWindowAttributes attributes = {0};
|
||||||
XVisualInfo visualtemplate = {0};
|
XVisualInfo visualtemplate = {0};
|
||||||
@ -764,9 +765,9 @@ static void xv_render_msg(xv_t *xv, const char *msg,
|
|||||||
static bool xv_frame(void *data, const void *frame, unsigned width,
|
static bool xv_frame(void *data, const void *frame, unsigned width,
|
||||||
unsigned height, unsigned pitch, const char *msg)
|
unsigned height, unsigned pitch, const char *msg)
|
||||||
{
|
{
|
||||||
char buf[128];
|
|
||||||
XWindowAttributes target;
|
XWindowAttributes target;
|
||||||
xv_t *xv = (xv_t*)data;
|
char buf[128] = {0};
|
||||||
|
xv_t *xv = (xv_t*)data;
|
||||||
|
|
||||||
if (!frame)
|
if (!frame)
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user