Merge pull request #5503 from leiradel/master

Remove threads as a prerequisite for cheevos
This commit is contained in:
Twinaphex 2017-10-03 22:24:33 +02:00 committed by GitHub
commit 796746525d
4 changed files with 11 additions and 19 deletions

View File

@ -1472,14 +1472,12 @@ ifeq ($(HAVE_NETWORKING), 1)
network/netplay/netplay_buf.o \
network/netplay/netplay_room_parse.o
# Retro Achievements (also depends on threads)
# Retro Achievements
ifeq ($(HAVE_CHEEVOS), 1)
ifeq ($(HAVE_THREADS), 1)
DEFINES += -DHAVE_CHEEVOS
OBJ += cheevos/cheevos.o \
$(LIBRETRO_COMM_DIR)/utils/md5.o
endif
DEFINES += -DHAVE_CHEEVOS
OBJ += cheevos/cheevos.o \
$(LIBRETRO_COMM_DIR)/utils/md5.o
endif
ifeq ($(HAVE_KEYMAPPER), 1)

View File

@ -1883,10 +1883,8 @@ static int cheevos_test_condition(cheevos_cond_t *cond)
case CHEEVOS_COND_OP_NOT_EQUAL_TO:
return sval != tval;
default:
break;
return 1;
}
return 0;
}
static int cheevos_test_cond_set(const cheevos_condset_t *condset,
@ -1925,20 +1923,20 @@ static int cheevos_test_cond_set(const cheevos_condset_t *condset,
/* Read all standard conditions, and process as normal: */
for (cond = condset->conds; cond < end; cond++)
{
if (cond->type != CHEEVOS_COND_TYPE_STANDARD)
if (cond->type == CHEEVOS_COND_TYPE_PAUSE_IF || cond->type == CHEEVOS_COND_TYPE_RESET_IF)
continue;
if (cond->type == CHEEVOS_COND_TYPE_ADD_SOURCE)
{
cheevos_locals.add_buffer += cheevos_get_var_value(&cond->source);
set_valid = 1;
set_valid &= 1;
continue;
}
if (cond->type == CHEEVOS_COND_TYPE_SUB_SOURCE)
{
cheevos_locals.add_buffer -= cheevos_get_var_value(&cond->source);
set_valid = 1;
set_valid &= 1;
continue;
}
@ -1954,7 +1952,7 @@ static int cheevos_test_cond_set(const cheevos_condset_t *condset,
continue;
}
if (cond->req_hits != 0 && cond->curr_hits >= cond->req_hits)
if (cond->req_hits != 0 && (cond->curr_hits + cheevos_locals.add_hits) >= cond->req_hits)
continue;
cond_valid = cheevos_test_condition(cond);
@ -2417,6 +2415,7 @@ static int cheevos_deactivate__json_number(void *userdata,
if (cheevo->id == (unsigned)id)
{
cheevo->active &= ~ud->mode;
found = 1;
break;
}
}

View File

@ -143,7 +143,7 @@ CONFIG FILE
/*============================================================
ACHIEVEMENTS
============================================================ */
#if defined(HAVE_CHEEVOS) && defined(HAVE_THREADS)
#if defined(HAVE_CHEEVOS)
#if !defined(HAVE_NETWORKING)
#include "../libretro-common/net/net_http.c"
#endif

View File

@ -497,11 +497,6 @@ if [ "$HAVE_ZLIB" = 'no' ] && [ "HAVE_RPNG" != 'no' ]; then
echo "Notice: zlib is not available, RPNG will also be disabled."
fi
if [ "$HAVE_THREADS" = 'no' ] && [ "HAVE_CHEEVOS" != 'no' ]; then
HAVE_CHEEVOS=no
echo "Notice: Threads are not available, Cheevos will also be disabled."
fi
if [ "$HAVE_THREADS" = 'no' ] && [ "HAVE_LIBUSB" != 'no' ]; then
HAVE_LIBUSB=no
echo "Notice: Threads are not available, libusb will also be disabled."