diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..ca910568 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,60 @@ +version: 2 +jobs: + build: + working_directory: /root/SRB2 + docker: + - image: debian:jessie + environment: + CC: ccache gcc -m32 + PKG_CONFIG_LIBDIR: /usr/lib/i386-linux-gnu/pkgconfig + LIBGME_CFLAGS: -I/usr/include + LIBGME_LDFLAGS: -lgme + CCACHE_COMPRESS: true + WFLAGS: -Wno-unsuffixed-float-constants + GCC49: true + #- image: ubuntu:trusty + # environment: + # CC: ccache gcc -m32 + # PKG_CONFIG_LIBDIR: /usr/lib/i386-linux-gnu/pkgconfig + # LIBGME_CFLAGS: -I/usr/include + # LIBGME_LDFLAGS: -lgme + # CCACHE_COMPRESS: true + # WFLAGS: -Wno-unsuffixed-float-constants + # GCC48: true + steps: + - run: + name: Add i386 arch + command: dpkg --add-architecture i386 + - run: + name: Update APT listing + command: apt-get -qq update + - run: + name: Support S3 upload + command: apt-get -qq -y install ca-certificates + - restore_cache: + keys: + - v1-SRB2-APT + - run: + name: Install SDK + command: apt-get -qq -y install git build-essential nasm libpng12-dev:i386 libsdl2-mixer-dev:i386 libgme-dev:i386 gettext ccache wget gcc-multilib upx + - save_cache: + key: v1-SRB2-APT + paths: + - /var/cache/apt/archives + - checkout + - run: + name: Clean build + command: make -C src LINUX=1 clean + - restore_cache: + keys: + - v1-SRB2-{{ .Branch }}-{{ checksum "objs/Linux/SDL/Release/depend.dep" }} + - run: + name: Compile + command: make -C src LINUX=1 ERRORMODE=1 -k + - store_artifacts: + path: /root/SRB2/bin/Linux/Release/ + destination: bin + - save_cache: + key: v1-SRB2-{{ .Branch }}-{{ checksum "objs/Linux/SDL/Release/depend.dep" }} + paths: + - /root/.ccache diff --git a/.gitattributes b/.gitattributes index 777bf189..d4562091 100644 --- a/.gitattributes +++ b/.gitattributes @@ -13,20 +13,6 @@ *.manifest -crlf -whitespace # Patches /tools/SDL-1.2.14-gc/SDL-1.2.14-gc.patch -whitespace -# LibPNG -/libs/libpng-src/CMakeLists.txt -whitespace -/libs/libpng-src/libpng-1.2.*.txt -whitespace -/libs/libpng-src/libpng.3 -whitespace -/libs/libpng-src/*.c -whitespace -# Zlib -/libs/zlib/contrib/amd64/amd64-match.S -whitespace -/libs/zlib/contrib/delphi/zlibd32.mak -crlf -whitespace -/libs/zlib/contrib/gcc_gvmat64/gvmat64.S -whitespace -/libs/zlib/contrib/minizip/MiniZip64_Changes.txt -whitespace -/libs/zlib/contrib/minizip/MiniZip64_info.txt -whitespace -/libs/zlib/contrib/pascal/zlibd32.mak -whitespace -/libs/zlib/nintendods/Makefile -whitespace -/libs/zlib/nintendods/README -whitespace -/libs/zlib/watcom/watcom_f.mak -crlf -whitespace -/libs/zlib/watcom/watcom_l.mak -crlf -whitespace +#Appveyor +/appveyor.yml -crlf -whitespace # Other diff --git a/.gitignore b/.gitignore index 567fecd8..922fac4a 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,9 @@ Win32_LIB_ASM_Release *.dgb *.debug *.debug.txt +/bin/VC10/ +/objs/VC10/ +*.user +*.db +*.opendb +/.vs diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..8a137d9d --- /dev/null +++ b/.travis.yml @@ -0,0 +1,264 @@ +language: c +sudo: required +dist: trusty + +matrix: + include: + - os: linux + addons: + apt: + packages: + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - p7zip-full + - gcc-4.4 + compiler: gcc-4.4 + #gcc-4.4 (Ubuntu/Linaro 4.4.7-8ubuntu1) 4.4.7 + - os: linux + addons: + apt: + packages: + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - p7zip-full + - gcc-4.6 + compiler: gcc-4.6 + #gcc-4.6 (Ubuntu/Linaro 4.6.4-6ubuntu2) 4.6.4 + - os: linux + addons: + apt: + packages: + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - p7zip-full + - gcc-4.7 + compiler: gcc-4.7 + #gcc-4.7 + - os: linux + compiler: gcc + #gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4 + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - p7zip-full + - gcc-4.8 + compiler: gcc-4.8 + #gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5 + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - p7zip-full + - gcc-7 + compiler: gcc-7 + env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wimplicit-fallthrough=3" + #gcc-7 (Ubuntu 7.2.0-1ubuntu1~14.04) 7.2.0 20170802 + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - p7zip-full + - gcc-8 + compiler: gcc-8 + env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wimplicit-fallthrough=3" + #gcc-8 (Ubuntu 7.2.0-1ubuntu1~14.04) 8.1.0 + - os: linux + compiler: clang + #clang version 3.5.0 (tags/RELEASE_350/final) + - os: linux + addons: + apt: + sources: + - llvm-toolchain-precise-3.5 + packages: + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - p7zip-full + - clang-3.5 + compiler: clang-3.5 + #Ubuntu clang version 3.5.0-4ubuntu2~trusty2 (tags/RELEASE_350/final) (based on LLVM 3.5.0) + - os: linux + addons: + apt: + sources: + - llvm-toolchain-precise-3.6 + - ubuntu-toolchain-r-test + packages: + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - p7zip-full + - clang-3.6 + compiler: clang-3.6 + #Ubuntu clang version 3.6.2-svn240577-1~exp1 (branches/release_36) (based on LLVM 3.6.2) + - os: linux + addons: + apt: + sources: + - llvm-toolchain-precise-3.7 + - ubuntu-toolchain-r-test + packages: + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - p7zip-full + - clang-3.7 + compiler: clang-3.7 + #Ubuntu clang version 3.7.1-svn253571-1~exp1 (branches/release_37) (based on LLVM 3.7.1) + - os: linux + addons: + apt: + sources: + - llvm-toolchain-precise-3.8 + - ubuntu-toolchain-r-test + packages: + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - p7zip-full + - clang-3.8 + compiler: clang-3.8 + #clang version 3.8.1-svn271127-1~exp1 (branches/release_38) + - os: linux + addons: + apt: + sources: + - llvm-toolchain-precise-3.9 + - ubuntu-toolchain-r-test + packages: + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - p7zip-full + - clang-3.9 + compiler: clang-3.9 + #clang version 3.9.X +# - os: linux +# addons: +# apt: +# sources: +# - llvm-toolchain-precise-4.0 +# - ubuntu-toolchain-r-test +# packages: +# - libsdl2-mixer-dev +# - libpng-dev +# - libgl1-mesa-dev +# - libgme-dev +# - p7zip-full +# - clang-4.0 +# compiler: clang-4.0 +# #clang version 4.0.X +# - os: linux +# addons: +# apt: +# sources: +# - llvm-toolchain-precise-5.0 +# - ubuntu-toolchain-r-test +# packages: +# - libsdl2-mixer-dev +# - libpng-dev +# - libgl1-mesa-dev +# - libgme-dev +# - p7zip-full +# - clang-5.0 +# compiler: clang-5.0 +# #clang version 5.0.X +# - os: osx +# osx_image: beta-xcode6.1 +# #Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn) +# - os: osx +# osx_image: beta-xcode6.2 +# compiler: gcc +# #Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn) +## - os: osx +## osx_image: beta-xcode6.3 +## #I think xcode.6.3 VM is broken, it does not boot +# - os: osx +# osx_image: xcode6.4 +# #Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) +# - os: osx +# osx_image: xcode7 +# #Apple LLVM version 7.0.0 (clang-700.0.72) +# - os: osx +# osx_image: xcode7.1 +# #Apple LLVM version 7.0.0 (clang-700.1.76) +# - os: osx +# osx_image: xcode7.2 +# #Apple LLVM version 7.0.2 (clang-700.1.81) + - os: osx + osx_image: xcode7.3 + #Apple LLVM version 7.3.0 (clang-703.0.31) + allow_failures: + - compiler: clang-3.5 + - compiler: clang-3.6 + - compiler: clang-3.7 + - compiler: clang-3.8 + - compiler: clang-3.9 + - compiler: clang-4.0 + - compiler: clang-5.0 + - compiler: gcc-8 + +cache: + apt: true + ccache: true + directories: + - $HOME/srb2_cache + +addons: + apt: + packages: + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - p7zip-full + +before_script: + - wget --verbose --server-response -c http://rosenthalcastle.org/srb2/SRB2-v2115-assets-2.7z -O $HOME/srb2_cache/SRB2-v2115-assets-2.7z + - 7z x $HOME/srb2_cache/SRB2-v2115-assets-2.7z -oassets + - mkdir build + - cd build + - export CFLAGS="-Wall -W -Werror $WFLAGS" + - export CCACHE_COMPRESS=true + - cmake .. -DCMAKE_BUILD_TYPE=Release + +before_install: + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2 sdl2_mixer game-music-emu p7zip; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install cmake||true; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -O -L https://www.libsdl.org/release/SDL2-2.0.6.dmg; hdiutil attach SDL2-2.0.6.dmg; sudo cp -a /Volumes/SDL2/SDL2.framework /Library/Frameworks/; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -O -L https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.dmg; hdiutil attach SDL2_mixer-2.0.1.dmg; sudo cp -a /Volumes/SDL2_mixer/SDL2_mixer.framework /Library/Frameworks/; fi + - mkdir -p $HOME/srb2_cache + +script: make -k diff --git a/CMakeLists.txt b/CMakeLists.txt index b8abe511..eb91866f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,12 @@ cmake_minimum_required(VERSION 3.0) project(SRB2 - VERSION 2.1.14 + VERSION 2.1.20 LANGUAGES C) +if(${PROJECT_SOURCE_DIR} MATCHES ${PROJECT_BINARY_DIR}) + message(FATAL_ERROR "In-source builds will bring you a world of pain. Please make a separate directory to invoke CMake from.") +endif() + # Set up CMAKE path set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") @@ -19,13 +23,13 @@ endfunction() # Macro to add OSX framework macro(add_framework fwname appname) find_library(FRAMEWORK_${fwname} - NAMES ${fwname} - PATHS ${CMAKE_OSX_SYSROOT}/System/Library - ${CMAKE_OSX_SYSROOT}/Library - /System/Library - /Library - PATH_SUFFIXES Frameworks - NO_DEFAULT_PATH) + NAMES ${fwname} + PATHS ${CMAKE_OSX_SYSROOT}/System/Library + ${CMAKE_OSX_SYSROOT}/Library + /System/Library + /Library + ATH_SUFFIXES Frameworks + NO_DEFAULT_PATH) if( ${FRAMEWORK_${fwname}} STREQUAL FRAMEWORK_${fwname}-NOTFOUND) MESSAGE(ERROR ": Framework ${fwname} not found") else() @@ -44,7 +48,7 @@ macro(copy_files_to_build_dir target dlllist_var) add_custom_command(TARGET ${target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${dlllist_item} - ${CMAKE_CURRENT_BINARY_DIR}/\$\(Configuration\)/${dllname} + $/${dllname} ) endforeach() endif() @@ -58,10 +62,6 @@ else() set(SRB2_SYSTEM_BITS 32) endif() -if(MSVC) - message(WARNING "!! MSVC BUILDS OF SRB2 CANNOT PLAY MULTIPLAYER !! You're more than welcome to try and fix this!") -endif() - # OS macros if (UNIX) add_definitions(-DUNIXCOMMON) @@ -80,11 +80,11 @@ endif() if(${CMAKE_SYSTEM} MATCHES "Darwin") add_definitions(-DMACOSX) - if(${CMAKE_C_COMPILER_ID} MATCHES "Clang") - set(CLANG ON) - endif() endif() +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") +set(CMAKE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") + # Set EXE names so the assets CMakeLists can refer to its target set(SRB2_SDL2_EXE_NAME srb2) set(SRB2_WIN_EXE_NAME srb2dd) @@ -98,7 +98,10 @@ add_subdirectory(assets) ## config.h generation set(GIT_EXECUTABLE "git" CACHE FILEPATH "Path to git binary") include(GitUtilities) -git_describe(SRB2_COMP_REVISION "${CMAKE_CURRENT_SOURCE_DIR}") +git_describe(SRB2_GIT_DESCRIBE "${CMAKE_SOURCE_DIR}") +git_current_branch(SRB2_GIT_BRANCH "${CMAKE_SOURCE_DIR}") +set(SRB2_COMP_BRANCH "${SRB2_GIT_BRANCH}") +set(SRB2_COMP_REVISION "${SRB2_GIT_DESCRIBE}") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/src/config.h) ##### PACKAGE CONFIGURATION ##### diff --git a/README.md b/README.md new file mode 100644 index 00000000..7d92ab30 --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# Sonic Robo Blast 2 + +[![Build status](https://ci.appveyor.com/api/projects/status/399d4hcw9yy7hg2y?svg=true)](https://ci.appveyor.com/project/STJr/srb2) +[![Build status](https://travis-ci.org/STJr/SRB2.svg?branch=master)](https://travis-ci.org/STJr/SRB2) +[![CircleCI](https://circleci.com/gh/STJr/SRB2/tree/master.svg?style=svg)](https://circleci.com/gh/STJr/SRB2/tree/master) + +[Sonic Robo Blast 2](https://srb2.org/) is a 3D Sonic the Hedgehog fangame based on a modified version of [Doom Legacy](http://doomlegacy.sourceforge.net/). + +## Dependencies +- NASM (x86 builds only) +- SDL2 (Linux/OS X only) +- SDL2-Mixer (Linux/OS X only) +- libupnp (Linux/OS X only) +- libgme (Linux/OS X only) + +## Compiling + +See [SRB2 Wiki/Source code compiling](http://wiki.srb2.org/wiki/Source_code_compiling) + +## Disclaimer +Sonic Team Junior is in no way affiliated with SEGA or Sonic Team. We do not claim ownership of any of SEGA's intellectual property used in SRB2. diff --git a/SRB2.cbp b/SRB2.cbp index 4834563e..5aa623fa 100644 --- a/SRB2.cbp +++ b/SRB2.cbp @@ -14,7 +14,7 @@ If you are compiling for Windows, use Mingw targets Interface Defines: _WINDOWS for DirectX Interface SDL for SDL Interface -HAVE_MIXER for SDL_Mixer +HAVE_MIXER for SDL2_mixer HAVE_PNG for PNG support (for APNG support. compile libs/libpng-src) HWRENDER for hardware render support @@ -31,7 +31,7 @@ HW3SOUND for 3D hardware sound support