Compare commits
No commits in common. "eb6ca7b6658df0ff46a5386b663f88e1855a95d5" and "841af0566fd792060a923421eaa1bc934ab8a2ae" have entirely different histories.
eb6ca7b665
...
841af0566f
|
@ -11,13 +11,22 @@ static:linux:deps:
|
|||
|
||||
script:
|
||||
- apt update && apt -y install libgl1-mesa-dev libgl1-mesa-dev:i386
|
||||
- dependencies=("glew" "protobuf[zlib]" "curl[core,openssl]" "nlohmann-json" "nlohmann-fifo-map" "stb")
|
||||
- cp -f vcpkg_triplets/*.cmake /vcpkg/triplets/
|
||||
- VCPKG_PATH=$(pwd)/vcpkg
|
||||
- TRIPLET=x86-linux-goldberg
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install --triplet=${TRIPLET} "${dependencies[@]}" || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install protobuf[zlib]:${TRIPLET} || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install curl[core,openssl]:${TRIPLET} || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install stb:${TRIPLET} || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install glew:${TRIPLET} || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install nlohmann-json:${TRIPLET} || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install nlohmann-fifo-map:${TRIPLET} || exit 1
|
||||
- TRIPLET=x64-linux-goldberg
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install --triplet=${TRIPLET} "${dependencies[@]}" || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install protobuf[zlib]:${TRIPLET} || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install curl[core,openssl]:${TRIPLET} || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install stb:${TRIPLET} || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install glew:${TRIPLET} || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install nlohmann-json:${TRIPLET} || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install nlohmann-fifo-map:${TRIPLET} || exit 1
|
||||
- exit 0
|
||||
|
||||
cache:
|
||||
|
@ -35,15 +44,24 @@ static:windows:deps:
|
|||
#when: manual
|
||||
|
||||
script:
|
||||
- dependencies=("glew" "protobuf[zlib]" "curl[core,winssl]" "nlohmann-json" "nlohmann-fifo-map" "stb")
|
||||
- cp -f vcpkg_triplets/*.cmake /vcpkg/triplets/
|
||||
- VCPKG_PATH=$(pwd)/vcpkg
|
||||
- cp -f vcpkg_triplets/*.cmake /vcpkg/triplets/
|
||||
- TRIPLET=x64-linux
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install protobuf:${TRIPLET} || exit 1
|
||||
- TRIPLET=x86-windows-goldberg
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install --triplet=${TRIPLET} "${dependencies[@]}" || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install protobuf[zlib]:${TRIPLET} || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install curl[core,winssl]:${TRIPLET} || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install stb:${TRIPLET} || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install glew:${TRIPLET} || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install nlohmann-json:${TRIPLET} || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install nlohmann-fifo-map:${TRIPLET} || exit 1
|
||||
- TRIPLET=x64-windows-goldberg
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install --triplet=${TRIPLET} "${dependencies[@]}" || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install protobuf[zlib]:${TRIPLET} || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install curl[core,winssl]:${TRIPLET} || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install stb:${TRIPLET} || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install glew:${TRIPLET} || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install nlohmann-json:${TRIPLET} || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install nlohmann-fifo-map:${TRIPLET} || exit 1
|
||||
- exit 0
|
||||
|
||||
cache:
|
||||
|
@ -61,15 +79,22 @@ static:macosx:deps:
|
|||
#when: manual
|
||||
|
||||
script:
|
||||
- dependencies=("protobuf[zlib]" "curl[core,openssl]" "nlohmann-json" "nlohmann-fifo-map" "stb")
|
||||
- cp -f vcpkg_triplets/*.cmake /vcpkg/triplets/
|
||||
- VCPKG_PATH=$(pwd)/vcpkg
|
||||
- cp -f vcpkg_triplets/*.cmake /vcpkg/triplets/
|
||||
- TRIPLET=x64-linux
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install protobuf:${TRIPLET} || exit 1
|
||||
- TRIPLET=x86-macosx-goldberg
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install --triplet=${TRIPLET} "${dependencies[@]}" || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install protobuf[zlib]:${TRIPLET} || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install curl[core,openssl]:${TRIPLET} || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install stb:${TRIPLET} || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install nlohmann-json:${TRIPLET} || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install nlohmann-fifo-map:${TRIPLET} || exit 1
|
||||
- TRIPLET=x64-macosx-goldberg
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install --triplet=${TRIPLET} "${dependencies[@]}" || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install protobuf[zlib]:${TRIPLET} || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install curl[core,openssl]:${TRIPLET} || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install stb:${TRIPLET} || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install nlohmann-json:${TRIPLET} || exit 1
|
||||
- vcpkg "--x-install-root=${VCPKG_PATH}" install nlohmann-fifo-map:${TRIPLET} || exit 1
|
||||
- exit 0
|
||||
|
||||
cache:
|
||||
|
@ -181,7 +206,6 @@ build:macosx:
|
|||
protobuf_static_steamos:
|
||||
stage: dependencies
|
||||
image: tianon/steamos
|
||||
when: manual
|
||||
|
||||
script:
|
||||
# don't rebuild every time
|
||||
|
@ -275,19 +299,21 @@ build_windows:
|
|||
|
||||
deploy_all:
|
||||
stage: deploy
|
||||
image: alpine
|
||||
image: fedora
|
||||
dependencies:
|
||||
- build:windows
|
||||
- build:linux
|
||||
- build:macosx
|
||||
- build_windows
|
||||
- build_steamos
|
||||
|
||||
script:
|
||||
- apk --no-cache add git tree
|
||||
- ls -lah
|
||||
- dnf -y install git tree
|
||||
- mkdir -p release/source_code
|
||||
- git bundle create release/source_code/source_code.bundle --all
|
||||
- "echo \"This is a git bundle of the full repo, to use: git clone source_code.bundle --branch master\" > release/source_code/Readme.txt"
|
||||
- find . -mindepth 1 -maxdepth 1 ! -name release -exec rm -rf '{}' \;
|
||||
- mv linux release/
|
||||
- shopt -s extglob
|
||||
- rm -rf .g*
|
||||
- rm -rf !(release)
|
||||
- mv release/* ./
|
||||
- rm -rf release
|
||||
- echo $CI_JOB_ID > job_id
|
||||
|
@ -313,4 +339,4 @@ pages:
|
|||
paths:
|
||||
- public/
|
||||
only:
|
||||
- master
|
||||
- master
|
||||
|
|
230
CMakeLists.txt
230
CMakeLists.txt
|
@ -1,6 +1,8 @@
|
|||
# Based on: https://github.com/ttroy50/cmake-examples/blob/master/03-code-generation/protobuf/CMakeLists.txt
|
||||
cmake_minimum_required(VERSION 3.6)
|
||||
|
||||
# Set the project name
|
||||
project(goldberg_emulator)
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
# Workaround because cross-compiling with CMake + vcpkg fucks up this variable
|
||||
# making the 'find_*' functions/macros somehow fail to find the right arch.
|
||||
|
@ -39,7 +41,7 @@ if(WIN32) # Setup some variables for Windows build
|
|||
|
||||
if(X64)
|
||||
set(LIB_STEAM_API steam_api64)
|
||||
set(LIB_STEAMCLIENT steamclient64)
|
||||
set(LIB_STEAMCLIENT steamclient64)
|
||||
set(OUT_DIR win64)
|
||||
elseif(X86)
|
||||
set(LIB_STEAM_API steam_api)
|
||||
|
@ -49,21 +51,19 @@ if(WIN32) # Setup some variables for Windows build
|
|||
message(FATAL_ERROR "Arch unknown")
|
||||
endif()
|
||||
|
||||
|
||||
file(
|
||||
GLOB
|
||||
overlay_sources
|
||||
overlay_experimental/*.cpp
|
||||
OVERLAY_EXPERIMENTAL_SRC_SHARED
|
||||
overlay_experimental/*.cpp
|
||||
overlay_experimental/windows/*.cpp
|
||||
ImGui/*.cpp
|
||||
ImGui/*.cpp
|
||||
ImGui/impls/*.cpp
|
||||
ImGui/impls/windows/*.cpp
|
||||
)
|
||||
|
||||
set(overlay_includes
|
||||
overlay_experimental/
|
||||
overlay_experimental/windows/
|
||||
ImGui/
|
||||
overlay/
|
||||
overlay/windows/
|
||||
)
|
||||
|
||||
elseif(APPLE)
|
||||
|
@ -86,22 +86,19 @@ elseif(APPLE)
|
|||
else()
|
||||
message(FATAL_ERROR "Arch unknown")
|
||||
endif()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
||||
|
||||
set(LIB_STEAM_API steam_api)
|
||||
set(LIB_STEAMCLIENT steamclient)
|
||||
|
||||
file(
|
||||
GLOB
|
||||
overlay_sources
|
||||
overlay_experimental/Renderer_Detector.cpp
|
||||
overlay_experimental/macosx/*.cpp
|
||||
OVERLAY_EXPERIMENTAL_SRC_SHARED
|
||||
overlay/*.cpp
|
||||
)
|
||||
|
||||
set(overlay_includes
|
||||
overlay_experimental/
|
||||
overlay_experimental/macosx/
|
||||
ImGui/
|
||||
overlay/
|
||||
)
|
||||
|
||||
elseif(UNIX)
|
||||
|
@ -129,18 +126,17 @@ elseif(UNIX)
|
|||
|
||||
file(
|
||||
GLOB
|
||||
overlay_sources
|
||||
overlay_experimental/*.cpp
|
||||
overlay_experimental/linux/*.cpp
|
||||
ImGui/*.cpp
|
||||
OVERLAY_EXPERIMENTAL_SRC_SHARED
|
||||
overlay_experimental/*.cpp
|
||||
overlay_experimental/linux/*.cpp
|
||||
ImGui/*.cpp
|
||||
ImGui/impls/*.cpp
|
||||
ImGui/impls/linux/*.cpp
|
||||
)
|
||||
|
||||
set(overlay_includes
|
||||
overlay_experimental/
|
||||
overlay_experimental/linux/
|
||||
ImGui/
|
||||
overlay/
|
||||
overlay/linux/
|
||||
)
|
||||
|
||||
else()
|
||||
|
@ -156,6 +152,7 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
|
||||
# Add option to enable experimental build
|
||||
option(EMU_EXPERIMENTAL_BUILD "Enable experimental build" OFF)
|
||||
if(EMU_EXPERIMENTAL_BUILD)
|
||||
if(APPLE)
|
||||
|
@ -167,9 +164,6 @@ else()
|
|||
set(EMU_OVERLAY OFF)
|
||||
endif()
|
||||
|
||||
|
||||
#set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Debug or Release")
|
||||
|
||||
set(Protobuf_USE_STATIC_LIBS ON)
|
||||
include(FindProtobuf)
|
||||
find_package(Threads REQUIRED)
|
||||
|
@ -180,46 +174,42 @@ find_package(nlohmann-fifo-map CONFIG REQUIRED)
|
|||
find_path(STB_INCLUDE_DIRS "stb.h")
|
||||
|
||||
if(NOT WIN32)
|
||||
find_package(OpenSSL REQUIRED)
|
||||
find_package(OpenSSL REQUIRED)
|
||||
endif()
|
||||
|
||||
if(NOT APPLE AND EMU_OVERLAY)
|
||||
find_package(GLEW REQUIRED)
|
||||
if(NOT APPLE)
|
||||
find_package(GLEW REQUIRED)
|
||||
endif()
|
||||
|
||||
########################################
|
||||
## net.h net.cc
|
||||
file(
|
||||
GLOB
|
||||
protobuf_sources
|
||||
dll/*.proto
|
||||
)
|
||||
protobuf_generate_cpp(net_PROTO_SRCS net_PROTO_HDRS ${protobuf_sources})
|
||||
# Generate the .h and .cxx files for dll/net.proto
|
||||
protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS dll/net.proto)
|
||||
|
||||
########################################
|
||||
## steamclient[64].dll
|
||||
file(
|
||||
GLOB
|
||||
emu_sources
|
||||
dll/*.cpp
|
||||
# Print path to generated files
|
||||
message(STATUS "PROTO_SRCS = ${PROTO_SRCS}")
|
||||
message(STATUS "PROTO_HDRS = ${PROTO_HDRS}")
|
||||
|
||||
# Gather the files that are shared between multiple targets
|
||||
file(GLOB DLL_SRC_SHARED
|
||||
dll/*.h
|
||||
dll/*.cpp
|
||||
)
|
||||
|
||||
file(GLOB detour_sources
|
||||
detours/*.cpp
|
||||
file(GLOB DETOURS_SRC_SHARED
|
||||
detours/*.cpp
|
||||
)
|
||||
|
||||
###################################################
|
||||
# Setup for the steam_api
|
||||
# Setup for the steam_api(64).dll / libsteam_api.so
|
||||
###################################################
|
||||
|
||||
# Setup the target
|
||||
add_library(${LIB_STEAM_API}
|
||||
SHARED
|
||||
$<$<BOOL:${EMU_EXPERIMENTAL_BUILD}>:${detour_sources}>
|
||||
$<$<AND:$<BOOL:${EMU_EXPERIMENTAL_BUILD}>,$<BOOL:${EMU_OVERLAY}>>:${overlay_sources}>
|
||||
${emu_sources}
|
||||
${net_PROTO_SRCS}
|
||||
${net_PROTO_HDRS}
|
||||
$<$<BOOL:${EMU_EXPERIMENTAL_BUILD}>:${DETOURS_SRC_SHARED}>
|
||||
$<$<AND:$<BOOL:${EMU_EXPERIMENTAL_BUILD}>,$<BOOL:${EMU_OVERLAY}>>:${OVERLAY_EXPERIMENTAL_SRC_SHARED}>
|
||||
${DLL_SRC_SHARED}
|
||||
${PROTO_SRCS}
|
||||
${PROTO_HDRS}
|
||||
)
|
||||
|
||||
# Include the required directories
|
||||
|
@ -228,8 +218,8 @@ target_include_directories(
|
|||
PRIVATE
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${STB_INCLUDE_DIRS}
|
||||
|
||||
${overlay_includes}
|
||||
|
||||
overlay_experimental
|
||||
)
|
||||
|
||||
# Link the required libraries
|
||||
|
@ -237,12 +227,11 @@ target_link_libraries(${LIB_STEAM_API}
|
|||
PRIVATE
|
||||
Threads::Threads
|
||||
protobuf::libprotobuf-lite
|
||||
nlohmann_json::nlohmann_json
|
||||
nlohmann-fifo-map::nlohmann-fifo-map
|
||||
|
||||
|
||||
$<$<AND:$<NOT:$<BOOL:${APPLE}>>,$<BOOL:${EMU_OVERLAY}>>:GLEW::GLEW>
|
||||
|
||||
#nlohmann_json::nlohmann_json doesn't work
|
||||
nlohmann-fifo-map::nlohmann-fifo-map
|
||||
|
||||
$<$<NOT:$<BOOL:${APPLE}>>:GLEW::GLEW>
|
||||
|
||||
$<$<BOOL:${WIN32}>:comdlg32>
|
||||
$<$<BOOL:${WIN32}>:advapi32>
|
||||
$<$<BOOL:${WIN32}>:shell32>
|
||||
|
@ -251,11 +240,11 @@ target_link_libraries(${LIB_STEAM_API}
|
|||
$<$<BOOL:${WIN32}>:iphlpapi>
|
||||
$<$<AND:$<BOOL:${WIN32}>,$<BOOL:${EMU_EXPERIMENTAL_BUILD}>,$<BOOL:${EMU_OVERLAY}>>:opengl32.lib>
|
||||
$<$<AND:$<BOOL:${WIN32}>,$<BOOL:${EMU_EXPERIMENTAL_BUILD}>,$<BOOL:${EMU_OVERLAY}>>:winmm.lib>
|
||||
|
||||
|
||||
# For library UNIX loading
|
||||
$<$<NOT:$<BOOL:${WIN32}>>:dl>
|
||||
# For overlay opengl
|
||||
$<$<AND:$<BOOL:${UNIX}>,$<NOT:$<BOOL:${APPLE}>>,$<BOOL:${EMU_OVERLAY}>>:GL>
|
||||
$<$<AND:$<BOOL:${UNIX}>,$<NOT:$<BOOL:${APPLE}>>>:GL>
|
||||
)
|
||||
|
||||
# Add target compile definitions
|
||||
|
@ -263,7 +252,7 @@ target_compile_definitions(${LIB_STEAM_API}
|
|||
PRIVATE
|
||||
GLEW_NO_GLU
|
||||
STBI_NO_SIMD
|
||||
|
||||
|
||||
$<$<CONFIG:>:EMU_RELEASE_BUILD>
|
||||
$<$<CONFIG:Release>:EMU_RELEASE_BUILD>
|
||||
$<$<CONFIG:RelWithDebInfo>:EMU_RELEASE_BUILD>
|
||||
|
@ -273,17 +262,17 @@ target_compile_definitions(${LIB_STEAM_API}
|
|||
)
|
||||
|
||||
########################################################
|
||||
# Setup for the steamclient
|
||||
# Setup for the steamclient(64).dll / libsteamclient.so?
|
||||
########################################################
|
||||
|
||||
# Setup the target
|
||||
add_library(${LIB_STEAMCLIENT}
|
||||
SHARED
|
||||
$<$<BOOL:${EMU_EXPERIMENTAL_BUILD}>:${detour_sources}>
|
||||
$<$<AND:$<BOOL:${EMU_EXPERIMENTAL_BUILD}>,$<BOOL:${EMU_OVERLAY}>>:${overlay_sources}>
|
||||
${emu_sources}
|
||||
${net_PROTO_SRCS}
|
||||
${net_PROTO_HDRS}
|
||||
$<$<BOOL:${EMU_EXPERIMENTAL_BUILD}>:${DETOURS_SRC_SHARED}>
|
||||
$<$<AND:$<BOOL:${EMU_EXPERIMENTAL_BUILD}>,$<BOOL:${EMU_OVERLAY}>>:${OVERLAY_EXPERIMENTAL_SRC_SHARED}>
|
||||
${DLL_SRC_SHARED}
|
||||
${PROTO_SRCS}
|
||||
${PROTO_HDRS}
|
||||
)
|
||||
|
||||
if(UNIX)
|
||||
|
@ -296,8 +285,8 @@ target_include_directories(
|
|||
PRIVATE
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${STB_INCLUDE_DIRS}
|
||||
|
||||
${overlay_includes}
|
||||
|
||||
overlay_experimental
|
||||
)
|
||||
|
||||
# Link the required libraries
|
||||
|
@ -305,11 +294,11 @@ target_link_libraries(${LIB_STEAMCLIENT}
|
|||
PRIVATE
|
||||
Threads::Threads
|
||||
protobuf::libprotobuf-lite
|
||||
nlohmann_json::nlohmann_json
|
||||
nlohmann-fifo-map::nlohmann-fifo-map
|
||||
|
||||
$<$<AND:$<NOT:$<BOOL:${APPLE}>>,$<BOOL:${EMU_OVERLAY}>>:GLEW::GLEW>
|
||||
|
||||
#nlohmann_json::nlohmann_json doesn't work
|
||||
nlohmann-fifo-map::nlohmann-fifo-map
|
||||
|
||||
$<$<NOT:$<BOOL:${APPLE}>>:GLEW::GLEW>
|
||||
|
||||
$<$<BOOL:${WIN32}>:comdlg32>
|
||||
$<$<BOOL:${WIN32}>:advapi32>
|
||||
$<$<BOOL:${WIN32}>:shell32>
|
||||
|
@ -318,11 +307,11 @@ target_link_libraries(${LIB_STEAMCLIENT}
|
|||
$<$<BOOL:${WIN32}>:iphlpapi>
|
||||
$<$<AND:$<BOOL:${WIN32}>,$<BOOL:${EMU_EXPERIMENTAL_BUILD}>,$<BOOL:${EMU_OVERLAY}>>:opengl32.lib>
|
||||
$<$<AND:$<BOOL:${WIN32}>,$<BOOL:${EMU_EXPERIMENTAL_BUILD}>,$<BOOL:${EMU_OVERLAY}>>:winmm.lib>
|
||||
|
||||
|
||||
# For library UNIX loading
|
||||
$<$<NOT:$<BOOL:${WIN32}>>:dl>
|
||||
# For overlay opengl
|
||||
$<$<AND:$<BOOL:${UNIX}>,$<NOT:$<BOOL:${APPLE}>>,$<BOOL:${EMU_OVERLAY}>>:GL>
|
||||
$<$<AND:$<BOOL:${UNIX}>,$<NOT:$<BOOL:${APPLE}>>>:GL>
|
||||
)
|
||||
|
||||
# Add target compile definitions
|
||||
|
@ -331,7 +320,7 @@ target_compile_definitions(${LIB_STEAMCLIENT}
|
|||
GLEW_NO_GLU
|
||||
STBI_NO_SIMD
|
||||
STEAMCLIENT_DLL
|
||||
|
||||
|
||||
$<$<CONFIG:>:EMU_RELEASE_BUILD>
|
||||
$<$<CONFIG:Release>:EMU_RELEASE_BUILD>
|
||||
$<$<CONFIG:RelWithDebInfo>:EMU_RELEASE_BUILD>
|
||||
|
@ -340,24 +329,44 @@ target_compile_definitions(${LIB_STEAMCLIENT}
|
|||
$<$<BOOL:${EMU_OVERLAY}>:EMU_OVERLAY>
|
||||
)
|
||||
|
||||
##############################################################################
|
||||
# Setup for the steamnetworkingsockets(64).dll / libsteamnetworkingsockets.so?
|
||||
##############################################################################
|
||||
|
||||
# Setup the target
|
||||
add_library(steamnetworkingsockets
|
||||
SHARED
|
||||
steamnetworkingsockets.cpp
|
||||
)
|
||||
|
||||
# Add target compile definitions
|
||||
target_compile_definitions(steamnetworkingsockets
|
||||
PRIVATE
|
||||
$<$<CONFIG:>:EMU_RELEASE_BUILD>
|
||||
$<$<CONFIG:Release>:EMU_RELEASE_BUILD>
|
||||
$<$<CONFIG:RelWithDebInfo>:EMU_RELEASE_BUILD>
|
||||
$<$<CONFIG:MinSizeRel>:EMU_RELEASE_BUILD>
|
||||
$<$<BOOL:${EMU_EXPERIMENTAL_BUILD}>:EMU_EXPERIMENTAL_BUILD>
|
||||
)
|
||||
|
||||
set_target_properties(steamnetworkingsockets PROPERTIES EXCLUDE_FROM_ALL 1 EXCLUDE_FROM_DEFAULT_BUILD 1)
|
||||
|
||||
###########################################################################
|
||||
# Setup for the lobby_connect
|
||||
# Setup for the lobby_connect(64).exe / lobby_connect
|
||||
###########################################################################
|
||||
|
||||
# Setup the target
|
||||
add_executable(lobby_connect
|
||||
lobby_connect.cpp
|
||||
${emu_sources}
|
||||
${net_PROTO_SRCS}
|
||||
${net_PROTO_HDRS}
|
||||
$<$<BOOL:${EMU_EXPERIMENTAL_BUILD}>:${DETOURS_SRC_SHARED}>
|
||||
${DLL_SRC_SHARED}
|
||||
${PROTO_SRCS}
|
||||
${PROTO_HDRS}
|
||||
)
|
||||
|
||||
# Include the required directories
|
||||
target_include_directories(
|
||||
lobby_connect
|
||||
target_include_directories(lobby_connect
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${STB_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
# Link the required libraries
|
||||
|
@ -365,18 +374,20 @@ target_link_libraries(lobby_connect
|
|||
PRIVATE
|
||||
Threads::Threads
|
||||
protobuf::libprotobuf-lite
|
||||
nlohmann_json::nlohmann_json
|
||||
nlohmann-fifo-map::nlohmann-fifo-map
|
||||
|
||||
#nlohmann_json::nlohmann_json doesn't work
|
||||
nlohmann-fifo-map::nlohmann-fifo-map
|
||||
|
||||
$<$<BOOL:${WIN32}>:comdlg32>
|
||||
$<$<BOOL:${WIN32}>:advapi32>
|
||||
$<$<BOOL:${WIN32}>:shell32>
|
||||
$<$<BOOL:${WIN32}>:user32>
|
||||
$<$<BOOL:${WIN32}>:ws2_32>
|
||||
$<$<BOOL:${WIN32}>:iphlpapi>
|
||||
|
||||
|
||||
# For library UNIX loading
|
||||
$<$<NOT:$<BOOL:${WIN32}>>:dl>
|
||||
|
||||
-debug:none
|
||||
)
|
||||
|
||||
# Add target compile definitions
|
||||
|
@ -384,15 +395,15 @@ target_compile_definitions(lobby_connect
|
|||
PRIVATE
|
||||
NO_DISK_WRITES
|
||||
LOBBY_CONNECT
|
||||
|
||||
$<$<CONFIG:>:EMU_RELEASE_BUILD>
|
||||
$<$<CONFIG:Release>:EMU_RELEASE_BUILD>
|
||||
$<$<CONFIG:RelWithDebInfo>:EMU_RELEASE_BUILD>
|
||||
$<$<CONFIG:MinSizeRel>:EMU_RELEASE_BUILD>
|
||||
$<$<BOOL:${EMU_EXPERIMENTAL_BUILD}>:EMU_EXPERIMENTAL_BUILD>
|
||||
)
|
||||
|
||||
###########################################################################
|
||||
# Setup for the generate_interfaces_file
|
||||
# Setup for the generate_interfaces_file(64).exe / generate_interfaces_file
|
||||
###########################################################################
|
||||
|
||||
# Setup the target
|
||||
|
@ -408,25 +419,6 @@ target_link_libraries(
|
|||
-debug:none
|
||||
)
|
||||
|
||||
###########################################################################
|
||||
# Setup for the generate_game_infos
|
||||
###########################################################################
|
||||
|
||||
# Setup the target
|
||||
add_executable(
|
||||
generate_game_infos
|
||||
generate_game_infos/generate_game_infos.cpp
|
||||
)
|
||||
|
||||
# Link the required libraries
|
||||
target_link_libraries(
|
||||
generate_game_infos
|
||||
PRIVATE
|
||||
nlohmann_json::nlohmann_json
|
||||
nlohmann-fifo-map::nlohmann-fifo-map
|
||||
CURL::libcurl
|
||||
-debug:none
|
||||
)
|
||||
|
||||
###########################################################################
|
||||
# Installation setup
|
||||
|
@ -452,30 +444,24 @@ install(TARGETS
|
|||
generate_interfaces
|
||||
RUNTIME DESTINATION ${OUT_DIR}/tools/generate_interfaces
|
||||
)
|
||||
install(FILES
|
||||
install(FILES
|
||||
scripts/find_interfaces.sh
|
||||
scripts/find_interfaces.ps1
|
||||
Readme_generate_interfaces.txt
|
||||
DESTINATION ${OUT_DIR}/tools/generate_interfaces
|
||||
)
|
||||
|
||||
# generate_game_infos
|
||||
install(TARGETS
|
||||
generate_game_infos
|
||||
RUNTIME DESTINATION ${OUT_DIR}/tools/generate_game_infos
|
||||
)
|
||||
|
||||
# lobby_connect
|
||||
install(TARGETS
|
||||
lobby_connect
|
||||
RUNTIME DESTINATION ${OUT_DIR}/tools/lobby_connect
|
||||
)
|
||||
install(FILES
|
||||
install(FILES
|
||||
Readme_lobby_connect.txt
|
||||
DESTINATION ${OUT_DIR}/tools/lobby_connect
|
||||
)
|
||||
|
||||
install(FILES
|
||||
install(FILES
|
||||
Readme_release.txt
|
||||
files_example/steam_appid.EDIT_AND_RENAME.txt
|
||||
files_example/steam_interfaces.EXAMPLE.txt
|
||||
|
@ -484,7 +470,7 @@ install(FILES
|
|||
DESTINATION ${OUT_DIR}
|
||||
)
|
||||
|
||||
install(DIRECTORY
|
||||
install(DIRECTORY
|
||||
files_example/steam_settings.EXAMPLE
|
||||
DESTINATION ${OUT_DIR}
|
||||
)
|
||||
)
|
||||
|
|
|
@ -0,0 +1,520 @@
|
|||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Windows-x64-Release",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "RelWithDebInfo",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "-v",
|
||||
"ctestCommandArgs": "",
|
||||
"variables": [
|
||||
{
|
||||
"name": "VCPKG_TARGET_TRIPLET",
|
||||
"value": "x64-windows-static",
|
||||
"type": "STRING"
|
||||
}
|
||||
],
|
||||
"cmakeToolchain": "../vcpkg/scripts/buildsystems/vcpkg.cmake"
|
||||
},
|
||||
{
|
||||
"name": "Windows-x64-Debug",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Debug",
|
||||
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "-v",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"variables": [
|
||||
{
|
||||
"name": "VCPKG_TARGET_TRIPLET",
|
||||
"value": "x64-windows-static",
|
||||
"type": "STRING"
|
||||
}
|
||||
],
|
||||
"cmakeToolchain": "../vcpkg/scripts/buildsystems/vcpkg.cmake"
|
||||
},
|
||||
{
|
||||
"name": "Windows-x86-Release",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "RelWithDebInfo",
|
||||
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "-v",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "msvc_x86" ],
|
||||
"variables": [
|
||||
{
|
||||
"name": "VCPKG_TARGET_TRIPLET",
|
||||
"value": "x86-windows-static",
|
||||
"type": "STRING"
|
||||
}
|
||||
],
|
||||
"cmakeToolchain": "../vcpkg/scripts/buildsystems/vcpkg.cmake"
|
||||
},
|
||||
{
|
||||
"name": "Windows-x86-Debug",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Debug",
|
||||
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "-v",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "msvc_x86" ],
|
||||
"variables": [
|
||||
{
|
||||
"name": "VCPKG_TARGET_TRIPLET",
|
||||
"value": "x86-windows-static",
|
||||
"type": "STRING"
|
||||
}
|
||||
],
|
||||
"cmakeToolchain": "../vcpkg/scripts/buildsystems/vcpkg.cmake"
|
||||
},
|
||||
{
|
||||
"name": "Linux-x64-Release",
|
||||
"generator": "Unix Makefiles",
|
||||
"configurationType": "RelWithDebInfo",
|
||||
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeExecutable": "/usr/local/bin/cmake",
|
||||
"remoteCopySourcesExclusionList": [ ".vs", ".git" ],
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "linux_x64" ],
|
||||
"remoteMachineName": "${defaultRemoteMachineName}",
|
||||
"remoteCMakeListsRoot": "/var/tmp/src/${workspaceHash}/${name}",
|
||||
"remoteBuildRoot": "/var/tmp/build/${workspaceHash}/build/${name}",
|
||||
"remoteInstallRoot": "/var/tmp/build/${workspaceHash}/install/${name}",
|
||||
"remoteCopySources": true,
|
||||
"rsyncCommandArgs": "-t --delete --delete-excluded",
|
||||
"remoteCopyBuildOutput": true,
|
||||
"remoteCopySourcesMethod": "rsync",
|
||||
"variables": []
|
||||
},
|
||||
{
|
||||
"name": "Linux-x64-Debug",
|
||||
"generator": "Unix Makefiles",
|
||||
"configurationType": "Debug",
|
||||
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeExecutable": "/usr/local/bin/cmake",
|
||||
"remoteCopySourcesExclusionList": [ ".vs", ".git" ],
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "linux_x64" ],
|
||||
"remoteMachineName": "${defaultRemoteMachineName}",
|
||||
"remoteCMakeListsRoot": "/var/tmp/src/${workspaceHash}/${name}",
|
||||
"remoteBuildRoot": "/var/tmp/build/${workspaceHash}/build/${name}",
|
||||
"remoteInstallRoot": "/var/tmp/build/${workspaceHash}/install/${name}",
|
||||
"remoteCopySources": true,
|
||||
"rsyncCommandArgs": "-t --delete --delete-excluded",
|
||||
"remoteCopyBuildOutput": true,
|
||||
"remoteCopySourcesMethod": "rsync",
|
||||
"variables": []
|
||||
},
|
||||
{
|
||||
"name": "Linux-x86-Release",
|
||||
"generator": "Unix Makefiles",
|
||||
"configurationType": "RelWithDebInfo",
|
||||
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeExecutable": "/usr/local/bin/cmake",
|
||||
"remoteCopySourcesExclusionList": [ ".vs", ".git" ],
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "linux_x86" ],
|
||||
"remoteMachineName": "${defaultRemoteMachineName}",
|
||||
"remoteCMakeListsRoot": "/var/tmp/src/${workspaceHash}/${name}",
|
||||
"remoteBuildRoot": "/var/tmp/build/${workspaceHash}/build/${name}",
|
||||
"remoteInstallRoot": "/var/tmp/build/${workspaceHash}/install/${name}",
|
||||
"remoteCopySources": true,
|
||||
"rsyncCommandArgs": "-t --delete --delete-excluded",
|
||||
"remoteCopyBuildOutput": true,
|
||||
"remoteCopySourcesMethod": "rsync",
|
||||
"variables": []
|
||||
},
|
||||
{
|
||||
"name": "Linux-x86-Debug",
|
||||
"generator": "Unix Makefiles",
|
||||
"configurationType": "Debug",
|
||||
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeExecutable": "/usr/local/bin/cmake",
|
||||
"remoteCopySourcesExclusionList": [ ".vs", ".git" ],
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "linux_x86" ],
|
||||
"remoteMachineName": "${defaultRemoteMachineName}",
|
||||
"remoteCMakeListsRoot": "/var/tmp/src/${workspaceHash}/${name}",
|
||||
"remoteBuildRoot": "/var/tmp/build/${workspaceHash}/build/${name}",
|
||||
"remoteInstallRoot": "/var/tmp/build/${workspaceHash}/install/${name}",
|
||||
"remoteCopySources": true,
|
||||
"rsyncCommandArgs": "-t --delete --delete-excluded",
|
||||
"remoteCopyBuildOutput": true,
|
||||
"remoteCopySourcesMethod": "rsync",
|
||||
"variables": []
|
||||
},
|
||||
{
|
||||
"name": "Windows-x64-ExperimentalRelease",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "RelWithDebInfo",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "-v",
|
||||
"ctestCommandArgs": "",
|
||||
"variables": [
|
||||
{
|
||||
"name": "VCPKG_TARGET_TRIPLET",
|
||||
"value": "x64-windows-static",
|
||||
"type": "STRING"
|
||||
},
|
||||
{
|
||||
"name": "EMU_EXPERIMENTAL_BUILD",
|
||||
"value": "true",
|
||||
"type": "STRING"
|
||||
}
|
||||
],
|
||||
"cmakeToolchain": "../vcpkg/scripts/buildsystems/vcpkg.cmake"
|
||||
},
|
||||
{
|
||||
"name": "Windows-x64-ExperimentalDebug",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Debug",
|
||||
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "-v",
|
||||
"ctestCommandArgs": "",
|
||||
"cmakeToolchain": "../vcpkg/scripts/buildsystems/vcpkg.cmake",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"variables": [
|
||||
{
|
||||
"name": "VCPKG_TARGET_TRIPLET",
|
||||
"value": "x64-windows-static",
|
||||
"type": "STRING"
|
||||
},
|
||||
{
|
||||
"name": "EMU_EXPERIMENTAL_BUILD",
|
||||
"value": "true",
|
||||
"type": "STRING"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Windows-x86-ExperimentalRelease",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "RelWithDebInfo",
|
||||
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "-v",
|
||||
"ctestCommandArgs": "",
|
||||
"cmakeToolchain": "../vcpkg/scripts/buildsystems/vcpkg.cmake",
|
||||
"inheritEnvironments": [ "msvc_x86" ],
|
||||
"variables": [
|
||||
{
|
||||
"name": "VCPKG_TARGET_TRIPLET",
|
||||
"value": "x86-windows-static",
|
||||
"type": "STRING"
|
||||
},
|
||||
{
|
||||
"name": "EMU_EXPERIMENTAL_BUILD",
|
||||
"value": "true",
|
||||
"type": "STRING"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Windows-x86-ExperimentalDebug",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Debug",
|
||||
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "-v",
|
||||
"ctestCommandArgs": "",
|
||||
"cmakeToolchain": "../vcpkg/scripts/buildsystems/vcpkg.cmake",
|
||||
"inheritEnvironments": [ "msvc_x86" ],
|
||||
"variables": [
|
||||
{
|
||||
"name": "VCPKG_TARGET_TRIPLET",
|
||||
"value": "x86-windows-static",
|
||||
"type": "STRING"
|
||||
},
|
||||
{
|
||||
"name": "EMU_EXPERIMENTAL_BUILD",
|
||||
"value": "true",
|
||||
"type": "STRING"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Linux-x64-ExperimentalRelease",
|
||||
"generator": "Unix Makefiles",
|
||||
"configurationType": "RelWithDebInfo",
|
||||
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeExecutable": "/usr/local/bin/cmake",
|
||||
"remoteCopySourcesExclusionList": [ ".vs", ".git" ],
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "linux_x64" ],
|
||||
"variables": [
|
||||
{
|
||||
"name": "EMU_EXPERIMENTAL_BUILD",
|
||||
"value": "true",
|
||||
"type": "STRING"
|
||||
}
|
||||
],
|
||||
"remoteMachineName": "${defaultRemoteMachineName}",
|
||||
"remoteCMakeListsRoot": "/var/tmp/src/${workspaceHash}/${name}",
|
||||
"remoteBuildRoot": "/var/tmp/build/${workspaceHash}/build/${name}",
|
||||
"remoteInstallRoot": "/var/tmp/build/${workspaceHash}/install/${name}",
|
||||
"remoteCopySources": true,
|
||||
"rsyncCommandArgs": "-t --delete --delete-excluded",
|
||||
"remoteCopyBuildOutput": true,
|
||||
"remoteCopySourcesMethod": "rsync"
|
||||
},
|
||||
{
|
||||
"name": "Linux-x64-ExperimentalDebug",
|
||||
"generator": "Unix Makefiles",
|
||||
"configurationType": "Debug",
|
||||
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeExecutable": "/usr/local/bin/cmake",
|
||||
"remoteCopySourcesExclusionList": [ ".vs", ".git" ],
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "linux_x64" ],
|
||||
"variables": [
|
||||
{
|
||||
"name": "EMU_EXPERIMENTAL_BUILD",
|
||||
"value": "true",
|
||||
"type": "STRING"
|
||||
}
|
||||
],
|
||||
"remoteMachineName": "${defaultRemoteMachineName}",
|
||||
"remoteCMakeListsRoot": "/var/tmp/src/${workspaceHash}/${name}",
|
||||
"remoteBuildRoot": "/var/tmp/build/${workspaceHash}/build/${name}",
|
||||
"remoteInstallRoot": "/var/tmp/build/${workspaceHash}/install/${name}",
|
||||
"remoteCopySources": true,
|
||||
"rsyncCommandArgs": "-t --delete --delete-excluded",
|
||||
"remoteCopyBuildOutput": true,
|
||||
"remoteCopySourcesMethod": "rsync"
|
||||
},
|
||||
{
|
||||
"name": "Linux-x86-ExperimentalRelease",
|
||||
"generator": "Unix Makefiles",
|
||||
"configurationType": "RelWithDebInfo",
|
||||
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeExecutable": "/usr/local/bin/cmake",
|
||||
"remoteCopySourcesExclusionList": [ ".vs", ".git" ],
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "linux_x86" ],
|
||||
"variables": [
|
||||
{
|
||||
"name": "EMU_EXPERIMENTAL_BUILD",
|
||||
"value": "true",
|
||||
"type": "STRING"
|
||||
}
|
||||
],
|
||||
"remoteMachineName": "${defaultRemoteMachineName}",
|
||||
"remoteCMakeListsRoot": "/var/tmp/src/${workspaceHash}/${name}",
|
||||
"remoteBuildRoot": "/var/tmp/build/${workspaceHash}/build/${name}",
|
||||
"remoteInstallRoot": "/var/tmp/build/${workspaceHash}/install/${name}",
|
||||
"remoteCopySources": true,
|
||||
"rsyncCommandArgs": "-t --delete --delete-excluded",
|
||||
"remoteCopyBuildOutput": true,
|
||||
"remoteCopySourcesMethod": "rsync"
|
||||
},
|
||||
{
|
||||
"name": "Linux-x86-ExperimentalDebug",
|
||||
"generator": "Unix Makefiles",
|
||||
"configurationType": "Debug",
|
||||
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeExecutable": "/usr/local/bin/cmake",
|
||||
"remoteCopySourcesExclusionList": [ ".vs", ".git" ],
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "linux_x86" ],
|
||||
"variables": [
|
||||
{
|
||||
"name": "EMU_EXPERIMENTAL_BUILD",
|
||||
"value": "true",
|
||||
"type": "STRING"
|
||||
}
|
||||
],
|
||||
"remoteMachineName": "${defaultRemoteMachineName}",
|
||||
"remoteCMakeListsRoot": "/var/tmp/src/${workspaceHash}/${name}",
|
||||
"remoteBuildRoot": "/var/tmp/build/${workspaceHash}/build/${name}",
|
||||
"remoteInstallRoot": "/var/tmp/build/${workspaceHash}/install/${name}",
|
||||
"remoteCopySources": true,
|
||||
"rsyncCommandArgs": "-t --delete --delete-excluded",
|
||||
"remoteCopyBuildOutput": true,
|
||||
"remoteCopySourcesMethod": "rsync"
|
||||
},
|
||||
{
|
||||
"name": "WSL-x64-Release",
|
||||
"generator": "Unix Makefiles",
|
||||
"configurationType": "RelWithDebInfo",
|
||||
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeExecutable": "/usr/bin/cmake",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "linux_x64" ],
|
||||
"wslPath": "${defaultWSLPath}",
|
||||
"addressSanitizerRuntimeFlags": "detect_leaks=0",
|
||||
"variables": []
|
||||
},
|
||||
{
|
||||
"name": "WSL-x64-Debug",
|
||||
"generator": "Unix Makefiles",
|
||||
"configurationType": "Debug",
|
||||
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeExecutable": "/usr/bin/cmake",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "linux_x64" ],
|
||||
"wslPath": "${defaultWSLPath}",
|
||||
"addressSanitizerRuntimeFlags": "detect_leaks=0",
|
||||
"variables": []
|
||||
},
|
||||
{
|
||||
"name": "WSL-x86-Release",
|
||||
"generator": "Unix Makefiles",
|
||||
"configurationType": "RelWithDebInfo",
|
||||
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeExecutable": "/usr/bin/cmake",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "linux_x86" ],
|
||||
"wslPath": "${defaultWSLPath}",
|
||||
"addressSanitizerRuntimeFlags": "detect_leaks=0",
|
||||
"variables": []
|
||||
},
|
||||
{
|
||||
"name": "WSL-x86-Debug",
|
||||
"generator": "Unix Makefiles",
|
||||
"configurationType": "Debug",
|
||||
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeExecutable": "/usr/bin/cmake",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "linux_x86" ],
|
||||
"wslPath": "${defaultWSLPath}",
|
||||
"addressSanitizerRuntimeFlags": "detect_leaks=0",
|
||||
"variables": []
|
||||
},
|
||||
{
|
||||
"name": "WSL-x64-ExperimentalRelease",
|
||||
"generator": "Unix Makefiles",
|
||||
"configurationType": "RelWithDebInfo",
|
||||
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeExecutable": "/usr/bin/cmake",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "linux_x64" ],
|
||||
"wslPath": "${defaultWSLPath}",
|
||||
"addressSanitizerRuntimeFlags": "detect_leaks=0",
|
||||
"variables": [
|
||||
{
|
||||
"name": "EMU_EXPERIMENTAL_BUILD",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "WSL-x64-ExperimentalDebug",
|
||||
"generator": "Unix Makefiles",
|
||||
"configurationType": "Debug",
|
||||
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeExecutable": "/usr/bin/cmake",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "linux_x64" ],
|
||||
"wslPath": "${defaultWSLPath}",
|
||||
"addressSanitizerRuntimeFlags": "detect_leaks=0",
|
||||
"variables": [
|
||||
{
|
||||
"name": "EMU_EXPERIMENTAL_BUILD",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "WSL-x86-ExperimentalRelease",
|
||||
"generator": "Unix Makefiles",
|
||||
"configurationType": "RelWithDebInfo",
|
||||
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeExecutable": "/usr/bin/cmake",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "linux_x86" ],
|
||||
"wslPath": "${defaultWSLPath}",
|
||||
"addressSanitizerRuntimeFlags": "detect_leaks=0",
|
||||
"variables": [
|
||||
{
|
||||
"name": "EMU_EXPERIMENTAL_BUILD",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "WSL-x86-ExperimentalDebug",
|
||||
"generator": "Unix Makefiles",
|
||||
"configurationType": "Debug",
|
||||
"buildRoot": "${projectDir}\\out\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeExecutable": "/usr/bin/cmake",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "linux_x86" ],
|
||||
"wslPath": "${defaultWSLPath}",
|
||||
"addressSanitizerRuntimeFlags": "detect_leaks=0",
|
||||
"variables": [
|
||||
{
|
||||
"name": "EMU_EXPERIMENTAL_BUILD",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -24,11 +24,11 @@
|
|||
#if defined(__WINDOWS__)
|
||||
#define STBI_WINDOWS_UTF8
|
||||
#endif
|
||||
#include <stb_image.h>
|
||||
#include "../stb/stb_image.h"
|
||||
|
||||
#define STB_IMAGE_WRITE_IMPLEMENTATION
|
||||
#define STB_IMAGE_WRITE_STATIC
|
||||
#include <stb_image_write.h>
|
||||
#include "../stb/stb_image_write.h"
|
||||
|
||||
struct File_Data {
|
||||
std::string name;
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
#include <list>
|
||||
|
||||
#include <curl/curl.h>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <nlohmann/fifo_map.hpp>
|
||||
#include <json/json.hpp>
|
||||
#include <json/fifo_map.hpp>
|
||||
|
||||
class CurlGlobal
|
||||
{
|
||||
|
@ -246,7 +246,7 @@ static bool create_directory(std::string const& strPath)
|
|||
|
||||
return CreateDirectoryA(strPath.c_str(), NULL);
|
||||
}
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
#elif defined(__linux__)
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,547 @@
|
|||
/*
|
||||
The code is licensed under the MIT License <http://opensource.org/licenses/MIT>:
|
||||
|
||||
Copyright (c) 2015-2017 Niels Lohmann.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef NLOHMANN_FIFO_MAP_HPP
|
||||
#define NLOHMANN_FIFO_MAP_HPP
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstdlib>
|
||||
#include <functional>
|
||||
#include <iostream>
|
||||
#include <limits>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
/*!
|
||||
@brief namespace for Niels Lohmann
|
||||
@see https://github.com/nlohmann
|
||||
*/
|
||||
namespace nlohmann
|
||||
{
|
||||
|
||||
template<class Key>
|
||||
class fifo_map_compare
|
||||
{
|
||||
public:
|
||||
/// constructor given a pointer to a key storage
|
||||
fifo_map_compare(
|
||||
std::unordered_map<Key, std::size_t>* keys,
|
||||
std::size_t timestamp = 1)
|
||||
:
|
||||
m_timestamp(timestamp),
|
||||
m_keys(keys)
|
||||
{}
|
||||
|
||||
/*!
|
||||
This function compares two keys with respect to the order in which they
|
||||
were added to the container. For this, the mapping keys is used.
|
||||
*/
|
||||
bool operator()(const Key& lhs, const Key& rhs) const
|
||||
{
|
||||
// look up timestamps for both keys
|
||||
const auto timestamp_lhs = m_keys->find(lhs);
|
||||
const auto timestamp_rhs = m_keys->find(rhs);
|
||||
|
||||
if (timestamp_lhs == m_keys->end())
|
||||
{
|
||||
// timestamp for lhs not found - cannot be smaller than for rhs
|
||||
return false;
|
||||
}
|
||||
|
||||
if (timestamp_rhs == m_keys->end())
|
||||
{
|
||||
// timestamp for rhs not found - timestamp for lhs is smaller
|
||||
return true;
|
||||
}
|
||||
|
||||
// compare timestamps
|
||||
return timestamp_lhs->second < timestamp_rhs->second;
|
||||
}
|
||||
|
||||
void add_key(const Key& key)
|
||||
{
|
||||
m_keys->insert({key, m_timestamp++});
|
||||
}
|
||||
|
||||
void remove_key(const Key& key)
|
||||
{
|
||||
m_keys->erase(key);
|
||||
}
|
||||
|
||||
private:
|
||||
/// helper to access m_timestamp from fifo_map copy ctor,
|
||||
/// must have same number of template args as fifo_map
|
||||
template <
|
||||
class MapKey,
|
||||
class MapT,
|
||||
class MapCompare,
|
||||
class MapAllocator
|
||||
> friend class fifo_map;
|
||||
|
||||
private:
|
||||
/// the next valid insertion timestamp
|
||||
std::size_t m_timestamp = 1;
|
||||
|
||||
/// pointer to a mapping from keys to insertion timestamps
|
||||
std::unordered_map<Key, std::size_t>* m_keys = nullptr;
|
||||
};
|
||||
|
||||
|
||||
template <
|
||||
class Key,
|
||||
class T,
|
||||
class Compare = fifo_map_compare<Key>,
|
||||
class Allocator = std::allocator<std::pair<const Key, T>>
|
||||
> class fifo_map
|
||||
{
|
||||
public:
|
||||
using key_type = Key;
|
||||
using mapped_type = T;
|
||||
using value_type = std::pair<const Key, T>;
|
||||
using size_type = std::size_t;
|
||||
using difference_type = std::ptrdiff_t;
|
||||
using key_compare = Compare;
|
||||
using allocator_type = Allocator;
|
||||
using reference = value_type&;
|
||||
using const_reference = const value_type&;
|
||||
using pointer = typename std::allocator_traits<Allocator>::pointer;
|
||||
using const_pointer = typename std::allocator_traits<Allocator>::const_pointer;
|
||||
|
||||
using internal_map_type = std::map<Key, T, Compare, Allocator>;
|
||||
|
||||
using iterator = typename internal_map_type::iterator;
|
||||
using const_iterator = typename internal_map_type::const_iterator;
|
||||
using reverse_iterator = typename internal_map_type::reverse_iterator;
|
||||
using const_reverse_iterator = typename internal_map_type::const_reverse_iterator;
|
||||
|
||||
public:
|
||||
/// default constructor
|
||||
fifo_map() : m_keys(), m_compare(&m_keys), m_map(m_compare) {}
|
||||
|
||||
/// copy constructor
|
||||
fifo_map(const fifo_map &f) : m_keys(f.m_keys), m_compare(&m_keys, f.m_compare.m_timestamp), m_map(f.m_map.begin(), f.m_map.end(), m_compare) {}
|
||||
|
||||
/// constructor for a range of elements
|
||||
template<class InputIterator>
|
||||
fifo_map(InputIterator first, InputIterator last)
|
||||
: m_keys(), m_compare(&m_keys), m_map(m_compare)
|
||||
{
|
||||
for (auto it = first; it != last; ++it)
|
||||
{
|
||||
insert(*it);
|
||||
}
|
||||
}
|
||||
|
||||
/// constructor for a list of elements
|
||||
fifo_map(std::initializer_list<value_type> init) : fifo_map()
|
||||
{
|
||||
for (auto x : init)
|
||||
{
|
||||
insert(x);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Element access
|
||||
*/
|
||||
|
||||
/// access specified element with bounds checking
|
||||
T& at(const Key& key)
|
||||
{
|
||||
return m_map.at(key);
|
||||
}
|
||||
|
||||
/// access specified element with bounds checking
|
||||
const T& at(const Key& key) const
|
||||
{
|
||||
return m_map.at(key);
|
||||
}
|
||||
|
||||
/// access specified element
|
||||
T& operator[](const Key& key)
|
||||
{
|
||||
m_compare.add_key(key);
|
||||
return m_map[key];
|
||||
}
|
||||
|
||||
/// access specified element
|
||||
T& operator[](Key&& key)
|
||||
{
|
||||
m_compare.add_key(key);
|
||||
return m_map[key];
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Iterators
|
||||
*/
|
||||
|
||||
/// returns an iterator to the beginning
|
||||
iterator begin() noexcept
|
||||
{
|
||||
return m_map.begin();
|
||||
}
|
||||
|
||||
/// returns an iterator to the end
|
||||
iterator end() noexcept
|
||||
{
|
||||
return m_map.end();
|
||||
}
|
||||
|
||||
/// returns an iterator to the beginning
|
||||
const_iterator begin() const noexcept
|
||||
{
|
||||
return m_map.begin();
|
||||
}
|
||||
|
||||
/// returns an iterator to the end
|
||||
const_iterator end() const noexcept
|
||||
{
|
||||
return m_map.end();
|
||||
}
|
||||
|
||||
/// returns an iterator to the beginning
|
||||
const_iterator cbegin() const noexcept
|
||||
{
|
||||
return m_map.cbegin();
|
||||
}
|
||||
|
||||
/// returns an iterator to the end
|
||||
const_iterator cend() const noexcept
|
||||
{
|
||||
return m_map.cend();
|
||||
}
|
||||
|
||||
/// returns a reverse iterator to the beginning
|
||||
reverse_iterator rbegin() noexcept
|
||||
{
|
||||
return m_map.rbegin();
|
||||
}
|
||||
|
||||
/// returns a reverse iterator to the end
|
||||
reverse_iterator rend() noexcept
|
||||
{
|
||||
return m_map.rend();
|
||||
}
|
||||
|
||||
/// returns a reverse iterator to the beginning
|
||||
const_reverse_iterator rbegin() const noexcept
|
||||
{
|
||||
return m_map.rbegin();
|
||||
}
|
||||
|
||||
/// returns a reverse iterator to the end
|
||||
const_reverse_iterator rend() const noexcept
|
||||
{
|
||||
return m_map.rend();
|
||||
}
|
||||
|
||||
/// returns a reverse iterator to the beginning
|
||||
const_reverse_iterator crbegin() const noexcept
|
||||
{
|
||||
return m_map.crbegin();
|
||||
}
|
||||
|
||||
/// returns a reverse iterator to the end
|
||||
const_reverse_iterator crend() const noexcept
|
||||
{
|
||||
return m_map.crend();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Capacity
|
||||
*/
|
||||
|
||||
/// checks whether the container is empty
|
||||
bool empty() const noexcept
|
||||
{
|
||||
return m_map.empty();
|
||||
}
|
||||
|
||||
/// returns the number of elements
|
||||
size_type size() const noexcept
|
||||
{
|
||||
return m_map.size();
|
||||
}
|
||||
|
||||
/// returns the maximum possible number of elements
|
||||
size_type max_size() const noexcept
|
||||
{
|
||||
return m_map.max_size();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Modifiers
|
||||
*/
|
||||
|
||||
/// clears the contents
|
||||
void clear() noexcept
|
||||
{
|
||||
m_map.clear();
|
||||
m_keys.clear();
|
||||
}
|
||||
|
||||
/// insert value
|
||||
std::pair<iterator, bool> insert(const value_type& value)
|
||||
{
|
||||
m_compare.add_key(value.first);
|
||||
return m_map.insert(value);
|
||||
}
|
||||
|
||||
/// insert value
|
||||
template<class P>
|
||||
std::pair<iterator, bool> insert( P&& value )
|
||||
{
|
||||
m_compare.add_key(value.first);
|
||||
return m_map.insert(value);
|
||||
}
|
||||
|
||||
/// insert value with hint
|
||||
iterator insert(const_iterator hint, const value_type& value)
|
||||
{
|
||||
m_compare.add_key(value.first);
|
||||
return m_map.insert(hint, value);
|
||||
}
|
||||
|
||||
/// insert value with hint
|
||||
iterator insert(const_iterator hint, value_type&& value)
|
||||
{
|
||||
m_compare.add_key(value.first);
|
||||
return m_map.insert(hint, value);
|
||||
}
|
||||
|
||||
/// insert value range
|
||||
template<class InputIt>
|
||||
void insert(InputIt first, InputIt last)
|
||||
{
|
||||
for (const_iterator it = first; it != last; ++it)
|
||||
{
|
||||
m_compare.add_key(it->first);
|
||||
}
|
||||
|
||||
m_map.insert(first, last);
|
||||
}
|
||||
|
||||
/// insert value list
|
||||
void insert(std::initializer_list<value_type> ilist)
|
||||
{
|
||||
for (auto value : ilist)
|
||||
{
|
||||
m_compare.add_key(value.first);
|
||||
}
|
||||
|
||||
m_map.insert(ilist);
|
||||
}
|
||||
|
||||
/// constructs element in-place
|
||||
template<class... Args>
|
||||
std::pair<iterator, bool> emplace(Args&& ... args)
|
||||
{
|
||||
typename fifo_map::value_type value(std::forward<Args>(args)...);
|
||||
m_compare.add_key(value.first);
|
||||
return m_map.emplace(std::move(value));
|
||||
}
|
||||
|
||||
/// constructs element in-place with hint
|
||||
template<class... Args>
|
||||
iterator emplace_hint(const_iterator hint, Args&& ... args)
|
||||
{
|
||||
typename fifo_map::value_type value(std::forward<Args>(args)...);
|
||||
m_compare.add_key(value.first);
|
||||
return m_map.emplace_hint(hint, std::move(value));
|
||||
}
|
||||
|
||||
/// remove element at position
|
||||
iterator erase(const_iterator pos)
|
||||
{
|
||||
m_compare.remove_key(pos->first);
|
||||
return m_map.erase(pos);
|
||||
}
|
||||
|
||||
/// remove elements in range
|
||||
iterator erase(const_iterator first, const_iterator last)
|
||||
{
|
||||
for (const_iterator it = first; it != last; ++it)
|
||||
{
|
||||
m_compare.remove_key(it->first);
|
||||
}
|
||||
|
||||
return m_map.erase(first, last);
|
||||
}
|
||||
|
||||
/// remove elements with key
|
||||
size_type erase(const key_type& key)
|
||||
{
|
||||
size_type res = m_map.erase(key);
|
||||
|
||||
if (res > 0)
|
||||
{
|
||||
m_compare.remove_key(key);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/// swaps the contents
|
||||
void swap(fifo_map& other)
|
||||
{
|
||||
std::swap(m_map, other.m_map);
|
||||
std::swap(m_compare, other.m_compare);
|
||||
std::swap(m_keys, other.m_keys);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Lookup
|
||||
*/
|
||||
|
||||
/// returns the number of elements matching specific key
|
||||
size_type count(const Key& key) const
|
||||
{
|
||||
return m_map.count(key);
|
||||
}
|
||||
|
||||
/// finds element with specific key
|
||||
iterator find(const Key& key)
|
||||
{
|
||||
return m_map.find(key);
|
||||
}
|
||||
|
||||
/// finds element with specific key
|
||||
const_iterator find(const Key& key) const
|
||||
{
|
||||
return m_map.find(key);
|
||||
}
|
||||
|
||||
/// returns range of elements matching a specific key
|
||||
std::pair<iterator, iterator> equal_range(const Key& key)
|
||||
{
|
||||
return m_map.equal_range(key);
|
||||
}
|
||||
|
||||
/// returns range of elements matching a specific key
|
||||
std::pair<const_iterator, const_iterator> equal_range(const Key& key) const
|
||||
{
|
||||
return m_map.equal_range(key);
|
||||
}
|
||||
|
||||
/// returns an iterator to the first element not less than the given key
|
||||
iterator lower_bound(const Key& key)
|
||||
{
|
||||
return m_map.lower_bound(key);
|
||||
}
|
||||
|
||||
/// returns an iterator to the first element not less than the given key
|
||||
const_iterator lower_bound(const Key& key) const
|
||||
{
|
||||
return m_map.lower_bound(key);
|
||||
}
|
||||
|
||||
/// returns an iterator to the first element greater than the given key
|
||||
iterator upper_bound(const Key& key)
|
||||
{
|
||||
return m_map.upper_bound(key);
|
||||
}
|
||||
|
||||
/// returns an iterator to the first element greater than the given key
|
||||
const_iterator upper_bound(const Key& key) const
|
||||
{
|
||||
return m_map.upper_bound(key);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Observers
|
||||
*/
|
||||
|
||||
/// returns the function that compares keys
|
||||
key_compare key_comp() const
|
||||
{
|
||||
return m_compare;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Non-member functions
|
||||
*/
|
||||
|
||||
friend bool operator==(const fifo_map& lhs, const fifo_map& rhs)
|
||||
{
|
||||
return lhs.m_map == rhs.m_map;
|
||||
}
|
||||
|
||||
friend bool operator!=(const fifo_map& lhs, const fifo_map& rhs)
|
||||
{
|
||||
return lhs.m_map != rhs.m_map;
|
||||
}
|
||||
|
||||
friend bool operator<(const fifo_map& lhs, const fifo_map& rhs)
|
||||
{
|
||||
return lhs.m_map < rhs.m_map;
|
||||
}
|
||||
|
||||
friend bool operator<=(const fifo_map& lhs, const fifo_map& rhs)
|
||||
{
|
||||
return lhs.m_map <= rhs.m_map;
|
||||
}
|
||||
|
||||
friend bool operator>(const fifo_map& lhs, const fifo_map& rhs)
|
||||
{
|
||||
return lhs.m_map > rhs.m_map;
|
||||
}
|
||||
|
||||
friend bool operator>=(const fifo_map& lhs, const fifo_map& rhs)
|
||||
{
|
||||
return lhs.m_map >= rhs.m_map;
|
||||
}
|
||||
|
||||
private:
|
||||
/// the keys
|
||||
std::unordered_map<Key, std::size_t> m_keys;
|
||||
/// the comparison object
|
||||
Compare m_compare;
|
||||
/// the internal data structure
|
||||
internal_map_type m_map;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
// specialization of std::swap
|
||||
namespace std
|
||||
{
|
||||
template <class Key, class T, class Compare, class Allocator>
|
||||
inline void swap(nlohmann::fifo_map<Key, T, Compare, Allocator>& m1,
|
||||
nlohmann::fifo_map<Key, T, Compare, Allocator>& m2)
|
||||
{
|
||||
m1.swap(m2);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
|
@ -182,7 +182,7 @@ public:
|
|||
void OpenOverlayInvite(CSteamID lobbyId) {}
|
||||
void OpenOverlay(const char* pchDialog) {}
|
||||
|
||||
bool ShowOverlay() const { return false; }
|
||||
bool ShowOverlay() const {}
|
||||
void ShowOverlay(bool state) {}
|
||||
|
||||
void SetLobbyInvite(Friend friendId, uint64 lobbyId) {}
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
This software is available under 2 licenses -- choose whichever you prefer.
|
||||
------------------------------------------------------------------------------
|
||||
ALTERNATIVE A - MIT License
|
||||
Copyright (c) 2017 Sean Barrett
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
------------------------------------------------------------------------------
|
||||
ALTERNATIVE B - Public Domain (www.unlicense.org)
|
||||
This is free and unencumbered software released into the public domain.
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
|
||||
software, either in source code form or as a compiled binary, for any purpose,
|
||||
commercial or non-commercial, and by any means.
|
||||
In jurisdictions that recognize copyright laws, the author or authors of this
|
||||
software dedicate any and all copyright interest in the software to the public
|
||||
domain. We make this dedication for the benefit of the public at large and to
|
||||
the detriment of our heirs and successors. We intend this dedication to be an
|
||||
overt act of relinquishment in perpetuity of all present and future rights to
|
||||
this software under copyright law.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue