Skip to content

Commit

Permalink
Merge branch 'master' into v0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
yvt committed May 3, 2019
2 parents 7650d2d + bac1b2c commit 7e03e09
Show file tree
Hide file tree
Showing 13 changed files with 291 additions and 25 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "flatpak/shared-modules"]
path = flatpak/shared-modules
url = https://github.com/flathub/shared-modules.git
21 changes: 12 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ set(OS_BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})

set(CMAKE_PREFIX_PATH Sources/Externals)

if(POLICY CMP0054)
# Escape variables in if
cmake_policy(SET CMP0054 OLD)
# Prefer GLVND OpenGL
if(POLICY CMP0072)
cmake_policy(SET CMP0072 NEW)
endif()

include(cmake/FindSDL2.cmake)
Expand All @@ -30,10 +30,11 @@ include(FindOpenGL)
if(NOT OPENGL_FOUND AND NOT OPENGL_XMESA_FOUND AND NOT OPENGL_GLU_FOUND)
message(FATAL_ERROR "OpenGL not found, please install it")
endif()

include(cmake/FindGLEW2.cmake)
if(NOT GLEW_FOUND)
message(FATAL_ERROR "GLEW not found, please install it and make sure CMake can find it (add it to the PATH)")
if(NOT APPLE)
include(cmake/FindGLEW2.cmake)
if(NOT GLEW_FOUND)
message(FATAL_ERROR "GLEW not found, please install it and make sure CMake can find it (add it to the PATH)")
endif()
endif()

include(FindZLIB)
Expand Down Expand Up @@ -197,7 +198,9 @@ include_directories("${SDL2_IMAGE_INCLUDE_DIR}")
if(OPENGL_INCLUDE_DIR)
include_directories("${OPENGL_INCLUDE_DIR}")
endif()
if(NOT APPLE)
include_directories("${GLEW_INCLUDE_DIR}")
endif()
include_directories("${ZLIB_INCLUDE_DIR}")
include_directories(${CURL_INCLUDE_DIRS})
include_directories(${FREETYPE_INCLUDE_DIRS})
Expand All @@ -207,7 +210,7 @@ add_subdirectory(Resources)
add_subdirectory(Sources)


if(UNIX AND NOT APPLE)
if(UNIX)
# various texts
INSTALL(FILES AUTHORS LICENSE README.md DESTINATION ${OPENSPADES_INSTALL_DOC}/)

Expand Down Expand Up @@ -256,7 +259,7 @@ if(UNIX AND NOT APPLE)
# Currently there is no files in lib/openspades. But if you reading this message in future and want to
# place somewhere libs, binaries or other non-media stuff, place them in lib/openspades. Thank you.

endif(UNIX AND NOT APPLE)
endif(UNIX)



Expand Down
4 changes: 2 additions & 2 deletions OpenSpades.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2329,7 +2329,7 @@
"$(SRCROOT)",
Sources,
Sources/json/include,
/opt/local/include/opus,
Sources/Externals/include/opus,
);
INFOPLIST_FILE = "XSpades/XSpades-Info.plist";
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks";
Expand Down Expand Up @@ -2373,7 +2373,7 @@
"$(SRCROOT)",
Sources,
Sources/json/include,
/opt/local/include/opus,
Sources/Externals/include/opus,
);
INFOPLIST_FILE = "XSpades/XSpades-Info.plist";
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks";
Expand Down
4 changes: 2 additions & 2 deletions Resources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ if(OPENSPADES_RESOURCES)
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
endif()

if(UNIX AND NOT APPLE)
if(UNIX)
add_custom_target(OpenSpades_Unix ALL COMMENT "Process unix stuff")

file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Icons)
Expand All @@ -77,4 +77,4 @@ if(UNIX AND NOT APPLE)
COMMAND sh -c \"gzip -9 -c ${CMAKE_CURRENT_BINARY_DIR}/Unix/Man/openspades.6 > openspades.6.gz\"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Unix/Man
)
endif(UNIX AND NOT APPLE)
endif(UNIX)
16 changes: 11 additions & 5 deletions Sources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ file(GLOB JSON_INCLUDE json/include/json/*.h)
file(GLOB SCRIPTBINDING_FILES ScriptBindings/*.cpp ScriptBindings/*.h)
file(GLOB UNZIP_FILES unzip/*.c unzip/*.h)

# TODO: compile ShellApi.mm on macOS
if(APPLE)
file(GLOB PLATFORM_FILES Core/*.mm)
endif()

add_subdirectory(AngelScript/projects/cmake)
add_subdirectory(AngelScript/projects/cmake_addons)
Expand All @@ -37,7 +39,7 @@ if(WIN32)
endif()
endif()

add_executable(OpenSpades ${AUDIO_FILES} ${AUDIO_AL_FILES} ${BINPACK_FILES} ${CLIENT_FILES} ${CORE_FILES} ${DRAW_FILES} ${ENET_FILES} ${ENET_INCLUDE} ${GUI_FILES}
add_executable(OpenSpades ${AUDIO_FILES} ${AUDIO_AL_FILES} ${BINPACK_FILES} ${CLIENT_FILES} ${CORE_FILES} ${PLATFORM_FILES} ${DRAW_FILES} ${ENET_FILES} ${ENET_INCLUDE} ${GUI_FILES}
${IMPORTS_FILES} ${KISS_FILES} ${JSON_FILES} ${JSON_INCLUDE} ${UNZIP_FILES} ${SCRIPTBINDING_FILES} ${RESOURCE_FILES})
set_target_properties(OpenSpades PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(OpenSpades PROPERTIES OUTPUT_NAME openspades)
Expand Down Expand Up @@ -83,6 +85,7 @@ source_group("Audio\\AL" FILES ${AUDIO_AL_FILES})
source_group("libs\\binpack2d" FILES ${BINPACK_FILES})
source_group("Client" FILES ${CLIENT_FILES})
source_group("Core" FILES ${CORE_FILES})
source_group("Platform-specific" FILES ${PLATFORM_FILES})
source_group("Draw" FILES ${DRAW_FILES})
source_group("libs\\Enet" FILES ${ENET_FILES})
source_group("libs\\Enet\\include" FILES ${ENET_INCLUDE})
Expand All @@ -94,7 +97,10 @@ source_group("libs\\json\\include" FILES ${JSON_INCLUDE})
source_group("ScriptBindings" FILES ${SCRIPTBINDING_FILES})
source_group("libs\\unzip" FILES ${UNZIP_FILES})

target_link_libraries(OpenSpades ${SDL2_LIBRARY} ${SDL2_IMAGE_LIBRARY} ${OPENGL_LIBRARIES} ${GLEW_LIBRARY} ${ZLIB_LIBRARIES} ${CURL_LIBRARY} ${FREETYPE_LIBRARIES} ${CMAKE_DL_LIBS} ${ANGELSCRIPT_LIBS} ${OpusFile_LIBRARY})
target_link_libraries(OpenSpades ${SDL2_LIBRARY} ${SDL2_IMAGE_LIBRARY} ${OPENGL_LIBRARIES} ${ZLIB_LIBRARIES} ${CURL_LIBRARY} ${FREETYPE_LIBRARIES} ${CMAKE_DL_LIBS} ${ANGELSCRIPT_LIBS} ${OpusFile_LIBRARY})
if(NOT APPLE)
target_link_libraries(OpenSpades ${GLEW_LIBRARY})
endif()

#todo: MACOSX_BUNDLE_ICON_FILE ?

Expand All @@ -105,12 +111,12 @@ endif()

if(WIN32)
target_link_libraries(OpenSpades ws2_32.lib winmm.lib)
else()
elseif(UNIX AND NOT APPLE)
target_link_libraries(OpenSpades Xext)
endif()

if(UNIX)
if(NOT CMAKE_SYSTEM_NAME MATCHES "BSD")
if(NOT(CMAKE_SYSTEM_NAME MATCHES "BSD" OR APPLE))
target_link_libraries(OpenSpades rt)
endif()
target_link_libraries(OpenSpades pthread)
Expand Down
2 changes: 1 addition & 1 deletion Sources/Externals/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ Externals

The following URL provides a pre-compiled zip file containing all required files.

https://openspadesmedia.yvt.jp/development-packages/OpenSpades-Externals-Darwin-3.zip
https://openspadesmedia.yvt.jp/development-packages/OpenSpades-Externals-Darwin-4.zip
10 changes: 6 additions & 4 deletions cmake/FindSDL2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,19 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)

FIND_PATH(SDL2_INCLUDE_DIR SDL.h
# SDL 1.2 has SDL.h too. As such, the search paths should be restricted to
# directories specific to SDL2.
FIND_PATH(SDL2_INCLUDE_DIR SDL_render.h
HINTS
$ENV{SDL2DIR}
PATH_SUFFIXES include/SDL2 include
PATHS
~/Library/Frameworks
/Library/Frameworks
~/Library/Frameworks/SDL2.framework/Headers
/Library/Frameworks/SDL2.framework/Headers
/usr/local/include/SDL2
/usr/include/SDL2
/sw # Fink
/opt/local # DarwinPorts
/opt/local/include/SDL2 # DarwinPorts
/opt/csw # Blastwave
/opt
)
Expand Down
34 changes: 34 additions & 0 deletions flatpak/disable-nonfree-download.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5cc2d18..e6f98cc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -226,13 +226,11 @@ if(UNIX AND NOT APPLE)
if(OPENSPADES_RESOURCES)
# install asset paks (including non-GPL one)
install(FILES
- ${CMAKE_BINARY_DIR}/Resources/pak000-Nonfree.pak
${CMAKE_BINARY_DIR}/Resources/pak002-Base.pak
${CMAKE_BINARY_DIR}/Resources/pak005-Models.pak
${CMAKE_BINARY_DIR}/Resources/pak010-BaseSkin.pak
${CMAKE_BINARY_DIR}/Resources/pak050-Locales.pak
${CMAKE_BINARY_DIR}/Resources/pak999-References.pak
- ${CMAKE_BINARY_DIR}/Resources/font-unifont.pak
DESTINATION ${OPENSPADES_INSTALL_RESOURCES})
endif(OPENSPADES_RESOURCES)

diff --git a/Resources/CMakeLists.txt b/Resources/CMakeLists.txt
index 1f9b514..34010fa 100644
--- a/Resources/CMakeLists.txt
+++ b/Resources/CMakeLists.txt
@@ -4,11 +4,6 @@ if(OPENSPADES_RESOURCES)
if (WIN32)
# No automatic downloading for Windows (for now)
elseif (UNIX)
- add_custom_target(OpenSpades_Resources_DevPaks ALL COMMENT "Downloading non-GPL assets")
- add_custom_command(
- TARGET OpenSpades_Resources_DevPaks
- COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/downloadpak.sh
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
endif()

# TODO: subgroups for script files
78 changes: 78 additions & 0 deletions flatpak/jp.yvt.OpenSpades.appdata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>jp.yvt.OpenSpades.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0+</project_license>
<project_license>OpenSpades Non-GPL Pak License</project_license>
<name>OpenSpades</name>

<summary>Open Source voxel shooter</summary>

<description>
<p> OpenSpades is a clone of Ace of Spades 0.75, which is a free online
first-person shooter created by Ben Aksoy, featuring fully destructible
terrain and plenty of game modes (including the well-known Capture the
Flag) created by the community.</p>
<ul>
<li>Can connect to a vanilla/pyspades/pysnip server</li>
<li>Uses OpenGL/AL for better experience</li>
<li>Open source, and cross platform</li>
</ul>
</description>

<categories>
<category>Game</category>
<category>Shooter</category>
​</categories>

<content_rating type="oars-1.1">
<content_attribute id="violence-cartoon">intense</content_attribute>
<content_attribute id="violence-bloodshed">mild</content_attribute>
<content_attribute id="social-chat">intense</content_attribute>
</content_rating>

<launchable type="desktop-id">jp.yvt.OpenSpades.desktop</launchable>

<url type="homepage">http://openspades.yvt.jp/</url>
<url type="bugtracker">https://github.com/yvt/openspades/issues</url>
<url type="translate">https://crowdin.com/project/openspades</url>

<screenshots>
<screenshot type="default">
<image>http://openspades.yvt.jp/media/images/ss4.jpg</image>
</screenshot>
<screenshot>
<image>http://openspades.yvt.jp/media/images/ss5.jpg</image>
</screenshot>
<screenshot>
<image>http://openspades.yvt.jp/media/images/ss6.jpg</image>
</screenshot>
<screenshot>
<image>http://openspades.yvt.jp/media/images/ss1.jpg</image>
</screenshot>
<screenshot>
<image>http://openspades.yvt.jp/media/images/ss2.jpg</image>
</screenshot>
<screenshot>
<image>http://openspades.yvt.jp/media/images/ss3.jpg</image>
</screenshot>
</screenshots>

<releases>
<release version="0.1.3" date="2019-01-04">
<description>
This release contains minor fixes since the previous version 0.1.2.
</description>
</release>
<release version="0.1.2" date="2018-01-01">
<description>
This release contains minor fixes since the previous version 0.1.1c.
</description>
</release>
<release version="0.1.1c" date="2017-03-04">
<description>
Contains minor or critical fixes since the previous version 0.1.1b.
</description>
</release>
</releases>
</component>
Loading

0 comments on commit 7e03e09

Please sign in to comment.