mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-02-20 19:02:37 +00:00
Merge remote-tracking branch 'refs/remotes/origin/zarrotsu'
This commit is contained in:
commit
fb1c3293a8
870 changed files with 181600 additions and 30629 deletions
60
.circleci/config.yml
Normal file
60
.circleci/config.yml
Normal file
|
@ -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
|
18
.gitattributes
vendored
18
.gitattributes
vendored
|
@ -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
|
||||
|
|
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -13,3 +13,8 @@ Win32_LIB_ASM_Release
|
|||
*.dgb
|
||||
*.debug
|
||||
*.debug.txt
|
||||
/bin/VC10/
|
||||
/objs/VC10/
|
||||
*.user
|
||||
*.db
|
||||
*.opendb
|
||||
|
|
291
.travis.yml
Normal file
291
.travis.yml
Normal file
|
@ -0,0 +1,291 @@
|
|||
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-4.9
|
||||
compiler: gcc-4.9
|
||||
#gcc-4.9 (Ubuntu 4.9.3-8ubuntu2~14.04) 4.9.3
|
||||
- os: linux
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- libsdl2-mixer-dev
|
||||
- libpng-dev
|
||||
- libgl1-mesa-dev
|
||||
- libgme-dev
|
||||
- p7zip-full
|
||||
- gcc-5
|
||||
compiler: gcc-5
|
||||
#gcc-5 (Ubuntu 5.3.0-3ubuntu1~14.04) 5.3.0 20151204
|
||||
- os: linux
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- libsdl2-mixer-dev
|
||||
- libpng-dev
|
||||
- libgl1-mesa-dev
|
||||
- libgme-dev
|
||||
- p7zip-full
|
||||
- gcc-6
|
||||
compiler: gcc-6
|
||||
env: WFLAGS="-Wno-tautological-compare"
|
||||
#gcc-6 (Ubuntu 6.1.1-3ubuntu11~14.04.1) 6.1.1 20160511
|
||||
- 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
|
||||
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
|
||||
|
||||
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
|
280
CMakeLists.txt
280
CMakeLists.txt
|
@ -1,173 +1,127 @@
|
|||
#
|
||||
# Simple CMakeLists for Sonic Robo Blast 2
|
||||
#
|
||||
PROJECT(SRB2)
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
project(SRB2
|
||||
VERSION 2.1.19
|
||||
LANGUAGES C)
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
||||
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()
|
||||
|
||||
#
|
||||
# Dependencies
|
||||
#
|
||||
FIND_PACKAGE(SDL)
|
||||
FIND_PACKAGE(SDL_mixer)
|
||||
FIND_PACKAGE(PNG)
|
||||
# Set up CMAKE path
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
|
||||
|
||||
#
|
||||
# Common stuff
|
||||
#
|
||||
### Useful functions
|
||||
|
||||
# not added defines:
|
||||
# -DHAVE_PNG - does not build (incorrect use of PNG_EXPORT etc.)
|
||||
ADD_DEFINITIONS(-DDIRECTFULLSCREEN -DSDL -DHAVE_MIXER -DNOHW -DHW3SOUND -DHAVE_BLUA -DNOASM)
|
||||
# Prepend sources with current source directory
|
||||
function(prepend_sources SOURCE_FILES)
|
||||
foreach(SOURCE_FILE ${${SOURCE_FILES}})
|
||||
set(MODIFIED ${MODIFIED} ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_FILE})
|
||||
endforeach()
|
||||
set(${SOURCE_FILES} ${MODIFIED} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
SET(SDL_DIR sdl) # may be set to SDL2 optionally
|
||||
# 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
|
||||
ATH_SUFFIXES Frameworks
|
||||
NO_DEFAULT_PATH)
|
||||
if( ${FRAMEWORK_${fwname}} STREQUAL FRAMEWORK_${fwname}-NOTFOUND)
|
||||
MESSAGE(ERROR ": Framework ${fwname} not found")
|
||||
else()
|
||||
TARGET_LINK_LIBRARIES(${appname} PRIVATE "${FRAMEWORK_${fwname}}/${fwname}")
|
||||
MESSAGE(STATUS "Framework ${fwname} found at ${FRAMEWORK_${fwname}}")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
SET(COMMON_SRCS
|
||||
src/${SDL_DIR}/dosstr.c
|
||||
src/${SDL_DIR}/endtxt.c
|
||||
src/${SDL_DIR}/hwsym_sdl.c
|
||||
src/${SDL_DIR}/i_cdmus.c
|
||||
src/${SDL_DIR}/i_main.c
|
||||
src/${SDL_DIR}/i_net.c
|
||||
src/${SDL_DIR}/i_system.c
|
||||
src/${SDL_DIR}/i_video.c
|
||||
src/${SDL_DIR}/mixer_sound.c
|
||||
src/am_map.c
|
||||
src/b_bot.c
|
||||
src/blua/lapi.c
|
||||
src/blua/lauxlib.c
|
||||
src/blua/lbaselib.c
|
||||
src/blua/lcode.c
|
||||
src/blua/ldebug.c
|
||||
src/blua/ldo.c
|
||||
src/blua/ldump.c
|
||||
src/blua/lfunc.c
|
||||
src/blua/lgc.c
|
||||
src/blua/linit.c
|
||||
src/blua/llex.c
|
||||
src/blua/lmem.c
|
||||
src/blua/lobject.c
|
||||
src/blua/lopcodes.c
|
||||
src/blua/lparser.c
|
||||
src/blua/lstate.c
|
||||
src/blua/lstring.c
|
||||
src/blua/lstrlib.c
|
||||
src/blua/ltable.c
|
||||
src/blua/ltablib.c
|
||||
src/blua/ltm.c
|
||||
src/blua/lundump.c
|
||||
src/blua/lvm.c
|
||||
src/blua/lzio.c
|
||||
src/command.c
|
||||
src/comptime.c
|
||||
src/console.c
|
||||
src/d_clisrv.c
|
||||
src/d_main.c
|
||||
src/d_net.c
|
||||
src/d_netcmd.c
|
||||
src/d_netfil.c
|
||||
src/dehacked.c
|
||||
src/f_finale.c
|
||||
src/f_wipe.c
|
||||
src/filesrch.c
|
||||
src/g_game.c
|
||||
src/g_input.c
|
||||
src/hardware/hw3sound.c
|
||||
src/hu_stuff.c
|
||||
src/i_tcp.c
|
||||
src/info.c
|
||||
src/lua_baselib.c
|
||||
src/lua_consolelib.c
|
||||
src/lua_hooklib.c
|
||||
src/lua_hudlib.c
|
||||
src/lua_infolib.c
|
||||
src/lua_maplib.c
|
||||
src/lua_mathlib.c
|
||||
src/lua_mobjlib.c
|
||||
src/lua_playerlib.c
|
||||
src/lua_script.c
|
||||
src/lua_skinlib.c
|
||||
src/lua_thinkerlib.c
|
||||
src/lzf.c
|
||||
src/m_anigif.c
|
||||
src/m_argv.c
|
||||
src/m_bbox.c
|
||||
src/m_cheat.c
|
||||
src/m_cond.c
|
||||
src/m_fixed.c
|
||||
src/m_menu.c
|
||||
src/m_misc.c
|
||||
src/m_queue.c
|
||||
src/m_random.c
|
||||
src/md5.c
|
||||
src/mserv.c
|
||||
src/p_ceilng.c
|
||||
src/p_enemy.c
|
||||
src/p_fab.c
|
||||
src/p_floor.c
|
||||
src/p_inter.c
|
||||
src/p_lights.c
|
||||
src/p_map.c
|
||||
src/p_maputl.c
|
||||
src/p_mobj.c
|
||||
src/p_polyobj.c
|
||||
src/p_saveg.c
|
||||
src/p_setup.c
|
||||
src/p_sight.c
|
||||
src/p_spec.c
|
||||
src/p_telept.c
|
||||
src/p_tick.c
|
||||
src/p_user.c
|
||||
src/r_bsp.c
|
||||
src/r_data.c
|
||||
src/r_draw.c
|
||||
src/r_main.c
|
||||
src/r_plane.c
|
||||
src/r_segs.c
|
||||
src/r_sky.c
|
||||
src/r_splats.c
|
||||
src/r_things.c
|
||||
src/s_sound.c
|
||||
src/screen.c
|
||||
src/sounds.c
|
||||
src/st_stuff.c
|
||||
src/string.c
|
||||
src/tables.c
|
||||
src/v_video.c
|
||||
src/w_wad.c
|
||||
src/y_inter.c
|
||||
src/z_zone.c
|
||||
)
|
||||
# Macro to copy Windows DLLs to Debug/Release folder for easy debugging
|
||||
# Note: this is general purpose, we could copy anything. Just using for DLLs on MSVC though
|
||||
macro(copy_files_to_build_dir target dlllist_var)
|
||||
if(MSVC)
|
||||
# http://stackoverflow.com/a/26983405/3064195
|
||||
foreach(dlllist_item ${${dlllist_var}})
|
||||
get_filename_component(dllname ${dlllist_item} NAME)
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
${dlllist_item}
|
||||
$<TARGET_FILE_DIR:${target}>/${dllname}
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
#
|
||||
# Platform-specific stuff
|
||||
#
|
||||
# 64-bit check
|
||||
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
|
||||
message(STATUS "Target is 64-bit")
|
||||
set(SRB2_SYSTEM_BITS 64)
|
||||
else()
|
||||
set(SRB2_SYSTEM_BITS 32)
|
||||
endif()
|
||||
|
||||
MACRO(EXTRALIB NAME)
|
||||
FIND_LIBRARY(${NAME}_LIBRARY NAMES ${NAME})
|
||||
IF(${NAME}_LIBRARY)
|
||||
MESSAGE(STATUS "Found lib${NAME}: ${${NAME}_LIBRARY}")
|
||||
SET(EXTRA_LIBRARIES ${EXTRA_LIBRARIES} ${${NAME}_LIBRARY})
|
||||
ELSE(${NAME}_LIBRARY)
|
||||
MESSAGE(FATAL_ERROR "Could not find lib${NAME}!")
|
||||
ENDIF(${NAME}_LIBRARY)
|
||||
ENDMACRO(EXTRALIB)
|
||||
# OS macros
|
||||
if (UNIX)
|
||||
add_definitions(-DUNIXCOMMON)
|
||||
endif()
|
||||
|
||||
IF(${CMAKE_SYSTEM} MATCHES "FreeBSD")
|
||||
ADD_DEFINITIONS(-DUNIXCOMMON -DLINUX -DFREEBSD)
|
||||
EXTRALIB(kvm)
|
||||
ELSEIF(${CMAKE_SYSTEM} MATCHES "Linux")
|
||||
ADD_DEFINITIONS(-DUNIXCOMMON -DLINUX)
|
||||
EXTRALIB(m)
|
||||
EXTRALIB(rt)
|
||||
ELSE(${CMAKE_SYSTEM} MATCHES "FreeBSD")
|
||||
ADD_DEFINITIONS(-DUNIXCOMMON -DLINUX)
|
||||
MESSAGE(WARNING "No specific settings for you system, it may be not supported!")
|
||||
ENDIF(${CMAKE_SYSTEM} MATCHES "FreeBSD")
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
find_program(OBJCOPY objcopy)
|
||||
endif()
|
||||
|
||||
#
|
||||
# Targets
|
||||
#
|
||||
INCLUDE_DIRECTORIES(${PNG_INCLUDE_DIRS} ${SDL_INCLUDE_DIR} ${SDL_MIXER_INCLUDE_DIRS})
|
||||
ADD_EXECUTABLE(SRB2 ${COMMON_SRCS})
|
||||
TARGET_LINK_LIBRARIES(SRB2 ${SDL_LIBRARY} ${SDL_MIXER_LIBRARIES} ${EXTRA_LIBRARIES})
|
||||
if(${CMAKE_SYSTEM} MATCHES "Linux")
|
||||
add_definitions(-DLINUX)
|
||||
if(${SRB2_SYSTEM_BITS} EQUAL 64)
|
||||
add_definitions(-DLINUX64)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(${CMAKE_SYSTEM} MATCHES "Darwin")
|
||||
add_definitions(-DMACOSX)
|
||||
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)
|
||||
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR}/src)
|
||||
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(assets)
|
||||
|
||||
|
||||
## config.h generation
|
||||
set(GIT_EXECUTABLE "git" CACHE FILEPATH "Path to git binary")
|
||||
include(GitUtilities)
|
||||
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 #####
|
||||
|
||||
if(${CMAKE_SYSTEM} MATCHES "Windows")
|
||||
set(CPACK_GENERATOR "ZIP")
|
||||
endif()
|
||||
if(${CMAKE_SYSTEM} MATCHES "Linux")
|
||||
set(CPACK_GENERATOR "TGZ")
|
||||
endif()
|
||||
if(${CMAKE_SYSTEM} MATCHES "Darwin")
|
||||
set(CPACK_GENERATOR "DragNDrop")
|
||||
endif()
|
||||
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Sonic Robo Blast 2")
|
||||
set(CPACK_PACKAGE_VENDOR "Sonic Team Jr.")
|
||||
#set(CPACK_PACKAGE_DESCRIPTION_FILE )
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR ${SRB2_VERSION_MAJOR})
|
||||
set(CPACK_PACKAGE_VERSION_MINOR ${SRB2_VERSION_MINOR})
|
||||
set(CPACK_PACKAGE_VERSION_PATCH ${SRB2_VERSION_PATCH})
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMAKE_VERSION_MAJOR}.${CMAKE_VERSION_MINOR}")
|
||||
include(CPack)
|
||||
|
|
23
README.md
Normal file
23
README.md
Normal file
|
@ -0,0 +1,23 @@
|
|||
# Sonic Robo Blast 2
|
||||
|
||||
[](https://ci.appveyor.com/project/STJr/srb2)
|
||||
[](https://travis-ci.org/STJr/SRB2)
|
||||
[](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)
|
||||
|
||||
Warning: 64-bit builds are not netgame compatible with 32-bit builds. Use at your own risk.
|
||||
|
||||
## 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.
|
28
SRB2_Debug.props
Normal file
28
SRB2_Debug.props
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ImportGroup Label="PropertySheets" />
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<ClCompile>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<AssemblerOutput>All</AssemblerOutput>
|
||||
<SmallerTypeCheck>true</SmallerTypeCheck>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>Debug</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup />
|
||||
</Project>
|
30
SRB2_Release.props
Normal file
30
SRB2_Release.props
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ImportGroup Label="PropertySheets" />
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<StringPooling>true</StringPooling>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Optimization>Full</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||
<GenerateDebugInformation>DebugFastLink</GenerateDebugInformation>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup />
|
||||
</Project>
|
46
SRB2_common.props
Normal file
46
SRB2_common.props
Normal file
|
@ -0,0 +1,46 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ImportGroup Label="PropertySheets" />
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<OutDir>$(SolutionDir)bin\VC10\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)objs\VC10\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PreprocessorDefinitions>HAVE_PNG;COMPVERSION;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<BrowseInformation>true</BrowseInformation>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<EnablePREfast>false</EnablePREfast>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<DisableSpecificWarnings>4244;4267</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(PlatformTarget)'=='x86'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>USEASM;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||
</Link>
|
||||
<CustomBuild>
|
||||
<Command>nasm -g -o $(IntDir)%(Filename).obj -f win32 "%(FullPath)"</Command>
|
||||
<Message>Compiling %(Filename).nas with NASM...</Message>
|
||||
<Outputs>$(IntDir)%(Filename).obj;%(Outputs)</Outputs>
|
||||
</CustomBuild>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(PlatformTarget)'!='x86'">
|
||||
<CustomBuild>
|
||||
<LinkObjects>false</LinkObjects>
|
||||
</CustomBuild>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup />
|
||||
</Project>
|
88
appveyor.yml
Normal file
88
appveyor.yml
Normal file
|
@ -0,0 +1,88 @@
|
|||
version: 2.1.19.{branch}-{build}
|
||||
os: MinGW
|
||||
|
||||
environment:
|
||||
CC: ccache
|
||||
CCACHE_CC: i686-w64-mingw32-gcc
|
||||
WINDRES: windres
|
||||
MINGW_SDK: c:\msys64\mingw32
|
||||
CFLAGS: -Wall -W -Werror
|
||||
NASM_ZIP: nasm-2.12.01
|
||||
NASM_URL: http://www.nasm.us/pub/nasm/releasebuilds/2.12.01/win64/nasm-2.12.01-win64.zip
|
||||
UPX_ZIP: upx391w
|
||||
UPX_URL: http://upx.sourceforge.net/download/upx391w.zip
|
||||
CCACHE_EXE: ccache.exe
|
||||
CCACHE_URL: http://alam.srb2.org/ccache.exe
|
||||
CCACHE_COMPRESS: true
|
||||
CCACHE_DIR: C:\Users\appveyor\.ccache
|
||||
|
||||
cache:
|
||||
- nasm-2.12.01.zip
|
||||
- upx391w.zip
|
||||
- ccache.exe
|
||||
- C:\Users\appveyor\.ccache
|
||||
|
||||
install:
|
||||
- if not exist "%NASM_ZIP%.zip" appveyor DownloadFile "%NASM_URL%" -FileName "%NASM_ZIP%.zip"
|
||||
- 7z x -y "%NASM_ZIP%.zip" -o%TMP% >null
|
||||
- robocopy /S /xx /ns /nc /nfl /ndl /np /njh /njs %TMP%\%NASM_ZIP% %MINGW_SDK%\bin nasm.exe || exit 0
|
||||
|
||||
- if not exist "%UPX_ZIP%.zip" appveyor DownloadFile "%UPX_URL%" -FileName "%UPX_ZIP%.zip"
|
||||
- 7z x -y "%UPX_ZIP%.zip" -o%TMP% >null
|
||||
- robocopy /S /xx /ns /nc /nfl /ndl /np /njh /njs %TMP%\%UPX_ZIP% %MINGW_SDK%\bin upx.exe || exit 0
|
||||
|
||||
- if not exist "%CCACHE_EXE%" appveyor DownloadFile "%CCACHE_URL%" -FileName "%CCACHE_EXE%"
|
||||
- ccache -M 99M
|
||||
- xcopy /Y /V /I ccache.exe %MINGW_SDK%\bin
|
||||
|
||||
configuration:
|
||||
- SDL
|
||||
- DD
|
||||
|
||||
before_build:
|
||||
- set Path=%MINGW_SDK%\bin;%Path%
|
||||
- i686-w64-mingw32-gcc --version
|
||||
- mingw32-make --version
|
||||
- nasm -v
|
||||
- upx -V
|
||||
- ccache -V
|
||||
- ccache -s
|
||||
- set SRB2_MFLAGS=-C src MINGW=1 WARNINGMODE=1 GCC63=1 CCACHE=1 NOOBJDUMP=1
|
||||
|
||||
build_script:
|
||||
- cmd: mingw32-make.exe %SRB2_MFLAGS% %CONFIGURATION%=1 clean
|
||||
- cmd: mingw32-make.exe %SRB2_MFLAGS% %CONFIGURATION%=1 ERRORMODE=1 -k
|
||||
|
||||
after_build:
|
||||
- ccache -s
|
||||
- cmd: git rev-parse --short %APPVEYOR_REPO_COMMIT%>%TMP%/gitshort.txt
|
||||
- cmd: set /P GITSHORT=<%TMP%/gitshort.txt
|
||||
- set BUILD_ARCHIVE=%APPVEYOR_REPO_BRANCH%-%GITSHORT%-%CONFIGURATION%.7z
|
||||
- set BUILDSARCHIVE=%APPVEYOR_REPO_BRANCH%-%CONFIGURATION%.7z
|
||||
- cmd: 7z a %BUILD_ARCHIVE% bin\Mingw\Release -xr!.gitignore
|
||||
- appveyor PushArtifact %BUILD_ARCHIVE%
|
||||
- cmd: copy %BUILD_ARCHIVE% %BUILDSARCHIVE%
|
||||
- appveyor PushArtifact %BUILDSARCHIVE%
|
||||
|
||||
test: off
|
||||
|
||||
#deploy:
|
||||
# - provider: FTP
|
||||
# protocol: ftps
|
||||
# host:
|
||||
# secure: NsLJEPIBvmwCOj8Tg8RoRQ==
|
||||
# username:
|
||||
# secure: ejxi5mvk7oLYu7QtbYojajEPigMy0mokaKhuEVuDZcA=
|
||||
# password:
|
||||
# secure: Hbn6Uy3lT0YZ88yFJ3aW4w==
|
||||
# folder: appveyor
|
||||
# application:
|
||||
# active_mode: false
|
||||
# on:
|
||||
# branch: master
|
||||
# appveyor_repo_tag: true
|
||||
|
||||
|
||||
on_finish:
|
||||
#- cmd: echo xfreerdp /u:appveyor /cert-ignore +clipboard /v:<ip>:<port>
|
||||
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
2
assets/.gitignore
vendored
Normal file
2
assets/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
*
|
||||
*.*
|
37
assets/CMakeLists.txt
Normal file
37
assets/CMakeLists.txt
Normal file
|
@ -0,0 +1,37 @@
|
|||
## Assets Target Configuration ##
|
||||
|
||||
# MD5 generation
|
||||
set(SRB2_ASSET_ALL
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/srb2.srb
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/player.dta
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rings.dta
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/zones.dta
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/patch.dta
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/music.dta
|
||||
)
|
||||
|
||||
set(SRB2_ASSET_HASHED
|
||||
srb2.srb
|
||||
player.dta
|
||||
rings.dta
|
||||
zones.dta
|
||||
patch.dta
|
||||
)
|
||||
|
||||
foreach(SRB2_ASSET ${SRB2_ASSET_HASHED})
|
||||
file(MD5 ${CMAKE_CURRENT_SOURCE_DIR}/${SRB2_ASSET} "SRB2_ASSET_${SRB2_ASSET}_HASH")
|
||||
set(SRB2_ASSET_${SRB2_ASSET}_HASH ${SRB2_ASSET_${SRB2_ASSET}_HASH} PARENT_SCOPE)
|
||||
endforeach()
|
||||
|
||||
# Installation
|
||||
|
||||
if(CLANG)
|
||||
get_target_property(outname SRB2SDL2 OUTPUT_NAME)
|
||||
install(FILES ${SRB2_ASSET_ALL}
|
||||
DESTINATION "${outname}.app/Contents/Resources"
|
||||
)
|
||||
else()
|
||||
install(FILES ${SRB2_ASSET_ALL}
|
||||
DESTINATION .
|
||||
)
|
||||
endif()
|
12
assets/debian/changelog
Normal file
12
assets/debian/changelog
Normal file
|
@ -0,0 +1,12 @@
|
|||
srb2-data (2.1.14~1) unstable; urgency=low
|
||||
|
||||
* Updated for SRB2 v2.1.14
|
||||
|
||||
-- Alam Arias <alam+debian@srb2.org> Sat, 6 Jan 2016 11:00:00 -0500
|
||||
|
||||
|
||||
srb2-data (2.0.6-2) maverick; urgency=high
|
||||
|
||||
* Initial proper release..
|
||||
|
||||
-- Callum Dickinson <gcfreak_ag20@hotmail.com> Sat, 29 Jan 2011 01:18:42 +1300
|
|
@ -37,7 +37,7 @@ RM := rm -rf
|
|||
DIR := $(shell pwd)
|
||||
|
||||
PACKAGE := $(shell cat $(DIR)/debian/control | grep 'Package:' | sed -e 's/Package: //g')
|
||||
DATAFILES := drill.dta music.dta soar.dta zones.dta player.dta rings.wpn srb2.wad
|
||||
DATAFILES := srb2.srb zones.dta player.dta rings.dta music.dta
|
||||
|
||||
DATADIR := usr/games/SRB2
|
||||
RESOURCEDIR := .
|
||||
|
@ -48,7 +48,7 @@ build:
|
|||
# This will need to be updated every time SRB2 official version is
|
||||
# Copy data files to their install locations, and add data files to include-binaries
|
||||
for file in $(DATAFILES); do \
|
||||
$(WGET) http://alam.srb2.org/SRB2/2.0.6-Final/Resources/$$file; \
|
||||
$(WGET) http://alam.srb2.org/SRB2/2.1.14-Final/Resources/$$file; \
|
||||
if test "$$file" = "srb2.wad"; then \
|
||||
$(INSTALL) $(RESOURCEDIR)/$$file $(DIR)/debian/tmp/$(DATADIR)/srb2.srb; \
|
||||
else \
|
1
assets/debian/source/format
Normal file
1
assets/debian/source/format
Normal file
|
@ -0,0 +1 @@
|
|||
3.0 (native)
|
2
bin/DC/.gitignore
vendored
Normal file
2
bin/DC/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/Dos/Debug/.gitignore
vendored
Normal file
2
bin/Dos/Debug/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/Dos/Release/.gitignore
vendored
Normal file
2
bin/Dos/Release/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/FreeBSD/Debug/.gitignore
vendored
Normal file
2
bin/FreeBSD/Debug/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/FreeBSD/Release/.gitignore
vendored
Normal file
2
bin/FreeBSD/Release/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
6
bin/Mingw/Debug/.gitignore
vendored
6
bin/Mingw/Debug/.gitignore
vendored
|
@ -1,3 +1,3 @@
|
|||
/srb2sdl.exe
|
||||
/srb2win.exe
|
||||
/r_opengl.dll
|
||||
*.exe
|
||||
*.mo
|
||||
r_opengl.dll
|
||||
|
|
6
bin/Mingw/Release/.gitignore
vendored
6
bin/Mingw/Release/.gitignore
vendored
|
@ -1,3 +1,3 @@
|
|||
/srb2sdl.exe
|
||||
/srb2win.exe
|
||||
/r_opengl.dll
|
||||
*.exe
|
||||
*.mo
|
||||
r_opengl.dll
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
srb2-data (2.0.6-2) maverick; urgency=high
|
||||
|
||||
* Initial proper release..
|
||||
|
||||
-- Callum Dickinson <gcfreak_ag20@hotmail.com> Sat, 29 Jan 2011 01:18:42 +1300
|
|
@ -1 +0,0 @@
|
|||
3.0 (quilt)
|
2
bin/SDL/Debug/.gitignore
vendored
Normal file
2
bin/SDL/Debug/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/SDL/Release/.gitignore
vendored
Normal file
2
bin/SDL/Release/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/ARMV4Dbg/.gitignore
vendored
Normal file
2
bin/WinCE/ARMV4Dbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/ARMV4IDbg/.gitignore
vendored
Normal file
2
bin/WinCE/ARMV4IDbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/ARMV4IRel/.gitignore
vendored
Normal file
2
bin/WinCE/ARMV4IRel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/ARMV4Rel/.gitignore
vendored
Normal file
2
bin/WinCE/ARMV4Rel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/ARMV4TDbg/.gitignore
vendored
Normal file
2
bin/WinCE/ARMV4TDbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/ARMV4TRel/.gitignore
vendored
Normal file
2
bin/WinCE/ARMV4TRel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/MIPS16Dbg/.gitignore
vendored
Normal file
2
bin/WinCE/MIPS16Dbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/MIPS16Rel/.gitignore
vendored
Normal file
2
bin/WinCE/MIPS16Rel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/MIPSIIDbg/.gitignore
vendored
Normal file
2
bin/WinCE/MIPSIIDbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/MIPSIIRel/.gitignore
vendored
Normal file
2
bin/WinCE/MIPSIIRel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/MIPSII_FPDbg/.gitignore
vendored
Normal file
2
bin/WinCE/MIPSII_FPDbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/MIPSII_FPRel/.gitignore
vendored
Normal file
2
bin/WinCE/MIPSII_FPRel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/MIPSIVDbg/.gitignore
vendored
Normal file
2
bin/WinCE/MIPSIVDbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/MIPSIVRel/.gitignore
vendored
Normal file
2
bin/WinCE/MIPSIVRel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/MIPSIV_FPDbg/.gitignore
vendored
Normal file
2
bin/WinCE/MIPSIV_FPDbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/MIPSIV_FPRel/.gitignore
vendored
Normal file
2
bin/WinCE/MIPSIV_FPRel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/Release/.gitignore
vendored
Normal file
2
bin/WinCE/Release/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/SH3Dbg/.gitignore
vendored
Normal file
2
bin/WinCE/SH3Dbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/SH3Rel/.gitignore
vendored
Normal file
2
bin/WinCE/SH3Rel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/SH4Dbg/.gitignore
vendored
Normal file
2
bin/WinCE/SH4Dbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/SH4Rel/.gitignore
vendored
Normal file
2
bin/WinCE/SH4Rel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/X86Dbg/.gitignore
vendored
Normal file
2
bin/WinCE/X86Dbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/X86Rel/.gitignore
vendored
Normal file
2
bin/WinCE/X86Rel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/emulatorDbg/.gitignore
vendored
Normal file
2
bin/WinCE/emulatorDbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/emulatorRel/.gitignore
vendored
Normal file
2
bin/WinCE/emulatorRel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/dummy/.gitignore
vendored
Normal file
2
bin/dummy/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
46
cmake/Modules/CMakeASM_YASMInformation.cmake
Normal file
46
cmake/Modules/CMakeASM_YASMInformation.cmake
Normal file
|
@ -0,0 +1,46 @@
|
|||
|
||||
#=============================================================================
|
||||
# Copyright 2010 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
# support for the yasm assembler
|
||||
|
||||
set(CMAKE_ASM_YASM_SOURCE_FILE_EXTENSIONS nasm yasm asm)
|
||||
|
||||
if(NOT CMAKE_ASM_YASM_OBJECT_FORMAT)
|
||||
if(WIN32)
|
||||
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
|
||||
set(CMAKE_ASM_YASM_OBJECT_FORMAT win64)
|
||||
else()
|
||||
set(CMAKE_ASM_YASM_OBJECT_FORMAT win32)
|
||||
endif()
|
||||
elseif(APPLE)
|
||||
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
|
||||
set(CMAKE_ASM_YASM_OBJECT_FORMAT macho64)
|
||||
else()
|
||||
set(CMAKE_ASM_YASM_OBJECT_FORMAT macho)
|
||||
endif()
|
||||
else()
|
||||
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
|
||||
set(CMAKE_ASM_YASM_OBJECT_FORMAT elf64)
|
||||
else()
|
||||
set(CMAKE_ASM_YASM_OBJECT_FORMAT elf)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CMAKE_ASM_YASM_COMPILE_OBJECT "<CMAKE_ASM_YASM_COMPILER> <FLAGS> -f ${CMAKE_ASM_YASM_OBJECT_FORMAT} -o <OBJECT> <SOURCE>")
|
||||
|
||||
# Load the generic ASMInformation file:
|
||||
set(ASM_DIALECT "_YASM")
|
||||
include(CMakeASMInformation)
|
||||
set(ASM_DIALECT)
|
27
cmake/Modules/CMakeDetermineASM_YASMCompiler.cmake
Normal file
27
cmake/Modules/CMakeDetermineASM_YASMCompiler.cmake
Normal file
|
@ -0,0 +1,27 @@
|
|||
|
||||
#=============================================================================
|
||||
# Copyright 2010 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
# Find the nasm assembler. yasm (http://www.tortall.net/projects/yasm/) is nasm compatible
|
||||
|
||||
set(CMAKE_ASM_YASM_COMPILER_LIST nasm yasm)
|
||||
|
||||
if(NOT CMAKE_ASM_YASM_COMPILER)
|
||||
find_program(CMAKE_ASM_YASM_COMPILER yasm
|
||||
"$ENV{ProgramFiles}/YASM")
|
||||
endif()
|
||||
|
||||
# Load the generic DetermineASM compiler file with the DIALECT set properly:
|
||||
set(ASM_DIALECT "_YASM")
|
||||
include(CMakeDetermineASMCompiler)
|
||||
set(ASM_DIALECT)
|
23
cmake/Modules/CMakeTestASM_YASMCompiler.cmake
Normal file
23
cmake/Modules/CMakeTestASM_YASMCompiler.cmake
Normal file
|
@ -0,0 +1,23 @@
|
|||
|
||||
#=============================================================================
|
||||
# Copyright 2010 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
# This file is used by EnableLanguage in cmGlobalGenerator to
|
||||
# determine that the selected ASM_NASM "compiler" works.
|
||||
# For assembler this can only check whether the compiler has been found,
|
||||
# because otherwise there would have to be a separate assembler source file
|
||||
# for each assembler on every architecture.
|
||||
|
||||
set(ASM_DIALECT "_YASM")
|
||||
include(CMakeTestASMCompiler)
|
||||
set(ASM_DIALECT)
|
23
cmake/Modules/FindGME.cmake
Normal file
23
cmake/Modules/FindGME.cmake
Normal file
|
@ -0,0 +1,23 @@
|
|||
include(LibFindMacros)
|
||||
|
||||
libfind_pkg_check_modules(GME_PKGCONF GME)
|
||||
|
||||
find_path(GME_INCLUDE_DIR
|
||||
NAMES gme.h
|
||||
PATHS
|
||||
${GME_PKGCONF_INCLUDE_DIRS}
|
||||
"/usr/include/gme"
|
||||
"/usr/local/include/gme"
|
||||
)
|
||||
|
||||
find_library(GME_LIBRARY
|
||||
NAMES gme
|
||||
PATHS
|
||||
${GME_PKGCONF_LIBRARY_DIRS}
|
||||
"/usr/lib"
|
||||
"/usr/local/lib"
|
||||
)
|
||||
|
||||
set(GME_PROCESS_INCLUDES GME_INCLUDE_DIR)
|
||||
set(GME_PROCESS_LIBS GME_LIBRARY)
|
||||
libfind_process(GME)
|
33
cmake/Modules/FindSDL2.cmake
Normal file
33
cmake/Modules/FindSDL2.cmake
Normal file
|
@ -0,0 +1,33 @@
|
|||
# Find SDL2
|
||||
# Once done, this will define
|
||||
#
|
||||
# SDL2_FOUND - system has SDL2
|
||||
# SDL2_INCLUDE_DIRS - SDL2 include directories
|
||||
# SDL2_LIBRARIES - link libraries
|
||||
|
||||
include(LibFindMacros)
|
||||
|
||||
libfind_pkg_check_modules(SDL2_PKGCONF SDL2)
|
||||
|
||||
# includes
|
||||
find_path(SDL2_INCLUDE_DIR
|
||||
NAMES SDL.h
|
||||
PATHS
|
||||
${SDL2_PKGCONF_INCLUDE_DIRS}
|
||||
"/usr/include/SDL2"
|
||||
"/usr/local/include/SDL2"
|
||||
)
|
||||
|
||||
# library
|
||||
find_library(SDL2_LIBRARY
|
||||
NAMES SDL2
|
||||
PATHS
|
||||
${SDL2_PKGCONF_LIBRARY_DIRS}
|
||||
"/usr/lib"
|
||||
"/usr/local/lib"
|
||||
)
|
||||
|
||||
# set include dir variables
|
||||
set(SDL2_PROCESS_INCLUDES SDL2_INCLUDE_DIR)
|
||||
set(SDL2_PROCESS_LIBS SDL2_LIBRARY)
|
||||
libfind_process(SDL2)
|
34
cmake/Modules/FindSDL2_main.cmake
Normal file
34
cmake/Modules/FindSDL2_main.cmake
Normal file
|
@ -0,0 +1,34 @@
|
|||
# Find SDL2
|
||||
# Once done, this will define
|
||||
#
|
||||
# SDL2_MAIN_FOUND - system has SDL2
|
||||
# SDL2_MAIN_INCLUDE_DIRS - SDL2 include directories
|
||||
# SDL2_MAIN_LIBRARIES - link libraries
|
||||
|
||||
include(LibFindMacros)
|
||||
|
||||
libfind_pkg_check_modules(SDL2_MAIN_PKGCONF SDL2)
|
||||
|
||||
# includes
|
||||
find_path(SDL2_MAIN_INCLUDE_DIR
|
||||
NAMES SDL.h
|
||||
PATHS
|
||||
${SDL2_MAIN_PKGCONF_INCLUDE_DIRS}
|
||||
"/usr/include/SDL2"
|
||||
"/usr/local/include/SDL2"
|
||||
)
|
||||
|
||||
# library
|
||||
find_library(SDL2_MAIN_LIBRARY
|
||||
NAMES SDL2_main
|
||||
PATHS
|
||||
${SDL2_MAIN_PKGCONF_LIBRARY_DIRS}
|
||||
"/usr/lib"
|
||||
"/usr/local/lib"
|
||||
)
|
||||
|
||||
|
||||
# set include dir variables
|
||||
set(SDL2_MAIN_PROCESS_INCLUDES SDL2_MAIN_INCLUDE_DIR)
|
||||
set(SDL2_MAIN_PROCESS_LIBS SDL2_MAIN_LIBRARY)
|
||||
libfind_process(SDL2_MAIN)
|
34
cmake/Modules/FindSDL2_mixer.cmake
Normal file
34
cmake/Modules/FindSDL2_mixer.cmake
Normal file
|
@ -0,0 +1,34 @@
|
|||
# Find SDL2
|
||||
# Once done, this will define
|
||||
#
|
||||
# SDL2_MIXER_FOUND - system has SDL2
|
||||
# SDL2_MIXER_INCLUDE_DIRS - SDL2 include directories
|
||||
# SDL2_MIXER_LIBRARIES - link libraries
|
||||
|
||||
include(LibFindMacros)
|
||||
|
||||
libfind_pkg_check_modules(SDL2_MIXER_PKGCONF SDL2_mixer)
|
||||
|
||||
# includes
|
||||
find_path(SDL2_MIXER_INCLUDE_DIR
|
||||
NAMES SDL_mixer.h
|
||||
PATHS
|
||||
${SDL2_MIXER_PKGCONF_INCLUDE_DIRS}
|
||||
"/usr/include/SDL2"
|
||||
"/usr/local/include/SDL2"
|
||||
)
|
||||
|
||||
# library
|
||||
find_library(SDL2_MIXER_LIBRARY
|
||||
NAMES SDL2_mixer
|
||||
PATHS
|
||||
${SDL2_MIXER_PKGCONF_LIBRARY_DIRS}
|
||||
"/usr/lib"
|
||||
"/usr/local/lib"
|
||||
)
|
||||
|
||||
|
||||
# set include dir variables
|
||||
set(SDL2_MIXER_PROCESS_INCLUDES SDL2_MIXER_INCLUDE_DIR)
|
||||
set(SDL2_MIXER_PROCESS_LIBS SDL2_MIXER_LIBRARY)
|
||||
libfind_process(SDL2_MIXER)
|
31
cmake/Modules/GitUtilities.cmake
Normal file
31
cmake/Modules/GitUtilities.cmake
Normal file
|
@ -0,0 +1,31 @@
|
|||
# Git utilities
|
||||
|
||||
if(__GitUtilities)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(__GitUtilities ON)
|
||||
|
||||
function(git_describe variable path)
|
||||
execute_process(COMMAND "${GIT_EXECUTABLE}" "describe"
|
||||
WORKING_DIRECTORY "${path}"
|
||||
RESULT_VARIABLE result
|
||||
OUTPUT_VARIABLE output
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
set(${variable} "${output}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(git_current_branch variable path)
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} "symbolic-ref" "--short" "HEAD"
|
||||
WORKING_DIRECTORY "${path}"
|
||||
RESULT_VARIABLE result
|
||||
OUTPUT_VARIABLE output
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
set(${variable} "${output}" PARENT_SCOPE)
|
||||
endfunction()
|
265
cmake/Modules/LibFindMacros.cmake
Normal file
265
cmake/Modules/LibFindMacros.cmake
Normal file
|
@ -0,0 +1,265 @@
|
|||
# Version 2.2
|
||||
# Public Domain, originally written by Lasse Kärkkäinen <tronic>
|
||||
# Maintained at https://github.com/Tronic/cmake-modules
|
||||
# Please send your improvements as pull requests on Github.
|
||||
|
||||
# Find another package and make it a dependency of the current package.
|
||||
# This also automatically forwards the "REQUIRED" argument.
|
||||
# Usage: libfind_package(<prefix> <another package> [extra args to find_package])
|
||||
macro (libfind_package PREFIX PKG)
|
||||
set(${PREFIX}_args ${PKG} ${ARGN})
|
||||
if (${PREFIX}_FIND_REQUIRED)
|
||||
set(${PREFIX}_args ${${PREFIX}_args} REQUIRED)
|
||||
endif()
|
||||
find_package(${${PREFIX}_args})
|
||||
set(${PREFIX}_DEPENDENCIES ${${PREFIX}_DEPENDENCIES};${PKG})
|
||||
unset(${PREFIX}_args)
|
||||
endmacro()
|
||||
|
||||
# A simple wrapper to make pkg-config searches a bit easier.
|
||||
# Works the same as CMake's internal pkg_check_modules but is always quiet.
|
||||
macro (libfind_pkg_check_modules)
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(${ARGN} QUIET)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# Avoid useless copy&pasta by doing what most simple libraries do anyway:
|
||||
# pkg-config, find headers, find library.
|
||||
# Usage: libfind_pkg_detect(<prefix> <pkg-config args> FIND_PATH <name> [other args] FIND_LIBRARY <name> [other args])
|
||||
# E.g. libfind_pkg_detect(SDL2 sdl2 FIND_PATH SDL.h PATH_SUFFIXES SDL2 FIND_LIBRARY SDL2)
|
||||
function (libfind_pkg_detect PREFIX)
|
||||
# Parse arguments
|
||||
set(argname pkgargs)
|
||||
foreach (i ${ARGN})
|
||||
if ("${i}" STREQUAL "FIND_PATH")
|
||||
set(argname pathargs)
|
||||
elseif ("${i}" STREQUAL "FIND_LIBRARY")
|
||||
set(argname libraryargs)
|
||||
else()
|
||||
set(${argname} ${${argname}} ${i})
|
||||
endif()
|
||||
endforeach()
|
||||
if (NOT pkgargs)
|
||||
message(FATAL_ERROR "libfind_pkg_detect requires at least a pkg_config package name to be passed.")
|
||||
endif()
|
||||
# Find library
|
||||
libfind_pkg_check_modules(${PREFIX}_PKGCONF ${pkgargs})
|
||||
if (pathargs)
|
||||
find_path(${PREFIX}_INCLUDE_DIR NAMES ${pathargs} HINTS ${${PREFIX}_PKGCONF_INCLUDE_DIRS})
|
||||
endif()
|
||||
if (libraryargs)
|
||||
find_library(${PREFIX}_LIBRARY NAMES ${libraryargs} HINTS ${${PREFIX}_PKGCONF_LIBRARY_DIRS})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Extracts a version #define from a version.h file, output stored to <PREFIX>_VERSION.
|
||||
# Usage: libfind_version_header(Foobar foobar/version.h FOOBAR_VERSION_STR)
|
||||
# Fourth argument "QUIET" may be used for silently testing different define names.
|
||||
# This function does nothing if the version variable is already defined.
|
||||
function (libfind_version_header PREFIX VERSION_H DEFINE_NAME)
|
||||
# Skip processing if we already have a version or if the include dir was not found
|
||||
if (${PREFIX}_VERSION OR NOT ${PREFIX}_INCLUDE_DIR)
|
||||
return()
|
||||
endif()
|
||||
set(quiet ${${PREFIX}_FIND_QUIETLY})
|
||||
# Process optional arguments
|
||||
foreach(arg ${ARGN})
|
||||
if (arg STREQUAL "QUIET")
|
||||
set(quiet TRUE)
|
||||
else()
|
||||
message(AUTHOR_WARNING "Unknown argument ${arg} to libfind_version_header ignored.")
|
||||
endif()
|
||||
endforeach()
|
||||
# Read the header and parse for version number
|
||||
set(filename "${${PREFIX}_INCLUDE_DIR}/${VERSION_H}")
|
||||
if (NOT EXISTS ${filename})
|
||||
if (NOT quiet)
|
||||
message(AUTHOR_WARNING "Unable to find ${${PREFIX}_INCLUDE_DIR}/${VERSION_H}")
|
||||
endif()
|
||||
return()
|
||||
endif()
|
||||
file(READ "${filename}" header)
|
||||
string(REGEX REPLACE ".*#[ \t]*define[ \t]*${DEFINE_NAME}[ \t]*\"([^\n]*)\".*" "\\1" match "${header}")
|
||||
# No regex match?
|
||||
if (match STREQUAL header)
|
||||
if (NOT quiet)
|
||||
message(AUTHOR_WARNING "Unable to find \#define ${DEFINE_NAME} \"<version>\" from ${${PREFIX}_INCLUDE_DIR}/${VERSION_H}")
|
||||
endif()
|
||||
return()
|
||||
endif()
|
||||
# Export the version string
|
||||
set(${PREFIX}_VERSION "${match}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Do the final processing once the paths have been detected.
|
||||
# If include dirs are needed, ${PREFIX}_PROCESS_INCLUDES should be set to contain
|
||||
# all the variables, each of which contain one include directory.
|
||||
# Ditto for ${PREFIX}_PROCESS_LIBS and library files.
|
||||
# Will set ${PREFIX}_FOUND, ${PREFIX}_INCLUDE_DIRS and ${PREFIX}_LIBRARIES.
|
||||
# Also handles errors in case library detection was required, etc.
|
||||
function (libfind_process PREFIX)
|
||||
# Skip processing if already processed during this configuration run
|
||||
if (${PREFIX}_FOUND)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(found TRUE) # Start with the assumption that the package was found
|
||||
|
||||
# Did we find any files? Did we miss includes? These are for formatting better error messages.
|
||||
set(some_files FALSE)
|
||||
set(missing_headers FALSE)
|
||||
|
||||
# Shorthands for some variables that we need often
|
||||
set(quiet ${${PREFIX}_FIND_QUIETLY})
|
||||
set(required ${${PREFIX}_FIND_REQUIRED})
|
||||
set(exactver ${${PREFIX}_FIND_VERSION_EXACT})
|
||||
set(findver "${${PREFIX}_FIND_VERSION}")
|
||||
set(version "${${PREFIX}_VERSION}")
|
||||
|
||||
# Lists of config option names (all, includes, libs)
|
||||
unset(configopts)
|
||||
set(includeopts ${${PREFIX}_PROCESS_INCLUDES})
|
||||
set(libraryopts ${${PREFIX}_PROCESS_LIBS})
|
||||
|
||||
# Process deps to add to
|
||||
foreach (i ${PREFIX} ${${PREFIX}_DEPENDENCIES})
|
||||
if (DEFINED ${i}_INCLUDE_OPTS OR DEFINED ${i}_LIBRARY_OPTS)
|
||||
# The package seems to export option lists that we can use, woohoo!
|
||||
list(APPEND includeopts ${${i}_INCLUDE_OPTS})
|
||||
list(APPEND libraryopts ${${i}_LIBRARY_OPTS})
|
||||
else()
|
||||
# If plural forms don't exist or they equal singular forms
|
||||
if ((NOT DEFINED ${i}_INCLUDE_DIRS AND NOT DEFINED ${i}_LIBRARIES) OR
|
||||
({i}_INCLUDE_DIR STREQUAL ${i}_INCLUDE_DIRS AND ${i}_LIBRARY STREQUAL ${i}_LIBRARIES))
|
||||
# Singular forms can be used
|
||||
if (DEFINED ${i}_INCLUDE_DIR)
|
||||
list(APPEND includeopts ${i}_INCLUDE_DIR)
|
||||
endif()
|
||||
if (DEFINED ${i}_LIBRARY)
|
||||
list(APPEND libraryopts ${i}_LIBRARY)
|
||||
endif()
|
||||
else()
|
||||
# Oh no, we don't know the option names
|
||||
message(FATAL_ERROR "We couldn't determine config variable names for ${i} includes and libs. Aieeh!")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if (includeopts)
|
||||
list(REMOVE_DUPLICATES includeopts)
|
||||
endif()
|
||||
|
||||
if (libraryopts)
|
||||
list(REMOVE_DUPLICATES libraryopts)
|
||||
endif()
|
||||
|
||||
string(REGEX REPLACE ".*[ ;]([^ ;]*(_INCLUDE_DIRS|_LIBRARIES))" "\\1" tmp "${includeopts} ${libraryopts}")
|
||||
if (NOT tmp STREQUAL "${includeopts} ${libraryopts}")
|
||||
message(AUTHOR_WARNING "Plural form ${tmp} found in config options of ${PREFIX}. This works as before but is now deprecated. Please only use singular forms INCLUDE_DIR and LIBRARY, and update your find scripts for LibFindMacros > 2.0 automatic dependency system (most often you can simply remove the PROCESS variables entirely).")
|
||||
endif()
|
||||
|
||||
# Include/library names separated by spaces (notice: not CMake lists)
|
||||
unset(includes)
|
||||
unset(libs)
|
||||
|
||||
# Process all includes and set found false if any are missing
|
||||
foreach (i ${includeopts})
|
||||
list(APPEND configopts ${i})
|
||||
if (NOT "${${i}}" STREQUAL "${i}-NOTFOUND")
|
||||
list(APPEND includes "${${i}}")
|
||||
else()
|
||||
set(found FALSE)
|
||||
set(missing_headers TRUE)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Process all libraries and set found false if any are missing
|
||||
foreach (i ${libraryopts})
|
||||
list(APPEND configopts ${i})
|
||||
if (NOT "${${i}}" STREQUAL "${i}-NOTFOUND")
|
||||
list(APPEND libs "${${i}}")
|
||||
else()
|
||||
set (found FALSE)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Version checks
|
||||
if (found AND findver)
|
||||
if (NOT version)
|
||||
message(WARNING "The find module for ${PREFIX} does not provide version information, so we'll just assume that it is OK. Please fix the module or remove package version requirements to get rid of this warning.")
|
||||
elseif (version VERSION_LESS findver OR (exactver AND NOT version VERSION_EQUAL findver))
|
||||
set(found FALSE)
|
||||
set(version_unsuitable TRUE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# If all-OK, hide all config options, export variables, print status and exit
|
||||
if (found)
|
||||
foreach (i ${configopts})
|
||||
mark_as_advanced(${i})
|
||||
endforeach()
|
||||
if (NOT quiet)
|
||||
message(STATUS "Found ${PREFIX} ${${PREFIX}_VERSION}")
|
||||
if (LIBFIND_DEBUG)
|
||||
message(STATUS " ${PREFIX}_DEPENDENCIES=${${PREFIX}_DEPENDENCIES}")
|
||||
message(STATUS " ${PREFIX}_INCLUDE_OPTS=${includeopts}")
|
||||
message(STATUS " ${PREFIX}_INCLUDE_DIRS=${includes}")
|
||||
message(STATUS " ${PREFIX}_LIBRARY_OPTS=${libraryopts}")
|
||||
message(STATUS " ${PREFIX}_LIBRARIES=${libs}")
|
||||
endif()
|
||||
set (${PREFIX}_INCLUDE_OPTS ${includeopts} PARENT_SCOPE)
|
||||
set (${PREFIX}_LIBRARY_OPTS ${libraryopts} PARENT_SCOPE)
|
||||
set (${PREFIX}_INCLUDE_DIRS ${includes} PARENT_SCOPE)
|
||||
set (${PREFIX}_LIBRARIES ${libs} PARENT_SCOPE)
|
||||
set (${PREFIX}_FOUND TRUE PARENT_SCOPE)
|
||||
endif()
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Format messages for debug info and the type of error
|
||||
set(vars "Relevant CMake configuration variables:\n")
|
||||
foreach (i ${configopts})
|
||||
mark_as_advanced(CLEAR ${i})
|
||||
set(val ${${i}})
|
||||
if ("${val}" STREQUAL "${i}-NOTFOUND")
|
||||
set (val "<not found>")
|
||||
elseif (val AND NOT EXISTS ${val})
|
||||
set (val "${val} (does not exist)")
|
||||
else()
|
||||
set(some_files TRUE)
|
||||
endif()
|
||||
set(vars "${vars} ${i}=${val}\n")
|
||||
endforeach()
|
||||
set(vars "${vars}You may use CMake GUI, cmake -D or ccmake to modify the values. Delete CMakeCache.txt to discard all values and force full re-detection if necessary.\n")
|
||||
if (version_unsuitable)
|
||||
set(msg "${PREFIX} ${${PREFIX}_VERSION} was found but")
|
||||
if (exactver)
|
||||
set(msg "${msg} only version ${findver} is acceptable.")
|
||||
else()
|
||||
set(msg "${msg} version ${findver} is the minimum requirement.")
|
||||
endif()
|
||||
else()
|
||||
if (missing_headers)
|
||||
set(msg "We could not find development headers for ${PREFIX}. Do you have the necessary dev package installed?")
|
||||
elseif (some_files)
|
||||
set(msg "We only found some files of ${PREFIX}, not all of them. Perhaps your installation is incomplete or maybe we just didn't look in the right place?")
|
||||
if(findver)
|
||||
set(msg "${msg} This could also be caused by incompatible version (if it helps, at least ${PREFIX} ${findver} should work).")
|
||||
endif()
|
||||
else()
|
||||
set(msg "We were unable to find package ${PREFIX}.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Fatal error out if REQUIRED
|
||||
if (required)
|
||||
set(msg "REQUIRED PACKAGE NOT FOUND\n${msg} This package is REQUIRED and you need to install it or adjust CMake configuration in order to continue building ${CMAKE_PROJECT_NAME}.")
|
||||
message(FATAL_ERROR "${msg}\n${vars}")
|
||||
endif()
|
||||
# Otherwise just print a nasty warning
|
||||
if (NOT quiet)
|
||||
message(WARNING "WARNING: MISSING PACKAGE\n${msg} This package is NOT REQUIRED and you may ignore this warning but by doing so you may miss some functionality of ${CMAKE_PROJECT_NAME}. \n${vars}")
|
||||
endif()
|
||||
endfunction()
|
38
comptime.bat
38
comptime.bat
|
@ -1,10 +1,32 @@
|
|||
@ECHO OFF
|
||||
set REV=Unknown
|
||||
@echo off
|
||||
set BRA=Unknown
|
||||
set REV=illegal
|
||||
|
||||
copy nul: /b +%1\comptime.c tmp.$$$ > nul
|
||||
move tmp.$$$ %1\comptime.c > nul
|
||||
SET REV=illegal
|
||||
FOR /F "usebackq" %%s IN (`svnversion %1`) DO @SET REV=%%s
|
||||
ECHO // Do not edit! This file was autogenerated > %1\comptime.h
|
||||
ECHO // by the %0 batch file >> %1\comptime.h
|
||||
ECHO // >> %1\comptime.h
|
||||
ECHO const char* comprevision = "r%REV%"; >> %1\comptime.h
|
||||
|
||||
if exist .git goto gitrev
|
||||
if exist ..\.git goto gitrev
|
||||
if exist .svn goto svnrev
|
||||
goto filwri
|
||||
|
||||
:gitrev
|
||||
set GIT=%2
|
||||
if "%GIT%"=="" set GIT=git
|
||||
for /f "usebackq" %%s in (`%GIT% rev-parse --abbrev-ref HEAD`) do @set BRA=%%s
|
||||
for /f "usebackq" %%s in (`%GIT% rev-parse HEAD`) do @set REV=%%s
|
||||
set REV=%REV:~0,8%
|
||||
goto filwri
|
||||
|
||||
:svnrev
|
||||
set BRA=Subversion
|
||||
for /f "usebackq" %%s in (`svnversion .`) do @set REV=%%s
|
||||
set REV=r%REV%
|
||||
goto filwri
|
||||
|
||||
:filwri
|
||||
echo // Do not edit! This file was autogenerated > %1\comptime.h
|
||||
echo // by the %0 batch file >> %1\comptime.h
|
||||
echo // >> %1\comptime.h
|
||||
echo const char* compbranch = "%BRA%"; >> %1\comptime.h
|
||||
echo const char* comprevision = "%REV%"; >> %1\comptime.h
|
||||
|
|
13
comptime.props
Normal file
13
comptime.props
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ImportGroup Label="PropertySheets" />
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
<ItemDefinitionGroup>
|
||||
<PreBuildEvent>
|
||||
<Command>"$(SolutionDir)comptime.bat" "$(ProjectDir).."</Command>
|
||||
<Message>Getting revision number from the SCM system</Message>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup />
|
||||
</Project>
|
12
comptime.sh
12
comptime.sh
|
@ -1,17 +1,19 @@
|
|||
#!/bin/sh -e
|
||||
#!/bin/bash -e
|
||||
path="."
|
||||
if [ x"$1" != x ]; then
|
||||
path="$1"
|
||||
fi
|
||||
|
||||
versiongit() {
|
||||
gitversion=`git describe`
|
||||
gitbranch=`git rev-parse --abbrev-ref HEAD`
|
||||
gitversion=`git rev-parse HEAD`
|
||||
cat <<EOF > $path/comptime.h
|
||||
|
||||
// Do not edit! This file was autogenerated
|
||||
// by the $0 script with git svn
|
||||
// by the $0 script with git
|
||||
//
|
||||
const char* comprevision = "$gitversion";
|
||||
const char* compbranch = "$gitbranch";
|
||||
const char* comprevision = "${gitversion:0:8}";
|
||||
EOF
|
||||
exit 0
|
||||
}
|
||||
|
@ -23,6 +25,7 @@ versionsvn() {
|
|||
// Do not edit! This file was autogenerated
|
||||
// by the $0 script with subversion
|
||||
//
|
||||
const char* compbranch = "Subversion";
|
||||
const char* comprevision = "r$svnrevision";
|
||||
EOF
|
||||
exit 0
|
||||
|
@ -34,6 +37,7 @@ versionfake() {
|
|||
// Do not edit! This file was autogenerated
|
||||
// by the $0 script with an unknown or nonexist SCM
|
||||
//
|
||||
const char* compbranch = "Unknown";
|
||||
const char* comprevision = "illegal";
|
||||
EOF
|
||||
}
|
||||
|
|
14
debian/control
vendored
14
debian/control
vendored
|
@ -4,13 +4,19 @@ Source: srb2
|
|||
Section: games
|
||||
Priority: extra
|
||||
Maintainer: Callum Dickinson <gcfreak_ag20@hotmail.com>
|
||||
Build-Depends: debhelper (>= 7.0.50~), libsdl1.2-dev (>= 1.2.7), libsdl-mixer1.2-dev (>= 1.2.7), libpng12-dev (>= 1.2.7), libglu1-dev | libglu-dev, libosmesa6-dev | libgl-dev, nasm [i386]
|
||||
Build-Depends: debhelper (>= 7.0.50~),
|
||||
libsdl2-dev,
|
||||
libsdl2-mixer-dev,
|
||||
libpng12-dev (>= 1.2.7),
|
||||
libglu1-dev | libglu-dev,
|
||||
libosmesa6-dev | libgl-dev,
|
||||
nasm [i386]
|
||||
Standards-Version: 3.8.4
|
||||
Homepage: http://www.srb2.org
|
||||
|
||||
Package: srb2
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, srb2-data (= 2.0.6)
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, srb2-data (= 2.1.14)
|
||||
Description: A cross-platform 3D Sonic fangame
|
||||
Sonic Robo Blast 2 is a 3D open-source Sonic the Hedgehog
|
||||
fangame built using a modified version of the Doom Legacy
|
||||
|
@ -22,8 +28,8 @@ Description: A cross-platform 3D Sonic fangame
|
|||
|
||||
Package: srb2-dbg
|
||||
Architecture: any
|
||||
# FIXME: should be Depends: ${shlibs:Depends}, ${misc:Depends}, srb2-data (= 2.0.6), srb2 but dh_shlibdeps is being an asshat
|
||||
Depends: libc6, ${misc:Depends}, srb2-data (= 2.0.6), srb2
|
||||
# FIXME: should be Depends: ${shlibs:Depends}, ${misc:Depends}, srb2-data (= 2.1.14), srb2 but dh_shlibdeps is being an asshat
|
||||
Depends: libc6, ${misc:Depends}, srb2-data (= 2.1.14), srb2
|
||||
Description: A cross-platform 3D Sonic fangame
|
||||
Sonic Robo Blast 2 is a 3D open-source Sonic the Hedgehog
|
||||
fangame built using a modified version of the Doom Legacy
|
||||
|
|
3
debian/docs
vendored
3
debian/docs
vendored
|
@ -1,2 +1 @@
|
|||
readme.txt
|
||||
readme.txt
|
||||
README.md
|
||||
|
|
17
debian/rules
vendored
17
debian/rules
vendored
|
@ -59,16 +59,18 @@ DBGNAME = debug/$(EXENAME)
|
|||
|
||||
PKGDIR = usr/games
|
||||
DBGDIR = usr/lib/debug/$(PKGDIR)
|
||||
PIXMAPS_DIR = usr/share/pixmaps
|
||||
DESKTOP_DIR = usr/share/applications
|
||||
PREFIX = $(shell test "$(CROSS_COMPILE_BUILD)" != "$(CROSS_COMPILE_HOST)" && echo "PREFIX=$(CROSS_COMPILE_HOST)")
|
||||
OS = LINUX=1
|
||||
NONX86 = $(shell test "`echo $(CROSS_COMPILE_HOST) | grep 'i[3-6]86'`" || echo "NONX86=1")
|
||||
MAKEARGS = $(OS) $(NONX86) $(PREFIX) EXENAME=$(EXENAME) DBGNAME=$(DBGNAME) SDL_PKGCONFIG=sdl PNG_PKGCONFIG=libpng NOOBJDUMP=1
|
||||
MAKEARGS = $(OS) $(NONX86) $(PREFIX) EXENAME=$(EXENAME) DBGNAME=$(DBGNAME) SDL_PKGCONFIG=sdl2 PNG_PKGCONFIG=libpng NOOBJDUMP=1
|
||||
MENUFILE1 = ?package($(PACKAGE)):needs="X11" section="$(SECTION)"
|
||||
MENUFILE2 = title="$(TITLE)" command="/$(PKGDIR)/$(PACKAGE)"
|
||||
# FIXME pkg-config dir hacks
|
||||
export PKG_CONFIG_LIBDIR = /usr/$(CROSS_COMPILE_HOST)/lib/pkgconfig
|
||||
export PKG_CONFIG_LIBDIR = /usr/lib/$(CROSS_COMPILE_HOST)/pkgconfig
|
||||
BINDIR := $(DIR)/bin/Linux/Release
|
||||
LDFLAGS += "-Wl,-rpath=/usr/$(CROSS_COMPILE_HOST)/lib/"
|
||||
LDFLAGS += "-Wl,-rpath=/usr/lib/$(CROSS_COMPILE_HOST)"
|
||||
|
||||
build:
|
||||
$(MKDIR) $(BINDIR)/debug
|
||||
|
@ -80,14 +82,23 @@ binary-indep:
|
|||
echo "no need to do any arch-independent stuff"
|
||||
|
||||
binary-arch:
|
||||
# create ddirs
|
||||
$(MKDIR) $(DIR)/debian/tmp/$(PKGDIR) $(DIR)/debian/tmp/$(DBGDIR)
|
||||
$(MKDIR) $(DIR)/debian/tmp/$(PKGDIR) $(DIR)/debian/tmp/$(DESKTOP_DIR)
|
||||
$(MKDIR) $(DIR)/debian/tmp/$(PKGDIR) $(DIR)/debian/tmp/$(PIXMAPS_DIR)
|
||||
# install main binaries
|
||||
$(INSTALL) $(BINDIR)/$(EXENAME) $(DIR)/debian/tmp/$(PKGDIR)/$(PACKAGE)
|
||||
$(INSTALL) $(BINDIR)/$(DBGNAME) $(DIR)/debian/tmp/$(DBGDIR)/$(PACKAGE)
|
||||
# Install desktop file and banner image
|
||||
$(INSTALL) $(DIR)/srb2.png $(DIR)/debian/tmp/usr/share/pixmaps
|
||||
$(INSTALL) $(DIR)/debian/srb2.desktop $(DIR)/debian/tmp/usr/share/applications
|
||||
# add compiled binaries to include-binaries
|
||||
echo $(BINDIR)/$(EXENAME) >> $(DIR)/debian/source/include-binaries
|
||||
echo $(BINDIR)/$(EXENAME) >> $(DIR)/debian/source/include-binaries
|
||||
# Generate install folder files
|
||||
echo $(PKGDIR) > $(DIR)/debian/$(PACKAGE).install
|
||||
echo $(DESKTOP_DIR) >> $(DIR)/debian/$(PACKAGE).install
|
||||
echo $(PIXMAPS_DIR) >> $(DIR)/debian/$(PACKAGE).install
|
||||
echo $(DBGDIR) > $(DIR)/debian/$(DBGPKG).install
|
||||
|
||||
binary: binary-arch
|
||||
|
|
10
debian/srb2.desktop
vendored
Normal file
10
debian/srb2.desktop
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
[Desktop Entry]
|
||||
Name=Sonic Robo Blast 2
|
||||
Comment=A free 3D Sonic the Hedgehog fan-game built using a modified ver. of the Doom Legacy source port
|
||||
Encoding=UTF-8
|
||||
Exec=srb2
|
||||
Icon=/usr/share/pixmaps/srb2.png
|
||||
Terminal=false
|
||||
Type=Application
|
||||
StartupNotify=false
|
||||
Categories=Application;Game;
|
8
libs/.gitattributes
vendored
Normal file
8
libs/.gitattributes
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
#All
|
||||
* -whitespace
|
||||
# Zlib
|
||||
/zlib/watcom/watcom_f.mak -crlf
|
||||
/zlib/watcom/watcom_l.mak -crlf
|
||||
#SDL2
|
||||
/SDL2/docs/README-porting.md conflict-marker-size=32
|
||||
# Other
|
21
libs/FMOD.props
Normal file
21
libs/FMOD.props
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ImportGroup Label="PropertySheets" />
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<IncludePath>$(SolutionDir)libs\fmodex\inc;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(SolutionDir)libs\fmodex\lib;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup />
|
||||
<ItemDefinitionGroup Condition="'$(PlatformTarget)'=='x64'">
|
||||
<Link>
|
||||
<AdditionalDependencies>fmodexL64_vc.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(PlatformTarget)'=='x86'">
|
||||
<Link>
|
||||
<AdditionalDependencies>fmodexL_vc.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup />
|
||||
</Project>
|
15
libs/SDL2.props
Normal file
15
libs/SDL2.props
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ImportGroup Label="PropertySheets" />
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<IncludePath>$(SolutionDir)libs\SDL2\include;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(SolutionDir)libs\SDL2\lib\$(PlatformTarget);$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<Link>
|
||||
<AdditionalDependencies>SDL2.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup />
|
||||
</Project>
|
16
libs/SDL2/BUGS.txt
Normal file
16
libs/SDL2/BUGS.txt
Normal file
|
@ -0,0 +1,16 @@
|
|||
|
||||
Bugs are now managed in the SDL bug tracker, here:
|
||||
|
||||
http://bugzilla.libsdl.org/
|
||||
|
||||
You may report bugs there, and search to see if a given issue has already
|
||||
been reported, discussed, and maybe even fixed.
|
||||
|
||||
|
||||
You may also find help on the SDL mailing list. Subscription information:
|
||||
|
||||
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
||||
|
||||
Bug reports are welcome here, but we really appreciate if you use Bugzilla, as
|
||||
bugs discussed on the mailing list may be forgotten or missed.
|
||||
|
20
libs/SDL2/COPYING.txt
Normal file
20
libs/SDL2/COPYING.txt
Normal file
|
@ -0,0 +1,20 @@
|
|||
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
53
libs/SDL2/CREDITS.txt
Normal file
53
libs/SDL2/CREDITS.txt
Normal file
|
@ -0,0 +1,53 @@
|
|||
|
||||
Simple DirectMedia Layer CREDITS
|
||||
Thanks to everyone who made this possible, including:
|
||||
|
||||
* Cliff Matthews, for giving me a reason to start this project. :)
|
||||
-- Executor rocks! *grin*
|
||||
|
||||
* Ryan Gordon for helping everybody out and keeping the dream alive. :)
|
||||
|
||||
* Gabriel Jacobo for his work on the Android port and generally helping out all around.
|
||||
|
||||
* Philipp Wiesemann for his attention to detail reviewing the entire SDL code base and proposes patches.
|
||||
|
||||
* Andreas Schiffler for his dedication to unit tests, Visual Studio projects, and managing the Google Summer of Code.
|
||||
|
||||
* Mike Sartain for incorporating SDL into Team Fortress 2 and cheering me on at Valve.
|
||||
|
||||
* Alfred Reynolds for the game controller API and general (in)sanity
|
||||
|
||||
* Jørgen Tjernø for numerous magical Mac OS X fixes.
|
||||
|
||||
* Pierre-Loup Griffais for his deep knowledge of OpenGL drivers.
|
||||
|
||||
* Julian Winter for the SDL 2.0 website.
|
||||
|
||||
* Sheena Smith for many months of great work on the SDL wiki creating the API documentation and style guides.
|
||||
|
||||
* Paul Hunkin for his port of SDL to Android during the Google Summer of Code 2010.
|
||||
|
||||
* Eli Gottlieb for his work on shaped windows during the Google Summer of Code 2010.
|
||||
|
||||
* Jim Grandpre for his work on multi-touch and gesture recognition during
|
||||
the Google Summer of Code 2010.
|
||||
|
||||
* Edgar "bobbens" Simo for his force feedback API development during the
|
||||
Google Summer of Code 2008.
|
||||
|
||||
* Aaron Wishnick for his work on audio resampling and pitch shifting during
|
||||
the Google Summer of Code 2008.
|
||||
|
||||
* Holmes Futrell for his port of SDL to the iPhone and iPod Touch during the
|
||||
Google Summer of Code 2008.
|
||||
|
||||
* Jon Atkins for SDL_image, SDL_mixer and SDL_net documentation.
|
||||
|
||||
* Everybody at Loki Software, Inc. for their great contributions!
|
||||
|
||||
And a big hand to everyone else who has contributed over the years.
|
||||
|
||||
THANKS! :)
|
||||
|
||||
-- Sam Lantinga <slouken@libsdl.org>
|
||||
|
15
libs/SDL2/INSTALL.txt
Normal file
15
libs/SDL2/INSTALL.txt
Normal file
|
@ -0,0 +1,15 @@
|
|||
|
||||
To install SDL for native development:
|
||||
make native
|
||||
|
||||
To install SDL for cross-compiling development:
|
||||
make cross
|
||||
|
||||
Look at the example programs in ./test, and check out online documentation:
|
||||
http://wiki.libsdl.org/
|
||||
|
||||
Join the SDL developer mailing list if you want to join the community:
|
||||
http://www.libsdl.org/mailing-list.php
|
||||
|
||||
That's it!
|
||||
Sam Lantinga <slouken@libsdl.org>
|
29
libs/SDL2/Makefile
Normal file
29
libs/SDL2/Makefile
Normal file
|
@ -0,0 +1,29 @@
|
|||
#
|
||||
# Makefile for installing the mingw32 version of the SDL library
|
||||
|
||||
CROSS_PATH := /usr/local/cross-tools
|
||||
ARCHITECTURES := i686-w64-mingw32 x86_64-w64-mingw32
|
||||
|
||||
all install:
|
||||
@echo "Type \"make native\" to install 32-bit to /usr"
|
||||
@echo "Type \"make cross\" to install 32-bit and 64-bit to $(CROSS_PATH)"
|
||||
|
||||
native:
|
||||
make install-package arch=i686-w64-mingw32 prefix=/usr
|
||||
|
||||
cross:
|
||||
for arch in $(ARCHITECTURES); do \
|
||||
make install-package arch=$$arch prefix=$(CROSS_PATH)/$$arch; \
|
||||
done
|
||||
|
||||
install-package:
|
||||
@if test -d $(arch) && test -d $(prefix); then \
|
||||
(cd $(arch) && cp -rv bin include lib share $(prefix)/); \
|
||||
sed "s|^prefix=.*|prefix=$(prefix)|" <$(arch)/bin/sdl2-config >$(prefix)/bin/sdl2-config; \
|
||||
chmod 755 $(prefix)/bin/sdl2-config; \
|
||||
sed "s|^libdir=.*|libdir=\'$(prefix)/lib\'|" <$(arch)/lib/libSDL2.la >$(prefix)/lib/libSDL2.la; \
|
||||
sed "s|^prefix=.*|prefix=$(prefix)|" <$(arch)/lib/pkgconfig/sdl2.pc >$(prefix)/lib/pkgconfig/sdl2.pc; \
|
||||
else \
|
||||
echo "*** ERROR: $(arch) or $(prefix) does not exist!"; \
|
||||
exit 1; \
|
||||
fi
|
13
libs/SDL2/README-SDL.txt
Normal file
13
libs/SDL2/README-SDL.txt
Normal file
|
@ -0,0 +1,13 @@
|
|||
|
||||
Please distribute this file with the SDL runtime environment:
|
||||
|
||||
The Simple DirectMedia Layer (SDL for short) is a cross-platform library
|
||||
designed to make it easy to write multi-media software, such as games and
|
||||
emulators.
|
||||
|
||||
The Simple DirectMedia Layer library source code is available from:
|
||||
http://www.libsdl.org/
|
||||
|
||||
This library is distributed under the terms of the zlib license:
|
||||
http://www.zlib.net/zlib_license.html
|
||||
|
21
libs/SDL2/README.txt
Normal file
21
libs/SDL2/README.txt
Normal file
|
@ -0,0 +1,21 @@
|
|||
|
||||
Simple DirectMedia Layer
|
||||
|
||||
(SDL)
|
||||
|
||||
Version 2.0
|
||||
|
||||
---
|
||||
http://www.libsdl.org/
|
||||
|
||||
Simple DirectMedia Layer is a cross-platform development library designed
|
||||
to provide low level access to audio, keyboard, mouse, joystick, and graphics
|
||||
hardware via OpenGL and Direct3D. It is used by video playback software,
|
||||
emulators, and popular games including Valve's award winning catalog
|
||||
and many Humble Bundle games.
|
||||
|
||||
More extensive documentation is available in the docs directory, starting
|
||||
with README.md
|
||||
|
||||
Enjoy!
|
||||
Sam Lantinga (slouken@libsdl.org)
|
199
libs/SDL2/WhatsNew.txt
Normal file
199
libs/SDL2/WhatsNew.txt
Normal file
|
@ -0,0 +1,199 @@
|
|||
|
||||
This is a list of major changes in SDL's version history.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
2.0.4:
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
General:
|
||||
* Added support for web applications using Emscripten, see docs/README-emscripten.md for more information
|
||||
* Added support for web applications using Native Client (NaCl), see docs/README-nacl.md for more information
|
||||
* Added an API to queue audio instead of using the audio callback:
|
||||
SDL_QueueAudio(), SDL_GetQueuedAudioSize(), SDL_ClearQueuedAudio()
|
||||
* Added events for audio device hot plug support:
|
||||
SDL_AUDIODEVICEADDED, SDL_AUDIODEVICEREMOVED
|
||||
* Added SDL_PointInRect()
|
||||
* Added SDL_HasAVX2() to detect CPUs with AVX2 support
|
||||
* Added SDL_SetWindowHitTest() to let apps treat parts of their SDL window like traditional window decorations (drag areas, resize areas)
|
||||
* Added SDL_GetGrabbedWindow() to get the window that currently has input grab, if any
|
||||
* Added SDL_RenderIsClipEnabled() to tell whether clipping is currently enabled in a renderer
|
||||
* Added SDL_CaptureMouse() to capture the mouse to get events while the mouse is not in your window
|
||||
* Added SDL_WarpMouseGlobal() to warp the mouse cursor in global screen space
|
||||
* Added SDL_GetGlobalMouseState() to get the current mouse state outside of an SDL window
|
||||
* Added a direction field to mouse wheel events to tell whether they are flipped (natural) or not
|
||||
* Added GL_CONTEXT_RELEASE_BEHAVIOR GL attribute (maps to [WGL|GLX]_ARB_context_flush_control extension)
|
||||
* Added EGL_KHR_create_context support to allow OpenGL ES version selection on some platforms
|
||||
* Added NV12 and NV21 YUV texture support for OpenGL and OpenGL ES 2.0 renderers
|
||||
* Added a Vivante video driver that is used on various SoC platforms
|
||||
* Added an event SDL_RENDER_DEVICE_RESET that is sent from the D3D renderers when the D3D device is lost, and from Android's event loop when the GLES context had to be recreated
|
||||
* Added a hint SDL_HINT_NO_SIGNAL_HANDLERS to disable SDL's built in signal handling
|
||||
* Added a hint SDL_HINT_THREAD_STACK_SIZE to set the stack size of SDL's threads
|
||||
* Added SDL_sqrtf(), SDL_tan(), and SDL_tanf() to the stdlib routines
|
||||
* Improved support for WAV and BMP files with unusual chunks in them
|
||||
* Renamed SDL_assert_data to SDL_AssertData and SDL_assert_state to SDL_AssertState
|
||||
* Added a hint SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN to prevent window interaction while cursor is hidden
|
||||
* Added SDL_GetDisplayDPI() to get the DPI information for a display
|
||||
* Added SDL_JoystickCurrentPowerLevel() to get the battery level of a joystick
|
||||
* Added SDL_JoystickFromInstanceID(), as a helper function, to get the SDL_Joystick* that an event is referring to.
|
||||
* Added SDL_GameControllerFromInstanceID(), as a helper function, to get the SDL_GameController* that an event is referring to.
|
||||
|
||||
Windows:
|
||||
* Added support for Windows Phone 8.1 and Windows 10/UWP (Universal Windows Platform)
|
||||
* Timer resolution is now 1 ms by default, adjustable with the SDL_HINT_TIMER_RESOLUTION hint
|
||||
* SDLmain no longer depends on the C runtime, so you can use the same .lib in both Debug and Release builds
|
||||
* Added SDL_SetWindowsMessageHook() to set a function to be called for every windows message before TranslateMessage()
|
||||
* Added a hint SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP to control whether SDL_PumpEvents() processes the Windows message loop
|
||||
* You can distinguish between real mouse and touch events by looking for SDL_TOUCH_MOUSEID in the mouse event "which" field
|
||||
* SDL_SysWMinfo now contains the window HDC
|
||||
* Added support for Unicode command line options
|
||||
* Prevent beeping when Alt-key combos are pressed
|
||||
* SDL_SetTextInputRect() re-positions the OS-rendered IME
|
||||
* Added a hint SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 to prevent generating SDL_WINDOWEVENT_CLOSE events when Alt-F4 is pressed
|
||||
* Added a hint SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING to use the old axis and button mapping for XInput devices (deprecated)
|
||||
|
||||
Mac OS X:
|
||||
* Implemented drag-and-drop support
|
||||
* Improved joystick hot-plug detection
|
||||
* The SDL_WINDOWEVENT_EXPOSED window event is triggered in the appropriate situations
|
||||
* Fixed relative mouse mode when the application loses/regains focus
|
||||
* Fixed bugs related to transitioning to and from Spaces-aware fullscreen-desktop mode
|
||||
* Fixed the refresh rate of display modes
|
||||
* SDL_SysWMInfo is now ARC-compatible
|
||||
* Added a hint SDL_HINT_MAC_BACKGROUND_APP to prevent forcing the application to become a foreground process
|
||||
|
||||
Linux:
|
||||
* Enabled building with Mir and Wayland support by default.
|
||||
* Added IBus IME support
|
||||
* Added a hint SDL_HINT_IME_INTERNAL_EDITING to control whether IBus should handle text editing internally instead of sending SDL_TEXTEDITING events
|
||||
* Added a hint SDL_HINT_VIDEO_X11_NET_WM_PING to allow disabling _NET_WM_PING protocol handling in SDL_CreateWindow()
|
||||
* Added support for multiple audio devices when using Pulseaudio
|
||||
* Fixed duplicate mouse events when using relative mouse motion
|
||||
|
||||
iOS:
|
||||
* Added support for iOS 8
|
||||
* The SDL_WINDOW_ALLOW_HIGHDPI window flag now enables high-dpi support, and SDL_GL_GetDrawableSize() or SDL_GetRendererOutputSize() gets the window resolution in pixels
|
||||
* SDL_GetWindowSize() and display mode sizes are in the "DPI-independent points" / "screen coordinates" coordinate space rather than pixels (matches OS X behavior)
|
||||
* Added native resolution support for the iPhone 6 Plus
|
||||
* Added support for MFi game controllers
|
||||
* Added support for the hint SDL_HINT_ACCELEROMETER_AS_JOYSTICK
|
||||
* Added sRGB OpenGL ES context support on iOS 7+
|
||||
* Added support for SDL_DisableScreenSaver(), SDL_EnableScreenSaver() and the hint SDL_HINT_VIDEO_ALLOW_SCREENSAVER
|
||||
* SDL_SysWMinfo now contains the OpenGL ES framebuffer and color renderbuffer objects used by the window's active GLES view
|
||||
* Fixed various rotation and orientation issues
|
||||
* Fixed memory leaks
|
||||
|
||||
Android:
|
||||
* Added a hint SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH to prevent mouse events from being registered as touch events
|
||||
* Added hints SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION and SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION
|
||||
* Added support for SDL_DisableScreenSaver(), SDL_EnableScreenSaver() and the hint SDL_HINT_VIDEO_ALLOW_SCREENSAVER
|
||||
* Added support for SDL_ShowMessageBox() and SDL_ShowSimpleMessageBox()
|
||||
|
||||
Raspberry Pi:
|
||||
* Added support for the Raspberry Pi 2
|
||||
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
2.0.3:
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Mac OS X:
|
||||
* Fixed creating an OpenGL context by default on Mac OS X 10.6
|
||||
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
2.0.2:
|
||||
---------------------------------------------------------------------------
|
||||
General:
|
||||
* Added SDL_GL_ResetAttributes() to reset OpenGL attributes to default values
|
||||
* Added an API to load a database of game controller mappings from a file:
|
||||
SDL_GameControllerAddMappingsFromFile(), SDL_GameControllerAddMappingsFromRW()
|
||||
* Added game controller mappings for the PS4 and OUYA controllers
|
||||
* Added SDL_GetDefaultAssertionHandler() and SDL_GetAssertionHandler()
|
||||
* Added SDL_DetachThread()
|
||||
* Added SDL_HasAVX() to determine if the CPU has AVX features
|
||||
* Added SDL_vsscanf(), SDL_acos(), and SDL_asin() to the stdlib routines
|
||||
* EGL can now create/manage OpenGL and OpenGL ES 1.x/2.x contexts, and share
|
||||
them using SDL_GL_SHARE_WITH_CURRENT_CONTEXT
|
||||
* Added a field "clicks" to the mouse button event which records whether the event is a single click, double click, etc.
|
||||
* The screensaver is now disabled by default, and there is a hint SDL_HINT_VIDEO_ALLOW_SCREENSAVER that can change that behavior.
|
||||
* Added a hint SDL_HINT_MOUSE_RELATIVE_MODE_WARP to specify whether mouse relative mode should be emulated using mouse warping.
|
||||
* testgl2 does not need to link with libGL anymore
|
||||
* Added testgles2 test program to demonstrate working with OpenGL ES 2.0
|
||||
* Added controllermap test program to visually map a game controller
|
||||
|
||||
Windows:
|
||||
* Support for OpenGL ES 2.x contexts using either WGL or EGL (natively via
|
||||
the driver or emulated through ANGLE)
|
||||
* Added a hint SDL_HINT_VIDEO_WIN_D3DCOMPILER to specify which D3D shader compiler to use for OpenGL ES 2 support through ANGLE
|
||||
* Added a hint SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT that is useful when creating multiple windows that should share the same OpenGL context.
|
||||
* Added an event SDL_RENDER_TARGETS_RESET that is sent when D3D9 render targets are reset after the device has been restored.
|
||||
|
||||
Mac OS X:
|
||||
* Added a hint SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK to control whether Ctrl+click should be treated as a right click on Mac OS X. This is off by default.
|
||||
|
||||
Linux:
|
||||
* Fixed fullscreen and focused behavior when receiving NotifyGrab events
|
||||
* Added experimental Wayland and Mir support, disabled by default
|
||||
|
||||
Android:
|
||||
* Joystick support (minimum SDK version required to build SDL is now 12,
|
||||
the required runtime version remains at 10, but on such devices joystick
|
||||
support won't be available).
|
||||
* Hotplugging support for joysticks
|
||||
* Added a hint SDL_HINT_ACCELEROMETER_AS_JOYSTICK to control whether the accelerometer should be listed as a 3 axis joystick, which it will by default.
|
||||
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
2.0.1:
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
General:
|
||||
* Added an API to get common filesystem paths in SDL_filesystem.h:
|
||||
SDL_GetBasePath(), SDL_GetPrefPath()
|
||||
* Added an API to do optimized YV12 and IYUV texture updates:
|
||||
SDL_UpdateYUVTexture()
|
||||
* Added an API to get the amount of RAM on the system:
|
||||
SDL_GetSystemRAM()
|
||||
* Added a macro to perform timestamp comparisons with SDL_GetTicks():
|
||||
SDL_TICKS_PASSED()
|
||||
* Dramatically improved OpenGL ES 2.0 rendering performance
|
||||
* Added OpenGL attribute SDL_GL_FRAMEBUFFER_SRGB_CAPABLE
|
||||
|
||||
Windows:
|
||||
* Created a static library configuration for the Visual Studio 2010 project
|
||||
* Added a hint to create the Direct3D device with support for multi-threading:
|
||||
SDL_HINT_RENDER_DIRECT3D_THREADSAFE
|
||||
* Added a function to get the D3D9 adapter index for a display:
|
||||
SDL_Direct3D9GetAdapterIndex()
|
||||
* Added a function to get the D3D9 device for a D3D9 renderer:
|
||||
SDL_RenderGetD3D9Device()
|
||||
* Fixed building SDL with the mingw32 toolchain (mingw-w64 is preferred)
|
||||
* Fixed crash when using two XInput controllers at the same time
|
||||
* Fixed detecting a mixture of XInput and DirectInput controllers
|
||||
* Fixed clearing a D3D render target larger than the window
|
||||
* Improved support for format specifiers in SDL_snprintf()
|
||||
|
||||
Mac OS X:
|
||||
* Added support for retina displays:
|
||||
Create your window with the SDL_WINDOW_ALLOW_HIGHDPI flag, and then use SDL_GL_GetDrawableSize() to find the actual drawable size. You are responsible for scaling mouse and drawing coordinates appropriately.
|
||||
* Fixed mouse warping in fullscreen mode
|
||||
* Right mouse click is emulated by holding the Ctrl key while left clicking
|
||||
|
||||
Linux:
|
||||
* Fixed float audio support with the PulseAudio driver
|
||||
* Fixed missing line endpoints in the OpenGL renderer on some drivers
|
||||
* X11 symbols are no longer defined to avoid collisions when linking statically
|
||||
|
||||
iOS:
|
||||
* Fixed status bar visibility on iOS 7
|
||||
* Flipped the accelerometer Y axis to match expected values
|
||||
|
||||
Android:
|
||||
IMPORTANT: You MUST get the updated SDLActivity.java to match C code
|
||||
* Moved EGL initialization to native code
|
||||
* Fixed the accelerometer axis rotation relative to the device rotation
|
||||
* Fixed race conditions when handling the EGL context on pause/resume
|
||||
* Touch devices are available for enumeration immediately after init
|
||||
|
||||
Raspberry Pi:
|
||||
* Added support for the Raspberry Pi, see README-raspberrypi.txt for details
|
464
libs/SDL2/docs/README-android.md
Normal file
464
libs/SDL2/docs/README-android.md
Normal file
|
@ -0,0 +1,464 @@
|
|||
Android
|
||||
================================================================================
|
||||
|
||||
Requirements:
|
||||
|
||||
Android SDK (version 12 or later)
|
||||
http://developer.android.com/sdk/index.html
|
||||
|
||||
Android NDK r7 or later
|
||||
http://developer.android.com/tools/sdk/ndk/index.html
|
||||
|
||||
Minimum API level supported by SDL: 10 (Android 2.3.3)
|
||||
Joystick support is available for API level >=12 devices.
|
||||
|
||||
================================================================================
|
||||
How the port works
|
||||
================================================================================
|
||||
|
||||
- Android applications are Java-based, optionally with parts written in C
|
||||
- As SDL apps are C-based, we use a small Java shim that uses JNI to talk to
|
||||
the SDL library
|
||||
- This means that your application C code must be placed inside an Android
|
||||
Java project, along with some C support code that communicates with Java
|
||||
- This eventually produces a standard Android .apk package
|
||||
|
||||
The Android Java code implements an "Activity" and can be found in:
|
||||
android-project/src/org/libsdl/app/SDLActivity.java
|
||||
|
||||
The Java code loads your game code, the SDL shared library, and
|
||||
dispatches to native functions implemented in the SDL library:
|
||||
src/core/android/SDL_android.c
|
||||
|
||||
Your project must include some glue code that starts your main() routine:
|
||||
src/main/android/SDL_android_main.c
|
||||
|
||||
|
||||
================================================================================
|
||||
Building an app
|
||||
================================================================================
|
||||
|
||||
For simple projects you can use the script located at build-scripts/androidbuild.sh
|
||||
|
||||
There's two ways of using it:
|
||||
|
||||
androidbuild.sh com.yourcompany.yourapp < sources.list
|
||||
androidbuild.sh com.yourcompany.yourapp source1.c source2.c ...sourceN.c
|
||||
|
||||
sources.list should be a text file with a source file name in each line
|
||||
Filenames should be specified relative to the current directory, for example if
|
||||
you are in the build-scripts directory and want to create the testgles.c test, you'll
|
||||
run:
|
||||
|
||||
./androidbuild.sh org.libsdl.testgles ../test/testgles.c
|
||||
|
||||
One limitation of this script is that all sources provided will be aggregated into
|
||||
a single directory, thus all your source files should have a unique name.
|
||||
|
||||
Once the project is complete the script will tell you where the debug APK is located.
|
||||
If you want to create a signed release APK, you can use the project created by this
|
||||
utility to generate it.
|
||||
|
||||
Finally, a word of caution: re running androidbuild.sh wipes any changes you may have
|
||||
done in the build directory for the app!
|
||||
|
||||
|
||||
For more complex projects, follow these instructions:
|
||||
|
||||
1. Copy the android-project directory wherever you want to keep your projects
|
||||
and rename it to the name of your project.
|
||||
2. Move or symlink this SDL directory into the <project>/jni directory
|
||||
3. Edit <project>/jni/src/Android.mk to include your source files
|
||||
4. Run 'ndk-build' (a script provided by the NDK). This compiles the C source
|
||||
|
||||
If you want to use the Eclipse IDE, skip to the Eclipse section below.
|
||||
|
||||
5. Create <project>/local.properties and use that to point to the Android SDK directory, by writing a line with the following form:
|
||||
|
||||
sdk.dir=PATH_TO_ANDROID_SDK
|
||||
|
||||
6. Run 'ant debug' in android/project. This compiles the .java and eventually
|
||||
creates a .apk with the native code embedded
|
||||
7. 'ant debug install' will push the apk to the device or emulator (if connected)
|
||||
|
||||
Here's an explanation of the files in the Android project, so you can customize them:
|
||||
|
||||
android-project/
|
||||
AndroidManifest.xml - package manifest. Among others, it contains the class name
|
||||
of the main Activity and the package name of the application.
|
||||
build.properties - empty
|
||||
build.xml - build description file, used by ant. The actual application name
|
||||
is specified here.
|
||||
default.properties - holds the target ABI for the application, android-10 and up
|
||||
project.properties - holds the target ABI for the application, android-10 and up
|
||||
local.properties - holds the SDK path, you should change this to the path to your SDK
|
||||
jni/ - directory holding native code
|
||||
jni/Android.mk - Android makefile that can call recursively the Android.mk files
|
||||
in all subdirectories
|
||||
jni/SDL/ - (symlink to) directory holding the SDL library files
|
||||
jni/SDL/Android.mk - Android makefile for creating the SDL shared library
|
||||
jni/src/ - directory holding your C/C++ source
|
||||
jni/src/Android.mk - Android makefile that you should customize to include your
|
||||
source code and any library references
|
||||
res/ - directory holding resources for your application
|
||||
res/drawable-* - directories holding icons for different phone hardware. Could be
|
||||
one dir called "drawable".
|
||||
res/layout/main.xml - Usually contains a file main.xml, which declares the screen layout.
|
||||
We don't need it because we use the SDL video output.
|
||||
res/values/strings.xml - strings used in your application, including the application name
|
||||
shown on the phone.
|
||||
src/org/libsdl/app/SDLActivity.java - the Java class handling the initialization and binding
|
||||
to SDL. Be very careful changing this, as the SDL library relies
|
||||
on this implementation.
|
||||
|
||||
|
||||
================================================================================
|
||||
Build an app with static linking of libSDL
|
||||
================================================================================
|
||||
|
||||
This build uses the Android NDK module system.
|
||||
|
||||
Instructions:
|
||||
1. Copy the android-project directory wherever you want to keep your projects
|
||||
and rename it to the name of your project.
|
||||
2. Rename <project>/jni/src/Android_static.mk to <project>/jni/src/Android.mk
|
||||
(overwrite the existing one)
|
||||
3. Edit <project>/jni/src/Android.mk to include your source files
|
||||
4. create and export an environment variable named NDK_MODULE_PATH that points
|
||||
to the parent directory of this SDL directory. e.g.:
|
||||
|
||||
export NDK_MODULE_PATH="$PWD"/..
|
||||
|
||||
5. Edit <project>/src/org/libsdl/app/SDLActivity.java and remove the call to
|
||||
System.loadLibrary("SDL2").
|
||||
6. Run 'ndk-build' (a script provided by the NDK). This compiles the C source
|
||||
|
||||
|
||||
================================================================================
|
||||
Customizing your application name
|
||||
================================================================================
|
||||
|
||||
To customize your application name, edit AndroidManifest.xml and replace
|
||||
"org.libsdl.app" with an identifier for your product package.
|
||||
|
||||
Then create a Java class extending SDLActivity and place it in a directory
|
||||
under src matching your package, e.g.
|
||||
|
||||
src/com/gamemaker/game/MyGame.java
|
||||
|
||||
Here's an example of a minimal class file:
|
||||
|
||||
--- MyGame.java --------------------------
|
||||
package com.gamemaker.game;
|
||||
|
||||
import org.libsdl.app.SDLActivity;
|
||||
|
||||
/**
|
||||
* A sample wrapper class that just calls SDLActivity
|
||||
*/
|
||||
|
||||
public class MyGame extends SDLActivity { }
|
||||
|
||||
------------------------------------------
|
||||
|
||||
Then replace "SDLActivity" in AndroidManifest.xml with the name of your
|
||||
class, .e.g. "MyGame"
|
||||
|
||||
================================================================================
|
||||
Customizing your application icon
|
||||
================================================================================
|
||||
|
||||
Conceptually changing your icon is just replacing the "ic_launcher.png" files in
|
||||
the drawable directories under the res directory. There are four directories for
|
||||
different screen sizes. These can be replaced with one dir called "drawable",
|
||||
containing an icon file "ic_launcher.png" with dimensions 48x48 or 72x72.
|
||||
|
||||
You may need to change the name of your icon in AndroidManifest.xml to match
|
||||
this icon filename.
|
||||
|
||||
================================================================================
|
||||
Loading assets
|
||||
================================================================================
|
||||
|
||||
Any files you put in the "assets" directory of your android-project directory
|
||||
will get bundled into the application package and you can load them using the
|
||||
standard functions in SDL_rwops.h.
|
||||
|
||||
There are also a few Android specific functions that allow you to get other
|
||||
useful paths for saving and loading data:
|
||||
* SDL_AndroidGetInternalStoragePath()
|
||||
* SDL_AndroidGetExternalStorageState()
|
||||
* SDL_AndroidGetExternalStoragePath()
|
||||
|
||||
See SDL_system.h for more details on these functions.
|
||||
|
||||
The asset packaging system will, by default, compress certain file extensions.
|
||||
SDL includes two asset file access mechanisms, the preferred one is the so
|
||||
called "File Descriptor" method, which is faster and doesn't involve the Dalvik
|
||||
GC, but given this method does not work on compressed assets, there is also the
|
||||
"Input Stream" method, which is automatically used as a fall back by SDL. You
|
||||
may want to keep this fact in mind when building your APK, specially when large
|
||||
files are involved.
|
||||
For more information on which extensions get compressed by default and how to
|
||||
disable this behaviour, see for example:
|
||||
|
||||
http://ponystyle.com/blog/2010/03/26/dealing-with-asset-compression-in-android-apps/
|
||||
|
||||
================================================================================
|
||||
Pause / Resume behaviour
|
||||
================================================================================
|
||||
|
||||
If SDL is compiled with SDL_ANDROID_BLOCK_ON_PAUSE defined (the default),
|
||||
the event loop will block itself when the app is paused (ie, when the user
|
||||
returns to the main Android dashboard). Blocking is better in terms of battery
|
||||
use, and it allows your app to spring back to life instantaneously after resume
|
||||
(versus polling for a resume message).
|
||||
|
||||
Upon resume, SDL will attempt to restore the GL context automatically.
|
||||
In modern devices (Android 3.0 and up) this will most likely succeed and your
|
||||
app can continue to operate as it was.
|
||||
|
||||
However, there's a chance (on older hardware, or on systems under heavy load),
|
||||
where the GL context can not be restored. In that case you have to listen for
|
||||
a specific message, (which is not yet implemented!) and restore your textures
|
||||
manually or quit the app (which is actually the kind of behaviour you'll see
|
||||
under iOS, if the OS can not restore your GL context it will just kill your app)
|
||||
|
||||
================================================================================
|
||||
Threads and the Java VM
|
||||
================================================================================
|
||||
|
||||
For a quick tour on how Linux native threads interoperate with the Java VM, take
|
||||
a look here: http://developer.android.com/guide/practices/jni.html
|
||||
|
||||
If you want to use threads in your SDL app, it's strongly recommended that you
|
||||
do so by creating them using SDL functions. This way, the required attach/detach
|
||||
handling is managed by SDL automagically. If you have threads created by other
|
||||
means and they make calls to SDL functions, make sure that you call
|
||||
Android_JNI_SetupThread() before doing anything else otherwise SDL will attach
|
||||
your thread automatically anyway (when you make an SDL call), but it'll never
|
||||
detach it.
|
||||
|
||||
================================================================================
|
||||
Using STL
|
||||
================================================================================
|
||||
|
||||
You can use STL in your project by creating an Application.mk file in the jni
|
||||
folder and adding the following line:
|
||||
|
||||
APP_STL := stlport_static
|
||||
|
||||
For more information check out CPLUSPLUS-SUPPORT.html in the NDK documentation.
|
||||
|
||||
================================================================================
|
||||
Additional documentation
|
||||
================================================================================
|
||||
|
||||
The documentation in the NDK docs directory is very helpful in understanding the
|
||||
build process and how to work with native code on the Android platform.
|
||||
|
||||
The best place to start is with docs/OVERVIEW.TXT
|
||||
|
||||
|
||||
================================================================================
|
||||
Using Eclipse
|
||||
================================================================================
|
||||
|
||||
First make sure that you've installed Eclipse and the Android extensions as described here:
|
||||
http://developer.android.com/tools/sdk/eclipse-adt.html
|
||||
|
||||
Once you've copied the SDL android project and customized it, you can create an Eclipse project from it:
|
||||
* File -> New -> Other
|
||||
* Select the Android -> Android Project wizard and click Next
|
||||
* Enter the name you'd like your project to have
|
||||
* Select "Create project from existing source" and browse for your project directory
|
||||
* Make sure the Build Target is set to Android 3.1 (API 12)
|
||||
* Click Finish
|
||||
|
||||
|
||||
================================================================================
|
||||
Using the emulator
|
||||
================================================================================
|
||||
|
||||
There are some good tips and tricks for getting the most out of the
|
||||
emulator here: http://developer.android.com/tools/devices/emulator.html
|
||||
|
||||
Especially useful is the info on setting up OpenGL ES 2.0 emulation.
|
||||
|
||||
Notice that this software emulator is incredibly slow and needs a lot of disk space.
|
||||
Using a real device works better.
|
||||
|
||||
================================================================================
|
||||
Troubleshooting
|
||||
================================================================================
|
||||
|
||||
You can create and run an emulator from the Eclipse IDE:
|
||||
* Window -> Android SDK and AVD Manager
|
||||
|
||||
You can see if adb can see any devices with the following command:
|
||||
|
||||
adb devices
|
||||
|
||||
You can see the output of log messages on the default device with:
|
||||
|
||||
adb logcat
|
||||
|
||||
You can push files to the device with:
|
||||
|
||||
adb push local_file remote_path_and_file
|
||||
|
||||
You can push files to the SD Card at /sdcard, for example:
|
||||
|
||||
adb push moose.dat /sdcard/moose.dat
|
||||
|
||||
You can see the files on the SD card with a shell command:
|
||||
|
||||
adb shell ls /sdcard/
|
||||
|
||||
You can start a command shell on the default device with:
|
||||
|
||||
adb shell
|
||||
|
||||
You can remove the library files of your project (and not the SDL lib files) with:
|
||||
|
||||
ndk-build clean
|
||||
|
||||
You can do a build with the following command:
|
||||
|
||||
ndk-build
|
||||
|
||||
You can see the complete command line that ndk-build is using by passing V=1 on the command line:
|
||||
|
||||
ndk-build V=1
|
||||
|
||||
If your application crashes in native code, you can use addr2line to convert the
|
||||
addresses in the stack trace to lines in your code.
|
||||
|
||||
For example, if your crash looks like this:
|
||||
|
||||
I/DEBUG ( 31): signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 400085d0
|
||||
I/DEBUG ( 31): r0 00000000 r1 00001000 r2 00000003 r3 400085d4
|
||||
I/DEBUG ( 31): r4 400085d0 r5 40008000 r6 afd41504 r7 436c6a7c
|
||||
I/DEBUG ( 31): r8 436c6b30 r9 435c6fb0 10 435c6f9c fp 4168d82c
|
||||
I/DEBUG ( 31): ip 8346aff0 sp 436c6a60 lr afd1c8ff pc afd1c902 cpsr 60000030
|
||||
I/DEBUG ( 31): #00 pc 0001c902 /system/lib/libc.so
|
||||
I/DEBUG ( 31): #01 pc 0001ccf6 /system/lib/libc.so
|
||||
I/DEBUG ( 31): #02 pc 000014bc /data/data/org.libsdl.app/lib/libmain.so
|
||||
I/DEBUG ( 31): #03 pc 00001506 /data/data/org.libsdl.app/lib/libmain.so
|
||||
|
||||
You can see that there's a crash in the C library being called from the main code.
|
||||
I run addr2line with the debug version of my code:
|
||||
|
||||
arm-eabi-addr2line -C -f -e obj/local/armeabi/libmain.so
|
||||
|
||||
and then paste in the number after "pc" in the call stack, from the line that I care about:
|
||||
000014bc
|
||||
|
||||
I get output from addr2line showing that it's in the quit function, in testspriteminimal.c, on line 23.
|
||||
|
||||
You can add logging to your code to help show what's happening:
|
||||
|
||||
#include <android/log.h>
|
||||
|
||||
__android_log_print(ANDROID_LOG_INFO, "foo", "Something happened! x = %d", x);
|
||||
|
||||
If you need to build without optimization turned on, you can create a file called
|
||||
"Application.mk" in the jni directory, with the following line in it:
|
||||
|
||||
APP_OPTIM := debug
|
||||
|
||||
|
||||
================================================================================
|
||||
Memory debugging
|
||||
================================================================================
|
||||
|
||||
The best (and slowest) way to debug memory issues on Android is valgrind.
|
||||
Valgrind has support for Android out of the box, just grab code using:
|
||||
|
||||
svn co svn://svn.valgrind.org/valgrind/trunk valgrind
|
||||
|
||||
... and follow the instructions in the file README.android to build it.
|
||||
|
||||
One thing I needed to do on Mac OS X was change the path to the toolchain,
|
||||
and add ranlib to the environment variables:
|
||||
export RANLIB=$NDKROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-ranlib
|
||||
|
||||
Once valgrind is built, you can create a wrapper script to launch your
|
||||
application with it, changing org.libsdl.app to your package identifier:
|
||||
|
||||
--- start_valgrind_app -------------------
|
||||
#!/system/bin/sh
|
||||
export TMPDIR=/data/data/org.libsdl.app
|
||||
exec /data/local/Inst/bin/valgrind --log-file=/sdcard/valgrind.log --error-limit=no $*
|
||||
------------------------------------------
|
||||
|
||||
Then push it to the device:
|
||||
|
||||
adb push start_valgrind_app /data/local
|
||||
|
||||
and make it executable:
|
||||
|
||||
adb shell chmod 755 /data/local/start_valgrind_app
|
||||
|
||||
and tell Android to use the script to launch your application:
|
||||
|
||||
adb shell setprop wrap.org.libsdl.app "logwrapper /data/local/start_valgrind_app"
|
||||
|
||||
If the setprop command says "could not set property", it's likely that
|
||||
your package name is too long and you should make it shorter by changing
|
||||
AndroidManifest.xml and the path to your class file in android-project/src
|
||||
|
||||
You can then launch your application normally and waaaaaaaiiittt for it.
|
||||
You can monitor the startup process with the logcat command above, and
|
||||
when it's done (or even while it's running) you can grab the valgrind
|
||||
output file:
|
||||
|
||||
adb pull /sdcard/valgrind.log
|
||||
|
||||
When you're done instrumenting with valgrind, you can disable the wrapper:
|
||||
|
||||
adb shell setprop wrap.org.libsdl.app ""
|
||||
|
||||
================================================================================
|
||||
Why is API level 10 the minimum required?
|
||||
================================================================================
|
||||
|
||||
API level 10 is the minimum required level at runtime (that is, on the device)
|
||||
because SDL requires some functionality for running not
|
||||
available on older devices. Since the incorporation of joystick support into SDL,
|
||||
the minimum SDK required to *build* SDL is version 12. Devices running API levels
|
||||
10-11 are still supported, only with the joystick functionality disabled.
|
||||
|
||||
Support for native OpenGL ES and ES2 applications was introduced in the NDK for
|
||||
API level 4 and 8. EGL was made a stable API in the NDK for API level 9, which
|
||||
has since then been obsoleted, with the recommendation to developers to bump the
|
||||
required API level to 10.
|
||||
As of this writing, according to http://developer.android.com/about/dashboards/index.html
|
||||
about 90% of the Android devices accessing Google Play support API level 10 or
|
||||
higher (March 2013).
|
||||
|
||||
================================================================================
|
||||
A note regarding the use of the "dirty rectangles" rendering technique
|
||||
================================================================================
|
||||
|
||||
If your app uses a variation of the "dirty rectangles" rendering technique,
|
||||
where you only update a portion of the screen on each frame, you may notice a
|
||||
variety of visual glitches on Android, that are not present on other platforms.
|
||||
This is caused by SDL's use of EGL as the support system to handle OpenGL ES/ES2
|
||||
contexts, in particular the use of the eglSwapBuffers function. As stated in the
|
||||
documentation for the function "The contents of ancillary buffers are always
|
||||
undefined after calling eglSwapBuffers".
|
||||
Setting the EGL_SWAP_BEHAVIOR attribute of the surface to EGL_BUFFER_PRESERVED
|
||||
is not possible for SDL as it requires EGL 1.4, available only on the API level
|
||||
17+, so the only workaround available on this platform is to redraw the entire
|
||||
screen each frame.
|
||||
|
||||
Reference: http://www.khronos.org/registry/egl/specs/EGLTechNote0001.html
|
||||
|
||||
================================================================================
|
||||
Known issues
|
||||
================================================================================
|
||||
|
||||
- The number of buttons reported for each joystick is hardcoded to be 36, which
|
||||
is the current maximum number of buttons Android can report.
|
||||
|
32
libs/SDL2/docs/README-cmake.md
Normal file
32
libs/SDL2/docs/README-cmake.md
Normal file
|
@ -0,0 +1,32 @@
|
|||
CMake
|
||||
================================================================================
|
||||
(www.cmake.org)
|
||||
|
||||
SDL's build system was traditionally based on autotools. Over time, this
|
||||
approach has suffered from several issues across the different supported
|
||||
platforms.
|
||||
To solve these problems, a new build system based on CMake is under development.
|
||||
It works in parallel to the legacy system, so users can experiment with it
|
||||
without complication.
|
||||
While still experimental, the build system should be usable on the following
|
||||
platforms:
|
||||
|
||||
* FreeBSD
|
||||
* Linux
|
||||
* VS.NET 2010
|
||||
* MinGW and Msys
|
||||
* OS X with support for XCode
|
||||
|
||||
|
||||
================================================================================
|
||||
Usage
|
||||
================================================================================
|
||||
|
||||
Assuming the source for SDL is located at ~/sdl
|
||||
|
||||
cd ~
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ../sdl
|
||||
|
||||
This will build the static and dynamic versions of SDL in the ~/build directory.
|
107
libs/SDL2/docs/README-directfb.md
Normal file
107
libs/SDL2/docs/README-directfb.md
Normal file
|
@ -0,0 +1,107 @@
|
|||
DirectFB
|
||||
========
|
||||
|
||||
Supports:
|
||||
|
||||
- Hardware YUV overlays
|
||||
- OpenGL - software only
|
||||
- 2D/3D accelerations (depends on directfb driver)
|
||||
- multiple displays
|
||||
- windows
|
||||
|
||||
What you need:
|
||||
|
||||
* DirectFB 1.0.1, 1.2.x, 1.3.0
|
||||
* Kernel-Framebuffer support: required: vesafb, radeonfb ....
|
||||
* Mesa 7.0.x - optional for OpenGL
|
||||
|
||||
/etc/directfbrc
|
||||
|
||||
This file should contain the following lines to make
|
||||
your joystick work and avoid crashes:
|
||||
------------------------
|
||||
disable-module=joystick
|
||||
disable-module=cle266
|
||||
disable-module=cyber5k
|
||||
no-linux-input-grab
|
||||
------------------------
|
||||
|
||||
To disable to use x11 backend when DISPLAY variable is found use
|
||||
|
||||
export SDL_DIRECTFB_X11_CHECK=0
|
||||
|
||||
To disable the use of linux input devices, i.e. multimice/multikeyboard support,
|
||||
use
|
||||
|
||||
export SDL_DIRECTFB_LINUX_INPUT=0
|
||||
|
||||
To use hardware accelerated YUV-overlays for YUV-textures, use:
|
||||
|
||||
export SDL_DIRECTFB_YUV_DIRECT=1
|
||||
|
||||
This is disabled by default. It will only support one
|
||||
YUV texture, namely the first. Every other YUV texture will be
|
||||
rendered in software.
|
||||
|
||||
In addition, you may use (directfb-1.2.x)
|
||||
|
||||
export SDL_DIRECTFB_YUV_UNDERLAY=1
|
||||
|
||||
to make the YUV texture an underlay. This will make the cursor to
|
||||
be shown.
|
||||
|
||||
Simple Window Manager
|
||||
=====================
|
||||
|
||||
The driver has support for a very, very basic window manager you may
|
||||
want to use when running with "wm=default". Use
|
||||
|
||||
export SDL_DIRECTFB_WM=1
|
||||
|
||||
to enable basic window borders. In order to have the window title rendered,
|
||||
you need to have the following font installed:
|
||||
|
||||
/usr/share/fonts/truetype/freefont/FreeSans.ttf
|
||||
|
||||
OpenGL Support
|
||||
==============
|
||||
|
||||
The following instructions will give you *software* OpenGL. However this
|
||||
works at least on all directfb supported platforms.
|
||||
|
||||
As of this writing 20100802 you need to pull Mesa from git and do the following:
|
||||
|
||||
------------------------
|
||||
git clone git://anongit.freedesktop.org/git/mesa/mesa
|
||||
cd mesa
|
||||
git checkout 2c9fdaf7292423c157fc79b5ce43f0f199dd753a
|
||||
------------------------
|
||||
|
||||
Edit configs/linux-directfb so that the Directories-section looks like
|
||||
------------------------
|
||||
# Directories
|
||||
SRC_DIRS = mesa glu
|
||||
GLU_DIRS = sgi
|
||||
DRIVER_DIRS = directfb
|
||||
PROGRAM_DIRS =
|
||||
------------------------
|
||||
|
||||
make linux-directfb
|
||||
make
|
||||
|
||||
echo Installing - please enter sudo pw.
|
||||
|
||||
sudo make install INSTALL_DIR=/usr/local/dfb_GL
|
||||
cd src/mesa/drivers/directfb
|
||||
make
|
||||
sudo make install INSTALL_DIR=/usr/local/dfb_GL
|
||||
------------------------
|
||||
|
||||
To run the SDL - testprograms:
|
||||
|
||||
export SDL_VIDEODRIVER=directfb
|
||||
export LD_LIBRARY_PATH=/usr/local/dfb_GL/lib
|
||||
export LD_PRELOAD=/usr/local/dfb_GL/libGL.so.7
|
||||
|
||||
./testgl
|
||||
|
130
libs/SDL2/docs/README-dynapi.md
Normal file
130
libs/SDL2/docs/README-dynapi.md
Normal file
|
@ -0,0 +1,130 @@
|
|||
Dynamic API
|
||||
================================================================================
|
||||
Originally posted by Ryan at:
|
||||
https://plus.google.com/103391075724026391227/posts/TB8UfnDYu4U
|
||||
|
||||
Background:
|
||||
|
||||
- The Steam Runtime has (at least in theory) a really kick-ass build of SDL2,
|
||||
but developers are shipping their own SDL2 with individual Steam games.
|
||||
These games might stop getting updates, but a newer SDL2 might be needed later.
|
||||
Certainly we'll always be fixing bugs in SDL, even if a new video target isn't
|
||||
ever needed, and these fixes won't make it to a game shipping its own SDL.
|
||||
- Even if we replace the SDL2 in those games with a compatible one, that is to
|
||||
say, edit a developer's Steam depot (yuck!), there are developers that are
|
||||
statically linking SDL2 that we can't do this for. We can't even force the
|
||||
dynamic loader to ignore their SDL2 in this case, of course.
|
||||
- If you don't ship an SDL2 with the game in some form, people that disabled the
|
||||
Steam Runtime, or just tried to run the game from the command line instead of
|
||||
Steam might find themselves unable to run the game, due to a missing dependency.
|
||||
- If you want to ship on non-Steam platforms like GOG or Humble Bundle, or target
|
||||
generic Linux boxes that may or may not have SDL2 installed, you have to ship
|
||||
the library or risk a total failure to launch. So now, you might have to have
|
||||
a non-Steam build plus a Steam build (that is, one with and one without SDL2
|
||||
included), which is inconvenient if you could have had one universal build
|
||||
that works everywhere.
|
||||
- We like the zlib license, but the biggest complaint from the open source
|
||||
community about the license change is the static linking. The LGPL forced this
|
||||
as a legal, not technical issue, but zlib doesn't care. Even those that aren't
|
||||
concerned about the GNU freedoms found themselves solving the same problems:
|
||||
swapping in a newer SDL to an older game often times can save the day.
|
||||
Static linking stops this dead.
|
||||
|
||||
So here's what we did:
|
||||
|
||||
SDL now has, internally, a table of function pointers. So, this is what SDL_Init
|
||||
now looks like:
|
||||
|
||||
UInt32 SDL_Init(Uint32 flags)
|
||||
{
|
||||
return jump_table.SDL_Init(flags);
|
||||
}
|
||||
|
||||
Except that is all done with a bunch of macro magic so we don't have to maintain
|
||||
every one of these.
|
||||
|
||||
What is jump_table.SDL_init()? Eventually, that's a function pointer of the real
|
||||
SDL_Init() that you've been calling all this time. But at startup, it looks more
|
||||
like this:
|
||||
|
||||
Uint32 SDL_Init_DEFAULT(Uint32 flags)
|
||||
{
|
||||
SDL_InitDynamicAPI();
|
||||
return jump_table.SDL_Init(flags);
|
||||
}
|
||||
|
||||
SDL_InitDynamicAPI() fills in jump_table with all the actual SDL function
|
||||
pointers, which means that this _DEFAULT function never gets called again.
|
||||
First call to any SDL function sets the whole thing up.
|
||||
|
||||
So you might be asking, what was the value in that? Isn't this what the operating
|
||||
system's dynamic loader was supposed to do for us? Yes, but now we've got this
|
||||
level of indirection, we can do things like this:
|
||||
|
||||
export SDL_DYNAMIC_API=/my/actual/libSDL-2.0.so.0
|
||||
./MyGameThatIsStaticallyLinkedToSDL2
|
||||
|
||||
And now, this game that is staticallly linked to SDL, can still be overridden
|
||||
with a newer, or better, SDL. The statically linked one will only be used as
|
||||
far as calling into the jump table in this case. But in cases where no override
|
||||
is desired, the statically linked version will provide its own jump table,
|
||||
and everyone is happy.
|
||||
|
||||
So now:
|
||||
- Developers can statically link SDL, and users can still replace it.
|
||||
(We'd still rather you ship a shared library, though!)
|
||||
- Developers can ship an SDL with their game, Valve can override it for, say,
|
||||
new features on SteamOS, or distros can override it for their own needs,
|
||||
but it'll also just work in the default case.
|
||||
- Developers can ship the same package to everyone (Humble Bundle, GOG, etc),
|
||||
and it'll do the right thing.
|
||||
- End users (and Valve) can update a game's SDL in almost any case,
|
||||
to keep abandoned games running on newer platforms.
|
||||
- Everyone develops with SDL exactly as they have been doing all along.
|
||||
Same headers, same ABI. Just get the latest version to enable this magic.
|
||||
|
||||
|
||||
A little more about SDL_InitDynamicAPI():
|
||||
|
||||
Internally, InitAPI does some locking to make sure everything waits until a
|
||||
single thread initializes everything (although even SDL_CreateThread() goes
|
||||
through here before spinning a thread, too), and then decides if it should use
|
||||
an external SDL library. If not, it sets up the jump table using the current
|
||||
SDL's function pointers (which might be statically linked into a program, or in
|
||||
a shared library of its own). If so, it loads that library and looks for and
|
||||
calls a single function:
|
||||
|
||||
SInt32 SDL_DYNAPI_entry(Uint32 version, void *table, Uint32 tablesize);
|
||||
|
||||
That function takes a version number (more on that in a moment), the address of
|
||||
the jump table, and the size, in bytes, of the table.
|
||||
Now, we've got policy here: this table's layout never changes; new stuff gets
|
||||
added to the end. Therefore SDL_DYNAPI_entry() knows that it can provide all
|
||||
the needed functions if tablesize <= sizeof its own jump table. If tablesize is
|
||||
bigger (say, SDL 2.0.4 is trying to load SDL 2.0.3), then we know to abort, but
|
||||
if it's smaller, we know we can provide the entire API that the caller needs.
|
||||
|
||||
The version variable is a failsafe switch.
|
||||
Right now it's always 1. This number changes when there are major API changes
|
||||
(so we know if the tablesize might be smaller, or entries in it have changed).
|
||||
Right now SDL_DYNAPI_entry gives up if the version doesn't match, but it's not
|
||||
inconceivable to have a small dispatch library that only supplies this one
|
||||
function and loads different, otherwise-incompatible SDL libraries and has the
|
||||
right one initialize the jump table based on the version. For something that
|
||||
must generically catch lots of different versions of SDL over time, like the
|
||||
Steam Client, this isn't a bad option.
|
||||
|
||||
Finally, I'm sure some people are reading this and thinking,
|
||||
"I don't want that overhead in my project!"
|
||||
To which I would point out that the extra function call through the jump table
|
||||
probably wouldn't even show up in a profile, but lucky you: this can all be
|
||||
disabled. You can build SDL without this if you absolutely must, but we would
|
||||
encourage you not to do that. However, on heavily locked down platforms like
|
||||
iOS, or maybe when debugging, it makes sense to disable it. The way this is
|
||||
designed in SDL, you just have to change one #define, and the entire system
|
||||
vaporizes out, and SDL functions exactly like it always did. Most of it is
|
||||
macro magic, so the system is contained to one C file and a few headers.
|
||||
However, this is on by default and you have to edit a header file to turn it
|
||||
off. Our hopes is that if we make it easy to disable, but not too easy,
|
||||
everyone will ultimately be able to get what they want, but we've gently
|
||||
nudged everyone towards what we think is the best solution.
|
37
libs/SDL2/docs/README-emscripten.md
Normal file
37
libs/SDL2/docs/README-emscripten.md
Normal file
|
@ -0,0 +1,37 @@
|
|||
Emscripten
|
||||
================================================================================
|
||||
|
||||
Build:
|
||||
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
$ emconfigure ../configure --host=asmjs-unknown-emscripten --disable-assembly --disable-threads --enable-cpuinfo=false CFLAGS="-O2"
|
||||
$ emmake make
|
||||
|
||||
Or with cmake:
|
||||
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
$ emcmake cmake ..
|
||||
$ emmake make
|
||||
|
||||
To build one of the tests:
|
||||
|
||||
$ cd test/
|
||||
$ emcc -O2 --js-opts 0 -g4 testdraw2.c -I../include ../build/.libs/libSDL2.a ../build/libSDL2_test.a -o a.html
|
||||
|
||||
Uses GLES2 renderer or software
|
||||
|
||||
tests: https://dl.dropboxusercontent.com/u/17360362/SDL2-em/index.html
|
||||
|
||||
Some other SDL2 libraries can be easily built (assuming SDL2 is installed somewhere):
|
||||
|
||||
SDL_mixer (http://www.libsdl.org/projects/SDL_mixer/):
|
||||
|
||||
$ EMCONFIGURE_JS=1 emconfigure ../configure
|
||||
build as usual...
|
||||
|
||||
SDL_gfx (http://cms.ferzkopp.net/index.php/software/13-sdl-gfx):
|
||||
|
||||
$ EMCONFIGURE_JS=1 emconfigure ../configure --disable-mmx
|
||||
build as usual...
|
71
libs/SDL2/docs/README-gesture.md
Normal file
71
libs/SDL2/docs/README-gesture.md
Normal file
|
@ -0,0 +1,71 @@
|
|||
Dollar Gestures
|
||||
===========================================================================
|
||||
SDL provides an implementation of the $1 gesture recognition system. This allows for recording, saving, loading, and performing single stroke gestures.
|
||||
|
||||
Gestures can be performed with any number of fingers (the centroid of the fingers must follow the path of the gesture), but the number of fingers must be constant (a finger cannot go down in the middle of a gesture). The path of a gesture is considered the path from the time when the final finger went down, to the first time any finger comes up.
|
||||
|
||||
Dollar gestures are assigned an Id based on a hash function. This is guaranteed to remain constant for a given gesture. There is a (small) chance that two different gestures will be assigned the same ID. In this case, simply re-recording one of the gestures should result in a different ID.
|
||||
|
||||
Recording:
|
||||
----------
|
||||
To begin recording on a touch device call:
|
||||
SDL_RecordGesture(SDL_TouchID touchId), where touchId is the id of the touch device you wish to record on, or -1 to record on all connected devices.
|
||||
|
||||
Recording terminates as soon as a finger comes up. Recording is acknowledged by an SDL_DOLLARRECORD event.
|
||||
A SDL_DOLLARRECORD event is a dgesture with the following fields:
|
||||
|
||||
* event.dgesture.touchId - the Id of the touch used to record the gesture.
|
||||
* event.dgesture.gestureId - the unique id of the recorded gesture.
|
||||
|
||||
|
||||
Performing:
|
||||
-----------
|
||||
As long as there is a dollar gesture assigned to a touch, every finger-up event will also cause an SDL_DOLLARGESTURE event with the following fields:
|
||||
|
||||
* event.dgesture.touchId - the Id of the touch which performed the gesture.
|
||||
* event.dgesture.gestureId - the unique id of the closest gesture to the performed stroke.
|
||||
* event.dgesture.error - the difference between the gesture template and the actual performed gesture. Lower error is a better match.
|
||||
* event.dgesture.numFingers - the number of fingers used to draw the stroke.
|
||||
|
||||
Most programs will want to define an appropriate error threshold and check to be sure that the error of a gesture is not abnormally high (an indicator that no gesture was performed).
|
||||
|
||||
|
||||
|
||||
Saving:
|
||||
-------
|
||||
To save a template, call SDL_SaveDollarTemplate(gestureId, dst) where gestureId is the id of the gesture you want to save, and dst is an SDL_RWops pointer to the file where the gesture will be stored.
|
||||
|
||||
To save all currently loaded templates, call SDL_SaveAllDollarTemplates(dst) where dst is an SDL_RWops pointer to the file where the gesture will be stored.
|
||||
|
||||
Both functions return the number of gestures successfully saved.
|
||||
|
||||
|
||||
Loading:
|
||||
--------
|
||||
To load templates from a file, call SDL_LoadDollarTemplates(touchId,src) where touchId is the id of the touch to load to (or -1 to load to all touch devices), and src is an SDL_RWops pointer to a gesture save file.
|
||||
|
||||
SDL_LoadDollarTemplates returns the number of templates successfully loaded.
|
||||
|
||||
|
||||
|
||||
===========================================================================
|
||||
Multi Gestures
|
||||
===========================================================================
|
||||
SDL provides simple support for pinch/rotate/swipe gestures.
|
||||
Every time a finger is moved an SDL_MULTIGESTURE event is sent with the following fields:
|
||||
|
||||
* event.mgesture.touchId - the Id of the touch on which the gesture was performed.
|
||||
* event.mgesture.x - the normalized x coordinate of the gesture. (0..1)
|
||||
* event.mgesture.y - the normalized y coordinate of the gesture. (0..1)
|
||||
* event.mgesture.dTheta - the amount that the fingers rotated during this motion.
|
||||
* event.mgesture.dDist - the amount that the fingers pinched during this motion.
|
||||
* event.mgesture.numFingers - the number of fingers used in the gesture.
|
||||
|
||||
|
||||
===========================================================================
|
||||
Notes
|
||||
===========================================================================
|
||||
For a complete example see test/testgesture.c
|
||||
|
||||
Please direct questions/comments to:
|
||||
jim.tla+sdl_touch@gmail.com
|
25
libs/SDL2/docs/README-hg.md
Normal file
25
libs/SDL2/docs/README-hg.md
Normal file
|
@ -0,0 +1,25 @@
|
|||
Mercurial
|
||||
=========
|
||||
|
||||
The latest development version of SDL is available via Mercurial.
|
||||
Mercurial allows you to get up-to-the-minute fixes and enhancements;
|
||||
as a developer works on a source tree, you can use "hg" to mirror that
|
||||
source tree instead of waiting for an official release. Please look
|
||||
at the Mercurial website ( http://mercurial.selenic.com/ ) for more
|
||||
information on using hg, where you can also download software for
|
||||
Mac OS X, Windows, and Unix systems.
|
||||
|
||||
hg clone http://hg.libsdl.org/SDL
|
||||
|
||||
If you are building SDL with an IDE, you will need to copy the file
|
||||
include/SDL_config.h.default to include/SDL_config.h before building.
|
||||
|
||||
If you are building SDL via configure, you will need to run autogen.sh
|
||||
before running configure.
|
||||
|
||||
There is a web interface to the subversion repository at:
|
||||
http://hg.libsdl.org/SDL/
|
||||
|
||||
There is an RSS feed available at that URL, for those that want to
|
||||
track commits in real time.
|
||||
|
266
libs/SDL2/docs/README-ios.md
Normal file
266
libs/SDL2/docs/README-ios.md
Normal file
|
@ -0,0 +1,266 @@
|
|||
iOS
|
||||
======
|
||||
|
||||
==============================================================================
|
||||
Building the Simple DirectMedia Layer for iOS 5.1+
|
||||
==============================================================================
|
||||
|
||||
Requirements: Mac OS X 10.8 or later and the iOS 7+ SDK.
|
||||
|
||||
Instructions:
|
||||
1. Open SDL.xcodeproj (located in Xcode-iOS/SDL) in Xcode.
|
||||
2. Select your desired target, and hit build.
|
||||
|
||||
There are three build targets:
|
||||
- libSDL.a:
|
||||
Build SDL as a statically linked library
|
||||
- testsdl:
|
||||
Build a test program (there are known test failures which are fine)
|
||||
- Template:
|
||||
Package a project template together with the SDL for iPhone static libraries and copies of the SDL headers. The template includes proper references to the SDL library and headers, skeleton code for a basic SDL program, and placeholder graphics for the application icon and startup screen.
|
||||
|
||||
|
||||
==============================================================================
|
||||
Build SDL for iOS from the command line
|
||||
==============================================================================
|
||||
|
||||
1. cd (PATH WHERE THE SDL CODE IS)/build-scripts
|
||||
2. ./iosbuild.sh
|
||||
|
||||
If everything goes fine, you should see a build/ios directory, inside there's
|
||||
two directories "lib" and "include".
|
||||
"include" contains a copy of the SDL headers that you'll need for your project,
|
||||
make sure to configure XCode to look for headers there.
|
||||
"lib" contains find two files, libSDL2.a and libSDL2main.a, you have to add both
|
||||
to your XCode project. These libraries contain three architectures in them,
|
||||
armv6 for legacy devices, armv7, and i386 (for the simulator).
|
||||
By default, iosbuild.sh will autodetect the SDK version you have installed using
|
||||
xcodebuild -showsdks, and build for iOS >= 3.0, you can override this behaviour
|
||||
by setting the MIN_OS_VERSION variable, ie:
|
||||
|
||||
MIN_OS_VERSION=4.2 ./iosbuild.sh
|
||||
|
||||
==============================================================================
|
||||
Using the Simple DirectMedia Layer for iOS
|
||||
==============================================================================
|
||||
|
||||
FIXME: This needs to be updated for the latest methods
|
||||
|
||||
Here is the easiest method:
|
||||
1. Build the SDL library (libSDL2.a) and the iPhone SDL Application template.
|
||||
2. Install the iPhone SDL Application template by copying it to one of Xcode's template directories. I recommend creating a directory called "SDL" in "/Developer/Platforms/iOS.platform/Developer/Library/Xcode/Project Templates/" and placing it there.
|
||||
3. Start a new project using the template. The project should be immediately ready for use with SDL.
|
||||
|
||||
Here is a more manual method:
|
||||
1. Create a new iOS view based application.
|
||||
2. Build the SDL static library (libSDL2.a) for iOS and include them in your project. Xcode will ignore the library that is not currently of the correct architecture, hence your app will work both on iOS and in the iOS Simulator.
|
||||
3. Include the SDL header files in your project.
|
||||
4. Remove the ApplicationDelegate.h and ApplicationDelegate.m files -- SDL for iOS provides its own UIApplicationDelegate. Remove MainWindow.xib -- SDL for iOS produces its user interface programmatically.
|
||||
5. Delete the contents of main.m and program your app as a regular SDL program instead. You may replace main.m with your own main.c, but you must tell Xcode not to use the project prefix file, as it includes Objective-C code.
|
||||
|
||||
==============================================================================
|
||||
Notes -- Retina / High-DPI and window sizes
|
||||
==============================================================================
|
||||
|
||||
Window and display mode sizes in SDL are in "screen coordinates" (or "points",
|
||||
in Apple's terminology) rather than in pixels. On iOS this means that a window
|
||||
created on an iPhone 6 will have a size in screen coordinates of 375 x 667,
|
||||
rather than a size in pixels of 750 x 1334. All iOS apps are expected to
|
||||
size their content based on screen coordinates / points rather than pixels,
|
||||
as this allows different iOS devices to have different pixel densities
|
||||
(Retina versus non-Retina screens, etc.) without apps caring too much.
|
||||
|
||||
By default SDL will not use the full pixel density of the screen on
|
||||
Retina/high-dpi capable devices. Use the SDL_WINDOW_ALLOW_HIGHDPI flag when
|
||||
creating your window to enable high-dpi support.
|
||||
|
||||
When high-dpi support is enabled, SDL_GetWindowSize and display mode sizes
|
||||
will still be in "screen coordinates" rather than pixels, but the window will
|
||||
have a much greater pixel density when the device supports it, and the
|
||||
SDL_GL_GetDrawableSize or SDL_GetRendererOutputSize functions (depending on
|
||||
whether raw OpenGL or the SDL_Render API is used) can be queried to determine
|
||||
the size in pixels of the drawable screen framebuffer.
|
||||
|
||||
Some OpenGL ES functions such as glViewport expect sizes in pixels rather than
|
||||
sizes in screen coordinates. When doing 2D rendering with OpenGL ES, an
|
||||
orthographic projection matrix using the size in screen coordinates
|
||||
(SDL_GetWindowSize) can be used in order to display content at the same scale
|
||||
no matter whether a Retina device is used or not.
|
||||
|
||||
==============================================================================
|
||||
Notes -- Application events
|
||||
==============================================================================
|
||||
|
||||
On iOS the application goes through a fixed life cycle and you will get
|
||||
notifications of state changes via application events. When these events
|
||||
are delivered you must handle them in an event callback because the OS may
|
||||
not give you any processing time after the events are delivered.
|
||||
|
||||
e.g.
|
||||
|
||||
int HandleAppEvents(void *userdata, SDL_Event *event)
|
||||
{
|
||||
switch (event->type)
|
||||
{
|
||||
case SDL_APP_TERMINATING:
|
||||
/* Terminate the app.
|
||||
Shut everything down before returning from this function.
|
||||
*/
|
||||
return 0;
|
||||
case SDL_APP_LOWMEMORY:
|
||||
/* You will get this when your app is paused and iOS wants more memory.
|
||||
Release as much memory as possible.
|
||||
*/
|
||||
return 0;
|
||||
case SDL_APP_WILLENTERBACKGROUND:
|
||||
/* Prepare your app to go into the background. Stop loops, etc.
|
||||
This gets called when the user hits the home button, or gets a call.
|
||||
*/
|
||||
return 0;
|
||||
case SDL_APP_DIDENTERBACKGROUND:
|
||||
/* This will get called if the user accepted whatever sent your app to the background.
|
||||
If the user got a phone call and canceled it, you'll instead get an SDL_APP_DIDENTERFOREGROUND event and restart your loops.
|
||||
When you get this, you have 5 seconds to save all your state or the app will be terminated.
|
||||
Your app is NOT active at this point.
|
||||
*/
|
||||
return 0;
|
||||
case SDL_APP_WILLENTERFOREGROUND:
|
||||
/* This call happens when your app is coming back to the foreground.
|
||||
Restore all your state here.
|
||||
*/
|
||||
return 0;
|
||||
case SDL_APP_DIDENTERFOREGROUND:
|
||||
/* Restart your loops here.
|
||||
Your app is interactive and getting CPU again.
|
||||
*/
|
||||
return 0;
|
||||
default:
|
||||
/* No special processing, add it to the event queue */
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
SDL_SetEventFilter(HandleAppEvents, NULL);
|
||||
|
||||
... run your main loop
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
==============================================================================
|
||||
Notes -- Accelerometer as Joystick
|
||||
==============================================================================
|
||||
|
||||
SDL for iPhone supports polling the built in accelerometer as a joystick device. For an example on how to do this, see the accelerometer.c in the demos directory.
|
||||
|
||||
The main thing to note when using the accelerometer with SDL is that while the iPhone natively reports accelerometer as floating point values in units of g-force, SDL_JoystickGetAxis reports joystick values as signed integers. Hence, in order to convert between the two, some clamping and scaling is necessary on the part of the iPhone SDL joystick driver. To convert SDL_JoystickGetAxis reported values BACK to units of g-force, simply multiply the values by SDL_IPHONE_MAX_GFORCE / 0x7FFF.
|
||||
|
||||
==============================================================================
|
||||
Notes -- OpenGL ES
|
||||
==============================================================================
|
||||
|
||||
Your SDL application for iOS uses OpenGL ES for video by default.
|
||||
|
||||
OpenGL ES for iOS supports several display pixel formats, such as RGBA8 and RGB565, which provide a 32 bit and 16 bit color buffer respectively. By default, the implementation uses RGB565, but you may use RGBA8 by setting each color component to 8 bits in SDL_GL_SetAttribute.
|
||||
|
||||
If your application doesn't use OpenGL's depth buffer, you may find significant performance improvement by setting SDL_GL_DEPTH_SIZE to 0.
|
||||
|
||||
Finally, if your application completely redraws the screen each frame, you may find significant performance improvement by setting the attribute SDL_GL_RETAINED_BACKING to 0.
|
||||
|
||||
OpenGL ES on iOS doesn't use the traditional system-framebuffer setup provided in other operating systems. Special care must be taken because of this:
|
||||
|
||||
- The drawable Renderbuffer must be bound to the GL_RENDERBUFFER binding point when SDL_GL_SwapWindow is called.
|
||||
- The drawable Framebuffer Object must be bound while rendering to the screen and when SDL_GL_SwapWindow is called.
|
||||
- If multisample antialiasing (MSAA) is used and glReadPixels is used on the screen, the drawable framebuffer must be resolved to the MSAA resolve framebuffer (via glBlitFramebuffer or glResolveMultisampleFramebufferAPPLE), and the MSAA resolve framebuffer must be bound to the GL_READ_FRAMEBUFFER binding point, before glReadPixels is called.
|
||||
|
||||
The above objects can be obtained via SDL_GetWindowWMInfo (in SDL_syswm.h).
|
||||
|
||||
==============================================================================
|
||||
Notes -- Keyboard
|
||||
==============================================================================
|
||||
|
||||
The SDL keyboard API has been extended to support on-screen keyboards:
|
||||
|
||||
void SDL_StartTextInput()
|
||||
-- enables text events and reveals the onscreen keyboard.
|
||||
|
||||
void SDL_StopTextInput()
|
||||
-- disables text events and hides the onscreen keyboard.
|
||||
|
||||
SDL_bool SDL_IsTextInputActive()
|
||||
-- returns whether or not text events are enabled (and the onscreen keyboard is visible)
|
||||
|
||||
|
||||
==============================================================================
|
||||
Notes -- Reading and Writing files
|
||||
==============================================================================
|
||||
|
||||
Each application installed on iPhone resides in a sandbox which includes its own Application Home directory. Your application may not access files outside this directory.
|
||||
|
||||
Once your application is installed its directory tree looks like:
|
||||
|
||||
MySDLApp Home/
|
||||
MySDLApp.app
|
||||
Documents/
|
||||
Library/
|
||||
Preferences/
|
||||
tmp/
|
||||
|
||||
When your SDL based iPhone application starts up, it sets the working directory to the main bundle (MySDLApp Home/MySDLApp.app), where your application resources are stored. You cannot write to this directory. Instead, I advise you to write document files to "../Documents/" and preferences to "../Library/Preferences".
|
||||
|
||||
More information on this subject is available here:
|
||||
http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Introduction/Introduction.html
|
||||
|
||||
==============================================================================
|
||||
Notes -- iPhone SDL limitations
|
||||
==============================================================================
|
||||
|
||||
Windows:
|
||||
Full-size, single window applications only. You cannot create multi-window SDL applications for iPhone OS. The application window will fill the display, though you have the option of turning on or off the menu-bar (pass SDL_CreateWindow the flag SDL_WINDOW_BORDERLESS).
|
||||
|
||||
Textures:
|
||||
The optimal texture formats on iOS are SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, and SDL_PIXELFORMAT_RGB24 pixel formats.
|
||||
|
||||
Loading Shared Objects:
|
||||
This is disabled by default since it seems to break the terms of the iOS SDK agreement for iOS versions prior to iOS 8. It can be re-enabled in SDL_config_iphoneos.h.
|
||||
|
||||
==============================================================================
|
||||
Game Center
|
||||
==============================================================================
|
||||
|
||||
Game Center integration might require that you break up your main loop in order to yield control back to the system. In other words, instead of running an endless main loop, you run each frame in a callback function, using:
|
||||
|
||||
int SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
|
||||
|
||||
This will set up the given function to be called back on the animation callback, and then you have to return from main() to let the Cocoa event loop run.
|
||||
|
||||
e.g.
|
||||
|
||||
extern "C"
|
||||
void ShowFrame(void*)
|
||||
{
|
||||
... do event handling, frame logic and rendering ...
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
... initialize game ...
|
||||
|
||||
#if __IPHONEOS__
|
||||
// Initialize the Game Center for scoring and matchmaking
|
||||
InitGameCenter();
|
||||
|
||||
// Set up the game to run in the window animation callback on iOS
|
||||
// so that Game Center and so forth works correctly.
|
||||
SDL_iPhoneSetAnimationCallback(window, 1, ShowFrame, NULL);
|
||||
#else
|
||||
while ( running ) {
|
||||
ShowFrame(0);
|
||||
DelayFrame();
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
82
libs/SDL2/docs/README-linux.md
Normal file
82
libs/SDL2/docs/README-linux.md
Normal file
|
@ -0,0 +1,82 @@
|
|||
Linux
|
||||
================================================================================
|
||||
|
||||
By default SDL will only link against glibc, the rest of the features will be
|
||||
enabled dynamically at runtime depending on the available features on the target
|
||||
system. So, for example if you built SDL with Xinerama support and the target
|
||||
system does not have the Xinerama libraries installed, it will be disabled
|
||||
at runtime, and you won't get a missing library error, at least with the
|
||||
default configuration parameters.
|
||||
|
||||
|
||||
================================================================================
|
||||
Build Dependencies
|
||||
================================================================================
|
||||
|
||||
Ubuntu 13.04, all available features enabled:
|
||||
|
||||
sudo apt-get install build-essential mercurial make cmake autoconf automake \
|
||||
libtool libasound2-dev libpulse-dev libaudio-dev libx11-dev libxext-dev \
|
||||
libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev \
|
||||
libxss-dev libgl1-mesa-dev libesd0-dev libdbus-1-dev libudev-dev \
|
||||
libgles1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libibus-1.0-dev
|
||||
|
||||
Ubuntu 14.04 can also add "libwayland-dev libmirclient-dev libxkbcommon-dev"
|
||||
to that command line for Wayland and Mir support.
|
||||
|
||||
NOTES:
|
||||
- This includes all the audio targets except arts, because Ubuntu pulled the
|
||||
artsc0-dev package, but in theory SDL still supports it.
|
||||
- DirectFB isn't included because the configure script (currently) fails to find
|
||||
it at all. You can do "sudo apt-get install libdirectfb-dev" and fix the
|
||||
configure script to include DirectFB support. Send patches. :)
|
||||
|
||||
|
||||
================================================================================
|
||||
Joystick does not work
|
||||
================================================================================
|
||||
|
||||
If you compiled or are using a version of SDL with udev support (and you should!)
|
||||
there's a few issues that may cause SDL to fail to detect your joystick. To
|
||||
debug this, start by installing the evtest utility. On Ubuntu/Debian:
|
||||
|
||||
sudo apt-get install evtest
|
||||
|
||||
Then run:
|
||||
|
||||
sudo evtest
|
||||
|
||||
You'll hopefully see your joystick listed along with a name like "/dev/input/eventXX"
|
||||
Now run:
|
||||
|
||||
cat /dev/input/event/XX
|
||||
|
||||
If you get a permission error, you need to set a udev rule to change the mode of
|
||||
your device (see below)
|
||||
|
||||
Also, try:
|
||||
|
||||
sudo udevadm info --query=all --name=input/eventXX
|
||||
|
||||
If you see a line stating ID_INPUT_JOYSTICK=1, great, if you don't see it,
|
||||
you need to set up an udev rule to force this variable.
|
||||
|
||||
A combined rule for the Saitek Pro Flight Rudder Pedals to fix both issues looks
|
||||
like:
|
||||
|
||||
SUBSYSTEM=="input", ATTRS{idProduct}=="0763", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
|
||||
SUBSYSTEM=="input", ATTRS{idProduct}=="0764", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
|
||||
|
||||
You can set up similar rules for your device by changing the values listed in
|
||||
idProduct and idVendor. To obtain these values, try:
|
||||
|
||||
sudo udevadm info -a --name=input/eventXX | grep idVendor
|
||||
sudo udevadm info -a --name=input/eventXX | grep idProduct
|
||||
|
||||
If multiple values come up for each of these, the one you want is the first one of each.
|
||||
|
||||
On other systems which ship with an older udev (such as CentOS), you may need
|
||||
to set up a rule such as:
|
||||
|
||||
SUBSYSTEM=="input", ENV{ID_CLASS}=="joystick", ENV{ID_INPUT_JOYSTICK}="1"
|
||||
|
230
libs/SDL2/docs/README-macosx.md
Normal file
230
libs/SDL2/docs/README-macosx.md
Normal file
|
@ -0,0 +1,230 @@
|
|||
Mac OS X
|
||||
==============================================================================
|
||||
|
||||
These instructions are for people using Apple's Mac OS X (pronounced
|
||||
"ten").
|
||||
|
||||
From the developer's point of view, OS X is a sort of hybrid Mac and
|
||||
Unix system, and you have the option of using either traditional
|
||||
command line tools or Apple's IDE Xcode.
|
||||
|
||||
To build SDL using the command line, use the standard configure and make
|
||||
process:
|
||||
|
||||
./configure
|
||||
make
|
||||
sudo make install
|
||||
|
||||
You can also build SDL as a Universal library (a single binary for both
|
||||
32-bit and 64-bit Intel architectures), on Mac OS X 10.7 and newer, by using
|
||||
the gcc-fat.sh script in build-scripts:
|
||||
|
||||
mkdir mybuild
|
||||
cd mybuild
|
||||
CC=$PWD/../build-scripts/gcc-fat.sh CXX=$PWD/../build-scripts/g++fat.sh ../configure
|
||||
make
|
||||
sudo make install
|
||||
|
||||
This script builds SDL with 10.5 ABI compatibility on i386 and 10.6
|
||||
ABI compatibility on x86_64 architectures. For best compatibility you
|
||||
should compile your application the same way.
|
||||
|
||||
Please note that building SDL requires at least Xcode 4.6 and the 10.7 SDK
|
||||
(even if you target back to 10.5 systems). PowerPC support for Mac OS X has
|
||||
been officially dropped as of SDL 2.0.2.
|
||||
|
||||
To use the library once it's built, you essential have two possibilities:
|
||||
use the traditional autoconf/automake/make method, or use Xcode.
|
||||
|
||||
==============================================================================
|
||||
Caveats for using SDL with Mac OS X
|
||||
==============================================================================
|
||||
|
||||
Some things you have to be aware of when using SDL on Mac OS X:
|
||||
|
||||
- If you register your own NSApplicationDelegate (using [NSApp setDelegate:]),
|
||||
SDL will not register its own. This means that SDL will not terminate using
|
||||
SDL_Quit if it receives a termination request, it will terminate like a
|
||||
normal app, and it will not send a SDL_DROPFILE when you request to open a
|
||||
file with the app. To solve these issues, put the following code in your
|
||||
NSApplicationDelegate implementation:
|
||||
|
||||
|
||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
|
||||
{
|
||||
if (SDL_GetEventState(SDL_QUIT) == SDL_ENABLE) {
|
||||
SDL_Event event;
|
||||
event.type = SDL_QUIT;
|
||||
SDL_PushEvent(&event);
|
||||
}
|
||||
|
||||
return NSTerminateCancel;
|
||||
}
|
||||
|
||||
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
|
||||
{
|
||||
if (SDL_GetEventState(SDL_DROPFILE) == SDL_ENABLE) {
|
||||
SDL_Event event;
|
||||
event.type = SDL_DROPFILE;
|
||||
event.drop.file = SDL_strdup([filename UTF8String]);
|
||||
return (SDL_PushEvent(&event) > 0);
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
==============================================================================
|
||||
Using the Simple DirectMedia Layer with a traditional Makefile
|
||||
==============================================================================
|
||||
|
||||
An existing autoconf/automake build system for your SDL app has good chances
|
||||
to work almost unchanged on OS X. However, to produce a "real" Mac OS X binary
|
||||
that you can distribute to users, you need to put the generated binary into a
|
||||
so called "bundle", which basically is a fancy folder with a name like
|
||||
"MyCoolGame.app".
|
||||
|
||||
To get this build automatically, add something like the following rule to
|
||||
your Makefile.am:
|
||||
|
||||
bundle_contents = APP_NAME.app/Contents
|
||||
APP_NAME_bundle: EXE_NAME
|
||||
mkdir -p $(bundle_contents)/MacOS
|
||||
mkdir -p $(bundle_contents)/Resources
|
||||
echo "APPL????" > $(bundle_contents)/PkgInfo
|
||||
$(INSTALL_PROGRAM) $< $(bundle_contents)/MacOS/
|
||||
|
||||
You should replace EXE_NAME with the name of the executable. APP_NAME is what
|
||||
will be visible to the user in the Finder. Usually it will be the same
|
||||
as EXE_NAME but capitalized. E.g. if EXE_NAME is "testgame" then APP_NAME
|
||||
usually is "TestGame". You might also want to use @PACKAGE@ to use the package
|
||||
name as specified in your configure.in file.
|
||||
|
||||
If your project builds more than one application, you will have to do a bit
|
||||
more. For each of your target applications, you need a separate rule.
|
||||
|
||||
If you want the created bundles to be installed, you may want to add this
|
||||
rule to your Makefile.am:
|
||||
|
||||
install-exec-hook: APP_NAME_bundle
|
||||
rm -rf $(DESTDIR)$(prefix)/Applications/APP_NAME.app
|
||||
mkdir -p $(DESTDIR)$(prefix)/Applications/
|
||||
cp -r $< /$(DESTDIR)$(prefix)Applications/
|
||||
|
||||
This rule takes the Bundle created by the rule from step 3 and installs them
|
||||
into $(DESTDIR)$(prefix)/Applications/.
|
||||
|
||||
Again, if you want to install multiple applications, you will have to augment
|
||||
the make rule accordingly.
|
||||
|
||||
|
||||
But beware! That is only part of the story! With the above, you end up with
|
||||
a bare bone .app bundle, which is double clickable from the Finder. But
|
||||
there are some more things you should do before shipping your product...
|
||||
|
||||
1) The bundle right now probably is dynamically linked against SDL. That
|
||||
means that when you copy it to another computer, *it will not run*,
|
||||
unless you also install SDL on that other computer. A good solution
|
||||
for this dilemma is to static link against SDL. On OS X, you can
|
||||
achieve that by linking against the libraries listed by
|
||||
sdl-config --static-libs
|
||||
instead of those listed by
|
||||
sdl-config --libs
|
||||
Depending on how exactly SDL is integrated into your build systems, the
|
||||
way to achieve that varies, so I won't describe it here in detail
|
||||
2) Add an 'Info.plist' to your application. That is a special XML file which
|
||||
contains some meta-information about your application (like some copyright
|
||||
information, the version of your app, the name of an optional icon file,
|
||||
and other things). Part of that information is displayed by the Finder
|
||||
when you click on the .app, or if you look at the "Get Info" window.
|
||||
More information about Info.plist files can be found on Apple's homepage.
|
||||
|
||||
|
||||
As a final remark, let me add that I use some of the techniques (and some
|
||||
variations of them) in Exult and ScummVM; both are available in source on
|
||||
the net, so feel free to take a peek at them for inspiration!
|
||||
|
||||
|
||||
==============================================================================
|
||||
Using the Simple DirectMedia Layer with Xcode
|
||||
==============================================================================
|
||||
|
||||
These instructions are for using Apple's Xcode IDE to build SDL applications.
|
||||
|
||||
- First steps
|
||||
|
||||
The first thing to do is to unpack the Xcode.tar.gz archive in the
|
||||
top level SDL directory (where the Xcode.tar.gz archive resides).
|
||||
Because Stuffit Expander will unpack the archive into a subdirectory,
|
||||
you should unpack the archive manually from the command line:
|
||||
cd [path_to_SDL_source]
|
||||
tar zxf Xcode.tar.gz
|
||||
This will create a new folder called Xcode, which you can browse
|
||||
normally from the Finder.
|
||||
|
||||
- Building the Framework
|
||||
|
||||
The SDL Library is packaged as a framework bundle, an organized
|
||||
relocatable folder hierarchy of executable code, interface headers,
|
||||
and additional resources. For practical purposes, you can think of a
|
||||
framework as a more user and system-friendly shared library, whose library
|
||||
file behaves more or less like a standard UNIX shared library.
|
||||
|
||||
To build the framework, simply open the framework project and build it.
|
||||
By default, the framework bundle "SDL.framework" is installed in
|
||||
/Library/Frameworks. Therefore, the testers and project stationary expect
|
||||
it to be located there. However, it will function the same in any of the
|
||||
following locations:
|
||||
|
||||
~/Library/Frameworks
|
||||
/Local/Library/Frameworks
|
||||
/System/Library/Frameworks
|
||||
|
||||
- Build Options
|
||||
There are two "Build Styles" (See the "Targets" tab) for SDL.
|
||||
"Deployment" should be used if you aren't tweaking the SDL library.
|
||||
"Development" should be used to debug SDL apps or the library itself.
|
||||
|
||||
- Building the Testers
|
||||
Open the SDLTest project and build away!
|
||||
|
||||
- Using the Project Stationary
|
||||
Copy the stationary to the indicated folders to access it from
|
||||
the "New Project" and "Add target" menus. What could be easier?
|
||||
|
||||
- Setting up a new project by hand
|
||||
Some of you won't want to use the Stationary so I'll give some tips:
|
||||
* Create a new "Cocoa Application"
|
||||
* Add src/main/macosx/SDLMain.m , .h and .nib to your project
|
||||
* Remove "main.c" from your project
|
||||
* Remove "MainMenu.nib" from your project
|
||||
* Add "$(HOME)/Library/Frameworks/SDL.framework/Headers" to include path
|
||||
* Add "$(HOME)/Library/Frameworks" to the frameworks search path
|
||||
* Add "-framework SDL -framework Foundation -framework AppKit" to "OTHER_LDFLAGS"
|
||||
* Set the "Main Nib File" under "Application Settings" to "SDLMain.nib"
|
||||
* Add your files
|
||||
* Clean and build
|
||||
|
||||
- Building from command line
|
||||
Use pbxbuild in the same directory as your .pbproj file
|
||||
|
||||
- Running your app
|
||||
You can send command line args to your app by either invoking it from
|
||||
the command line (in *.app/Contents/MacOS) or by entering them in the
|
||||
"Executables" panel of the target settings.
|
||||
|
||||
- Implementation Notes
|
||||
Some things that may be of interest about how it all works...
|
||||
* Working directory
|
||||
As defined in the SDL_main.m file, the working directory of your SDL app
|
||||
is by default set to its parent. You may wish to change this to better
|
||||
suit your needs.
|
||||
* You have a Cocoa App!
|
||||
Your SDL app is essentially a Cocoa application. When your app
|
||||
starts up and the libraries finish loading, a Cocoa procedure is called,
|
||||
which sets up the working directory and calls your main() method.
|
||||
You are free to modify your Cocoa app with generally no consequence
|
||||
to SDL. You cannot, however, easily change the SDL window itself.
|
||||
Functionality may be added in the future to help this.
|
||||
|
||||
|
||||
Known bugs are listed in the file "BUGS"
|
103
libs/SDL2/docs/README-nacl.md
Normal file
103
libs/SDL2/docs/README-nacl.md
Normal file
|
@ -0,0 +1,103 @@
|
|||
Native Client
|
||||
================================================================================
|
||||
|
||||
Requirements:
|
||||
|
||||
* Native Client SDK (https://developer.chrome.com/native-client),
|
||||
(tested with Pepper version 33 or higher).
|
||||
|
||||
The SDL backend for Chrome's Native Client has been tested only with the PNaCl
|
||||
toolchain, which generates binaries designed to run on ARM and x86_32/64
|
||||
platforms. This does not mean it won't work with the other toolchains!
|
||||
|
||||
================================================================================
|
||||
Building SDL for NaCl
|
||||
================================================================================
|
||||
|
||||
Set up the right environment variables (see naclbuild.sh), then configure SDL with:
|
||||
|
||||
configure --host=pnacl --prefix some/install/destination
|
||||
|
||||
Then "make".
|
||||
|
||||
As an example of how to create a deployable app a Makefile project is provided
|
||||
in test/nacl/Makefile, which includes some monkey patching of the common.mk file
|
||||
provided by NaCl, without which linking properly to SDL won't work (the search
|
||||
path can't be modified externally, so the linker won't find SDL's binaries unless
|
||||
you dump them into the SDK path, which is inconvenient).
|
||||
Also provided in test/nacl is the required support file, such as index.html,
|
||||
manifest.json, etc.
|
||||
SDL apps for NaCl run on a worker thread using the ppapi_simple infrastructure.
|
||||
This allows for blocking calls on all the relevant systems (OpenGL ES, filesystem),
|
||||
hiding the asynchronous nature of the browser behind the scenes...which is not the
|
||||
same as making it disappear!
|
||||
|
||||
|
||||
================================================================================
|
||||
Running tests
|
||||
================================================================================
|
||||
|
||||
Due to the nature of NaCl programs, building and running SDL tests is not as
|
||||
straightforward as one would hope. The script naclbuild.sh in build-scripts
|
||||
automates the process and should serve as a guide for users of SDL trying to build
|
||||
their own applications.
|
||||
|
||||
Basic usage:
|
||||
|
||||
./naclbuild.sh path/to/pepper/toolchain (i.e. ~/naclsdk/pepper_35)
|
||||
|
||||
This will build testgles2.c by default.
|
||||
|
||||
If you want to build a different test, for example testrendercopyex.c:
|
||||
|
||||
SOURCES=~/sdl/SDL/test/testrendercopyex.c ./naclbuild.sh ~/naclsdk/pepper_35
|
||||
|
||||
Once the build finishes, you have to serve the contents with a web server (the
|
||||
script will give you instructions on how to do that with Python).
|
||||
|
||||
================================================================================
|
||||
RWops and nacl_io
|
||||
================================================================================
|
||||
|
||||
SDL_RWops work transparently with nacl_io. Two functions control the mount points:
|
||||
|
||||
int mount(const char* source, const char* target,
|
||||
const char* filesystemtype,
|
||||
unsigned long mountflags, const void *data);
|
||||
int umount(const char *target);
|
||||
|
||||
For convenience, SDL will by default mount an httpfs tree at / before calling
|
||||
the app's main function. Such setting can be overridden by calling:
|
||||
|
||||
umount("/");
|
||||
|
||||
And then mounting a different filesystem at /
|
||||
|
||||
It's important to consider that the asynchronous nature of file operations on a
|
||||
browser is hidden from the application, effectively providing the developer with
|
||||
a set of blocking file operations just like you get in a regular desktop
|
||||
environment, which eases the job of porting to Native Client, but also introduces
|
||||
a set of challenges of its own, in particular when big file sizes and slow
|
||||
connections are involved.
|
||||
|
||||
For more information on how nacl_io and mount points work, see:
|
||||
|
||||
https://developer.chrome.com/native-client/devguide/coding/nacl_io
|
||||
https://src.chromium.org/chrome/trunk/src/native_client_sdk/src/libraries/nacl_io/nacl_io.h
|
||||
|
||||
To be able to save into the directory "/save/" (like backup of game) :
|
||||
|
||||
mount("", "/save", "html5fs", 0, "type=PERSISTENT");
|
||||
|
||||
And add to manifest.json :
|
||||
|
||||
"permissions": [
|
||||
"unlimitedStorage"
|
||||
]
|
||||
|
||||
================================================================================
|
||||
TODO - Known Issues
|
||||
================================================================================
|
||||
* Testing of all systems with a real application (something other than SDL's tests)
|
||||
* Key events don't seem to work properly
|
||||
|
17
libs/SDL2/docs/README-pandora.md
Normal file
17
libs/SDL2/docs/README-pandora.md
Normal file
|
@ -0,0 +1,17 @@
|
|||
Pandora
|
||||
=====================================================================
|
||||
|
||||
( http://openpandora.org/ )
|
||||
- A pandora specific video driver was written to allow SDL 2.0 with OpenGL ES
|
||||
support to work on the pandora under the framebuffer. This driver do not have
|
||||
input support for now, so if you use it you will have to add your own control code.
|
||||
The video driver name is "pandora" so if you have problem running it from
|
||||
the framebuffer, try to set the following variable before starting your application :
|
||||
"export SDL_VIDEODRIVER=pandora"
|
||||
|
||||
- OpenGL ES support was added to the x11 driver, so it's working like the normal
|
||||
x11 driver one with OpenGLX support, with SDL input event's etc..
|
||||
|
||||
|
||||
David Carré (Cpasjuste)
|
||||
cpasjuste@gmail.com
|
8
libs/SDL2/docs/README-platforms.md
Normal file
8
libs/SDL2/docs/README-platforms.md
Normal file
|
@ -0,0 +1,8 @@
|
|||
Platforms
|
||||
=========
|
||||
|
||||
We maintain the list of supported platforms on our wiki now, and how to
|
||||
build and install SDL for those platforms:
|
||||
|
||||
https://wiki.libsdl.org/Installation
|
||||
|
64
libs/SDL2/docs/README-porting.md
Normal file
64
libs/SDL2/docs/README-porting.md
Normal file
|
@ -0,0 +1,64 @@
|
|||
Porting
|
||||
=======
|
||||
|
||||
* Porting To A New Platform
|
||||
|
||||
The first thing you have to do when porting to a new platform, is look at
|
||||
include/SDL_platform.h and create an entry there for your operating system.
|
||||
The standard format is __PLATFORM__, where PLATFORM is the name of the OS.
|
||||
Ideally SDL_platform.h will be able to auto-detect the system it's building
|
||||
on based on C preprocessor symbols.
|
||||
|
||||
There are two basic ways of building SDL at the moment:
|
||||
|
||||
1. The "UNIX" way: ./configure; make; make install
|
||||
|
||||
If you have a GNUish system, then you might try this. Edit configure.in,
|
||||
take a look at the large section labelled:
|
||||
"Set up the configuration based on the host platform!"
|
||||
Add a section for your platform, and then re-run autogen.sh and build!
|
||||
|
||||
2. Using an IDE:
|
||||
|
||||
If you're using an IDE or other non-configure build system, you'll probably
|
||||
want to create a custom SDL_config.h for your platform. Edit SDL_config.h,
|
||||
add a section for your platform, and create a custom SDL_config_{platform}.h,
|
||||
based on SDL_config.h.minimal and SDL_config.h.in
|
||||
|
||||
Add the top level include directory to the header search path, and then add
|
||||
the following sources to the project:
|
||||
src/*.c
|
||||
src/atomic/*.c
|
||||
src/audio/*.c
|
||||
src/cpuinfo/*.c
|
||||
src/events/*.c
|
||||
src/file/*.c
|
||||
src/haptic/*.c
|
||||
src/joystick/*.c
|
||||
src/power/*.c
|
||||
src/render/*.c
|
||||
src/stdlib/*.c
|
||||
src/thread/*.c
|
||||
src/timer/*.c
|
||||
src/video/*.c
|
||||
src/audio/disk/*.c
|
||||
src/audio/dummy/*.c
|
||||
src/filesystem/dummy/*.c
|
||||
src/video/dummy/*.c
|
||||
src/haptic/dummy/*.c
|
||||
src/joystick/dummy/*.c
|
||||
src/main/dummy/*.c
|
||||
src/thread/generic/*.c
|
||||
src/timer/dummy/*.c
|
||||
src/loadso/dummy/*.c
|
||||
|
||||
|
||||
Once you have a working library without any drivers, you can go back to each
|
||||
of the major subsystems and start implementing drivers for your platform.
|
||||
|
||||
If you have any questions, don't hesitate to ask on the SDL mailing list:
|
||||
http://www.libsdl.org/mailing-list.php
|
||||
|
||||
Enjoy!
|
||||
Sam Lantinga (slouken@libsdl.org)
|
||||
|
19
libs/SDL2/docs/README-psp.md
Normal file
19
libs/SDL2/docs/README-psp.md
Normal file
|
@ -0,0 +1,19 @@
|
|||
PSP
|
||||
======
|
||||
SDL port for the Sony PSP contributed by
|
||||
Captian Lex
|
||||
|
||||
Credit to
|
||||
Marcus R.Brown,Jim Paris,Matthew H for the original SDL 1.2 for PSP
|
||||
Geecko for his PSP GU lib "Glib2d"
|
||||
|
||||
Building
|
||||
--------
|
||||
To build for the PSP, make sure psp-config is in the path and run:
|
||||
make -f Makefile.psp
|
||||
|
||||
|
||||
|
||||
To Do
|
||||
------
|
||||
PSP Screen Keyboard
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue