Skip to content

Commit

Permalink
Finish refactoring Serializer, add LZ4 compression for SGM files.
Browse files Browse the repository at this point in the history
  • Loading branch information
Web-eWorks committed Jun 21, 2019
1 parent 09a84e6 commit 0a83956
Show file tree
Hide file tree
Showing 21 changed files with 9,024 additions and 100 deletions.
4 changes: 4 additions & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ Pioneer includes the following third-party software:
miniz by Rich Geldreich, April 2012
Public domain (see contrib/miniz/miniz.h)

LZ4 Library
Copyright (c) 2011-2016, Yann Collet
Licensed under the BSD 2-Clause license (see licenses/LZ4.txt)

lookup3.c, by Bob Jenkins, May 2006,
Public domain (see contrib/jenkins/lookup3.c)

Expand Down
13 changes: 8 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ option(WITH_OBJECTVIEWER "Include the object viewer in the build" ON)
option(WITH_DEVKEYS "Include various extra keybindings for dev functions" ON)

list(APPEND SRC_FOLDERS
src
src/
src/collider
src/galaxy
src/gameui
Expand Down Expand Up @@ -143,10 +143,10 @@ if (USE_SYSTEM_LIBLUA)
endif (WIN32)
endif (USE_SYSTEM_LIBLUA)

option(BUILD_WITH_PROFILER "Build pioneer with profiling support built-in." OFF)
if (BUILD_WITH_PROFILER)
option(PROFILER_ENABLED "Build pioneer with profiling support built-in." OFF)
if (PROFILER_ENABLED)
add_compile_definitions(PIONEER_PROFILER=1)
endif(BUILD_WITH_PROFILER)
endif(PROFILER_ENABLED)

find_package(Freetype REQUIRED)
find_package(OpenGL REQUIRED)
Expand All @@ -160,6 +160,8 @@ pkg_check_modules(ASSIMP REQUIRED assimp)
pkg_check_modules(SIGCPP REQUIRED sigc++-2.0)
pkg_check_modules(VORBISFILE REQUIRED vorbisfile)

add_subdirectory(contrib/lz4)

include_directories(
${CMAKE_SOURCE_DIR}/contrib
${CMAKE_SOURCE_DIR}/src
Expand Down Expand Up @@ -237,6 +239,7 @@ list(APPEND pioneerLibs
${SIGCPP_LIBRARIES}
${VORBISFILE_LIBRARIES}
${LUA_LIBRARIES}
lz4
GLEW::GLEW
imgui
jenkins
Expand All @@ -254,7 +257,7 @@ endif (WIN32)

target_link_libraries(${PROJECT_NAME} LINK_PRIVATE ${pioneerLibs} ${winLibs})
target_link_libraries(modelcompiler LINK_PRIVATE ${pioneerLibs} ${winLibs})
target_link_libraries(savegamedump LINK_PRIVATE ${SDL2_LIBRARIES} ${SDL2_IMAGE_LIBRARIES} profiler ${winLibs})
target_link_libraries(savegamedump LINK_PRIVATE ${SDL2_LIBRARIES} ${SDL2_IMAGE_LIBRARIES} profiler lz4 ${winLibs})

set_target_properties(${PROJECT_NAME} modelcompiler savegamedump pioneerLib PROPERTIES
CXX_STANDARD 11
Expand Down
2 changes: 1 addition & 1 deletion contrib/lua/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ if (NOT WIN32)
add_definitions(-DLUA_USE_POSIX)
endif (NOT WIN32)

add_library(${PROJECT_NAME} ${SRC_FILES})
add_library(${PROJECT_NAME} STATIC ${SRC_FILES})
2 changes: 0 additions & 2 deletions contrib/lua/ldo.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,5 +669,3 @@ int luaD_protectedparser (lua_State *L, ZIO *z, const char *name,
L->nny--;
return status;
}


15 changes: 15 additions & 0 deletions contrib/lz4/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cmake_minimum_required(VERSION 3.4)
project(lz4 LANGUAGES C)

list(APPEND LZ4_SOURCES
lz4.c
lz4hc.c
lz4frame.c
xxhash.c
)

add_library(lz4 STATIC ${LZ4_SOURCES})

target_include_directories(lz4 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_compile_options(lz4 PRIVATE "-O3")
target_compile_definitions(lz4 PRIVATE "XXH_NAMESPACE=LZ4_")
Loading

0 comments on commit 0a83956

Please sign in to comment.