mirror of
https://github.com/libretro/RetroArch
synced 2025-02-10 12:40:03 +00:00
Move title_buf to rarch_system_info_t
This commit is contained in:
parent
b9479576e8
commit
b400597a4c
@ -1133,7 +1133,7 @@ bool video_monitor_get_fps(char *buf, size_t size,
|
||||
static retro_time_t curr_time;
|
||||
static retro_time_t fps_time;
|
||||
uint64_t frame_count = video_driver_get_frame_count();
|
||||
global_t *global = global_get_ptr();
|
||||
rarch_system_info_t *system = rarch_system_info_get_ptr();
|
||||
|
||||
*buf = '\0';
|
||||
|
||||
@ -1154,7 +1154,7 @@ bool video_monitor_get_fps(char *buf, size_t size,
|
||||
curr_time = new_time;
|
||||
|
||||
snprintf(buf, size, "%s || FPS: %6.1f || Frames: " U64_SIGN,
|
||||
global->title_buf, last_fps, (unsigned long long)frame_count);
|
||||
system->title_buf, last_fps, (unsigned long long)frame_count);
|
||||
ret = true;
|
||||
}
|
||||
|
||||
@ -1166,7 +1166,7 @@ bool video_monitor_get_fps(char *buf, size_t size,
|
||||
}
|
||||
|
||||
curr_time = fps_time = new_time;
|
||||
strlcpy(buf, global->title_buf, size);
|
||||
strlcpy(buf, system->title_buf, size);
|
||||
if (buf_fps)
|
||||
strlcpy(buf_fps, "N/A", size_fps);
|
||||
|
||||
|
34
retroarch.c
34
retroarch.c
@ -1087,38 +1087,6 @@ void rarch_main_free(void)
|
||||
config_free();
|
||||
}
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
#define DEFAULT_EXT "zip"
|
||||
#else
|
||||
#define DEFAULT_EXT ""
|
||||
#endif
|
||||
|
||||
|
||||
static void init_system_info(void)
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
rarch_system_info_t *system = rarch_system_info_get_ptr();
|
||||
|
||||
pretro_get_system_info(&system->info);
|
||||
|
||||
if (!system->info.library_name)
|
||||
system->info.library_name = "Unknown";
|
||||
if (!system->info.library_version)
|
||||
system->info.library_version = "v0";
|
||||
|
||||
#ifndef RARCH_CONSOLE
|
||||
snprintf(global->title_buf, sizeof(global->title_buf),
|
||||
RETRO_FRONTEND " : ");
|
||||
#endif
|
||||
strlcat(global->title_buf, system->info.library_name, sizeof(global->title_buf));
|
||||
strlcat(global->title_buf, " ", sizeof(global->title_buf));
|
||||
strlcat(global->title_buf, system->info.library_version, sizeof(global->title_buf));
|
||||
strlcpy(system->valid_extensions, system->info.valid_extensions ?
|
||||
system->info.valid_extensions : DEFAULT_EXT,
|
||||
sizeof(system->valid_extensions));
|
||||
system->block_extract = system->info.block_extract;
|
||||
}
|
||||
|
||||
/*
|
||||
* rarch_verify_api_version:
|
||||
*
|
||||
@ -1249,7 +1217,7 @@ int rarch_main_init(int argc, char *argv[])
|
||||
#endif
|
||||
|
||||
init_libretro_sym(global->core_type);
|
||||
init_system_info();
|
||||
rarch_system_info_init();
|
||||
|
||||
init_drivers_pre();
|
||||
|
||||
|
@ -224,8 +224,6 @@ typedef struct global
|
||||
bool use_output_dir;
|
||||
} record;
|
||||
|
||||
char title_buf[64];
|
||||
|
||||
struct
|
||||
{
|
||||
struct string_list *list;
|
||||
|
34
system.c
34
system.c
@ -13,7 +13,17 @@
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <compat/strl.h>
|
||||
|
||||
#include "system.h"
|
||||
#include "dynamic.h"
|
||||
#include "intl/intl.h"
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
#define DEFAULT_EXT "zip"
|
||||
#else
|
||||
#define DEFAULT_EXT ""
|
||||
#endif
|
||||
|
||||
static rarch_system_info_t *g_system;
|
||||
|
||||
@ -51,3 +61,27 @@ void rarch_system_info_free(void)
|
||||
free(g_system);
|
||||
g_system = NULL;
|
||||
}
|
||||
|
||||
void rarch_system_info_init(void)
|
||||
{
|
||||
rarch_system_info_t *system = rarch_system_info_get_ptr();
|
||||
|
||||
pretro_get_system_info(&system->info);
|
||||
|
||||
if (!system->info.library_name)
|
||||
system->info.library_name = "Unknown";
|
||||
if (!system->info.library_version)
|
||||
system->info.library_version = "v0";
|
||||
|
||||
#ifndef RARCH_CONSOLE
|
||||
snprintf(system->title_buf, sizeof(system->title_buf),
|
||||
RETRO_FRONTEND " : ");
|
||||
#endif
|
||||
strlcat(system->title_buf, system->info.library_name, sizeof(system->title_buf));
|
||||
strlcat(system->title_buf, " ", sizeof(system->title_buf));
|
||||
strlcat(system->title_buf, system->info.library_version, sizeof(system->title_buf));
|
||||
strlcpy(system->valid_extensions, system->info.valid_extensions ?
|
||||
system->info.valid_extensions : DEFAULT_EXT,
|
||||
sizeof(system->valid_extensions));
|
||||
system->block_extract = system->info.block_extract;
|
||||
}
|
||||
|
4
system.h
4
system.h
@ -26,6 +26,8 @@ extern "C" {
|
||||
|
||||
typedef struct rarch_system_info
|
||||
{
|
||||
char title_buf[64];
|
||||
|
||||
struct retro_system_info info;
|
||||
|
||||
unsigned rotation;
|
||||
@ -61,6 +63,8 @@ rarch_system_info_t *rarch_system_info_get_ptr(void);
|
||||
|
||||
void rarch_system_info_free(void);
|
||||
|
||||
void rarch_system_info_init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user