1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-05 09:48:42 +00:00

Backport 'remove cheevos from the build unless HAVE_CHEEVOS=1;'

This commit is contained in:
twinaphex 2015-10-16 18:04:59 +02:00
parent 677d757c18
commit 21f23ea51d
5 changed files with 20 additions and 38 deletions

View File

@ -824,13 +824,8 @@ endif
# Retro Achievements
OBJ += cheevos.o libretro-common/utils/md5.o
ifeq ($(HAVE_CHEEVOS), 1)
ifeq ($(HAVE_SMW_CHEEVOS), 1)
DEFINES += -DHAVE_SMW_CHEEVOS
endif
OBJ += cheevos.o libretro-common/utils/md5.o
DEFINES += -DHAVE_CHEEVOS
endif

View File

@ -155,8 +155,6 @@ cheevos_config_t cheevos_config =
/* game_id */ 0,
};
#ifdef HAVE_CHEEVOS
static cheevoset_t core_cheevos = { NULL, 0 };
static cheevoset_t unofficial_cheevos = { NULL, 0 };
@ -1329,32 +1327,3 @@ int cheevos_get_by_content( const char** json, const void* data, size_t size )
RARCH_LOG( "CHEEVOS game id is %u\n", game_id );
return cheevos_get_by_game_id( json, game_id );
}
#else /* HAVE_CHEEVOS */
int cheevos_load( const char* json )
{
return -1;
}
void cheevos_test(void)
{
}
void cheevos_unload(void)
{
}
int cheevos_get_by_game_id( const char** json, unsigned game_id )
{
*json = "{}";
return -1;
}
int cheevos_get_by_content( const char** json, const void* data, size_t size )
{
*json = "{}";
return -1;
}
#endif /* HAVE_CHEEVOS */

View File

@ -26,6 +26,10 @@
#include "retroarch.h"
#include "dir_list_special.h"
#ifdef HAVE_CHEEVOS
#include "cheevos.h"
#endif
#include "runloop_data.h"
#include "configuration.h"
#include "input/input_remapping.h"
@ -534,6 +538,11 @@ static void event_deinit_core(bool reinit)
global_t *global = global_get_ptr();
settings_t *settings = config_get_ptr();
#ifdef HAVE_CHEEVOS
/* Unload the achievements from memory. */
cheevos_unload();
#endif
core.retro_unload_game();
core.retro_deinit();

View File

@ -463,7 +463,6 @@ static bool load_content(const struct retro_subsystem_info *special,
{
unsigned i;
bool ret = true;
const char* json = NULL;
struct string_list* additional_path_allocs = string_list_new();
struct retro_game_info *info = (struct retro_game_info*)
calloc(content->size, sizeof(*info));
@ -513,14 +512,21 @@ static bool load_content(const struct retro_subsystem_info *special,
ret = core.retro_load_game_special(special->id, info, content->size);
else
{
#ifdef HAVE_CHEEVOS
/* Load the achievements into memory if the game has content. */
if (*content->elems[0].data)
{
const char *json = NULL;
if ( cheevos_get_by_content(&json, info->data, info->size) == 0 )
{
cheevos_load(json);
free((void*)json);
}
}
#endif
ret = core.retro_load_game(*content->elems[0].data ? info : NULL);
}

View File

@ -1028,8 +1028,11 @@ int rarch_main_iterate(unsigned *sleep_ms)
/* Run libretro for one frame. */
core.retro_run();
#ifdef HAVE_CHEEVOS
/* Test the achievements. */
cheevos_test();
#endif
for (i = 0; i < settings->input.max_users; i++)
{