Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for Achievements in RetroPlayer #1

Open
wants to merge 13 commits into
base: rcheevos
Choose a base branch
from
13 changes: 11 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
cmake_minimum_required(VERSION 3.5)
project(game.libretro)

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

find_package(Kodi REQUIRED)
find_package(TinyXML REQUIRED)
find_package(Rcheevos REQUIRED)

include_directories(${KODI_INCLUDE_DIR}
${PROJECT_SOURCE_DIR}/src
${TINYXML_INCLUDE_DIRS})
${TINYXML_INCLUDE_DIRS}
${RCHEEVOS_INCLUDE_DIRS})

list(APPEND DEPLIBS ${TINYXML_LIBRARIES})
list(APPEND DEPLIBS ${RCHEEVOS_LIBRARIES})

if(WIN32)
find_package(dlfcn-win32 REQUIRED)
Expand All @@ -21,6 +24,9 @@ endif()
set(LIBRETRO_SOURCES src/client.cpp
src/audio/AudioStream.cpp
src/audio/SingleFrameAudio.cpp
src/cheevos/Cheevos.cpp
src/cheevos/CheevosEnvironment.cpp
src/cheevos/CheevosFrontendBridge.cpp
src/GameInfoLoader.cpp
src/input/ButtonMapper.cpp
src/input/ControllerLayout.cpp
Expand All @@ -37,6 +43,7 @@ set(LIBRETRO_SOURCES src/client.cpp
src/libretro/LibretroEnvironment.cpp
src/libretro/LibretroResources.cpp
src/libretro/LibretroTranslator.cpp
src/libretro/MemoryMap.cpp
src/log/Log.cpp
src/log/LogAddon.cpp
src/log/LogConsole.cpp
Expand All @@ -53,6 +60,7 @@ set(LIBRETRO_HEADERS src/GameInfoLoader.h
src/audio/AudioStream.h
src/audio/SingleFrameAudio.h
src/input/ButtonMapper.h
src/cheevos/Cheevos.h
src/input/ControllerLayout.h
src/input/ControllerTopology.h
src/input/DefaultControllerDefines.h
Expand All @@ -73,6 +81,7 @@ set(LIBRETRO_HEADERS src/GameInfoLoader.h
src/libretro/libretro.h
src/libretro/LibretroResources.h
src/libretro/LibretroTranslator.h
src/libretro/MemoryMap.h
src/log/ILog.h
src/log/LogAddon.h
src/log/LogConsole.h
Expand Down
29 changes: 29 additions & 0 deletions cmake/FindRcheevos.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# FindRcheevos
# -----------
# Finds the Rcheevos library
#
# This will define the following variables::
#
# RCHEEVOS_FOUND - system has Rcheevos
# RCHEEVOS_INCLUDE_DIRS - the Rcheevos include directory
# RCHEEVOS_LIBRARIES - the Rcheevos libraries
#


find_path(RCHEEVOS_INCLUDE_DIR rcheevos.h
PATH_SUFFIXES rcheevos
PATHS ${PC_RCHEEVOS_INCLUDEDIR})

find_library(RCHEEVOS_LIBRARY NAMES rcheevoslib
PATH_SUFFIXES rcheevos
PATHS ${PC_RCHEEVOS_LIBDIR})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Rcheevos REQUIRED_VARS RCHEEVOS_LIBRARY RCHEEVOS_INCLUDE_DIR)

if(RCHEEVOS_FOUND)
set(RCHEEVOS_INCLUDE_DIRS ${RCHEEVOS_INCLUDE_DIR})
set(RCHEEVOS_LIBRARIES ${RCHEEVOS_LIBRARY})
endif()

mark_as_advanced(RCHEEVOS_LIBRARY RCHEEVOS_INCLUDE_DIR)
File renamed without changes.
64 changes: 64 additions & 0 deletions depends/common/rcheevos/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
project(rcheevos)

cmake_minimum_required(VERSION 3.0)

# Disable Lua for now
add_definitions(-DRC_DISABLE_LUA)

include_directories(
include
)

add_library(${PROJECT_NAME}lib
src/rcheevos/alloc.c
src/rcheevos/compat.c
src/rcheevos/condition.c
src/rcheevos/condset.c
src/rcheevos/consoleinfo.c
src/rcheevos/format.c
src/rcheevos/lboard.c
src/rcheevos/memref.c
src/rcheevos/operand.c
src/rcheevos/richpresence.c
src/rcheevos/runtime.c
src/rcheevos/runtime_progress.c
src/rcheevos/trigger.c
src/rcheevos/value.c
src/rhash/cdreader.c
src/rhash/hash.c
src/rhash/md5.c
src/rurl/url.c
)

#add_dependencies(rcheevos
# lua # TODO
#)

#target_link_libraries(rcheevos
# lua
#)

install(TARGETS
${PROJECT_NAME}lib
ARCHIVE DESTINATION
lib
DESTINATION
lib
)

install(
FILES
include/rcheevos.h
include/rconsoles.h
include/rhash.h
include/rurl.h
DESTINATION
include/${PROJECT_NAME}
)

#install(
# DIRECTORY
# include
# DESTINATION
# include
#)
1 change: 1 addition & 0 deletions depends/common/rcheevos/rcheevos.sha256
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
c8ed6ca74f905ea0c256250e46cced579922880001337e7c3d3d68179ad89d4e
1 change: 1 addition & 0 deletions depends/common/rcheevos/rcheevos.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rcheevos https://github.com/RetroAchievements/rcheevos/archive/v9.2.0.tar.gz
Loading