mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'master' into capsules
This commit is contained in:
commit
e29f113047
148 changed files with 3344 additions and 2991 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -13,11 +13,11 @@ Win32_LIB_ASM_Release
|
||||||
*.dgb
|
*.dgb
|
||||||
*.debug
|
*.debug
|
||||||
*.debug.txt
|
*.debug.txt
|
||||||
/bin/VC10/
|
|
||||||
/objs/VC10/
|
|
||||||
*.user
|
*.user
|
||||||
*.db
|
*.db
|
||||||
*.opendb
|
*.opendb
|
||||||
/.vs
|
/.vs
|
||||||
/debian
|
/debian
|
||||||
/assets/debian
|
/assets/debian
|
||||||
|
/make
|
||||||
|
/bin
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
cmake_minimum_required(VERSION 3.0)
|
cmake_minimum_required(VERSION 3.13)
|
||||||
|
|
||||||
# Enable CCache early
|
# Enable CCache early
|
||||||
set(SRB2_USE_CCACHE OFF CACHE BOOL "Use CCache")
|
set(SRB2_USE_CCACHE OFF CACHE BOOL "Use CCache")
|
||||||
|
|
@ -34,12 +34,11 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
|
||||||
|
|
||||||
### Useful functions
|
### Useful functions
|
||||||
|
|
||||||
# Prepend sources with current source directory
|
# Add sources from Sourcefile
|
||||||
function(prepend_sources SOURCE_FILES)
|
function(target_sourcefile type)
|
||||||
foreach(SOURCE_FILE ${${SOURCE_FILES}})
|
file(STRINGS Sourcefile list
|
||||||
set(MODIFIED ${MODIFIED} ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_FILE})
|
REGEX "[-0-9A-Za-z_]+\.${type}")
|
||||||
endforeach()
|
target_sources(SRB2SDL2 PRIVATE ${list})
|
||||||
set(${SOURCE_FILES} ${MODIFIED} PARENT_SCOPE)
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
# Macro to add OSX framework
|
# Macro to add OSX framework
|
||||||
|
|
@ -119,8 +118,9 @@ set(SRB2_SDL2_EXE_NAME srb2kart CACHE STRING "Executable binary output name")
|
||||||
include_directories(${CMAKE_CURRENT_BINARY_DIR}/src)
|
include_directories(${CMAKE_CURRENT_BINARY_DIR}/src)
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
if(NOT ${SRB2_CONFIG_DEV_BUILD})
|
||||||
add_subdirectory(assets)
|
add_subdirectory(assets)
|
||||||
|
endif()
|
||||||
|
|
||||||
## config.h generation
|
## config.h generation
|
||||||
set(GIT_EXECUTABLE "git" CACHE FILEPATH "Path to git binary")
|
set(GIT_EXECUTABLE "git" CACHE FILEPATH "Path to git binary")
|
||||||
|
|
|
||||||
32
appveyor.yml
32
appveyor.yml
|
|
@ -2,15 +2,11 @@ version: 2.0.{branch}-{build}
|
||||||
os: MinGW
|
os: MinGW
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
CC: ccache
|
CC: i686-w64-mingw32-gcc
|
||||||
CCACHE_CC: i686-w64-mingw32-gcc
|
|
||||||
CCACHE_CC_64: x86_64-w64-mingw32-gcc
|
|
||||||
WINDRES: windres
|
WINDRES: windres
|
||||||
# c:\mingw-w64 i686 has gcc 6.3.0, so use c:\msys64 7.3.0 instead
|
# c:\mingw-w64 i686 has gcc 6.3.0, so use c:\msys64 7.3.0 instead
|
||||||
MINGW_SDK: c:\msys64\mingw32
|
MINGW_SDK: c:\msys64\mingw32
|
||||||
# c:\msys64 x86_64 has gcc 8.2.0, so use c:\mingw-w64 7.3.0 instead
|
CFLAGS: -Wno-implicit-fallthrough
|
||||||
MINGW_SDK_64: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64
|
|
||||||
CFLAGS: -Wall -W -Werror -Wno-error=implicit-fallthrough -Wimplicit-fallthrough=3 -Wno-tautological-compare -Wno-error=suggest-attribute=noreturn
|
|
||||||
NASM_ZIP: nasm-2.12.01
|
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
|
NASM_URL: http://www.nasm.us/pub/nasm/releasebuilds/2.12.01/win64/nasm-2.12.01-win64.zip
|
||||||
UPX_ZIP: upx391w
|
UPX_ZIP: upx391w
|
||||||
|
|
@ -19,8 +15,6 @@ environment:
|
||||||
CCACHE_URL: http://alam.srb2.org/ccache.exe
|
CCACHE_URL: http://alam.srb2.org/ccache.exe
|
||||||
CCACHE_COMPRESS: true
|
CCACHE_COMPRESS: true
|
||||||
CCACHE_DIR: C:\Users\appveyor\.ccache
|
CCACHE_DIR: C:\Users\appveyor\.ccache
|
||||||
# Disable UPX by default. The user can override this in their Appveyor project settings
|
|
||||||
NOUPX: 1
|
|
||||||
##############################
|
##############################
|
||||||
# DEPLOYER VARIABLES
|
# DEPLOYER VARIABLES
|
||||||
# DPL_ENABLED=1 builds installers for branch names starting with `deployer`.
|
# DPL_ENABLED=1 builds installers for branch names starting with `deployer`.
|
||||||
|
|
@ -53,11 +47,6 @@ cache:
|
||||||
- C:\Users\appveyor\srb2_cache
|
- C:\Users\appveyor\srb2_cache
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- if [%CONFIGURATION%] == [SDL64] ( set "X86_64=1" )
|
|
||||||
- if [%CONFIGURATION%] == [SDL64] ( set "CONFIGURATION=SDL" )
|
|
||||||
- if [%X86_64%] == [1] ( set "MINGW_SDK=%MINGW_SDK_64%" )
|
|
||||||
- if [%X86_64%] == [1] ( set "CCACHE_CC=%CCACHE_CC_64%" )
|
|
||||||
|
|
||||||
- if not exist "%NASM_ZIP%.zip" appveyor DownloadFile "%NASM_URL%" -FileName "%NASM_ZIP%.zip"
|
- if not exist "%NASM_ZIP%.zip" appveyor DownloadFile "%NASM_URL%" -FileName "%NASM_ZIP%.zip"
|
||||||
- 7z x -y "%NASM_ZIP%.zip" -o%TMP% >null
|
- 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
|
- robocopy /S /xx /ns /nc /nfl /ndl /np /njh /njs "%TMP%\%NASM_ZIP%" "%MINGW_SDK%\bin" nasm.exe || exit 0
|
||||||
|
|
@ -72,39 +61,27 @@ install:
|
||||||
|
|
||||||
configuration:
|
configuration:
|
||||||
- SDL
|
- SDL
|
||||||
- SDL64
|
|
||||||
|
|
||||||
before_build:
|
before_build:
|
||||||
- set "Path=%MINGW_SDK%\bin;%Path%"
|
- set "Path=%MINGW_SDK%\bin;%Path%"
|
||||||
- if [%X86_64%] == [1] ( x86_64-w64-mingw32-gcc --version ) else ( i686-w64-mingw32-gcc --version )
|
|
||||||
- mingw32-make --version
|
- mingw32-make --version
|
||||||
- if not [%X86_64%] == [1] ( nasm -v )
|
- nasm -v
|
||||||
- if not [%NOUPX%] == [1] ( upx -V )
|
- if not [%NOUPX%] == [1] ( upx -V )
|
||||||
- ccache -V
|
- ccache -V
|
||||||
- ccache -s
|
- ccache -s
|
||||||
- if [%NOUPX%] == [1] ( set "NOUPX=NOUPX=1" ) else ( set "NOUPX=" )
|
|
||||||
- if defined [%APPVEYOR_PULL_REQUEST_HEAD_COMMIT%] ( set "COMMIT=%APPVEYOR_PULL_REQUEST_HEAD_COMMIT%" ) else ( set "COMMIT=%APPVEYOR_REPO_COMMIT%" )
|
- if defined [%APPVEYOR_PULL_REQUEST_HEAD_COMMIT%] ( set "COMMIT=%APPVEYOR_PULL_REQUEST_HEAD_COMMIT%" ) else ( set "COMMIT=%APPVEYOR_REPO_COMMIT%" )
|
||||||
- cmd: git rev-parse --short %COMMIT%>%TMP%/gitshort.txt
|
- cmd: git rev-parse --short %COMMIT%>%TMP%/gitshort.txt
|
||||||
- cmd: set /P GITSHORT=<%TMP%/gitshort.txt
|
- cmd: set /P GITSHORT=<%TMP%/gitshort.txt
|
||||||
# for pull requests, take the owner's name only, if this isn't the same repo of course
|
# for pull requests, take the owner's name only, if this isn't the same repo of course
|
||||||
- set "REPO=%APPVEYOR_REPO_BRANCH%"
|
- set "REPO=%APPVEYOR_REPO_BRANCH%"
|
||||||
- if not [%APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME%] == [] ( if not [%APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME%] == [%APPVEYOR_REPO_NAME%] ( for /f "delims=/" %%a in ("%APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME%") do set "REPO=%%a-%APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH%" ) )
|
- if not [%APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME%] == [] ( if not [%APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME%] == [%APPVEYOR_REPO_NAME%] ( for /f "delims=/" %%a in ("%APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME%") do set "REPO=%%a-%APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH%" ) )
|
||||||
- set "EXENAME=EXENAME=srb2win-%REPO%-%GITSHORT%.exe"
|
- set "SRB2_MFLAGS=-C src NOECHOFILENAMES=1 CCACHE=1 EXENAME=srb2win-%REPO%-%GITSHORT%.exe"
|
||||||
- set "SRB2_MFLAGS=-C src WARNINGMODE=1 CCACHE=1 NOOBJDUMP=1 %NOUPX% %EXENAME%"
|
|
||||||
- if [%X86_64%] == [1] ( set "MINGW_FLAGS=MINGW64=1 X86_64=1 GCC81=1" ) else ( set "MINGW_FLAGS=MINGW=1 GCC91=1" )
|
|
||||||
- set "SRB2_MFLAGS=%SRB2_MFLAGS% %MINGW_FLAGS% %CONFIGURATION%=1"
|
|
||||||
|
|
||||||
build_script:
|
build_script:
|
||||||
- cmd: mingw32-make.exe %SRB2_MFLAGS% clean
|
- cmd: mingw32-make.exe %SRB2_MFLAGS% clean
|
||||||
- cmd: mingw32-make.exe %SRB2_MFLAGS% ERRORMODE=1 -k
|
- cmd: mingw32-make.exe %SRB2_MFLAGS% ERRORMODE=1 -k
|
||||||
|
|
||||||
after_build:
|
after_build:
|
||||||
- if [%X86_64%] == [1] (
|
|
||||||
set "BUILD_PATH=bin\Mingw64\Release"
|
|
||||||
) else (
|
|
||||||
set "BUILD_PATH=bin\Mingw\Release"
|
|
||||||
)
|
|
||||||
- if [%X86_64%] == [1] ( set "CONFIGURATION=%CONFIGURATION%64" )
|
|
||||||
- ccache -s
|
- ccache -s
|
||||||
- set BUILD_ARCHIVE=%REPO%-%GITSHORT%-%CONFIGURATION%.7z
|
- set BUILD_ARCHIVE=%REPO%-%GITSHORT%-%CONFIGURATION%.7z
|
||||||
- set BUILDSARCHIVE=%REPO%-%CONFIGURATION%.7z
|
- set BUILDSARCHIVE=%REPO%-%CONFIGURATION%.7z
|
||||||
|
|
@ -139,3 +116,4 @@ test: off
|
||||||
on_finish:
|
on_finish:
|
||||||
#- cmd: echo xfreerdp /u:appveyor /cert-ignore +clipboard /v:<ip>:<port>
|
#- 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'))
|
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
||||||
|
# vim: et ts=1
|
||||||
|
|
|
||||||
2
bin/FreeBSD/Debug/.gitignore
vendored
2
bin/FreeBSD/Debug/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
bin/FreeBSD/Release/.gitignore
vendored
2
bin/FreeBSD/Release/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
1
bin/Linux/Debug/.gitignore
vendored
1
bin/Linux/Debug/.gitignore
vendored
|
|
@ -1 +0,0 @@
|
||||||
/lsdlsrb2
|
|
||||||
3
bin/Linux/Release/.gitignore
vendored
3
bin/Linux/Release/.gitignore
vendored
|
|
@ -1,3 +0,0 @@
|
||||||
/lsdlsrb2
|
|
||||||
/pnd
|
|
||||||
/*.mo
|
|
||||||
1
bin/Linux64/Debug/.gitignore
vendored
1
bin/Linux64/Debug/.gitignore
vendored
|
|
@ -1 +0,0 @@
|
||||||
/lsdlsrb2
|
|
||||||
1
bin/Linux64/Release/.gitignore
vendored
1
bin/Linux64/Release/.gitignore
vendored
|
|
@ -1 +0,0 @@
|
||||||
/lsdlsrb2
|
|
||||||
4
bin/Mingw/Debug/.gitignore
vendored
4
bin/Mingw/Debug/.gitignore
vendored
|
|
@ -1,4 +0,0 @@
|
||||||
*.exe
|
|
||||||
*.mo
|
|
||||||
r_opengl.dll
|
|
||||||
*.bat
|
|
||||||
4
bin/Mingw/Release/.gitignore
vendored
4
bin/Mingw/Release/.gitignore
vendored
|
|
@ -1,4 +0,0 @@
|
||||||
*.exe
|
|
||||||
*.mo
|
|
||||||
r_opengl.dll
|
|
||||||
*.bat
|
|
||||||
3
bin/Mingw64/Debug/.gitignore
vendored
3
bin/Mingw64/Debug/.gitignore
vendored
|
|
@ -1,3 +0,0 @@
|
||||||
/srb2sdl.exe
|
|
||||||
/srb2win.exe
|
|
||||||
/r_opengl.dll
|
|
||||||
3
bin/Mingw64/Release/.gitignore
vendored
3
bin/Mingw64/Release/.gitignore
vendored
|
|
@ -1,3 +0,0 @@
|
||||||
/srb2sdl.exe
|
|
||||||
/srb2win.exe
|
|
||||||
/r_opengl.dll
|
|
||||||
2
bin/SDL/Debug/.gitignore
vendored
2
bin/SDL/Debug/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
bin/SDL/Release/.gitignore
vendored
2
bin/SDL/Release/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
bin/VC/.gitignore
vendored
2
bin/VC/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
/Release
|
|
||||||
/Debug
|
|
||||||
2
bin/VC9/.gitignore
vendored
2
bin/VC9/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
/Win32
|
|
||||||
/x64
|
|
||||||
2
bin/dummy/.gitignore
vendored
2
bin/dummy/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
dep/.gitignore
vendored
2
dep/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
#All folders
|
|
||||||
*.d
|
|
||||||
2
dep/FreeBSD/SDL/Debug/.gitignore
vendored
2
dep/FreeBSD/SDL/Debug/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
dep/FreeBSD/SDL/Release/.gitignore
vendored
2
dep/FreeBSD/SDL/Release/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
dep/Linux/SDL/Debug/.gitignore
vendored
2
dep/Linux/SDL/Debug/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
dep/Linux/SDL/Release/.gitignore
vendored
2
dep/Linux/SDL/Release/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
dep/Linux64/SDL/Debug/.gitignore
vendored
2
dep/Linux64/SDL/Debug/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
dep/Linux64/SDL/Release/.gitignore
vendored
2
dep/Linux64/SDL/Release/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
dep/MasterClient/.gitignore
vendored
2
dep/MasterClient/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
dep/MasterServer/.gitignore
vendored
2
dep/MasterServer/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
dep/Mingw/Debug/.gitignore
vendored
2
dep/Mingw/Debug/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
dep/Mingw/Release/.gitignore
vendored
2
dep/Mingw/Release/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
dep/Mingw/SDL/Debug/.gitignore
vendored
2
dep/Mingw/SDL/Debug/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
dep/Mingw/SDL/Release/.gitignore
vendored
2
dep/Mingw/SDL/Release/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
dep/Mingw64/Debug/.gitignore
vendored
2
dep/Mingw64/Debug/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
dep/Mingw64/Release/.gitignore
vendored
2
dep/Mingw64/Release/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
dep/Mingw64/SDL/Debug/.gitignore
vendored
2
dep/Mingw64/SDL/Debug/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
dep/Mingw64/SDL/Release/.gitignore
vendored
2
dep/Mingw64/SDL/Release/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
dep/SDL/Release/.gitignore
vendored
2
dep/SDL/Release/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
dep/VC/.gitignore
vendored
2
dep/VC/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
dep/VC9/.gitignore
vendored
2
dep/VC9/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
dep/cygwin/Debug/.gitignore
vendored
2
dep/cygwin/Debug/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
dep/cygwin/Release/.gitignore
vendored
2
dep/cygwin/Release/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
dep/dummy/.gitignore
vendored
2
dep/dummy/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
8
objs/.gitignore
vendored
8
objs/.gitignore
vendored
|
|
@ -1,8 +0,0 @@
|
||||||
#All folders
|
|
||||||
SRB2.res
|
|
||||||
depend.dep
|
|
||||||
depend.ped
|
|
||||||
*.o
|
|
||||||
#VC9 folder only
|
|
||||||
/VC9/Win32
|
|
||||||
/VC9/x64
|
|
||||||
2
objs/FreeBSD/SDL/Debug/.gitignore
vendored
2
objs/FreeBSD/SDL/Debug/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
objs/FreeBSD/SDL/Release/.gitignore
vendored
2
objs/FreeBSD/SDL/Release/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
objs/Linux/SDL/Debug/.gitignore
vendored
2
objs/Linux/SDL/Debug/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
objs/Linux/SDL/Release/.gitignore
vendored
2
objs/Linux/SDL/Release/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
objs/Linux64/SDL/Debug/.gitignore
vendored
2
objs/Linux64/SDL/Debug/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
objs/Linux64/SDL/Release/.gitignore
vendored
2
objs/Linux64/SDL/Release/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
objs/MasterClient/.gitignore
vendored
2
objs/MasterClient/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
objs/MasterServer/.gitignore
vendored
2
objs/MasterServer/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
objs/Mingw/Debug/.gitignore
vendored
2
objs/Mingw/Debug/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
objs/Mingw/Release/.gitignore
vendored
2
objs/Mingw/Release/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
objs/Mingw/SDL/Debug/.gitignore
vendored
2
objs/Mingw/SDL/Debug/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
objs/Mingw/SDL/Release/.gitignore
vendored
2
objs/Mingw/SDL/Release/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
objs/Mingw64/Debug/.gitignore
vendored
2
objs/Mingw64/Debug/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
objs/Mingw64/Release/.gitignore
vendored
2
objs/Mingw64/Release/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
objs/Mingw64/SDL/Debug/.gitignore
vendored
2
objs/Mingw64/SDL/Debug/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
objs/Mingw64/SDL/Release/.gitignore
vendored
2
objs/Mingw64/SDL/Release/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
objs/SDL/Release/.gitignore
vendored
2
objs/SDL/Release/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
objs/VC/.gitignore
vendored
2
objs/VC/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
objs/VC9/.gitignore
vendored
2
objs/VC9/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
objs/cygwin/Debug/.gitignore
vendored
2
objs/cygwin/Debug/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
objs/cygwin/Release/.gitignore
vendored
2
objs/cygwin/Release/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
2
objs/dummy/.gitignore
vendored
2
objs/dummy/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
|
|
@ -1,269 +1,14 @@
|
||||||
# SRB2 Core
|
# SRB2 Core
|
||||||
|
|
||||||
|
add_executable(SRB2SDL2 MACOSX_BUNDLE WIN32)
|
||||||
|
|
||||||
# Core sources
|
# Core sources
|
||||||
set(SRB2_CORE_SOURCES
|
target_sourcefile(c)
|
||||||
am_map.c
|
target_sources(SRB2SDL2 PRIVATE comptime.c md5.c config.h.in)
|
||||||
command.c
|
|
||||||
comptime.c
|
|
||||||
console.c
|
|
||||||
d_clisrv.c
|
|
||||||
d_main.c
|
|
||||||
d_net.c
|
|
||||||
d_netcmd.c
|
|
||||||
d_netfil.c
|
|
||||||
dehacked.c
|
|
||||||
deh_soc.c
|
|
||||||
deh_lua.c
|
|
||||||
deh_tables.c
|
|
||||||
f_finale.c
|
|
||||||
f_wipe.c
|
|
||||||
filesrch.c
|
|
||||||
g_demo.c
|
|
||||||
g_game.c
|
|
||||||
g_input.c
|
|
||||||
g_splitscreen.c
|
|
||||||
font.c
|
|
||||||
hu_stuff.c
|
|
||||||
i_tcp.c
|
|
||||||
info.c
|
|
||||||
lzf.c
|
|
||||||
m_aatree.c
|
|
||||||
m_anigif.c
|
|
||||||
m_argv.c
|
|
||||||
m_bbox.c
|
|
||||||
m_cheat.c
|
|
||||||
m_cond.c
|
|
||||||
m_fixed.c
|
|
||||||
m_menu.c
|
|
||||||
m_misc.c
|
|
||||||
m_perfstats.c
|
|
||||||
m_queue.c
|
|
||||||
m_random.c
|
|
||||||
md5.c
|
|
||||||
mserv.c
|
|
||||||
http-mserv.c
|
|
||||||
s_sound.c
|
|
||||||
screen.c
|
|
||||||
sounds.c
|
|
||||||
st_stuff.c
|
|
||||||
#string.c
|
|
||||||
tables.c
|
|
||||||
v_video.c
|
|
||||||
w_wad.c
|
|
||||||
y_inter.c
|
|
||||||
z_zone.c
|
|
||||||
)
|
|
||||||
|
|
||||||
set(SRB2_CORE_HEADERS
|
set(SRB2_ASM_SOURCES vid_copy.s)
|
||||||
am_map.h
|
|
||||||
byteptr.h
|
|
||||||
command.h
|
|
||||||
console.h
|
|
||||||
d_clisrv.h
|
|
||||||
d_event.h
|
|
||||||
d_main.h
|
|
||||||
d_net.h
|
|
||||||
d_netcmd.h
|
|
||||||
d_netfil.h
|
|
||||||
d_player.h
|
|
||||||
d_think.h
|
|
||||||
d_ticcmd.h
|
|
||||||
dehacked.h
|
|
||||||
deh_soc.h
|
|
||||||
deh_lua.h
|
|
||||||
deh_tables.h
|
|
||||||
doomdata.h
|
|
||||||
doomdef.h
|
|
||||||
doomstat.h
|
|
||||||
doomtype.h
|
|
||||||
endian.h
|
|
||||||
f_finale.h
|
|
||||||
fastcmp.h
|
|
||||||
filesrch.h
|
|
||||||
g_demo.h
|
|
||||||
g_game.h
|
|
||||||
g_input.h
|
|
||||||
g_state.h
|
|
||||||
font.h
|
|
||||||
hu_stuff.h
|
|
||||||
i_joy.h
|
|
||||||
i_net.h
|
|
||||||
i_sound.h
|
|
||||||
i_system.h
|
|
||||||
i_tcp.h
|
|
||||||
i_video.h
|
|
||||||
info.h
|
|
||||||
keys.h
|
|
||||||
lzf.h
|
|
||||||
m_aatree.h
|
|
||||||
m_anigif.h
|
|
||||||
m_argv.h
|
|
||||||
m_bbox.h
|
|
||||||
m_cheat.h
|
|
||||||
m_cond.h
|
|
||||||
m_dllist.h
|
|
||||||
m_fixed.h
|
|
||||||
m_menu.h
|
|
||||||
m_misc.h
|
|
||||||
m_perfstats.h
|
|
||||||
m_queue.h
|
|
||||||
m_random.h
|
|
||||||
m_swap.h
|
|
||||||
md5.h
|
|
||||||
mserv.h
|
|
||||||
p5prof.h
|
|
||||||
s_sound.h
|
|
||||||
screen.h
|
|
||||||
sounds.h
|
|
||||||
st_stuff.h
|
|
||||||
tables.h
|
|
||||||
v_video.h
|
|
||||||
w_wad.h
|
|
||||||
y_inter.h
|
|
||||||
z_zone.h
|
|
||||||
|
|
||||||
config.h.in
|
|
||||||
)
|
|
||||||
|
|
||||||
set(SRB2_CORE_RENDER_SOURCES
|
|
||||||
r_bsp.c
|
|
||||||
r_data.c
|
|
||||||
r_draw.c
|
|
||||||
r_main.c
|
|
||||||
r_plane.c
|
|
||||||
r_segs.c
|
|
||||||
r_skins.c
|
|
||||||
r_sky.c
|
|
||||||
r_splats.c
|
|
||||||
r_things.c
|
|
||||||
r_textures.c
|
|
||||||
r_patch.c
|
|
||||||
r_patchrotation.c
|
|
||||||
r_picformats.c
|
|
||||||
r_portal.c
|
|
||||||
|
|
||||||
r_bsp.h
|
|
||||||
r_data.h
|
|
||||||
r_defs.h
|
|
||||||
r_draw.h
|
|
||||||
r_local.h
|
|
||||||
r_main.h
|
|
||||||
r_plane.h
|
|
||||||
r_segs.h
|
|
||||||
r_skins.h
|
|
||||||
r_sky.h
|
|
||||||
r_splats.h
|
|
||||||
r_state.h
|
|
||||||
r_things.h
|
|
||||||
r_textures.h
|
|
||||||
r_patch.h
|
|
||||||
r_patchrotation.h
|
|
||||||
r_picformats.h
|
|
||||||
r_portal.h
|
|
||||||
)
|
|
||||||
|
|
||||||
set(SRB2_CORE_GAME_SOURCES
|
|
||||||
p_ceilng.c
|
|
||||||
p_enemy.c
|
|
||||||
p_floor.c
|
|
||||||
p_inter.c
|
|
||||||
p_lights.c
|
|
||||||
p_map.c
|
|
||||||
p_maputl.c
|
|
||||||
p_mobj.c
|
|
||||||
p_polyobj.c
|
|
||||||
p_saveg.c
|
|
||||||
p_setup.c
|
|
||||||
p_sight.c
|
|
||||||
p_slopes.c
|
|
||||||
p_spec.c
|
|
||||||
p_telept.c
|
|
||||||
p_tick.c
|
|
||||||
p_user.c
|
|
||||||
taglist.c
|
|
||||||
|
|
||||||
k_race.c
|
|
||||||
k_battle.c
|
|
||||||
k_bheap.c
|
|
||||||
k_collide.c
|
|
||||||
k_kart.c
|
|
||||||
k_pathfind.c
|
|
||||||
k_pwrlv.c
|
|
||||||
k_waypoint.c
|
|
||||||
k_color.c
|
|
||||||
k_bot.c
|
|
||||||
k_botitem.c
|
|
||||||
k_botsearch.c
|
|
||||||
k_respawn.c
|
|
||||||
k_grandprix.c
|
|
||||||
k_hud.c
|
|
||||||
|
|
||||||
p_local.h
|
|
||||||
p_maputl.h
|
|
||||||
p_mobj.h
|
|
||||||
p_polyobj.h
|
|
||||||
p_pspr.h
|
|
||||||
p_saveg.h
|
|
||||||
p_setup.h
|
|
||||||
p_slopes.h
|
|
||||||
p_spec.h
|
|
||||||
p_tick.h
|
|
||||||
taglist.h
|
|
||||||
|
|
||||||
k_race.h
|
|
||||||
k_battle.h
|
|
||||||
k_bheap.h
|
|
||||||
k_collide.h
|
|
||||||
k_kart.h
|
|
||||||
k_pathfind.h
|
|
||||||
k_pwrlv.h
|
|
||||||
k_waypoint.h
|
|
||||||
k_color.h
|
|
||||||
k_bot.h
|
|
||||||
k_respawn.h
|
|
||||||
k_grandprix.h
|
|
||||||
k_hud.h
|
|
||||||
)
|
|
||||||
|
|
||||||
if(NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
|
||||||
set(SRB2_CORE_SOURCES ${SRB2_CORE_SOURCES} string.c)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
prepend_sources(SRB2_CORE_SOURCES)
|
|
||||||
prepend_sources(SRB2_CORE_HEADERS)
|
|
||||||
prepend_sources(SRB2_CORE_RENDER_SOURCES)
|
|
||||||
prepend_sources(SRB2_CORE_GAME_SOURCES)
|
|
||||||
|
|
||||||
set(SRB2_CORE_HEADERS ${SRB2_CORE_HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
|
||||||
source_group("Main" FILES ${SRB2_CORE_SOURCES} ${SRB2_CORE_HEADERS})
|
|
||||||
source_group("Renderer" FILES ${SRB2_CORE_RENDER_SOURCES})
|
|
||||||
source_group("Game" FILES ${SRB2_CORE_GAME_SOURCES})
|
|
||||||
|
|
||||||
|
|
||||||
set(SRB2_ASM_SOURCES
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/vid_copy.s
|
|
||||||
)
|
|
||||||
|
|
||||||
set(SRB2_NASM_SOURCES
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/tmap_mmx.nas
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/tmap.nas
|
|
||||||
)
|
|
||||||
|
|
||||||
if(MSVC)
|
|
||||||
list(APPEND SRB2_NASM_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/tmap_vc.nas)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(SRB2_NASM_OBJECTS
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/tmap_mmx.obj
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/tmap.obj
|
|
||||||
)
|
|
||||||
|
|
||||||
if(MSVC)
|
|
||||||
list(APPEND SRB2_NASM_OBJECTS ${CMAKE_CURRENT_BINARY_DIR}/tmap_vc.obj)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
source_group("Assembly" FILES ${SRB2_ASM_SOURCES} ${SRB2_NASM_SOURCES})
|
|
||||||
|
|
||||||
|
set(SRB2_NASM_SOURCES tmap_mmx.nas tmap.nas)
|
||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
set(SRB2_CONFIG_HAVE_PNG ON CACHE BOOL
|
set(SRB2_CONFIG_HAVE_PNG ON CACHE BOOL
|
||||||
|
|
@ -296,6 +41,8 @@ set(SRB2_CONFIG_YASM OFF CACHE BOOL
|
||||||
"Use YASM in place of NASM.")
|
"Use YASM in place of NASM.")
|
||||||
set(SRB2_CONFIG_STATIC_OPENGL OFF CACHE BOOL
|
set(SRB2_CONFIG_STATIC_OPENGL OFF CACHE BOOL
|
||||||
"Use statically linked OpenGL. NOT RECOMMENDED.")
|
"Use statically linked OpenGL. NOT RECOMMENDED.")
|
||||||
|
set(SRB2_CONFIG_DEV_BUILD OFF CACHE BOOL
|
||||||
|
"Compile a development build of SRB2Kart.")
|
||||||
|
|
||||||
### use internal libraries?
|
### use internal libraries?
|
||||||
if(${CMAKE_SYSTEM} MATCHES "Windows") ###set on Windows only
|
if(${CMAKE_SYSTEM} MATCHES "Windows") ###set on Windows only
|
||||||
|
|
@ -303,92 +50,7 @@ if(${CMAKE_SYSTEM} MATCHES "Windows") ###set on Windows only
|
||||||
"Use SRB2Kart's internal copies of required dependencies (SDL2, PNG, zlib, GME, OpenMPT, cURL).")
|
"Use SRB2Kart's internal copies of required dependencies (SDL2, PNG, zlib, GME, OpenMPT, cURL).")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(SRB2_LUA_SOURCES
|
add_subdirectory(blua)
|
||||||
lua_baselib.c
|
|
||||||
lua_blockmaplib.c
|
|
||||||
lua_consolelib.c
|
|
||||||
lua_hooklib.c
|
|
||||||
lua_hudlib.c
|
|
||||||
lua_infolib.c
|
|
||||||
lua_maplib.c
|
|
||||||
lua_taglib.c
|
|
||||||
lua_mathlib.c
|
|
||||||
lua_mobjlib.c
|
|
||||||
lua_playerlib.c
|
|
||||||
lua_polyobjlib.c
|
|
||||||
lua_script.c
|
|
||||||
lua_skinlib.c
|
|
||||||
lua_thinkerlib.c
|
|
||||||
)
|
|
||||||
set(SRB2_LUA_HEADERS
|
|
||||||
lua_hook.h
|
|
||||||
lua_hud.h
|
|
||||||
lua_libs.h
|
|
||||||
lua_script.h
|
|
||||||
)
|
|
||||||
|
|
||||||
prepend_sources(SRB2_LUA_SOURCES)
|
|
||||||
prepend_sources(SRB2_LUA_HEADERS)
|
|
||||||
|
|
||||||
source_group("LUA" FILES ${SRB2_LUA_SOURCES} ${SRB2_LUA_HEADERS})
|
|
||||||
|
|
||||||
set(SRB2_BLUA_SOURCES
|
|
||||||
blua/lapi.c
|
|
||||||
blua/lauxlib.c
|
|
||||||
blua/lbaselib.c
|
|
||||||
blua/lcode.c
|
|
||||||
blua/ldebug.c
|
|
||||||
blua/ldo.c
|
|
||||||
blua/ldump.c
|
|
||||||
blua/lfunc.c
|
|
||||||
blua/lgc.c
|
|
||||||
blua/linit.c
|
|
||||||
blua/liolib.c
|
|
||||||
blua/llex.c
|
|
||||||
blua/lmem.c
|
|
||||||
blua/lobject.c
|
|
||||||
blua/lopcodes.c
|
|
||||||
blua/lparser.c
|
|
||||||
blua/lstate.c
|
|
||||||
blua/lstring.c
|
|
||||||
blua/lstrlib.c
|
|
||||||
blua/ltable.c
|
|
||||||
blua/ltablib.c
|
|
||||||
blua/ltm.c
|
|
||||||
blua/lundump.c
|
|
||||||
blua/lvm.c
|
|
||||||
blua/lzio.c
|
|
||||||
)
|
|
||||||
set(SRB2_BLUA_HEADERS
|
|
||||||
blua/lapi.h
|
|
||||||
blua/lauxlib.h
|
|
||||||
blua/lcode.h
|
|
||||||
blua/ldebug.h
|
|
||||||
blua/ldo.h
|
|
||||||
blua/lfunc.h
|
|
||||||
blua/lgc.h
|
|
||||||
blua/llex.h
|
|
||||||
blua/llimits.h
|
|
||||||
blua/lmem.h
|
|
||||||
blua/lobject.h
|
|
||||||
blua/lopcodes.h
|
|
||||||
blua/lparser.h
|
|
||||||
blua/lstate.h
|
|
||||||
blua/lstring.h
|
|
||||||
blua/ltable.h
|
|
||||||
blua/ltm.h
|
|
||||||
blua/lua.h
|
|
||||||
blua/luaconf.h
|
|
||||||
blua/lualib.h
|
|
||||||
blua/lundump.h
|
|
||||||
blua/lvm.h
|
|
||||||
blua/lzio.h
|
|
||||||
)
|
|
||||||
|
|
||||||
prepend_sources(SRB2_BLUA_SOURCES)
|
|
||||||
prepend_sources(SRB2_BLUA_HEADERS)
|
|
||||||
|
|
||||||
source_group("LUA\\Interpreter" FILES ${SRB2_BLUA_SOURCES} ${SRB2_BLUA_HEADERS})
|
|
||||||
|
|
||||||
if(${SRB2_CONFIG_HAVE_GME})
|
if(${SRB2_CONFIG_HAVE_GME})
|
||||||
if(${SRB2_CONFIG_USE_INTERNAL_LIBRARIES})
|
if(${SRB2_CONFIG_USE_INTERNAL_LIBRARIES})
|
||||||
|
|
@ -404,7 +66,7 @@ if(${SRB2_CONFIG_HAVE_GME})
|
||||||
endif()
|
endif()
|
||||||
if(${GME_FOUND})
|
if(${GME_FOUND})
|
||||||
set(SRB2_HAVE_GME ON)
|
set(SRB2_HAVE_GME ON)
|
||||||
add_definitions(-DHAVE_LIBGME)
|
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_GME)
|
||||||
else()
|
else()
|
||||||
message(WARNING "You have specified that GME is available but it was not found.")
|
message(WARNING "You have specified that GME is available but it was not found.")
|
||||||
endif()
|
endif()
|
||||||
|
|
@ -424,7 +86,7 @@ if(${SRB2_CONFIG_HAVE_OPENMPT})
|
||||||
endif()
|
endif()
|
||||||
if(${OPENMPT_FOUND})
|
if(${OPENMPT_FOUND})
|
||||||
set(SRB2_HAVE_OPENMPT ON)
|
set(SRB2_HAVE_OPENMPT ON)
|
||||||
add_definitions(-DHAVE_OPENMPT)
|
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_OPENMPT)
|
||||||
else()
|
else()
|
||||||
message(WARNING "You have specified that OpenMPT is available but it was not found.")
|
message(WARNING "You have specified that OpenMPT is available but it was not found.")
|
||||||
endif()
|
endif()
|
||||||
|
|
@ -447,8 +109,7 @@ if(${SRB2_CONFIG_HAVE_MIXERX})
|
||||||
endif()
|
endif()
|
||||||
if(${MIXERX_FOUND})
|
if(${MIXERX_FOUND})
|
||||||
set(SRB2_HAVE_MIXERX ON)
|
set(SRB2_HAVE_MIXERX ON)
|
||||||
set(SRB2_SDL2_SOUNDIMPL mixer_sound.c)
|
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_MIXERX)
|
||||||
add_definitions(-DHAVE_MIXERX)
|
|
||||||
else()
|
else()
|
||||||
message(WARNING "You have specified that SDL Mixer X is available but it was not found.")
|
message(WARNING "You have specified that SDL Mixer X is available but it was not found.")
|
||||||
endif()
|
endif()
|
||||||
|
|
@ -469,13 +130,9 @@ if(${SRB2_CONFIG_HAVE_DISCORDRPC})
|
||||||
endif()
|
endif()
|
||||||
if(${DISCORDRPC_FOUND})
|
if(${DISCORDRPC_FOUND})
|
||||||
set(SRB2_HAVE_DISCORDRPC ON)
|
set(SRB2_HAVE_DISCORDRPC ON)
|
||||||
add_definitions(-DHAVE_DISCORDRPC)
|
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_DISCORDRPC)
|
||||||
add_definitions(-DUSE_STUN)
|
target_compile_definitions(SRB2SDL2 PRIVATE -DUSE_STUN)
|
||||||
set(SRB2_DISCORDRPC_SOURCES discord.c stun.c)
|
target_sources(SRB2SDL2 PRIVATE discord.c stun.c)
|
||||||
set(SRB2_DISCORDRPC_HEADERS discord.h stun.h)
|
|
||||||
prepend_sources(SRB2_DISCORDRPC_SOURCES)
|
|
||||||
prepend_sources(SRB2_DISCORDRPC_HEADERS)
|
|
||||||
source_group("Discord Rich Presence" FILES ${SRB2_DISCORDRPC_SOURCES} ${SRB2_DISCORDRPC_HEADERS})
|
|
||||||
else()
|
else()
|
||||||
message(WARNING "You have specified that Discord Rich Presence is available but it was not found.")
|
message(WARNING "You have specified that Discord Rich Presence is available but it was not found.")
|
||||||
endif()
|
endif()
|
||||||
|
|
@ -495,7 +152,7 @@ if(${SRB2_CONFIG_HAVE_ZLIB})
|
||||||
endif()
|
endif()
|
||||||
if(${ZLIB_FOUND})
|
if(${ZLIB_FOUND})
|
||||||
set(SRB2_HAVE_ZLIB ON)
|
set(SRB2_HAVE_ZLIB ON)
|
||||||
add_definitions(-DHAVE_ZLIB)
|
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_ZLIB)
|
||||||
else()
|
else()
|
||||||
message(WARNING "You have specified that ZLIB is available but it was not found. SRB2Kart may not compile correctly.")
|
message(WARNING "You have specified that ZLIB is available but it was not found. SRB2Kart may not compile correctly.")
|
||||||
endif()
|
endif()
|
||||||
|
|
@ -516,14 +173,9 @@ if(${SRB2_CONFIG_HAVE_PNG} AND ${SRB2_CONFIG_HAVE_ZLIB})
|
||||||
endif()
|
endif()
|
||||||
if(${PNG_FOUND})
|
if(${PNG_FOUND})
|
||||||
set(SRB2_HAVE_PNG ON)
|
set(SRB2_HAVE_PNG ON)
|
||||||
add_definitions(-DHAVE_PNG)
|
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_PNG)
|
||||||
add_definitions(-D_LARGEFILE64_SOURCE)
|
target_compile_definitions(SRB2SDL2 PRIVATE -D_LARGEFILE64_SOURCE)
|
||||||
set(SRB2_PNG_SOURCES apng.c)
|
target_sources(SRB2SDL2 PRIVATE apng.c)
|
||||||
set(SRB2_PNG_HEADERS apng.h)
|
|
||||||
prepend_sources(SRB2_PNG_SOURCES)
|
|
||||||
prepend_sources(SRB2_PNG_HEADERS)
|
|
||||||
source_group("Main" FILES ${SRB2_CORE_SOURCES} ${SRB2_CORE_HEADERS}
|
|
||||||
${SRB2_PNG_SOURCES} ${SRB2_PNG_HEADERS})
|
|
||||||
else()
|
else()
|
||||||
message(WARNING "You have specified that PNG is available but it was not found. SRB2Kart may not compile correctly.")
|
message(WARNING "You have specified that PNG is available but it was not found. SRB2Kart may not compile correctly.")
|
||||||
endif()
|
endif()
|
||||||
|
|
@ -544,7 +196,7 @@ if(${SRB2_CONFIG_HAVE_CURL})
|
||||||
endif()
|
endif()
|
||||||
if(${CURL_FOUND})
|
if(${CURL_FOUND})
|
||||||
set(SRB2_HAVE_CURL ON)
|
set(SRB2_HAVE_CURL ON)
|
||||||
add_definitions(-DHAVE_CURL)
|
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_CURL)
|
||||||
else()
|
else()
|
||||||
message(WARNING "You have specified that CURL is available but it was not found. SRB2Kart may not compile correctly.")
|
message(WARNING "You have specified that CURL is available but it was not found. SRB2Kart may not compile correctly.")
|
||||||
endif()
|
endif()
|
||||||
|
|
@ -552,59 +204,19 @@ endif()
|
||||||
|
|
||||||
if(${SRB2_CONFIG_HAVE_THREADS})
|
if(${SRB2_CONFIG_HAVE_THREADS})
|
||||||
set(SRB2_HAVE_THREADS ON)
|
set(SRB2_HAVE_THREADS ON)
|
||||||
set(SRB2_CORE_HEADERS ${SRB2_CORE_HEADERS} ${CMAKE_CURRENT_SOURCE_DIR}/i_threads.h)
|
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_THREADS)
|
||||||
add_definitions(-DHAVE_THREADS)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${SRB2_CONFIG_HWRENDER})
|
if(${SRB2_CONFIG_HWRENDER})
|
||||||
add_definitions(-DHWRENDER)
|
target_compile_definitions(SRB2SDL2 PRIVATE -DHWRENDER)
|
||||||
set(SRB2_HWRENDER_SOURCES
|
add_subdirectory(hardware)
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_batching.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_bsp.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_cache.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_clip.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_draw.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_light.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_main.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_md2.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_md2load.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_md3load.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_model.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/u_list.c
|
|
||||||
)
|
|
||||||
|
|
||||||
set (SRB2_HWRENDER_HEADERS
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_batching.h
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_clip.h
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_data.h
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_defs.h
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_dll.h
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_drv.h
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_glob.h
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_light.h
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_main.h
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_md2.h
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_md2load.h
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_md3load.h
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_model.h
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/u_list.h
|
|
||||||
)
|
|
||||||
|
|
||||||
set(SRB2_R_OPENGL_SOURCES
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/r_opengl/r_opengl.c
|
|
||||||
)
|
|
||||||
|
|
||||||
set(SRB2_R_OPENGL_HEADERS
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/r_opengl/r_opengl.h
|
|
||||||
)
|
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${SRB2_CONFIG_HWRENDER} AND ${SRB2_CONFIG_STATIC_OPENGL})
|
if(${SRB2_CONFIG_HWRENDER} AND ${SRB2_CONFIG_STATIC_OPENGL})
|
||||||
find_package(OpenGL)
|
find_package(OpenGL)
|
||||||
if(${OPENGL_FOUND})
|
if(${OPENGL_FOUND})
|
||||||
add_definitions(-DHWRENDER)
|
target_compile_definitions(SRB2SDL2 PRIVATE -DHWRENDER)
|
||||||
add_definitions(-DSTATIC_OPENGL)
|
target_compile_definitions(SRB2SDL2 PRIVATE -DSTATIC_OPENGL)
|
||||||
else()
|
else()
|
||||||
message(WARNING "You have specified static opengl but opengl was not found. Not setting HWRENDER.")
|
message(WARNING "You have specified static opengl but opengl was not found. Not setting HWRENDER.")
|
||||||
endif()
|
endif()
|
||||||
|
|
@ -625,12 +237,16 @@ if(${SRB2_CONFIG_USEASM})
|
||||||
set(CMAKE_ASM_NASM_FLAGS "${SRB2_ASM_FLAGS}" CACHE STRING "Flags used by the assembler during all build types.")
|
set(CMAKE_ASM_NASM_FLAGS "${SRB2_ASM_FLAGS}" CACHE STRING "Flags used by the assembler during all build types.")
|
||||||
enable_language(ASM_NASM)
|
enable_language(ASM_NASM)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(SRB2_USEASM ON)
|
set(SRB2_USEASM ON)
|
||||||
add_definitions(-DUSEASM)
|
target_compile_definitions(SRB2SDL2 PRIVATE -DUSEASM)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse3 -mfpmath=sse")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse3 -mfpmath=sse")
|
||||||
|
|
||||||
|
target_sources(SRB2SDL2 PRIVATE ${SRB2_ASM_SOURCES}
|
||||||
|
${SRB2_NASM_SOURCES})
|
||||||
else()
|
else()
|
||||||
set(SRB2_USEASM OFF)
|
set(SRB2_USEASM OFF)
|
||||||
add_definitions(-DNONX86 -DNORUSEASM)
|
target_compile_definitions(SRB2SDL2 PRIVATE -DNONX86 -DNORUSEASM)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Targets
|
# Targets
|
||||||
|
|
@ -666,7 +282,13 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||||
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -Wno-absolute-value)
|
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -Wno-absolute-value)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_definitions(-DCMAKECONFIG)
|
if(${SRB2_CONFIG_DEV_BUILD})
|
||||||
|
target_compile_definitions(SRB2SDL2 PRIVATE -DDEVELOP)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -Wno-trigraphs)
|
||||||
|
|
||||||
|
target_compile_definitions(SRB2SDL2 PRIVATE -DCMAKECONFIG)
|
||||||
|
|
||||||
#add_library(SRB2Core STATIC
|
#add_library(SRB2Core STATIC
|
||||||
# ${SRB2_CORE_SOURCES}
|
# ${SRB2_CORE_SOURCES}
|
||||||
|
|
|
||||||
1145
src/Makefile
1145
src/Makefile
File diff suppressed because it is too large
Load diff
482
src/Makefile.cfg
482
src/Makefile.cfg
|
|
@ -1,482 +0,0 @@
|
||||||
# vim: ft=make
|
|
||||||
#
|
|
||||||
# Makefile.cfg for SRB2
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# GNU compiler & tools' flags
|
|
||||||
# and other things
|
|
||||||
#
|
|
||||||
|
|
||||||
# See the following variable don't start with 'GCC'. This is
|
|
||||||
# to avoid a false positive with the version detection...
|
|
||||||
|
|
||||||
SUPPORTED_GCC_VERSIONS:=\
|
|
||||||
101 102\
|
|
||||||
91 92 93\
|
|
||||||
81 82 83 84\
|
|
||||||
71 72 73 74 75\
|
|
||||||
61 62 63 64\
|
|
||||||
51 52 53 54 55\
|
|
||||||
40 41 42 43 44 45 46 47 48 49
|
|
||||||
|
|
||||||
LATEST_GCC_VERSION=10.2
|
|
||||||
|
|
||||||
# gcc or g++
|
|
||||||
ifdef PREFIX
|
|
||||||
CC=$(PREFIX)-gcc
|
|
||||||
CXX=$(PREFIX)-g++
|
|
||||||
OBJCOPY=$(PREFIX)-objcopy
|
|
||||||
OBJDUMP=$(PREFIX)-objdump
|
|
||||||
STRIP=$(PREFIX)-strip
|
|
||||||
WINDRES=$(PREFIX)-windres
|
|
||||||
else
|
|
||||||
OBJCOPY=objcopy
|
|
||||||
OBJDUMP=objdump
|
|
||||||
STRIP=strip
|
|
||||||
WINDRES=windres
|
|
||||||
endif
|
|
||||||
|
|
||||||
# because Apple screws with us on this
|
|
||||||
# need to get bintools from homebrew
|
|
||||||
ifdef MACOSX
|
|
||||||
CC=clang
|
|
||||||
CXX=clang
|
|
||||||
OBJCOPY=gobjcopy
|
|
||||||
OBJDUMP=gobjdump
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Automatically set version flag, but not if one was manually set
|
|
||||||
# And don't bother if this is a clean only run
|
|
||||||
ifeq (,$(filter GCC% CLEANONLY,$(.VARIABLES)))
|
|
||||||
version:=$(shell $(CC) --version)
|
|
||||||
# check if this is in fact GCC
|
|
||||||
ifneq (,$(or $(findstring gcc,$(version)),$(findstring GCC,$(version))))
|
|
||||||
version:=$(shell $(CC) -dumpversion)
|
|
||||||
|
|
||||||
# Turn version into words of major, minor
|
|
||||||
v:=$(subst ., ,$(version))
|
|
||||||
# concat. major minor
|
|
||||||
v:=$(word 1,$(v))$(word 2,$(v))
|
|
||||||
|
|
||||||
# If this version is not in the list, default to the latest supported
|
|
||||||
ifeq (,$(filter $(v),$(SUPPORTED_GCC_VERSIONS)))
|
|
||||||
define line =
|
|
||||||
Your compiler version, GCC $(version), is not supported by the Makefile.
|
|
||||||
The Makefile will assume GCC $(LATEST_GCC_VERSION).))
|
|
||||||
endef
|
|
||||||
$(call print,$(line))
|
|
||||||
GCC$(subst .,,$(LATEST_GCC_VERSION))=1
|
|
||||||
else
|
|
||||||
$(call print,Detected GCC $(version) (GCC$(v)))
|
|
||||||
GCC$(v)=1
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC102
|
|
||||||
GCC101=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC101
|
|
||||||
GCC93=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC93
|
|
||||||
GCC92=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC92
|
|
||||||
GCC91=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC91
|
|
||||||
GCC84=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC84
|
|
||||||
GCC83=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC83
|
|
||||||
GCC82=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC82
|
|
||||||
GCC81=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC81
|
|
||||||
GCC75=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC75
|
|
||||||
GCC74=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC74
|
|
||||||
GCC73=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC73
|
|
||||||
GCC72=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC72
|
|
||||||
GCC71=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC71
|
|
||||||
GCC64=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC64
|
|
||||||
GCC63=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC63
|
|
||||||
GCC62=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC62
|
|
||||||
GCC61=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC61
|
|
||||||
GCC55=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC55
|
|
||||||
GCC54=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC54
|
|
||||||
GCC53=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC53
|
|
||||||
GCC52=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC52
|
|
||||||
GCC51=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC51
|
|
||||||
GCC49=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC49
|
|
||||||
GCC48=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC48
|
|
||||||
GCC47=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC47
|
|
||||||
GCC46=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC46
|
|
||||||
GCC45=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC45
|
|
||||||
GCC44=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC44
|
|
||||||
GCC43=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC43
|
|
||||||
GCC42=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC42
|
|
||||||
GCC41=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC41
|
|
||||||
GCC40=1
|
|
||||||
VCHELP=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GCC295
|
|
||||||
GCC29=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
OLDWFLAGS:=$(WFLAGS)
|
|
||||||
# -W -Wno-unused
|
|
||||||
WFLAGS=-Wall
|
|
||||||
ifndef GCC295
|
|
||||||
#WFLAGS+=-Wno-packed
|
|
||||||
endif
|
|
||||||
ifndef RELAXWARNINGS
|
|
||||||
WFLAGS+=-W
|
|
||||||
#WFLAGS+=-Wno-sign-compare
|
|
||||||
ifndef GCC295
|
|
||||||
WFLAGS+=-Wno-div-by-zero
|
|
||||||
endif
|
|
||||||
#WFLAGS+=-Wsystem-headers
|
|
||||||
WFLAGS+=-Wfloat-equal
|
|
||||||
#WFLAGS+=-Wtraditional
|
|
||||||
ifdef VCHELP
|
|
||||||
WFLAGS+=-Wdeclaration-after-statement
|
|
||||||
WFLAGS+=-Wno-error=declaration-after-statement
|
|
||||||
endif
|
|
||||||
WFLAGS+=-Wundef
|
|
||||||
ifndef GCC295
|
|
||||||
WFLAGS+=-Wendif-labels
|
|
||||||
endif
|
|
||||||
ifdef GCC40
|
|
||||||
WFLAGS+=-std=gnu89
|
|
||||||
endif
|
|
||||||
ifdef GCC41
|
|
||||||
WFLAGS+=-Wshadow
|
|
||||||
endif
|
|
||||||
#WFLAGS+=-Wlarger-than-%len%
|
|
||||||
WFLAGS+=-Wpointer-arith -Wbad-function-cast
|
|
||||||
ifdef GCC45
|
|
||||||
#WFLAGS+=-Wc++-compat
|
|
||||||
endif
|
|
||||||
WFLAGS+=-Wcast-qual
|
|
||||||
ifndef NOCASTALIGNWARN
|
|
||||||
WFLAGS+=-Wcast-align
|
|
||||||
endif
|
|
||||||
WFLAGS+=-Wwrite-strings
|
|
||||||
ifndef ERRORMODE
|
|
||||||
#WFLAGS+=-Wconversion
|
|
||||||
ifdef GCC43
|
|
||||||
#WFLAGS+=-Wno-sign-conversion
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
WFLAGS+=-Wsign-compare
|
|
||||||
ifdef GCC91
|
|
||||||
WFLAGS+=-Wno-error=address-of-packed-member
|
|
||||||
endif
|
|
||||||
ifdef GCC45
|
|
||||||
WFLAGS+=-Wlogical-op
|
|
||||||
endif
|
|
||||||
WFLAGS+=-Waggregate-return
|
|
||||||
ifdef HAIKU
|
|
||||||
ifdef GCC41
|
|
||||||
#WFLAGS+=-Wno-attributes
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
#WFLAGS+=-Wstrict-prototypes
|
|
||||||
ifdef GCC40
|
|
||||||
WFLAGS+=-Wold-style-definition
|
|
||||||
endif
|
|
||||||
WFLAGS+=-Wmissing-prototypes -Wmissing-declarations
|
|
||||||
ifdef GCC40
|
|
||||||
WFLAGS+=-Wmissing-field-initializers
|
|
||||||
endif
|
|
||||||
WFLAGS+=-Wmissing-noreturn
|
|
||||||
#WFLAGS+=-Wmissing-format-attribute
|
|
||||||
#WFLAGS+=-Wno-multichar
|
|
||||||
#WFLAGS+=-Wno-deprecated-declarations
|
|
||||||
#WFLAGS+=-Wpacked
|
|
||||||
#WFLAGS+=-Wpadded
|
|
||||||
#WFLAGS+=-Wredundant-decls
|
|
||||||
WFLAGS+=-Wnested-externs
|
|
||||||
#WFLAGS+=-Wunreachable-code
|
|
||||||
WFLAGS+=-Winline
|
|
||||||
ifdef GCC43
|
|
||||||
WFLAGS+=-funit-at-a-time
|
|
||||||
WFLAGS+=-Wlogical-op
|
|
||||||
endif
|
|
||||||
ifndef GCC295
|
|
||||||
WFLAGS+=-Wdisabled-optimization
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
WFLAGS+=-Wformat-y2k
|
|
||||||
ifdef GCC71
|
|
||||||
WFLAGS+=-Wno-error=format-overflow=2
|
|
||||||
endif
|
|
||||||
WFLAGS+=-Wformat-security
|
|
||||||
ifndef GCC29
|
|
||||||
#WFLAGS+=-Winit-self
|
|
||||||
endif
|
|
||||||
ifdef GCC46
|
|
||||||
WFLAGS+=-Wno-suggest-attribute=noreturn
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef NOLDWARNING
|
|
||||||
LDFLAGS+=-Wl,--as-needed
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef ERRORMODE
|
|
||||||
WFLAGS+=-Werror
|
|
||||||
endif
|
|
||||||
|
|
||||||
WFLAGS+=$(OLDWFLAGS)
|
|
||||||
|
|
||||||
ifdef GCC43
|
|
||||||
#WFLAGS+=-Wno-error=clobbered
|
|
||||||
endif
|
|
||||||
ifdef GCC44
|
|
||||||
WFLAGS+=-Wno-error=array-bounds
|
|
||||||
endif
|
|
||||||
ifdef GCC46
|
|
||||||
WFLAGS+=-Wno-error=suggest-attribute=noreturn
|
|
||||||
endif
|
|
||||||
ifdef GCC54
|
|
||||||
WFLAGS+=-Wno-logical-op -Wno-error=logical-op
|
|
||||||
endif
|
|
||||||
ifdef GCC61
|
|
||||||
WFLAGS+=-Wno-tautological-compare -Wno-error=tautological-compare
|
|
||||||
endif
|
|
||||||
ifdef GCC71
|
|
||||||
WFLAGS+=-Wimplicit-fallthrough=4
|
|
||||||
WFLAGS+=-Wno-format-truncation
|
|
||||||
endif
|
|
||||||
ifdef GCC81
|
|
||||||
WFLAGS+=-Wno-error=format-overflow
|
|
||||||
WFLAGS+=-Wno-error=stringop-truncation
|
|
||||||
WFLAGS+=-Wno-error=stringop-overflow
|
|
||||||
WFLAGS+=-Wno-format-overflow
|
|
||||||
WFLAGS+=-Wno-stringop-truncation
|
|
||||||
WFLAGS+=-Wno-stringop-overflow
|
|
||||||
WFLAGS+=-Wno-error=multistatement-macros
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
#indicate platform and what interface use with
|
|
||||||
ifndef LINUX
|
|
||||||
ifndef FREEBSD
|
|
||||||
ifndef CYGWIN32
|
|
||||||
ifndef MINGW
|
|
||||||
ifndef MINGW64
|
|
||||||
ifndef SDL
|
|
||||||
ifndef DUMMY
|
|
||||||
$(error No interface or platform flag defined)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
#determine the interface directory (where you put all i_*.c)
|
|
||||||
i_net_o=$(OBJDIR)/i_net.o
|
|
||||||
i_system_o=$(OBJDIR)/i_system.o
|
|
||||||
i_sound_o=$(OBJDIR)/i_sound.o
|
|
||||||
i_main_o=$(OBJDIR)/i_main.o
|
|
||||||
#set OBJDIR and BIN's starting place
|
|
||||||
OBJDIR=../objs
|
|
||||||
BIN=../bin
|
|
||||||
DEPDIR=../dep
|
|
||||||
#Nasm ASM and rm
|
|
||||||
ifdef YASM
|
|
||||||
NASM?=yasm
|
|
||||||
else
|
|
||||||
NASM?=nasm
|
|
||||||
endif
|
|
||||||
REMOVE?=rm -f
|
|
||||||
MKDIR?=mkdir -p
|
|
||||||
GZIP?=gzip
|
|
||||||
GZIP_OPTS?=-9 -f -n
|
|
||||||
GZIP_OPT2=$(GZIP_OPTS) --rsyncable
|
|
||||||
UPX?=upx
|
|
||||||
UPX_OPTS?=--best --preserve-build-id
|
|
||||||
ifndef ECHO
|
|
||||||
UPX_OPTS+=-q
|
|
||||||
endif
|
|
||||||
|
|
||||||
#Interface Setup
|
|
||||||
ifdef DUMMY
|
|
||||||
INTERFACE=dummy
|
|
||||||
OBJDIR:=$(OBJDIR)/dummy
|
|
||||||
BIN:=$(BIN)/dummy
|
|
||||||
DEPDIR:=$(DEPDIR)/dummy
|
|
||||||
else
|
|
||||||
ifdef LINUX
|
|
||||||
NASMFORMAT=elf -DLINUX
|
|
||||||
SDL=1
|
|
||||||
ifdef LINUX64
|
|
||||||
OBJDIR:=$(OBJDIR)/Linux64
|
|
||||||
BIN:=$(BIN)/Linux64
|
|
||||||
DEPDIR:=$(DEPDIR)/Linux64
|
|
||||||
else
|
|
||||||
OBJDIR:=$(OBJDIR)/Linux
|
|
||||||
BIN:=$(BIN)/Linux
|
|
||||||
DEPDIR:=$(DEPDIR)/Linux
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
ifdef FREEBSD
|
|
||||||
INTERFACE=sdl
|
|
||||||
NASMFORMAT=elf -DLINUX
|
|
||||||
SDL=1
|
|
||||||
|
|
||||||
OBJDIR:=$(OBJDIR)/FreeBSD
|
|
||||||
BIN:=$(BIN)/FreeBSD
|
|
||||||
DEPDIR:=$(DEPDIR)/Linux
|
|
||||||
else
|
|
||||||
ifdef SOLARIS
|
|
||||||
INTERFACE=sdl
|
|
||||||
NASMFORMAT=elf -DLINUX
|
|
||||||
SDL=1
|
|
||||||
|
|
||||||
OBJDIR:=$(OBJDIR)/Solaris
|
|
||||||
BIN:=$(BIN)/Solaris
|
|
||||||
DEPDIR:=$(DEPDIR)/Solaris
|
|
||||||
else
|
|
||||||
ifdef CYGWIN32
|
|
||||||
INTERFACE=sdl
|
|
||||||
NASMFORMAT=win32
|
|
||||||
SDL=1
|
|
||||||
|
|
||||||
OBJDIR:=$(OBJDIR)/cygwin
|
|
||||||
BIN:=$(BIN)/Cygwin
|
|
||||||
DEPDIR:=$(DEPDIR)/Cygwin
|
|
||||||
else
|
|
||||||
ifdef MINGW64
|
|
||||||
#NASMFORMAT=win64
|
|
||||||
SDL=1
|
|
||||||
OBJDIR:=$(OBJDIR)/Mingw64
|
|
||||||
BIN:=$(BIN)/Mingw64
|
|
||||||
DEPDIR:=$(DEPDIR)/Mingw64
|
|
||||||
else
|
|
||||||
ifdef MINGW
|
|
||||||
NASMFORMAT=win32
|
|
||||||
SDL=1
|
|
||||||
OBJDIR:=$(OBJDIR)/Mingw
|
|
||||||
BIN:=$(BIN)/Mingw
|
|
||||||
DEPDIR:=$(DEPDIR)/Mingw
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef ARCHNAME
|
|
||||||
OBJDIR:=$(OBJDIR)/$(ARCHNAME)
|
|
||||||
BIN:=$(BIN)/$(ARCHNAME)
|
|
||||||
DEPDIR:=$(DEPDIR)/$(ARCHNAME)
|
|
||||||
endif
|
|
||||||
|
|
||||||
OBJDUMP_OPTS?=--wide --source --line-numbers
|
|
||||||
LD=$(CC)
|
|
||||||
|
|
||||||
ifdef SDL
|
|
||||||
INTERFACE=sdl
|
|
||||||
OBJDIR:=$(OBJDIR)/SDL
|
|
||||||
DEPDIR:=$(DEPDIR)/SDL
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef DUMMY
|
|
||||||
ifdef DEBUGMODE
|
|
||||||
OBJDIR:=$(OBJDIR)/Debug
|
|
||||||
BIN:=$(BIN)/Debug
|
|
||||||
DEPDIR:=$(DEPDIR)/Debug
|
|
||||||
else
|
|
||||||
OBJDIR:=$(OBJDIR)/Release
|
|
||||||
BIN:=$(BIN)/Release
|
|
||||||
DEPDIR:=$(DEPDIR)/Release
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
107
src/Makefile.d/detect.mk
Normal file
107
src/Makefile.d/detect.mk
Normal file
|
|
@ -0,0 +1,107 @@
|
||||||
|
#
|
||||||
|
# Detect the host system and compiler version.
|
||||||
|
#
|
||||||
|
|
||||||
|
# Previously featured:\
|
||||||
|
PANDORA\
|
||||||
|
HAIKU\
|
||||||
|
DUMMY\
|
||||||
|
DJGPPDOS\
|
||||||
|
SOLARIS\
|
||||||
|
MACOSX\
|
||||||
|
|
||||||
|
all_systems:=\
|
||||||
|
LINUX64\
|
||||||
|
MINGW64\
|
||||||
|
MINGW\
|
||||||
|
UNIX\
|
||||||
|
LINUX\
|
||||||
|
FREEBSD\
|
||||||
|
SDL\
|
||||||
|
|
||||||
|
# check for user specified system
|
||||||
|
ifeq (,$(filter $(all_systems),$(.VARIABLES)))
|
||||||
|
ifeq ($(OS),Windows_NT) # all windows are Windows_NT...
|
||||||
|
|
||||||
|
_m=Detected a Windows system,\
|
||||||
|
compiling for 32-bit MinGW SDL...)
|
||||||
|
$(call Print,$(_m))
|
||||||
|
|
||||||
|
# go for a 32-bit sdl mingw exe by default
|
||||||
|
MINGW:=1
|
||||||
|
|
||||||
|
else # if you on the *nix
|
||||||
|
|
||||||
|
system:=$(shell uname -s)
|
||||||
|
|
||||||
|
ifeq ($(system),Linux)
|
||||||
|
new_system:=LINUX
|
||||||
|
else
|
||||||
|
|
||||||
|
$(error \
|
||||||
|
Could not automatically detect your system,\
|
||||||
|
try specifying a system manually)
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(shell getconf LONG_BIT),64)
|
||||||
|
system+=64-bit
|
||||||
|
new_system:=$(new_system)64
|
||||||
|
endif
|
||||||
|
|
||||||
|
$(call Print,Detected $(system) ($(new_system))...)
|
||||||
|
$(new_system):=1
|
||||||
|
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
# This must have high to low order.
|
||||||
|
gcc_versions:=\
|
||||||
|
102 101\
|
||||||
|
93 92 91\
|
||||||
|
84 83 82 81\
|
||||||
|
75 74 73 72 71\
|
||||||
|
64 63 62 61\
|
||||||
|
55 54 53 52 51\
|
||||||
|
49 48 47 46 45 44 43 42 41 40
|
||||||
|
|
||||||
|
latest_gcc_version:=10.2
|
||||||
|
|
||||||
|
# Automatically set version flag, but not if one was
|
||||||
|
# manually set. And don't bother if this is a clean only
|
||||||
|
# run.
|
||||||
|
ifeq (,$(call Wildvar,GCC% destructive))
|
||||||
|
|
||||||
|
# can't use $(CC) --version here since that uses argv[0] to display the name
|
||||||
|
# also gcc outputs the information to stderr, so I had to do 2>&1
|
||||||
|
# this program really doesn't like identifying itself
|
||||||
|
version:=$(shell $(CC) -v 2>&1)
|
||||||
|
|
||||||
|
# check if this is in fact GCC
|
||||||
|
ifneq (,$(findstring gcc version,$(version)))
|
||||||
|
|
||||||
|
# in stark contrast to the name, gcc will give me a nicely formatted version number for free
|
||||||
|
version:=$(shell $(CC) -dumpfullversion)
|
||||||
|
|
||||||
|
# Turn version into words of major, minor
|
||||||
|
v:=$(subst ., ,$(version))
|
||||||
|
# concat. major minor
|
||||||
|
v:=$(word 1,$(v))$(word 2,$(v))
|
||||||
|
|
||||||
|
# If this version is not in the list,
|
||||||
|
# default to the latest supported
|
||||||
|
ifeq (,$(filter $(v),$(gcc_versions)))
|
||||||
|
define line =
|
||||||
|
Your compiler version, GCC $(version), \
|
||||||
|
is not supported by the Makefile.
|
||||||
|
The Makefile will assume GCC $(latest_gcc_version).
|
||||||
|
endef
|
||||||
|
$(call Print,$(line))
|
||||||
|
GCC$(subst .,,$(latest_gcc_version)):=1
|
||||||
|
else
|
||||||
|
$(call Print,Detected GCC $(version) (GCC$(v)))
|
||||||
|
GCC$(v):=1
|
||||||
|
endif
|
||||||
|
|
||||||
|
endif
|
||||||
|
endif
|
||||||
84
src/Makefile.d/features.mk
Normal file
84
src/Makefile.d/features.mk
Normal file
|
|
@ -0,0 +1,84 @@
|
||||||
|
#
|
||||||
|
# Makefile for feature flags.
|
||||||
|
#
|
||||||
|
|
||||||
|
passthru_opts+=\
|
||||||
|
NONET NO_IPV6 NOHW NOMD5 NOPOSTPROCESSING\
|
||||||
|
MOBJCONSISTANCY PACKETDROP ZDEBUG\
|
||||||
|
HAVE_MINIUPNPC\
|
||||||
|
HAVE_DISCORDRPC TESTERS DEVELOP
|
||||||
|
|
||||||
|
# build with debugging information
|
||||||
|
ifdef DEBUGMODE
|
||||||
|
MOBJCONSISTANCY=1
|
||||||
|
PACKETDROP=1
|
||||||
|
opts+=-DPARANOIA -DRANGECHECK
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef NOHW
|
||||||
|
opts+=-DHWRENDER
|
||||||
|
sources+=$(call List,hardware/Sourcefile)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef NOASM
|
||||||
|
ifndef NONX86
|
||||||
|
sources+=tmap.nas tmap_mmx.nas
|
||||||
|
opts+=-DUSEASM
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef NOMD5
|
||||||
|
sources+=md5.c
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef NOZLIB
|
||||||
|
ifndef NOPNG
|
||||||
|
ifdef PNG_PKGCONFIG
|
||||||
|
$(eval $(call Use_pkg_config,PNG_PKGCONFIG))
|
||||||
|
else
|
||||||
|
PNG_CONFIG?=$(call Prefix,libpng-config)
|
||||||
|
$(eval $(call Configure,PNG,$(PNG_CONFIG) \
|
||||||
|
$(if $(PNG_STATIC),--static),,--ldflags))
|
||||||
|
endif
|
||||||
|
ifdef LINUX
|
||||||
|
opts+=-D_LARGFILE64_SOURCE
|
||||||
|
endif
|
||||||
|
opts+=-DHAVE_PNG
|
||||||
|
sources+=apng.c
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef NONET
|
||||||
|
ifndef NOCURL
|
||||||
|
CURLCONFIG?=curl-config
|
||||||
|
$(eval $(call Configure,CURL,$(CURLCONFIG)))
|
||||||
|
opts+=-DHAVE_CURL
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef HAVE_MINIUPNPC
|
||||||
|
libs+=-lminiupnpc
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef HAVE_DISCORDRPC
|
||||||
|
$(eval $(call Propogate_flags,DISCORDRPC))
|
||||||
|
libs+=-ldiscord-rpc
|
||||||
|
opts+=-DUSE_STUN
|
||||||
|
sources+=discord.c stun.c
|
||||||
|
endif
|
||||||
|
|
||||||
|
# (Valgrind is a memory debugger.)
|
||||||
|
ifdef VALGRIND
|
||||||
|
VALGRIND_PKGCONFIG?=valgrind
|
||||||
|
$(eval $(call Use_pkg_config,VALGRIND))
|
||||||
|
ZDEBUG=1
|
||||||
|
opts+=-DHAVE_VALGRIND
|
||||||
|
endif
|
||||||
|
|
||||||
|
default_packages:=\
|
||||||
|
GME/libgme/LIBGME\
|
||||||
|
OPENMPT/libopenmpt/LIBOPENMPT\
|
||||||
|
ZLIB/zlib\
|
||||||
|
|
||||||
|
$(foreach p,$(default_packages),\
|
||||||
|
$(eval $(call Check_pkg_config,$(p))))
|
||||||
40
src/Makefile.d/nix.mk
Normal file
40
src/Makefile.d/nix.mk
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
#
|
||||||
|
# Makefile options for unices (linux, bsd...)
|
||||||
|
#
|
||||||
|
|
||||||
|
EXENAME?=lsdl2srb2kart
|
||||||
|
|
||||||
|
opts+=-DUNIXCOMMON -DLUA_USE_POSIX
|
||||||
|
libs+=-lm
|
||||||
|
|
||||||
|
ifndef nasm_format
|
||||||
|
nasm_format:=elf -DLINUX
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef NOHW
|
||||||
|
opts+=-I/usr/X11R6/include
|
||||||
|
libs+=-L/usr/X11R6/lib
|
||||||
|
endif
|
||||||
|
|
||||||
|
SDL=1
|
||||||
|
|
||||||
|
# In common usage.
|
||||||
|
ifdef LINUX
|
||||||
|
libs+=-lrt
|
||||||
|
passthru_opts+=NOTERMIOS
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Tested by Steel, as of release 2.2.8.
|
||||||
|
ifdef FREEBSD
|
||||||
|
opts+=-I/usr/X11R6/include -DLINUX -DFREEBSD
|
||||||
|
libs+=-L/usr/X11R6/lib -lipx -lkvm
|
||||||
|
endif
|
||||||
|
|
||||||
|
# FIXME: UNTESTED
|
||||||
|
#ifdef SOLARIS
|
||||||
|
#NOIPX=1
|
||||||
|
#NOASM=1
|
||||||
|
#opts+=-I/usr/local/include -I/opt/sfw/include \
|
||||||
|
# -DSOLARIS -DINADDR_NONE=INADDR_ANY -DBSD_COMP
|
||||||
|
#libs+=-L/opt/sfw/lib -lsocket -lnsl
|
||||||
|
#endif
|
||||||
16
src/Makefile.d/old.mk
Normal file
16
src/Makefile.d/old.mk
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
#
|
||||||
|
# Warn about old build directories and offer to purge.
|
||||||
|
#
|
||||||
|
|
||||||
|
_old:=$(wildcard $(addprefix ../bin/,FreeBSD Linux \
|
||||||
|
Linux64 Mingw Mingw64 SDL dummy) ../objs ../dep)
|
||||||
|
|
||||||
|
ifdef _old
|
||||||
|
$(foreach v,$(_old),$(info $(abspath $(v))))
|
||||||
|
$(info )
|
||||||
|
$(info These directories are no longer\
|
||||||
|
required and should be removed.)
|
||||||
|
$(info You may remove them manually or\
|
||||||
|
by using 'make distclean')
|
||||||
|
$(error )
|
||||||
|
endif
|
||||||
69
src/Makefile.d/platform.mk
Normal file
69
src/Makefile.d/platform.mk
Normal file
|
|
@ -0,0 +1,69 @@
|
||||||
|
#
|
||||||
|
# Platform specific options.
|
||||||
|
#
|
||||||
|
|
||||||
|
PKG_CONFIG?=pkg-config
|
||||||
|
|
||||||
|
ifdef WINDOWSHELL
|
||||||
|
rmrf=-2>NUL DEL /S /Q
|
||||||
|
mkdir=-2>NUL MD
|
||||||
|
cat=TYPE
|
||||||
|
else
|
||||||
|
rmrf=rm -rf
|
||||||
|
mkdir=mkdir -p
|
||||||
|
cat=cat
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef LINUX64
|
||||||
|
LINUX=1
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef MINGW64
|
||||||
|
MINGW=1
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef LINUX
|
||||||
|
UNIX=1
|
||||||
|
ifdef LINUX64
|
||||||
|
NONX86=1
|
||||||
|
# LINUX64 does not imply X86_64=1;
|
||||||
|
# could mean ARM64 or Itanium
|
||||||
|
platform=linux/64
|
||||||
|
else
|
||||||
|
platform=linux
|
||||||
|
endif
|
||||||
|
else ifdef FREEBSD
|
||||||
|
UNIX=1
|
||||||
|
platform=freebsd
|
||||||
|
else ifdef SOLARIS # FIXME: UNTESTED
|
||||||
|
UNIX=1
|
||||||
|
platform=solaris
|
||||||
|
else ifdef CYGWIN32 # FIXME: UNTESTED
|
||||||
|
nasm_format=win32
|
||||||
|
platform=cygwin
|
||||||
|
else ifdef MINGW
|
||||||
|
ifdef MINGW64
|
||||||
|
NONX86=1
|
||||||
|
NOASM=1
|
||||||
|
# MINGW64 should not necessarily imply X86_64=1,
|
||||||
|
# but we make that assumption elsewhere
|
||||||
|
# Once that changes, remove this
|
||||||
|
X86_64=1
|
||||||
|
platform=mingw/64
|
||||||
|
else
|
||||||
|
platform=mingw
|
||||||
|
endif
|
||||||
|
include Makefile.d/win32.mk
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef platform
|
||||||
|
makedir:=$(makedir)/$(platform)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef UNIX
|
||||||
|
include Makefile.d/nix.mk
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef SDL
|
||||||
|
include Makefile.d/sdl.mk
|
||||||
|
endif
|
||||||
79
src/Makefile.d/sdl.mk
Normal file
79
src/Makefile.d/sdl.mk
Normal file
|
|
@ -0,0 +1,79 @@
|
||||||
|
#
|
||||||
|
# Makefile options for SDL2 backend.
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# SDL...., *looks at Alam*, THIS IS A MESS!
|
||||||
|
#
|
||||||
|
# ...a little bird flexes its muscles...
|
||||||
|
#
|
||||||
|
|
||||||
|
makedir:=$(makedir)/SDL
|
||||||
|
|
||||||
|
sources+=$(call List,sdl/Sourcefile)
|
||||||
|
opts+=-DDIRECTFULLSCREEN -DHAVE_SDL
|
||||||
|
|
||||||
|
# FIXME: UNTESTED
|
||||||
|
#ifdef PANDORA
|
||||||
|
#include sdl/SRB2Pandora/Makefile.cfg
|
||||||
|
#endif #ifdef PANDORA
|
||||||
|
|
||||||
|
# FIXME: UNTESTED
|
||||||
|
#ifdef CYGWIN32
|
||||||
|
#include sdl/MakeCYG.cfg
|
||||||
|
#endif #ifdef CYGWIN32
|
||||||
|
|
||||||
|
ifndef NOHW
|
||||||
|
sources+=sdl/ogl_sdl.c
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef NOMIXER
|
||||||
|
sources+=sdl/sdl_sound.c
|
||||||
|
else
|
||||||
|
opts+=-DHAVE_MIXER
|
||||||
|
sources+=sdl/mixer_sound.c
|
||||||
|
|
||||||
|
ifdef HAVE_MIXERX
|
||||||
|
opts+=-DHAVE_MIXERX
|
||||||
|
libs+=-lSDL2_mixer_ext
|
||||||
|
else
|
||||||
|
libs+=-lSDL2_mixer
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef NOTHREADS
|
||||||
|
opts+=-DHAVE_THREADS
|
||||||
|
sources+=sdl/i_threads.c
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef SDL_PKGCONFIG
|
||||||
|
$(eval $(call Use_pkg_config,SDL))
|
||||||
|
else
|
||||||
|
SDL_CONFIG?=$(call Prefix,sdl2-config)
|
||||||
|
SDL_CFLAGS?=$(shell $(SDL_CONFIG) --cflags)
|
||||||
|
SDL_LDFLAGS?=$(shell $(SDL_CONFIG) \
|
||||||
|
$(if $(STATIC),--static-libs,--libs))
|
||||||
|
$(eval $(call Propogate_flags,SDL))
|
||||||
|
endif
|
||||||
|
|
||||||
|
# use the x86 asm code
|
||||||
|
ifndef CYGWIN32
|
||||||
|
ifndef NOASM
|
||||||
|
USEASM=1
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef MINGW
|
||||||
|
ifndef NOSDLMAIN
|
||||||
|
SDLMAIN=1
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef SDLMAIN
|
||||||
|
opts+=-DSDLMAIN
|
||||||
|
else
|
||||||
|
ifdef MINGW
|
||||||
|
opts+=-Umain
|
||||||
|
libs+=-mconsole
|
||||||
|
endif
|
||||||
|
endif
|
||||||
93
src/Makefile.d/util.mk
Normal file
93
src/Makefile.d/util.mk
Normal file
|
|
@ -0,0 +1,93 @@
|
||||||
|
#
|
||||||
|
# Utility macros for the rest of the Makefiles.
|
||||||
|
#
|
||||||
|
|
||||||
|
Ifnot=$(if $(1),$(3),$(2))
|
||||||
|
Ifndef=$(call Ifnot,$($(1)),$(2),$(3))
|
||||||
|
|
||||||
|
# Match and expand a list of variables by pattern.
|
||||||
|
Wildvar=$(foreach v,$(filter $(1),$(.VARIABLES)),$($(v)))
|
||||||
|
|
||||||
|
# Read a list of words from file and prepend each with the
|
||||||
|
# directory of the file.
|
||||||
|
_cat=$(shell $(cat) $(call Windows_path,$(1)))
|
||||||
|
List=$(addprefix $(dir $(1)),$(call _cat,$(1)))
|
||||||
|
|
||||||
|
# Convert path separators to backslash on Windows.
|
||||||
|
Windows_path=$(if $(WINDOWSHELL),$(subst /,\,$(1)),$(1))
|
||||||
|
|
||||||
|
define Propogate_flags =
|
||||||
|
opts+=$$($(1)_CFLAGS)
|
||||||
|
libs+=$$($(1)_LDFLAGS)
|
||||||
|
endef
|
||||||
|
|
||||||
|
# Set library's _CFLAGS and _LDFLAGS from some command.
|
||||||
|
# Automatically propogates the flags too.
|
||||||
|
# 1: variable prefix (e.g. CURL)
|
||||||
|
# 2: start of command (e.g. curl-config)
|
||||||
|
# --- optional ----
|
||||||
|
# 3: CFLAGS command arguments, default '--cflags'
|
||||||
|
# 4: LDFLAGS command arguments, default '--libs'
|
||||||
|
# 5: common command arguments at the end of command
|
||||||
|
define Configure =
|
||||||
|
$(1)_CFLAGS?=$$(shell $(2) $(or $(3),--cflags) $(5))
|
||||||
|
$(1)_LDFLAGS?=$$(shell $(2) $(or $(4),--libs) $(5))
|
||||||
|
$(call Propogate_flags,$(1))
|
||||||
|
endef
|
||||||
|
|
||||||
|
# Configure library with pkg-config. The package name is
|
||||||
|
# taken from a _PKGCONFIG variable.
|
||||||
|
# 1: variable prefix
|
||||||
|
#
|
||||||
|
# LIBGME_PKGCONFIG=libgme
|
||||||
|
# $(eval $(call Use_pkg_config,LIBGME))
|
||||||
|
define Use_pkg_config =
|
||||||
|
$(call Configure,$(1),$(PKG_CONFIG),,,$($(1)_PKGCONFIG))
|
||||||
|
endef
|
||||||
|
|
||||||
|
# Check disabling flag and configure package in one step
|
||||||
|
# according to delimited argument.
|
||||||
|
# (There is only one argument, but it split by slash.)
|
||||||
|
# 1/: short form library name (uppercase). This is
|
||||||
|
# prefixed with 'NO' and 'HAVE_'. E.g. NOGME, HAVE_GME
|
||||||
|
# /2: package name (e.g. libgme)
|
||||||
|
# /3: variable prefix
|
||||||
|
#
|
||||||
|
# The following example would check if NOGME is not
|
||||||
|
# defined before attempting to define LIBGME_CFLAGS and
|
||||||
|
# LIBGME_LDFLAGS as with Use_pkg_config.
|
||||||
|
#
|
||||||
|
# $(eval $(call Check_pkg_config,GME/libgme/LIBGME))
|
||||||
|
define Check_pkg_config =
|
||||||
|
_p:=$(subst /, ,$(1))
|
||||||
|
_v1:=$$(word 1,$$(_p))
|
||||||
|
_v2:=$$(or $$(word 3,$$(_p)),$$(_v1))
|
||||||
|
ifndef NO$$(_v1)
|
||||||
|
$$(_v2)_PKGCONFIG?=$$(word 2,$$(_p))
|
||||||
|
$$(eval $$(call Use_pkg_config,$$(_v2)))
|
||||||
|
opts+=-DHAVE_$$(_v1)
|
||||||
|
endif
|
||||||
|
endef
|
||||||
|
|
||||||
|
# $(call Prefix,gcc)
|
||||||
|
Prefix=$(if $(PREFIX),$(PREFIX)-)$(1)
|
||||||
|
|
||||||
|
Echo=
|
||||||
|
Echo_name=
|
||||||
|
Print=
|
||||||
|
|
||||||
|
ifndef SILENT
|
||||||
|
Echo=@echo $(1)
|
||||||
|
ifndef ECHO
|
||||||
|
ifndef NOECHOFILENAMES
|
||||||
|
Echo_name=$(call Echo,-- $(1) ...)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
ifndef MAKE_RESTARTS
|
||||||
|
ifndef destructive
|
||||||
|
Print=$(info $(1))
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
.=$(call Ifndef,ECHO,@)
|
||||||
181
src/Makefile.d/versions.mk
Normal file
181
src/Makefile.d/versions.mk
Normal file
|
|
@ -0,0 +1,181 @@
|
||||||
|
#
|
||||||
|
# Flags to put a sock in GCC!
|
||||||
|
#
|
||||||
|
|
||||||
|
# See the versions list in detect.mk
|
||||||
|
# This will define all version flags going backward.
|
||||||
|
# Yes, it's magic.
|
||||||
|
define _predecessor =
|
||||||
|
ifdef GCC$(firstword $(1))
|
||||||
|
GCC$(lastword $(1)):=1
|
||||||
|
endif
|
||||||
|
endef
|
||||||
|
_n:=$(words $(gcc_versions))
|
||||||
|
$(foreach v,$(join $(wordlist 2,$(_n),- $(gcc_versions)),\
|
||||||
|
$(addprefix =,$(wordlist 2,$(_n),$(gcc_versions)))),\
|
||||||
|
$(and $(findstring =,$(v)),\
|
||||||
|
$(eval $(call _predecessor,$(subst =, ,$(v))))))
|
||||||
|
|
||||||
|
# -W -Wno-unused
|
||||||
|
WFLAGS:=-Wall -Wno-trigraphs
|
||||||
|
ifndef GCC295
|
||||||
|
#WFLAGS+=-Wno-packed
|
||||||
|
endif
|
||||||
|
ifndef RELAXWARNINGS
|
||||||
|
WFLAGS+=-W
|
||||||
|
#WFLAGS+=-Wno-sign-compare
|
||||||
|
ifndef GCC295
|
||||||
|
WFLAGS+=-Wno-div-by-zero
|
||||||
|
endif
|
||||||
|
#WFLAGS+=-Wsystem-headers
|
||||||
|
WFLAGS+=-Wfloat-equal
|
||||||
|
#WFLAGS+=-Wtraditional
|
||||||
|
WFLAGS+=-Wundef
|
||||||
|
ifndef GCC295
|
||||||
|
WFLAGS+=-Wendif-labels
|
||||||
|
endif
|
||||||
|
ifdef GCC40
|
||||||
|
WFLAGS+=-std=gnu89
|
||||||
|
endif
|
||||||
|
ifdef GCC41
|
||||||
|
WFLAGS+=-Wdeclaration-after-statement
|
||||||
|
WFLAGS+=-Wno-error=declaration-after-statement
|
||||||
|
WFLAGS+=-Wshadow
|
||||||
|
endif
|
||||||
|
#WFLAGS+=-Wlarger-than-%len%
|
||||||
|
WFLAGS+=-Wpointer-arith -Wbad-function-cast
|
||||||
|
ifdef GCC45
|
||||||
|
#WFLAGS+=-Wc++-compat
|
||||||
|
endif
|
||||||
|
WFLAGS+=-Wcast-qual
|
||||||
|
ifndef NOCASTALIGNWARN
|
||||||
|
WFLAGS+=-Wcast-align
|
||||||
|
endif
|
||||||
|
WFLAGS+=-Wwrite-strings
|
||||||
|
ifndef ERRORMODE
|
||||||
|
#WFLAGS+=-Wconversion
|
||||||
|
ifdef GCC43
|
||||||
|
#WFLAGS+=-Wno-sign-conversion
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
WFLAGS+=-Wsign-compare
|
||||||
|
ifdef GCC91
|
||||||
|
WFLAGS+=-Wno-error=address-of-packed-member
|
||||||
|
endif
|
||||||
|
ifdef GCC45
|
||||||
|
WFLAGS+=-Wlogical-op
|
||||||
|
endif
|
||||||
|
WFLAGS+=-Waggregate-return
|
||||||
|
ifdef HAIKU
|
||||||
|
ifdef GCC41
|
||||||
|
#WFLAGS+=-Wno-attributes
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
#WFLAGS+=-Wstrict-prototypes
|
||||||
|
ifdef GCC40
|
||||||
|
WFLAGS+=-Wold-style-definition
|
||||||
|
endif
|
||||||
|
WFLAGS+=-Wmissing-prototypes -Wmissing-declarations
|
||||||
|
ifdef GCC40
|
||||||
|
WFLAGS+=-Wmissing-field-initializers
|
||||||
|
endif
|
||||||
|
WFLAGS+=-Wmissing-noreturn
|
||||||
|
#WFLAGS+=-Wmissing-format-attribute
|
||||||
|
#WFLAGS+=-Wno-multichar
|
||||||
|
#WFLAGS+=-Wno-deprecated-declarations
|
||||||
|
#WFLAGS+=-Wpacked
|
||||||
|
#WFLAGS+=-Wpadded
|
||||||
|
#WFLAGS+=-Wredundant-decls
|
||||||
|
WFLAGS+=-Wnested-externs
|
||||||
|
#WFLAGS+=-Wunreachable-code
|
||||||
|
WFLAGS+=-Winline
|
||||||
|
ifdef GCC43
|
||||||
|
WFLAGS+=-funit-at-a-time
|
||||||
|
WFLAGS+=-Wlogical-op
|
||||||
|
endif
|
||||||
|
ifndef GCC295
|
||||||
|
WFLAGS+=-Wdisabled-optimization
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
WFLAGS+=-Wformat-y2k
|
||||||
|
ifdef GCC71
|
||||||
|
WFLAGS+=-Wno-error=format-overflow=2
|
||||||
|
endif
|
||||||
|
WFLAGS+=-Wformat-security
|
||||||
|
ifndef GCC29
|
||||||
|
#WFLAGS+=-Winit-self
|
||||||
|
endif
|
||||||
|
ifdef GCC46
|
||||||
|
WFLAGS+=-Wno-suggest-attribute=noreturn
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef NOLDWARNING
|
||||||
|
LDFLAGS+=-Wl,--as-needed
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef ERRORMODE
|
||||||
|
WFLAGS+=-Werror
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef GCC43
|
||||||
|
#WFLAGS+=-Wno-error=clobbered
|
||||||
|
endif
|
||||||
|
ifdef GCC44
|
||||||
|
WFLAGS+=-Wno-error=array-bounds
|
||||||
|
endif
|
||||||
|
ifdef GCC46
|
||||||
|
WFLAGS+=-Wno-error=suggest-attribute=noreturn
|
||||||
|
endif
|
||||||
|
ifdef GCC54
|
||||||
|
WFLAGS+=-Wno-logical-op -Wno-error=logical-op
|
||||||
|
endif
|
||||||
|
ifdef GCC61
|
||||||
|
WFLAGS+=-Wno-tautological-compare -Wno-error=tautological-compare
|
||||||
|
endif
|
||||||
|
ifdef GCC71
|
||||||
|
WFLAGS+=-Wimplicit-fallthrough=4
|
||||||
|
WFLAGS+=-Wno-format-truncation
|
||||||
|
endif
|
||||||
|
ifdef GCC81
|
||||||
|
WFLAGS+=-Wno-error=format-overflow
|
||||||
|
WFLAGS+=-Wno-error=stringop-truncation
|
||||||
|
WFLAGS+=-Wno-error=stringop-overflow
|
||||||
|
WFLAGS+=-Wno-format-overflow
|
||||||
|
WFLAGS+=-Wno-stringop-truncation
|
||||||
|
WFLAGS+=-Wno-stringop-overflow
|
||||||
|
WFLAGS+=-Wno-error=multistatement-macros
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef NONX86
|
||||||
|
ifdef X86_64 # yeah that SEEMS contradictory
|
||||||
|
opts+=-march=nocona
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
ifndef GCC29
|
||||||
|
opts+=-msse3 -mfpmath=sse
|
||||||
|
else
|
||||||
|
opts+=-mpentium
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef DEBUGMODE
|
||||||
|
ifdef GCC48
|
||||||
|
opts+=-Og
|
||||||
|
else
|
||||||
|
opts+=-O0
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef VALGRIND
|
||||||
|
ifdef GCC46
|
||||||
|
WFLAGS+=-Wno-error=unused-but-set-variable
|
||||||
|
WFLAGS+=-Wno-unused-but-set-variable
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Lua
|
||||||
|
ifdef GCC43
|
||||||
|
ifndef GCC44
|
||||||
|
WFLAGS+=-Wno-logical-op
|
||||||
|
endif
|
||||||
|
endif
|
||||||
117
src/Makefile.d/win32.mk
Normal file
117
src/Makefile.d/win32.mk
Normal file
|
|
@ -0,0 +1,117 @@
|
||||||
|
#
|
||||||
|
# Mingw, if you don't know, that's Win32/Win64
|
||||||
|
#
|
||||||
|
|
||||||
|
ifndef MINGW64
|
||||||
|
EXENAME?=srb2kart.exe
|
||||||
|
else
|
||||||
|
EXENAME?=srb2kart64.exe
|
||||||
|
endif
|
||||||
|
|
||||||
|
sources+=win32/Srb2win.rc
|
||||||
|
opts+=-DSTDC_HEADERS
|
||||||
|
libs+=-ladvapi32 -lkernel32 -lmsvcrt -luser32
|
||||||
|
|
||||||
|
nasm_format:=win32
|
||||||
|
|
||||||
|
SDL=1
|
||||||
|
|
||||||
|
ifndef NOHW
|
||||||
|
opts+=-DUSE_WGL_SWAP
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef MINGW64
|
||||||
|
libs+=-lws2_32
|
||||||
|
else
|
||||||
|
ifdef NO_IPV6
|
||||||
|
libs+=-lwsock32
|
||||||
|
else
|
||||||
|
libs+=-lws2_32
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef MINGW64
|
||||||
|
opts+=-I../libs/drmingw/include
|
||||||
|
libs+=-L../libs/drmingw/lib/win32 -lmgwhelp -lexchndl
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef MINGW64
|
||||||
|
libs+=-Wl,--large-address-aware
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef NONET
|
||||||
|
ifndef MINGW64 # miniupnc is broken with MINGW64
|
||||||
|
opts+=-I../libs -DSTATIC_MINIUPNPC
|
||||||
|
libs+=-L../libs/miniupnpc/mingw$(32) -lws2_32 -liphlpapi
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef NO_DISCORDRPC
|
||||||
|
HAVE_DISCORDRPC=1
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef MINGW64
|
||||||
|
32=32
|
||||||
|
x86=x86
|
||||||
|
i686=i686
|
||||||
|
else
|
||||||
|
32=64
|
||||||
|
x86=x86_64
|
||||||
|
i686=x86_64
|
||||||
|
endif
|
||||||
|
|
||||||
|
mingw:=$(i686)-w64-mingw32
|
||||||
|
|
||||||
|
define _set =
|
||||||
|
$(1)_CFLAGS?=$($(1)_opts)
|
||||||
|
$(1)_LDFLAGS?=$($(1)_libs)
|
||||||
|
endef
|
||||||
|
|
||||||
|
lib:=../libs/gme
|
||||||
|
LIBGME_opts:=-I$(lib)/include
|
||||||
|
LIBGME_libs:=-L$(lib)/win$(32) -lgme
|
||||||
|
$(eval $(call _set,LIBGME))
|
||||||
|
|
||||||
|
lib:=../libs/libopenmpt
|
||||||
|
LIBOPENMPT_opts:=-I$(lib)/inc
|
||||||
|
LIBOPENMPT_libs:=-L$(lib)/lib/$(x86)/mingw -lopenmpt
|
||||||
|
$(eval $(call _set,LIBOPENMPT))
|
||||||
|
|
||||||
|
ifndef NOMIXERX
|
||||||
|
HAVE_MIXERX=1
|
||||||
|
lib:=../libs/SDLMixerX/$(mingw)
|
||||||
|
else
|
||||||
|
lib:=../libs/SDL2_mixer/$(mingw)
|
||||||
|
endif
|
||||||
|
|
||||||
|
mixer_opts:=-I$(lib)/include/SDL2
|
||||||
|
mixer_libs:=-L$(lib)/lib
|
||||||
|
|
||||||
|
lib:=../libs/SDL2/$(mingw)
|
||||||
|
SDL_opts:=-I$(lib)/include/SDL2\
|
||||||
|
$(mixer_opts) -Dmain=SDL_main
|
||||||
|
SDL_libs:=-L$(lib)/lib $(mixer_libs)\
|
||||||
|
-lmingw32 -lSDL2main -lSDL2 -mwindows
|
||||||
|
$(eval $(call _set,SDL))
|
||||||
|
|
||||||
|
lib:=../libs/zlib
|
||||||
|
ZLIB_opts:=-I$(lib)
|
||||||
|
ZLIB_libs:=-L$(lib)/win32 -lz$(32)
|
||||||
|
$(eval $(call _set,ZLIB))
|
||||||
|
|
||||||
|
ifndef PNG_CONFIG
|
||||||
|
lib:=../libs/libpng-src
|
||||||
|
PNG_opts:=-I$(lib)
|
||||||
|
PNG_libs:=-L$(lib)/projects -lpng$(32)
|
||||||
|
$(eval $(call _set,PNG))
|
||||||
|
endif
|
||||||
|
|
||||||
|
lib:=../libs/curl
|
||||||
|
CURL_opts:=-I$(lib)/include
|
||||||
|
CURL_libs:=-L$(lib)/lib$(32) -lcurl
|
||||||
|
$(eval $(call _set,CURL))
|
||||||
|
|
||||||
|
lib:=../libs/discord-rpc/win$(32)-dynamic
|
||||||
|
DISCORDRPC_opts:=-I$(lib)/include
|
||||||
|
DISCORDRPC_libs:=-L$(lib)/lib
|
||||||
|
$(eval $(call _set,DISCORDRPC))
|
||||||
113
src/Sourcefile
Normal file
113
src/Sourcefile
Normal file
|
|
@ -0,0 +1,113 @@
|
||||||
|
string.c
|
||||||
|
d_main.c
|
||||||
|
d_clisrv.c
|
||||||
|
d_net.c
|
||||||
|
d_netfil.c
|
||||||
|
d_netcmd.c
|
||||||
|
dehacked.c
|
||||||
|
deh_soc.c
|
||||||
|
deh_lua.c
|
||||||
|
deh_tables.c
|
||||||
|
z_zone.c
|
||||||
|
f_finale.c
|
||||||
|
f_wipe.c
|
||||||
|
g_demo.c
|
||||||
|
g_game.c
|
||||||
|
g_input.c
|
||||||
|
g_splitscreen.c
|
||||||
|
am_map.c
|
||||||
|
command.c
|
||||||
|
console.c
|
||||||
|
font.c
|
||||||
|
hu_stuff.c
|
||||||
|
y_inter.c
|
||||||
|
st_stuff.c
|
||||||
|
m_aatree.c
|
||||||
|
m_anigif.c
|
||||||
|
m_argv.c
|
||||||
|
m_bbox.c
|
||||||
|
m_cheat.c
|
||||||
|
m_cond.c
|
||||||
|
m_fixed.c
|
||||||
|
m_menu.c
|
||||||
|
m_misc.c
|
||||||
|
m_perfstats.c
|
||||||
|
m_random.c
|
||||||
|
m_queue.c
|
||||||
|
info.c
|
||||||
|
p_ceilng.c
|
||||||
|
p_enemy.c
|
||||||
|
p_floor.c
|
||||||
|
p_inter.c
|
||||||
|
p_lights.c
|
||||||
|
p_map.c
|
||||||
|
p_maputl.c
|
||||||
|
p_mobj.c
|
||||||
|
p_polyobj.c
|
||||||
|
p_saveg.c
|
||||||
|
p_setup.c
|
||||||
|
p_sight.c
|
||||||
|
p_spec.c
|
||||||
|
p_telept.c
|
||||||
|
p_tick.c
|
||||||
|
p_user.c
|
||||||
|
p_slopes.c
|
||||||
|
tables.c
|
||||||
|
r_bsp.c
|
||||||
|
r_data.c
|
||||||
|
r_draw.c
|
||||||
|
r_fps.c
|
||||||
|
r_main.c
|
||||||
|
r_plane.c
|
||||||
|
r_segs.c
|
||||||
|
r_skins.c
|
||||||
|
r_sky.c
|
||||||
|
r_splats.c
|
||||||
|
r_things.c
|
||||||
|
r_textures.c
|
||||||
|
r_patch.c
|
||||||
|
r_patchrotation.c
|
||||||
|
r_picformats.c
|
||||||
|
r_portal.c
|
||||||
|
screen.c
|
||||||
|
taglist.c
|
||||||
|
v_video.c
|
||||||
|
s_sound.c
|
||||||
|
sounds.c
|
||||||
|
w_wad.c
|
||||||
|
filesrch.c
|
||||||
|
mserv.c
|
||||||
|
http-mserv.c
|
||||||
|
i_tcp.c
|
||||||
|
lzf.c
|
||||||
|
vid_copy.s
|
||||||
|
lua_script.c
|
||||||
|
lua_baselib.c
|
||||||
|
lua_mathlib.c
|
||||||
|
lua_hooklib.c
|
||||||
|
lua_consolelib.c
|
||||||
|
lua_infolib.c
|
||||||
|
lua_mobjlib.c
|
||||||
|
lua_playerlib.c
|
||||||
|
lua_skinlib.c
|
||||||
|
lua_thinkerlib.c
|
||||||
|
lua_maplib.c
|
||||||
|
lua_taglib.c
|
||||||
|
lua_polyobjlib.c
|
||||||
|
lua_blockmaplib.c
|
||||||
|
lua_hudlib.c
|
||||||
|
k_kart.c
|
||||||
|
k_respawn.c
|
||||||
|
k_collide.c
|
||||||
|
k_color.c
|
||||||
|
k_race.c
|
||||||
|
k_battle.c
|
||||||
|
k_pwrlv.c
|
||||||
|
k_waypoint.c
|
||||||
|
k_pathfind.c
|
||||||
|
k_bheap.c
|
||||||
|
k_bot.c
|
||||||
|
k_botitem.c
|
||||||
|
k_botsearch.c
|
||||||
|
k_grandprix.c
|
||||||
|
k_hud.c
|
||||||
|
|
@ -88,6 +88,12 @@ tic_t I_GetTime(void)
|
||||||
return (since_start*TICRATE)/1000000;
|
return (since_start*TICRATE)/1000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fixed_t I_GetTimeFrac(void)
|
||||||
|
{
|
||||||
|
//stub
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void I_Sleep(void){}
|
void I_Sleep(void){}
|
||||||
|
|
||||||
void I_GetEvent(void){}
|
void I_GetEvent(void){}
|
||||||
|
|
|
||||||
1
src/blua/CMakeLists.txt
Normal file
1
src/blua/CMakeLists.txt
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
target_sourcefile(c)
|
||||||
|
|
@ -1,53 +0,0 @@
|
||||||
ifdef UNIXCOMMON
|
|
||||||
LUA_CFLAGS+=-DLUA_USE_POSIX
|
|
||||||
endif
|
|
||||||
ifdef LINUX
|
|
||||||
LUA_CFLAGS+=-DLUA_USE_POSIX
|
|
||||||
endif
|
|
||||||
ifdef GCC43
|
|
||||||
ifndef GCC44
|
|
||||||
WFLAGS+=-Wno-logical-op
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
OBJS:=$(OBJS) \
|
|
||||||
$(OBJDIR)/lapi.o \
|
|
||||||
$(OBJDIR)/lbaselib.o \
|
|
||||||
$(OBJDIR)/ldo.o \
|
|
||||||
$(OBJDIR)/lfunc.o \
|
|
||||||
$(OBJDIR)/linit.o \
|
|
||||||
$(OBJDIR)/liolib.o \
|
|
||||||
$(OBJDIR)/llex.o \
|
|
||||||
$(OBJDIR)/lmem.o \
|
|
||||||
$(OBJDIR)/lobject.o \
|
|
||||||
$(OBJDIR)/lstate.o \
|
|
||||||
$(OBJDIR)/lstrlib.o \
|
|
||||||
$(OBJDIR)/ltablib.o \
|
|
||||||
$(OBJDIR)/lundump.o \
|
|
||||||
$(OBJDIR)/lzio.o \
|
|
||||||
$(OBJDIR)/lauxlib.o \
|
|
||||||
$(OBJDIR)/lcode.o \
|
|
||||||
$(OBJDIR)/ldebug.o \
|
|
||||||
$(OBJDIR)/ldump.o \
|
|
||||||
$(OBJDIR)/lgc.o \
|
|
||||||
$(OBJDIR)/lopcodes.o \
|
|
||||||
$(OBJDIR)/lparser.o \
|
|
||||||
$(OBJDIR)/lstring.o \
|
|
||||||
$(OBJDIR)/ltable.o \
|
|
||||||
$(OBJDIR)/ltm.o \
|
|
||||||
$(OBJDIR)/lvm.o \
|
|
||||||
$(OBJDIR)/lua_script.o \
|
|
||||||
$(OBJDIR)/lua_baselib.o \
|
|
||||||
$(OBJDIR)/lua_mathlib.o \
|
|
||||||
$(OBJDIR)/lua_hooklib.o \
|
|
||||||
$(OBJDIR)/lua_consolelib.o \
|
|
||||||
$(OBJDIR)/lua_infolib.o \
|
|
||||||
$(OBJDIR)/lua_mobjlib.o \
|
|
||||||
$(OBJDIR)/lua_playerlib.o \
|
|
||||||
$(OBJDIR)/lua_skinlib.o \
|
|
||||||
$(OBJDIR)/lua_thinkerlib.o \
|
|
||||||
$(OBJDIR)/lua_maplib.o \
|
|
||||||
$(OBJDIR)/lua_taglib.o \
|
|
||||||
$(OBJDIR)/lua_polyobjlib.o \
|
|
||||||
$(OBJDIR)/lua_blockmaplib.o \
|
|
||||||
$(OBJDIR)/lua_hudlib.o
|
|
||||||
25
src/blua/Sourcefile
Normal file
25
src/blua/Sourcefile
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
lapi.c
|
||||||
|
lbaselib.c
|
||||||
|
ldo.c
|
||||||
|
lfunc.c
|
||||||
|
linit.c
|
||||||
|
liolib.c
|
||||||
|
llex.c
|
||||||
|
lmem.c
|
||||||
|
lobject.c
|
||||||
|
lstate.c
|
||||||
|
lstrlib.c
|
||||||
|
ltablib.c
|
||||||
|
lundump.c
|
||||||
|
lzio.c
|
||||||
|
lauxlib.c
|
||||||
|
lcode.c
|
||||||
|
ldebug.c
|
||||||
|
ldump.c
|
||||||
|
lgc.c
|
||||||
|
lopcodes.c
|
||||||
|
lparser.c
|
||||||
|
lstring.c
|
||||||
|
ltable.c
|
||||||
|
ltm.c
|
||||||
|
lvm.c
|
||||||
|
|
@ -141,7 +141,7 @@ UINT8 adminpassmd5[16];
|
||||||
boolean adminpasswordset = false;
|
boolean adminpasswordset = false;
|
||||||
|
|
||||||
// Client specific
|
// Client specific
|
||||||
static ticcmd_t localcmds[MAXSPLITSCREENPLAYERS];
|
static ticcmd_t localcmds[MAXSPLITSCREENPLAYERS][MAXGENTLEMENDELAY];
|
||||||
static boolean cl_packetmissed;
|
static boolean cl_packetmissed;
|
||||||
// here it is for the secondary local player (splitscreen)
|
// here it is for the secondary local player (splitscreen)
|
||||||
static UINT8 mynode; // my address pointofview server
|
static UINT8 mynode; // my address pointofview server
|
||||||
|
|
@ -440,10 +440,15 @@ static void D_Clearticcmd(tic_t tic)
|
||||||
|
|
||||||
void D_ResetTiccmds(void)
|
void D_ResetTiccmds(void)
|
||||||
{
|
{
|
||||||
INT32 i;
|
INT32 i, j;
|
||||||
|
|
||||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||||
memset(&localcmds[i], 0, sizeof(ticcmd_t));
|
{
|
||||||
|
for (j = 0; j < MAXGENTLEMENDELAY; j++)
|
||||||
|
{
|
||||||
|
memset(&localcmds[i][j], 0, sizeof(ticcmd_t));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Reset the net command list
|
// Reset the net command list
|
||||||
for (i = 0; i < TEXTCMD_HASH_SIZE; i++)
|
for (i = 0; i < TEXTCMD_HASH_SIZE; i++)
|
||||||
|
|
@ -2390,6 +2395,7 @@ void CL_RemovePlayer(INT32 playernum, kickreason_t reason)
|
||||||
|
|
||||||
// remove avatar of player
|
// remove avatar of player
|
||||||
playeringame[playernum] = false;
|
playeringame[playernum] = false;
|
||||||
|
demo_extradata[playernum] |= DXD_PLAYSTATE;
|
||||||
playernode[playernum] = UINT8_MAX;
|
playernode[playernum] = UINT8_MAX;
|
||||||
while (!playeringame[doomcom->numslots-1] && doomcom->numslots > 1)
|
while (!playeringame[doomcom->numslots-1] && doomcom->numslots > 1)
|
||||||
doomcom->numslots--;
|
doomcom->numslots--;
|
||||||
|
|
@ -4934,12 +4940,6 @@ static void CL_SendClientCmd(void)
|
||||||
size_t packetsize = 0;
|
size_t packetsize = 0;
|
||||||
boolean mis = false;
|
boolean mis = false;
|
||||||
|
|
||||||
if (lowest_lag && ( gametic % lowest_lag ))
|
|
||||||
{
|
|
||||||
cl_packetmissed = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
netbuffer->packettype = PT_CLIENTCMD;
|
netbuffer->packettype = PT_CLIENTCMD;
|
||||||
|
|
||||||
if (cl_packetmissed)
|
if (cl_packetmissed)
|
||||||
|
|
@ -4960,27 +4960,35 @@ static void CL_SendClientCmd(void)
|
||||||
}
|
}
|
||||||
else if (gamestate != GS_NULL && (addedtogame || dedicated))
|
else if (gamestate != GS_NULL && (addedtogame || dedicated))
|
||||||
{
|
{
|
||||||
|
UINT8 lagDelay = 0;
|
||||||
|
|
||||||
|
if (lowest_lag > 0)
|
||||||
|
{
|
||||||
|
// Gentlemens' ping.
|
||||||
|
lagDelay = min(lowest_lag, MAXGENTLEMENDELAY);
|
||||||
|
}
|
||||||
|
|
||||||
packetsize = sizeof (clientcmd_pak);
|
packetsize = sizeof (clientcmd_pak);
|
||||||
G_MoveTiccmd(&netbuffer->u.clientpak.cmd, &localcmds[0], 1);
|
G_MoveTiccmd(&netbuffer->u.clientpak.cmd, &localcmds[0][lagDelay], 1);
|
||||||
netbuffer->u.clientpak.consistancy = SHORT(consistancy[gametic % TICQUEUE]);
|
netbuffer->u.clientpak.consistancy = SHORT(consistancy[gametic % TICQUEUE]);
|
||||||
|
|
||||||
if (splitscreen) // Send a special packet with 2 cmd for splitscreen
|
if (splitscreen) // Send a special packet with 2 cmd for splitscreen
|
||||||
{
|
{
|
||||||
netbuffer->packettype = (mis ? PT_CLIENT2MIS : PT_CLIENT2CMD);
|
netbuffer->packettype = (mis ? PT_CLIENT2MIS : PT_CLIENT2CMD);
|
||||||
packetsize = sizeof (client2cmd_pak);
|
packetsize = sizeof (client2cmd_pak);
|
||||||
G_MoveTiccmd(&netbuffer->u.client2pak.cmd2, &localcmds[1], 1);
|
G_MoveTiccmd(&netbuffer->u.client2pak.cmd2, &localcmds[1][lagDelay], 1);
|
||||||
|
|
||||||
if (splitscreen > 1)
|
if (splitscreen > 1)
|
||||||
{
|
{
|
||||||
netbuffer->packettype = (mis ? PT_CLIENT3MIS : PT_CLIENT3CMD);
|
netbuffer->packettype = (mis ? PT_CLIENT3MIS : PT_CLIENT3CMD);
|
||||||
packetsize = sizeof (client3cmd_pak);
|
packetsize = sizeof (client3cmd_pak);
|
||||||
G_MoveTiccmd(&netbuffer->u.client3pak.cmd3, &localcmds[2], 1);
|
G_MoveTiccmd(&netbuffer->u.client3pak.cmd3, &localcmds[2][lagDelay], 1);
|
||||||
|
|
||||||
if (splitscreen > 2)
|
if (splitscreen > 2)
|
||||||
{
|
{
|
||||||
netbuffer->packettype = (mis ? PT_CLIENT4MIS : PT_CLIENT4CMD);
|
netbuffer->packettype = (mis ? PT_CLIENT4MIS : PT_CLIENT4CMD);
|
||||||
packetsize = sizeof (client4cmd_pak);
|
packetsize = sizeof (client4cmd_pak);
|
||||||
G_MoveTiccmd(&netbuffer->u.client4pak.cmd4, &localcmds[3], 1);
|
G_MoveTiccmd(&netbuffer->u.client4pak.cmd4, &localcmds[3][lagDelay], 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5143,8 +5151,23 @@ static void SV_SendTics(void)
|
||||||
//
|
//
|
||||||
// TryRunTics
|
// TryRunTics
|
||||||
//
|
//
|
||||||
|
static void CreateNewLocalCMD(UINT8 p, INT32 realtics)
|
||||||
|
{
|
||||||
|
INT32 i;
|
||||||
|
|
||||||
|
for (i = MAXGENTLEMENDELAY-1; i > 0; i--)
|
||||||
|
{
|
||||||
|
G_MoveTiccmd(&localcmds[p][i], &localcmds[p][i-1], 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
G_BuildTiccmd(&localcmds[p][0], realtics, p+1);
|
||||||
|
localcmds[p][0].flags |= TICCMD_RECEIVED;
|
||||||
|
}
|
||||||
|
|
||||||
static void Local_Maketic(INT32 realtics)
|
static void Local_Maketic(INT32 realtics)
|
||||||
{
|
{
|
||||||
|
INT32 i;
|
||||||
|
|
||||||
I_OsPolling(); // I_Getevent
|
I_OsPolling(); // I_Getevent
|
||||||
D_ProcessEvents(); // menu responder, cons responder,
|
D_ProcessEvents(); // menu responder, cons responder,
|
||||||
// game responder calls HU_Responder, AM_Responder,
|
// game responder calls HU_Responder, AM_Responder,
|
||||||
|
|
@ -5153,25 +5176,9 @@ static void Local_Maketic(INT32 realtics)
|
||||||
if (!dedicated) rendergametic = gametic;
|
if (!dedicated) rendergametic = gametic;
|
||||||
|
|
||||||
// translate inputs (keyboard/mouse/joystick) into game controls
|
// translate inputs (keyboard/mouse/joystick) into game controls
|
||||||
G_BuildTiccmd(&localcmds[0], realtics, 1);
|
for (i = 0; i <= splitscreen; i++)
|
||||||
localcmds[0].flags |= TICCMD_RECEIVED;
|
|
||||||
|
|
||||||
if (splitscreen)
|
|
||||||
{
|
{
|
||||||
G_BuildTiccmd(&localcmds[1], realtics, 2);
|
CreateNewLocalCMD(i, realtics);
|
||||||
localcmds[1].flags |= TICCMD_RECEIVED;
|
|
||||||
|
|
||||||
if (splitscreen > 1)
|
|
||||||
{
|
|
||||||
G_BuildTiccmd(&localcmds[2], realtics, 3);
|
|
||||||
localcmds[2].flags |= TICCMD_RECEIVED;
|
|
||||||
|
|
||||||
if (splitscreen > 2)
|
|
||||||
{
|
|
||||||
G_BuildTiccmd(&localcmds[3], realtics, 4);
|
|
||||||
localcmds[3].flags |= TICCMD_RECEIVED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -5264,11 +5271,13 @@ void TryRunTics(tic_t realtics)
|
||||||
|
|
||||||
if (neededtic > gametic)
|
if (neededtic > gametic)
|
||||||
{
|
{
|
||||||
|
if (realtics)
|
||||||
hu_stopped = false;
|
hu_stopped = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player_joining)
|
if (player_joining)
|
||||||
{
|
{
|
||||||
|
if (realtics)
|
||||||
hu_stopped = true;
|
hu_stopped = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -5288,6 +5297,7 @@ void TryRunTics(tic_t realtics)
|
||||||
while (neededtic > gametic)
|
while (neededtic > gametic)
|
||||||
{
|
{
|
||||||
DEBFILE(va("============ Running tic %d (local %d)\n", gametic, localgametic));
|
DEBFILE(va("============ Running tic %d (local %d)\n", gametic, localgametic));
|
||||||
|
prev_tics = I_GetTime();
|
||||||
|
|
||||||
ps_tictime = I_GetPreciseTime();
|
ps_tictime = I_GetPreciseTime();
|
||||||
|
|
||||||
|
|
@ -5306,6 +5316,7 @@ void TryRunTics(tic_t realtics)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (realtics)
|
||||||
hu_stopped = true;
|
hu_stopped = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,15 @@ applications may follow different packet versions.
|
||||||
// Networking and tick handling related.
|
// Networking and tick handling related.
|
||||||
#define TICQUEUE 512 // more than enough for most timeouts....
|
#define TICQUEUE 512 // more than enough for most timeouts....
|
||||||
#define MAXTEXTCMD 256
|
#define MAXTEXTCMD 256
|
||||||
|
|
||||||
|
// No. of tics your controls can be delayed by.
|
||||||
|
|
||||||
|
// TODO: Instead of storing a ton of extra cmds for gentlemens' delay,
|
||||||
|
// keep them in a linked-list, with timestamps to discard everything that's older than already sent.
|
||||||
|
// That will support any amount of lag, and be less wasteful for clients who don't use it.
|
||||||
|
// This just works as a quick implementation.
|
||||||
|
#define MAXGENTLEMENDELAY TICRATE
|
||||||
|
|
||||||
//
|
//
|
||||||
// Packet structure
|
// Packet structure
|
||||||
//
|
//
|
||||||
|
|
|
||||||
48
src/d_main.c
48
src/d_main.c
|
|
@ -63,6 +63,7 @@
|
||||||
#include "deh_tables.h" // Dehacked list test
|
#include "deh_tables.h" // Dehacked list test
|
||||||
#include "m_cond.h" // condition initialization
|
#include "m_cond.h" // condition initialization
|
||||||
#include "fastcmp.h"
|
#include "fastcmp.h"
|
||||||
|
#include "r_fps.h" // Frame interpolation/uncapped
|
||||||
#include "keys.h"
|
#include "keys.h"
|
||||||
#include "filesrch.h" // refreshdirmenu
|
#include "filesrch.h" // refreshdirmenu
|
||||||
#include "g_input.h" // tutorial mode control scheming
|
#include "g_input.h" // tutorial mode control scheming
|
||||||
|
|
@ -755,7 +756,7 @@ void D_SRB2Loop(void)
|
||||||
debugload--;
|
debugload--;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!realtics && !singletics)
|
if (!realtics && !singletics && cv_frameinterpolation.value != 1)
|
||||||
{
|
{
|
||||||
I_Sleep();
|
I_Sleep();
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -773,13 +774,37 @@ void D_SRB2Loop(void)
|
||||||
// process tics (but maybe not if realtic == 0)
|
// process tics (but maybe not if realtic == 0)
|
||||||
TryRunTics(realtics);
|
TryRunTics(realtics);
|
||||||
|
|
||||||
|
if (cv_frameinterpolation.value == 1)
|
||||||
|
{
|
||||||
|
fixed_t entertimefrac = I_GetTimeFrac();
|
||||||
|
// renderdeltatics is a bit awkard to evaluate, since the system time interface is whole tic-based
|
||||||
|
renderdeltatics = realtics * FRACUNIT;
|
||||||
|
if (entertimefrac > rendertimefrac)
|
||||||
|
renderdeltatics += entertimefrac - rendertimefrac;
|
||||||
|
else
|
||||||
|
renderdeltatics -= rendertimefrac - entertimefrac;
|
||||||
|
|
||||||
|
rendertimefrac = entertimefrac;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rendertimefrac = FRACUNIT;
|
||||||
|
renderdeltatics = realtics * FRACUNIT;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cv_frameinterpolation.value == 1)
|
||||||
|
{
|
||||||
|
D_Display();
|
||||||
|
}
|
||||||
|
|
||||||
if (lastdraw || singletics || gametic > rendergametic)
|
if (lastdraw || singletics || gametic > rendergametic)
|
||||||
{
|
{
|
||||||
rendergametic = gametic;
|
rendergametic = gametic;
|
||||||
rendertimeout = entertic+TICRATE/17;
|
rendertimeout = entertic+TICRATE/17;
|
||||||
|
|
||||||
// Update display, next frame, with current state.
|
// Update display, next frame, with current state.
|
||||||
D_Display();
|
// (Only display if not already done for frame interp)
|
||||||
|
cv_frameinterpolation.value == 0 ? D_Display() : 0;
|
||||||
|
|
||||||
if (moviemode)
|
if (moviemode)
|
||||||
M_SaveFrame();
|
M_SaveFrame();
|
||||||
|
|
@ -788,7 +813,22 @@ void D_SRB2Loop(void)
|
||||||
}
|
}
|
||||||
else if (rendertimeout < entertic) // in case the server hang or netsplit
|
else if (rendertimeout < entertic) // in case the server hang or netsplit
|
||||||
{
|
{
|
||||||
D_Display();
|
#if 0
|
||||||
|
// Lagless camera! Yay!
|
||||||
|
if (gamestate == GS_LEVEL && netgame)
|
||||||
|
{
|
||||||
|
INT32 i;
|
||||||
|
|
||||||
|
for (i = 0; i <= r_splitscreen; i++)
|
||||||
|
{
|
||||||
|
if (camera[i].chase)
|
||||||
|
P_MoveChaseCamera(&players[displayplayers[i]], &camera[i], false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// (Only display if not already done for frame interp)
|
||||||
|
cv_frameinterpolation.value == 0 ? D_Display() : 0;
|
||||||
|
|
||||||
if (moviemode)
|
if (moviemode)
|
||||||
M_SaveFrame();
|
M_SaveFrame();
|
||||||
|
|
@ -1639,6 +1679,8 @@ void D_SRB2Main(void)
|
||||||
// as having been modified for the first game.
|
// as having been modified for the first game.
|
||||||
M_PushSpecialParameters(); // push all "+" parameter at the command buffer
|
M_PushSpecialParameters(); // push all "+" parameter at the command buffer
|
||||||
|
|
||||||
|
COM_BufExecute(); // ensure the command buffer gets executed before the map starts (+skin)
|
||||||
|
|
||||||
strncpy(connectedservername, cv_servername.string, MAXSERVERNAME);
|
strncpy(connectedservername, cv_servername.string, MAXSERVERNAME);
|
||||||
|
|
||||||
if (M_CheckParm("-gametype") && M_IsNextParm())
|
if (M_CheckParm("-gametype") && M_IsNextParm())
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ typedef enum
|
||||||
PF_ATTACKDOWN = 1,
|
PF_ATTACKDOWN = 1,
|
||||||
PF_ACCELDOWN = 1<<1,
|
PF_ACCELDOWN = 1<<1,
|
||||||
PF_BRAKEDOWN = 1<<2,
|
PF_BRAKEDOWN = 1<<2,
|
||||||
PF_WPNDOWN = 1<<3, // reserved - gonna turn this into lookback when i'm done with all the major reengineering
|
PF_LOOKDOWN = 1<<3,
|
||||||
|
|
||||||
// Accessibility and cheats
|
// Accessibility and cheats
|
||||||
PF_KICKSTARTACCEL = 1<<4, // Is accelerate in kickstart mode?
|
PF_KICKSTARTACCEL = 1<<4, // Is accelerate in kickstart mode?
|
||||||
|
|
@ -198,6 +198,13 @@ typedef enum
|
||||||
#undef KSPIN_TYPE
|
#undef KSPIN_TYPE
|
||||||
} kartspinoutflags_t;
|
} kartspinoutflags_t;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
TRIP_NONE,
|
||||||
|
TRIP_PASSED,
|
||||||
|
TRIP_BLOCKED,
|
||||||
|
} tripwirestate_t;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
// Unsynced, HUD or clientsided effects
|
// Unsynced, HUD or clientsided effects
|
||||||
|
|
@ -263,6 +270,7 @@ typedef struct respawnvars_s
|
||||||
fixed_t pointz;
|
fixed_t pointz;
|
||||||
boolean flip; // Flip upside down or not
|
boolean flip; // Flip upside down or not
|
||||||
tic_t timer; // Time left on respawn animation once you're there
|
tic_t timer; // Time left on respawn animation once you're there
|
||||||
|
tic_t airtimer; // Time spent in the air before respawning
|
||||||
UINT32 distanceleft; // How far along the course to respawn you
|
UINT32 distanceleft; // How far along the course to respawn you
|
||||||
tic_t dropdash; // Drop Dash charge timer
|
tic_t dropdash; // Drop Dash charge timer
|
||||||
} respawnvars_t;
|
} respawnvars_t;
|
||||||
|
|
@ -375,7 +383,7 @@ typedef struct player_s
|
||||||
UINT8 wipeoutslow; // Timer before you slowdown when getting wiped out
|
UINT8 wipeoutslow; // Timer before you slowdown when getting wiped out
|
||||||
UINT8 justbumped; // Prevent players from endlessly bumping into each other
|
UINT8 justbumped; // Prevent players from endlessly bumping into each other
|
||||||
UINT8 tumbleBounces;
|
UINT8 tumbleBounces;
|
||||||
UINT16 tumbleHeight;
|
UINT16 tumbleHeight; // In *mobjscaled* fracunits, or mfu, not raw fu
|
||||||
|
|
||||||
SINT8 drift; // (-5 to 5) - Drifting Left or Right, plus a bigger counter = sharper turn
|
SINT8 drift; // (-5 to 5) - Drifting Left or Right, plus a bigger counter = sharper turn
|
||||||
fixed_t driftcharge; // Charge your drift so you can release a burst of speed
|
fixed_t driftcharge; // Charge your drift so you can release a burst of speed
|
||||||
|
|
@ -389,7 +397,7 @@ typedef struct player_s
|
||||||
fixed_t offroad; // In Super Mario Kart, going offroad has lee-way of about 1 second before you start losing speed
|
fixed_t offroad; // In Super Mario Kart, going offroad has lee-way of about 1 second before you start losing speed
|
||||||
UINT8 waterskip; // Water skipping counter
|
UINT8 waterskip; // Water skipping counter
|
||||||
|
|
||||||
UINT16 tiregrease; // Reduced friction timer after hitting a horizontal spring
|
UINT16 tiregrease; // Reduced friction timer after hitting a spring
|
||||||
UINT16 springstars; // Spawn stars around a player when they hit a spring
|
UINT16 springstars; // Spawn stars around a player when they hit a spring
|
||||||
UINT16 springcolor; // Color of spring stars
|
UINT16 springcolor; // Color of spring stars
|
||||||
UINT8 dashpadcooldown; // Separate the vanilla SA-style dash pads from using flashing
|
UINT8 dashpadcooldown; // Separate the vanilla SA-style dash pads from using flashing
|
||||||
|
|
@ -455,9 +463,6 @@ typedef struct player_s
|
||||||
|
|
||||||
UINT8 trickpanel; // Trick panel state
|
UINT8 trickpanel; // Trick panel state
|
||||||
UINT8 tricktime; // Increases while you're tricking. You can't input any trick until it's reached a certain threshold
|
UINT8 tricktime; // Increases while you're tricking. You can't input any trick until it's reached a certain threshold
|
||||||
fixed_t trickmomx;
|
|
||||||
fixed_t trickmomy;
|
|
||||||
fixed_t trickmomz;
|
|
||||||
fixed_t trickboostpower; // Save the rough speed multiplier. Used for upwards tricks.
|
fixed_t trickboostpower; // Save the rough speed multiplier. Used for upwards tricks.
|
||||||
UINT8 trickboostdecay; // used to know how long you've waited
|
UINT8 trickboostdecay; // used to know how long you've waited
|
||||||
UINT8 trickboost; // Trick boost. This one is weird and has variable speed. Dear god.
|
UINT8 trickboost; // Trick boost. This one is weird and has variable speed. Dear god.
|
||||||
|
|
@ -467,10 +472,13 @@ typedef struct player_s
|
||||||
UINT8 emeralds;
|
UINT8 emeralds;
|
||||||
UINT8 bumpers;
|
UINT8 bumpers;
|
||||||
INT16 karmadelay;
|
INT16 karmadelay;
|
||||||
|
tic_t overtimekarma; // time to live in overtime comeback
|
||||||
INT16 spheres;
|
INT16 spheres;
|
||||||
|
|
||||||
SINT8 glanceDir; // Direction the player is trying to look backwards in
|
SINT8 glanceDir; // Direction the player is trying to look backwards in
|
||||||
|
|
||||||
|
UINT8 tripWireState; // see tripwirestate_t
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
SINT8 lives;
|
SINT8 lives;
|
||||||
|
|
|
||||||
|
|
@ -2683,6 +2683,10 @@ void readsound(MYFILE *f, INT32 num)
|
||||||
{
|
{
|
||||||
S_sfx[num].pitch = value;
|
S_sfx[num].pitch = value;
|
||||||
}
|
}
|
||||||
|
else if (fastcmp(word, "VOLUME"))
|
||||||
|
{
|
||||||
|
S_sfx[num].volume = value;
|
||||||
|
}
|
||||||
else if (fastcmp(word, "CAPTION") || fastcmp(word, "DESCRIPTION"))
|
else if (fastcmp(word, "CAPTION") || fastcmp(word, "DESCRIPTION"))
|
||||||
{
|
{
|
||||||
deh_strlcpy(S_sfx[num].caption, word2,
|
deh_strlcpy(S_sfx[num].caption, word2,
|
||||||
|
|
|
||||||
|
|
@ -4592,6 +4592,11 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
|
||||||
"S_RINGSPARKS14",
|
"S_RINGSPARKS14",
|
||||||
"S_RINGSPARKS15",
|
"S_RINGSPARKS15",
|
||||||
|
|
||||||
|
"S_GAINAX_TINY",
|
||||||
|
"S_GAINAX_HUGE",
|
||||||
|
"S_GAINAX_MID1",
|
||||||
|
"S_GAINAX_MID2",
|
||||||
|
|
||||||
"S_DRAFTDUST1",
|
"S_DRAFTDUST1",
|
||||||
"S_DRAFTDUST2",
|
"S_DRAFTDUST2",
|
||||||
"S_DRAFTDUST3",
|
"S_DRAFTDUST3",
|
||||||
|
|
@ -5729,6 +5734,7 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t
|
||||||
|
|
||||||
"MT_KARMAFIREWORK",
|
"MT_KARMAFIREWORK",
|
||||||
"MT_RINGSPARKS",
|
"MT_RINGSPARKS",
|
||||||
|
"MT_GAINAX",
|
||||||
"MT_DRAFTDUST",
|
"MT_DRAFTDUST",
|
||||||
"MT_SPBDUST",
|
"MT_SPBDUST",
|
||||||
"MT_TIREGREASE",
|
"MT_TIREGREASE",
|
||||||
|
|
@ -5851,7 +5857,7 @@ const char *const PLAYERFLAG_LIST[] = {
|
||||||
"ATTACKDOWN",
|
"ATTACKDOWN",
|
||||||
"ACCELDOWN",
|
"ACCELDOWN",
|
||||||
"BRAKEDOWN",
|
"BRAKEDOWN",
|
||||||
"WPNDOWN", // reserved - gonna turn this into lookback when i'm done with all the major reengineering
|
"LOOKDOWN",
|
||||||
|
|
||||||
// Accessibility and cheats
|
// Accessibility and cheats
|
||||||
"KICKSTARTACCEL", // Is accelerate in kickstart mode?
|
"KICKSTARTACCEL", // Is accelerate in kickstart mode?
|
||||||
|
|
@ -6838,6 +6844,7 @@ struct int_const_s const INT_CONST[] = {
|
||||||
{"TC_RAINBOW",TC_RAINBOW},
|
{"TC_RAINBOW",TC_RAINBOW},
|
||||||
{"TC_BLINK",TC_BLINK},
|
{"TC_BLINK",TC_BLINK},
|
||||||
{"TC_DASHMODE",TC_DASHMODE},
|
{"TC_DASHMODE",TC_DASHMODE},
|
||||||
|
{"TC_HITLAG",TC_HITLAG},
|
||||||
|
|
||||||
// marathonmode flags
|
// marathonmode flags
|
||||||
{"MA_INIT",MA_INIT},
|
{"MA_INIT",MA_INIT},
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ tic_t I_GetTime(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int I_GetTimeMicros(void)
|
fixed_t I_GetTimeFrac(void)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
53
src/g_demo.c
53
src/g_demo.c
|
|
@ -112,6 +112,10 @@ demoghost *ghosts = NULL;
|
||||||
#define DF_BREAKTHECAPSULES 0x04 // This demo is from Break the Capsules and contains its final completion time!
|
#define DF_BREAKTHECAPSULES 0x04 // This demo is from Break the Capsules and contains its final completion time!
|
||||||
#define DF_ATTACKMASK 0x06 // This demo is from ??? attack and contains ???
|
#define DF_ATTACKMASK 0x06 // This demo is from ??? attack and contains ???
|
||||||
|
|
||||||
|
// 0x08 free
|
||||||
|
|
||||||
|
#define DF_NONETMP 0x10 // multiplayer but not netgame
|
||||||
|
|
||||||
#define DF_LUAVARS 0x20 // this demo contains extra lua vars
|
#define DF_LUAVARS 0x20 // this demo contains extra lua vars
|
||||||
|
|
||||||
#define DF_ATTACKSHIFT 1
|
#define DF_ATTACKSHIFT 1
|
||||||
|
|
@ -304,11 +308,12 @@ void G_ReadDemoExtraData(void)
|
||||||
}
|
}
|
||||||
if (extradata & DXD_PLAYSTATE)
|
if (extradata & DXD_PLAYSTATE)
|
||||||
{
|
{
|
||||||
extradata = READUINT8(demo_p);
|
i = READUINT8(demo_p);
|
||||||
|
|
||||||
switch (extradata) {
|
switch (i) {
|
||||||
case DXD_PST_PLAYING:
|
case DXD_PST_PLAYING:
|
||||||
players[p].pflags |= PF_WANTSTOJOIN; // fuck you
|
players[p].pflags |= PF_WANTSTOJOIN; // fuck you
|
||||||
|
//CONS_Printf("player %s is despectating on tic %d\n", player_names[p], leveltime);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DXD_PST_SPECTATING:
|
case DXD_PST_SPECTATING:
|
||||||
|
|
@ -319,9 +324,11 @@ void G_ReadDemoExtraData(void)
|
||||||
playeringame[p] = true;
|
playeringame[p] = true;
|
||||||
G_AddPlayer(p);
|
G_AddPlayer(p);
|
||||||
players[p].spectator = true;
|
players[p].spectator = true;
|
||||||
|
//CONS_Printf("player %s is joining server on tic %d\n", player_names[p], leveltime);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
//CONS_Printf("player %s is spectating on tic %d\n", player_names[p], leveltime);
|
||||||
players[p].spectator = true;
|
players[p].spectator = true;
|
||||||
if (players[p].mo)
|
if (players[p].mo)
|
||||||
P_DamageMobj(players[p].mo, NULL, NULL, 1, DMG_INSTAKILL);
|
P_DamageMobj(players[p].mo, NULL, NULL, 1, DMG_INSTAKILL);
|
||||||
|
|
@ -343,11 +350,11 @@ void G_ReadDemoExtraData(void)
|
||||||
}
|
}
|
||||||
if (extradata & DXD_WEAPONPREF)
|
if (extradata & DXD_WEAPONPREF)
|
||||||
{
|
{
|
||||||
extradata = READUINT8(demo_p);
|
i = READUINT8(demo_p);
|
||||||
players[p].pflags &= ~(PF_KICKSTARTACCEL);
|
players[p].pflags &= ~(PF_KICKSTARTACCEL);
|
||||||
if (extradata & 1)
|
if (i & 1)
|
||||||
players[p].pflags |= PF_KICKSTARTACCEL;
|
players[p].pflags |= PF_KICKSTARTACCEL;
|
||||||
//CONS_Printf("weaponpref is %d for player %d\n", extradata, p);
|
//CONS_Printf("weaponpref is %d for player %d\n", i, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
p = READUINT8(demo_p);
|
p = READUINT8(demo_p);
|
||||||
|
|
@ -366,7 +373,7 @@ void G_ReadDemoExtraData(void)
|
||||||
P_SetRandSeed(rng);
|
P_SetRandSeed(rng);
|
||||||
|
|
||||||
if (demosynced)
|
if (demosynced)
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced!\n"));
|
CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced (RNG)!\n"));
|
||||||
demosynced = false;
|
demosynced = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -493,6 +500,7 @@ void G_ReadDemoTiccmd(ticcmd_t *cmd, INT32 playernum)
|
||||||
|
|
||||||
if (!demo_p || !demo.deferstart)
|
if (!demo_p || !demo.deferstart)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ziptic = READUINT8(demo_p);
|
ziptic = READUINT8(demo_p);
|
||||||
|
|
||||||
if (ziptic & ZT_FWD)
|
if (ziptic & ZT_FWD)
|
||||||
|
|
@ -530,7 +538,7 @@ void G_WriteDemoTiccmd(ticcmd_t *cmd, INT32 playernum)
|
||||||
|
|
||||||
if (cmd->forwardmove != oldcmd[playernum].forwardmove)
|
if (cmd->forwardmove != oldcmd[playernum].forwardmove)
|
||||||
{
|
{
|
||||||
WRITEUINT8(demo_p,cmd->forwardmove);
|
WRITESINT8(demo_p,cmd->forwardmove);
|
||||||
oldcmd[playernum].forwardmove = cmd->forwardmove;
|
oldcmd[playernum].forwardmove = cmd->forwardmove;
|
||||||
ziptic |= ZT_FWD;
|
ziptic |= ZT_FWD;
|
||||||
}
|
}
|
||||||
|
|
@ -621,7 +629,7 @@ void G_GhostAddHit(INT32 playernum, mobj_t *victim)
|
||||||
ghostext[playernum].flags |= EZT_HIT;
|
ghostext[playernum].flags |= EZT_HIT;
|
||||||
ghostext[playernum].hits++;
|
ghostext[playernum].hits++;
|
||||||
ghostext[playernum].hitlist = Z_Realloc(ghostext[playernum].hitlist, ghostext[playernum].hits * sizeof(mobj_t *), PU_LEVEL, NULL);
|
ghostext[playernum].hitlist = Z_Realloc(ghostext[playernum].hitlist, ghostext[playernum].hits * sizeof(mobj_t *), PU_LEVEL, NULL);
|
||||||
ghostext[playernum].hitlist[ghostext[playernum].hits-1] = victim;
|
P_SetTarget(ghostext[playernum].hitlist + (ghostext[playernum].hits-1), victim);
|
||||||
}
|
}
|
||||||
|
|
||||||
void G_WriteAllGhostTics(void)
|
void G_WriteAllGhostTics(void)
|
||||||
|
|
@ -793,6 +801,7 @@ void G_WriteGhostTic(mobj_t *ghost, INT32 playernum)
|
||||||
WRITEFIXED(demo_p,mo->y);
|
WRITEFIXED(demo_p,mo->y);
|
||||||
WRITEFIXED(demo_p,mo->z);
|
WRITEFIXED(demo_p,mo->z);
|
||||||
WRITEANGLE(demo_p,mo->angle);
|
WRITEANGLE(demo_p,mo->angle);
|
||||||
|
P_SetTarget(ghostext[playernum].hitlist+i, NULL);
|
||||||
}
|
}
|
||||||
Z_Free(ghostext[playernum].hitlist);
|
Z_Free(ghostext[playernum].hitlist);
|
||||||
ghostext[playernum].hits = 0;
|
ghostext[playernum].hits = 0;
|
||||||
|
|
@ -862,7 +871,12 @@ void G_WriteGhostTic(mobj_t *ghost, INT32 playernum)
|
||||||
|
|
||||||
void G_ConsAllGhostTics(void)
|
void G_ConsAllGhostTics(void)
|
||||||
{
|
{
|
||||||
UINT8 p = READUINT8(demo_p);
|
UINT8 p;
|
||||||
|
|
||||||
|
if (!demo_p || !demo.deferstart)
|
||||||
|
return;
|
||||||
|
|
||||||
|
p = READUINT8(demo_p);
|
||||||
|
|
||||||
while (p != 0xFF)
|
while (p != 0xFF)
|
||||||
{
|
{
|
||||||
|
|
@ -887,8 +901,6 @@ void G_ConsGhostTic(INT32 playernum)
|
||||||
mobj_t *testmo;
|
mobj_t *testmo;
|
||||||
UINT32 syncleeway;
|
UINT32 syncleeway;
|
||||||
|
|
||||||
if (!demo_p || !demo.deferstart)
|
|
||||||
return;
|
|
||||||
if (!(demoflags & DF_GHOST))
|
if (!(demoflags & DF_GHOST))
|
||||||
return; // No ghost data to use.
|
return; // No ghost data to use.
|
||||||
|
|
||||||
|
|
@ -965,7 +977,7 @@ void G_ConsGhostTic(INT32 playernum)
|
||||||
if (th != &thlist[THINK_MOBJ] && mobj->health != health) // Wasn't damaged?! This is desync! Fix it!
|
if (th != &thlist[THINK_MOBJ] && mobj->health != health) // Wasn't damaged?! This is desync! Fix it!
|
||||||
{
|
{
|
||||||
if (demosynced)
|
if (demosynced)
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced!\n"));
|
CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced (health)!\n"));
|
||||||
demosynced = false;
|
demosynced = false;
|
||||||
P_DamageMobj(mobj, players[0].mo, players[0].mo, 1, DMG_NORMAL);
|
P_DamageMobj(mobj, players[0].mo, players[0].mo, 1, DMG_NORMAL);
|
||||||
}
|
}
|
||||||
|
|
@ -1018,7 +1030,7 @@ void G_ConsGhostTic(INT32 playernum)
|
||||||
if (ghostext[playernum].desyncframes >= 2)
|
if (ghostext[playernum].desyncframes >= 2)
|
||||||
{
|
{
|
||||||
if (demosynced)
|
if (demosynced)
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced!\n"));
|
CONS_Alert(CONS_WARNING, "Demo playback has desynced (player %s)!\n", player_names[playernum]);
|
||||||
demosynced = false;
|
demosynced = false;
|
||||||
|
|
||||||
P_UnsetThingPosition(testmo);
|
P_UnsetThingPosition(testmo);
|
||||||
|
|
@ -1041,7 +1053,7 @@ void G_ConsGhostTic(INT32 playernum)
|
||||||
|| players[playernum].bumpers != ghostext[playernum].kartbumpers)
|
|| players[playernum].bumpers != ghostext[playernum].kartbumpers)
|
||||||
{
|
{
|
||||||
if (demosynced)
|
if (demosynced)
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced!\n"));
|
CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced (item/bumpers)!\n"));
|
||||||
demosynced = false;
|
demosynced = false;
|
||||||
|
|
||||||
players[playernum].itemtype = ghostext[playernum].kartitem;
|
players[playernum].itemtype = ghostext[playernum].kartitem;
|
||||||
|
|
@ -1579,7 +1591,7 @@ void G_ReadMetalTic(mobj_t *metal)
|
||||||
oldmetal.x = READFIXED(metal_p);
|
oldmetal.x = READFIXED(metal_p);
|
||||||
oldmetal.y = READFIXED(metal_p);
|
oldmetal.y = READFIXED(metal_p);
|
||||||
oldmetal.z = READFIXED(metal_p);
|
oldmetal.z = READFIXED(metal_p);
|
||||||
P_TeleportMove(metal, oldmetal.x, oldmetal.y, oldmetal.z);
|
P_MoveOrigin(metal, oldmetal.x, oldmetal.y, oldmetal.z);
|
||||||
oldmetal.x = metal->x;
|
oldmetal.x = metal->x;
|
||||||
oldmetal.y = metal->y;
|
oldmetal.y = metal->y;
|
||||||
oldmetal.z = metal->z;
|
oldmetal.z = metal->z;
|
||||||
|
|
@ -1920,6 +1932,9 @@ void G_BeginRecording(void)
|
||||||
demo_p = demobuffer;
|
demo_p = demobuffer;
|
||||||
demoflags = DF_GHOST|(multiplayer ? DF_MULTIPLAYER : (modeattacking<<DF_ATTACKSHIFT));
|
demoflags = DF_GHOST|(multiplayer ? DF_MULTIPLAYER : (modeattacking<<DF_ATTACKSHIFT));
|
||||||
|
|
||||||
|
if (multiplayer && !netgame)
|
||||||
|
demoflags |= DF_NONETMP;
|
||||||
|
|
||||||
if (encoremode)
|
if (encoremode)
|
||||||
demoflags |= DF_ENCORE;
|
demoflags |= DF_ENCORE;
|
||||||
|
|
||||||
|
|
@ -2837,6 +2852,7 @@ void G_DoPlayDemo(char *defdemoname)
|
||||||
|
|
||||||
modeattacking = (demoflags & DF_ATTACKMASK)>>DF_ATTACKSHIFT;
|
modeattacking = (demoflags & DF_ATTACKMASK)>>DF_ATTACKSHIFT;
|
||||||
multiplayer = !!(demoflags & DF_MULTIPLAYER);
|
multiplayer = !!(demoflags & DF_MULTIPLAYER);
|
||||||
|
demo.netgame = (multiplayer && !(demoflags & DF_NONETMP));
|
||||||
CON_ToggleOff();
|
CON_ToggleOff();
|
||||||
|
|
||||||
hu_demotime = UINT32_MAX;
|
hu_demotime = UINT32_MAX;
|
||||||
|
|
@ -2926,7 +2942,7 @@ void G_DoPlayDemo(char *defdemoname)
|
||||||
|
|
||||||
while (p != 0xFF)
|
while (p != 0xFF)
|
||||||
{
|
{
|
||||||
if ((spectator = (p & DEMO_SPECTATOR)))
|
if ((spectator = !!(p & DEMO_SPECTATOR)))
|
||||||
{
|
{
|
||||||
p &= ~DEMO_SPECTATOR;
|
p &= ~DEMO_SPECTATOR;
|
||||||
|
|
||||||
|
|
@ -2974,6 +2990,11 @@ void G_DoPlayDemo(char *defdemoname)
|
||||||
M_Memcpy(player_names[p],demo_p,16);
|
M_Memcpy(player_names[p],demo_p,16);
|
||||||
demo_p += 16;
|
demo_p += 16;
|
||||||
|
|
||||||
|
/*if (players[p].spectator)
|
||||||
|
{
|
||||||
|
CONS_Printf("player %s is spectator at start\n", player_names[p]);
|
||||||
|
}*/
|
||||||
|
|
||||||
// Skin
|
// Skin
|
||||||
M_Memcpy(skin,demo_p,16);
|
M_Memcpy(skin,demo_p,16);
|
||||||
demo_p += 16;
|
demo_p += 16;
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ struct demovars_s {
|
||||||
boolean inreplayhut; // Go back to replayhut after demos
|
boolean inreplayhut; // Go back to replayhut after demos
|
||||||
boolean quitafterplaying; // quit after playing a demo from cmdline
|
boolean quitafterplaying; // quit after playing a demo from cmdline
|
||||||
boolean deferstart; // don't start playing demo right away
|
boolean deferstart; // don't start playing demo right away
|
||||||
|
boolean netgame; // multiplayer netgame
|
||||||
|
|
||||||
tic_t savebutton; // Used to determine when the local player can choose to save the replay while the race is still going
|
tic_t savebutton; // Used to determine when the local player can choose to save the replay while the race is still going
|
||||||
enum {
|
enum {
|
||||||
|
|
|
||||||
20
src/g_game.c
20
src/g_game.c
|
|
@ -45,8 +45,8 @@
|
||||||
#include "y_inter.h"
|
#include "y_inter.h"
|
||||||
#include "v_video.h"
|
#include "v_video.h"
|
||||||
#include "lua_hook.h"
|
#include "lua_hook.h"
|
||||||
#include "k_bot.h"
|
|
||||||
#include "m_cond.h" // condition sets
|
#include "m_cond.h" // condition sets
|
||||||
|
#include "r_fps.h" // frame interpolation/uncapped
|
||||||
#include "lua_hud.h"
|
#include "lua_hud.h"
|
||||||
|
|
||||||
// SRB2kart
|
// SRB2kart
|
||||||
|
|
@ -56,6 +56,7 @@
|
||||||
#include "k_color.h"
|
#include "k_color.h"
|
||||||
#include "k_respawn.h"
|
#include "k_respawn.h"
|
||||||
#include "k_grandprix.h"
|
#include "k_grandprix.h"
|
||||||
|
#include "k_bot.h"
|
||||||
#include "doomstat.h"
|
#include "doomstat.h"
|
||||||
|
|
||||||
#ifdef HAVE_DISCORDRPC
|
#ifdef HAVE_DISCORDRPC
|
||||||
|
|
@ -1920,6 +1921,8 @@ void G_Ticker(boolean run)
|
||||||
F_TextPromptTicker();
|
F_TextPromptTicker();
|
||||||
AM_Ticker();
|
AM_Ticker();
|
||||||
HU_Ticker();
|
HU_Ticker();
|
||||||
|
R_UpdateViewInterpolation();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GS_INTERMISSION:
|
case GS_INTERMISSION:
|
||||||
|
|
@ -1976,7 +1979,12 @@ void G_Ticker(boolean run)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GS_TITLESCREEN:
|
case GS_TITLESCREEN:
|
||||||
if (titlemapinaction) P_Ticker(run);
|
if (titlemapinaction)
|
||||||
|
{
|
||||||
|
P_Ticker(run);
|
||||||
|
R_UpdateViewInterpolation();
|
||||||
|
}
|
||||||
|
|
||||||
F_TitleScreenTicker(run);
|
F_TitleScreenTicker(run);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -2281,11 +2289,13 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
||||||
p->growshrinktimer = growshrinktimer;
|
p->growshrinktimer = growshrinktimer;
|
||||||
p->bumpers = bumper;
|
p->bumpers = bumper;
|
||||||
p->karmadelay = comebacktime;
|
p->karmadelay = comebacktime;
|
||||||
|
p->overtimekarma = 0;
|
||||||
p->eggmanblame = -1;
|
p->eggmanblame = -1;
|
||||||
p->lastdraft = -1;
|
p->lastdraft = -1;
|
||||||
p->karthud[khud_fault] = khudfault;
|
p->karthud[khud_fault] = khudfault;
|
||||||
p->nocontrol = nocontrol;
|
p->nocontrol = nocontrol;
|
||||||
p->kickstartaccel = kickstartaccel;
|
p->kickstartaccel = kickstartaccel;
|
||||||
|
p->tripWireState = TRIP_NONE;
|
||||||
|
|
||||||
memcpy(&p->respawn, &respawn, sizeof (p->respawn));
|
memcpy(&p->respawn, &respawn, sizeof (p->respawn));
|
||||||
|
|
||||||
|
|
@ -2550,7 +2560,7 @@ mapthing_t *G_FindRaceStart(INT32 playernum)
|
||||||
if (j == i)
|
if (j == i)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (netgame && cv_kartusepwrlv.value)
|
if ((netgame || (demo.playback && demo.netgame)) && cv_kartusepwrlv.value)
|
||||||
{
|
{
|
||||||
if (clientpowerlevels[j][PWRLV_RACE] == clientpowerlevels[i][PWRLV_RACE])
|
if (clientpowerlevels[j][PWRLV_RACE] == clientpowerlevels[i][PWRLV_RACE])
|
||||||
num++;
|
num++;
|
||||||
|
|
@ -2571,7 +2581,7 @@ mapthing_t *G_FindRaceStart(INT32 playernum)
|
||||||
pos++;
|
pos++;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (netgame && cv_kartusepwrlv.value)
|
if ((netgame || (demo.playback && demo.netgame)) && cv_kartusepwrlv.value)
|
||||||
{
|
{
|
||||||
if (clientpowerlevels[i][PWRLV_RACE] > clientpowerlevels[playernum][PWRLV_RACE])
|
if (clientpowerlevels[i][PWRLV_RACE] > clientpowerlevels[playernum][PWRLV_RACE])
|
||||||
pos++;
|
pos++;
|
||||||
|
|
@ -3111,7 +3121,7 @@ boolean G_GametypeHasTeams(void)
|
||||||
//
|
//
|
||||||
boolean G_GametypeHasSpectators(void)
|
boolean G_GametypeHasSpectators(void)
|
||||||
{
|
{
|
||||||
return (netgame || (multiplayer && demo.playback));
|
return (netgame || (multiplayer && demo.netgame));
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
||||||
1
src/hardware/CMakeLists.txt
Normal file
1
src/hardware/CMakeLists.txt
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
target_sourcefile(c)
|
||||||
13
src/hardware/Sourcefile
Normal file
13
src/hardware/Sourcefile
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
hw_bsp.c
|
||||||
|
hw_draw.c
|
||||||
|
hw_light.c
|
||||||
|
hw_main.c
|
||||||
|
hw_clip.c
|
||||||
|
hw_md2.c
|
||||||
|
hw_cache.c
|
||||||
|
hw_md2load.c
|
||||||
|
hw_md3load.c
|
||||||
|
hw_model.c
|
||||||
|
u_list.c
|
||||||
|
hw_batching.c
|
||||||
|
r_opengl/r_opengl.c
|
||||||
|
|
@ -38,6 +38,7 @@
|
||||||
#include "../m_cheat.h"
|
#include "../m_cheat.h"
|
||||||
#include "../f_finale.h"
|
#include "../f_finale.h"
|
||||||
#include "../r_things.h" // R_GetShadowZ
|
#include "../r_things.h" // R_GetShadowZ
|
||||||
|
#include "../d_main.h"
|
||||||
#include "../p_slopes.h"
|
#include "../p_slopes.h"
|
||||||
#include "hw_md2.h"
|
#include "hw_md2.h"
|
||||||
|
|
||||||
|
|
@ -1478,7 +1479,8 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||||
transnum_t transtable = R_GetLinedefTransTable(gl_linedef);
|
transnum_t transtable = R_GetLinedefTransTable(gl_linedef);
|
||||||
if (transtable == NUMTRANSMAPS)
|
if (transtable == NUMTRANSMAPS)
|
||||||
transtable = 0;
|
transtable = 0;
|
||||||
if (gl_linedef->special == 910)
|
if (gl_linedef->special == 910 ||
|
||||||
|
P_IsLineTripWire(gl_linedef))
|
||||||
blend = AST_ADD;
|
blend = AST_ADD;
|
||||||
else if (gl_linedef->special == 911)
|
else if (gl_linedef->special == 911)
|
||||||
blend = AST_SUBTRACT;
|
blend = AST_SUBTRACT;
|
||||||
|
|
@ -3622,10 +3624,6 @@ static boolean HWR_DoCulling(line_t *cullheight, line_t *viewcullheight, float v
|
||||||
|
|
||||||
static void HWR_DrawDropShadow(mobj_t *thing, fixed_t scale)
|
static void HWR_DrawDropShadow(mobj_t *thing, fixed_t scale)
|
||||||
{
|
{
|
||||||
fixed_t thingxpos = thing->x + thing->sprxoff;
|
|
||||||
fixed_t thingypos = thing->y + thing->spryoff;
|
|
||||||
fixed_t thingzpos = thing->z + thing->sprzoff;
|
|
||||||
|
|
||||||
patch_t *gpatch;
|
patch_t *gpatch;
|
||||||
FOutVector shadowVerts[4];
|
FOutVector shadowVerts[4];
|
||||||
FSurfaceInfo sSurf;
|
FSurfaceInfo sSurf;
|
||||||
|
|
@ -3642,8 +3640,20 @@ static void HWR_DrawDropShadow(mobj_t *thing, fixed_t scale)
|
||||||
fixed_t slopez;
|
fixed_t slopez;
|
||||||
pslope_t *groundslope;
|
pslope_t *groundslope;
|
||||||
|
|
||||||
// hitlag vibrating
|
fixed_t interpx = thing->x;
|
||||||
if (thing->hitlag > 0)
|
fixed_t interpy = thing->y;
|
||||||
|
fixed_t interpz = thing->z;
|
||||||
|
|
||||||
|
// do interpolation
|
||||||
|
if (cv_frameinterpolation.value == 1 && !paused)
|
||||||
|
{
|
||||||
|
interpx = thing->old_x + FixedMul(rendertimefrac, thing->x - thing->old_x);
|
||||||
|
interpy = thing->old_y + FixedMul(rendertimefrac, thing->y - thing->old_y);
|
||||||
|
interpz = thing->old_z + FixedMul(rendertimefrac, thing->z - thing->old_z);
|
||||||
|
}
|
||||||
|
|
||||||
|
// hitlag vibrating (todo: interp somehow?)
|
||||||
|
if (thing->hitlag > 0 && (thing->eflags & MFE_DAMAGEHITLAG))
|
||||||
{
|
{
|
||||||
fixed_t mul = thing->hitlag * (FRACUNIT / 10);
|
fixed_t mul = thing->hitlag * (FRACUNIT / 10);
|
||||||
|
|
||||||
|
|
@ -3652,14 +3662,19 @@ static void HWR_DrawDropShadow(mobj_t *thing, fixed_t scale)
|
||||||
mul = -mul;
|
mul = -mul;
|
||||||
}
|
}
|
||||||
|
|
||||||
thingxpos += FixedMul(thing->momx, mul);
|
interpx += FixedMul(thing->momx, mul);
|
||||||
thingypos += FixedMul(thing->momy, mul);
|
interpy += FixedMul(thing->momy, mul);
|
||||||
thingzpos += FixedMul(thing->momz, mul);
|
interpz += FixedMul(thing->momz, mul);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// sprite offset
|
||||||
|
interpx += thing->sprxoff;
|
||||||
|
interpy += thing->spryoff;
|
||||||
|
interpz += thing->sprzoff;
|
||||||
|
|
||||||
groundz = R_GetShadowZ(thing, &groundslope);
|
groundz = R_GetShadowZ(thing, &groundslope);
|
||||||
|
|
||||||
floordiff = abs((flip < 0 ? thing->height : 0) + thingzpos - groundz);
|
floordiff = abs((flip < 0 ? thing->height : 0) + interpz - groundz);
|
||||||
|
|
||||||
alpha = floordiff / (4*FRACUNIT) + 75;
|
alpha = floordiff / (4*FRACUNIT) + 75;
|
||||||
if (alpha >= 255) return;
|
if (alpha >= 255) return;
|
||||||
|
|
@ -3673,8 +3688,8 @@ static void HWR_DrawDropShadow(mobj_t *thing, fixed_t scale)
|
||||||
scalemul = FixedMul(scalemul, (thing->radius*2) / gpatch->height);
|
scalemul = FixedMul(scalemul, (thing->radius*2) / gpatch->height);
|
||||||
|
|
||||||
fscale = FIXED_TO_FLOAT(scalemul);
|
fscale = FIXED_TO_FLOAT(scalemul);
|
||||||
fx = FIXED_TO_FLOAT(thingxpos);
|
fx = FIXED_TO_FLOAT(interpx);
|
||||||
fy = FIXED_TO_FLOAT(thingypos);
|
fy = FIXED_TO_FLOAT(interpy);
|
||||||
|
|
||||||
// 3--2
|
// 3--2
|
||||||
// | /|
|
// | /|
|
||||||
|
|
@ -5012,10 +5027,6 @@ static void HWR_AddSprites(sector_t *sec)
|
||||||
// BP why not use xtoviexangle/viewangletox like in bsp ?....
|
// BP why not use xtoviexangle/viewangletox like in bsp ?....
|
||||||
static void HWR_ProjectSprite(mobj_t *thing)
|
static void HWR_ProjectSprite(mobj_t *thing)
|
||||||
{
|
{
|
||||||
fixed_t thingxpos = thing->x + thing->sprxoff;
|
|
||||||
fixed_t thingypos = thing->y + thing->spryoff;
|
|
||||||
fixed_t thingzpos = thing->z + thing->sprzoff;
|
|
||||||
|
|
||||||
gl_vissprite_t *vis;
|
gl_vissprite_t *vis;
|
||||||
float tr_x, tr_y;
|
float tr_x, tr_y;
|
||||||
float tz;
|
float tz;
|
||||||
|
|
@ -5055,14 +5066,35 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||||
angle_t spriterotangle = 0;
|
angle_t spriterotangle = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// uncapped/interpolation
|
||||||
|
fixed_t interpx;
|
||||||
|
fixed_t interpy;
|
||||||
|
fixed_t interpz;
|
||||||
|
angle_t interpangle;
|
||||||
|
|
||||||
if (!thing)
|
if (!thing)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (thing->spritexscale < 1 || thing->spriteyscale < 1)
|
if (thing->spritexscale < 1 || thing->spriteyscale < 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// hitlag vibrating
|
dispoffset = thing->info->dispoffset;
|
||||||
if (thing->hitlag > 0)
|
|
||||||
|
interpx = thing->x;
|
||||||
|
interpy = thing->y;
|
||||||
|
interpz = thing->z;
|
||||||
|
interpangle = mobjangle;
|
||||||
|
|
||||||
|
if (cv_frameinterpolation.value == 1 && !paused)
|
||||||
|
{
|
||||||
|
interpx = thing->old_x + FixedMul(rendertimefrac, thing->x - thing->old_x);
|
||||||
|
interpy = thing->old_y + FixedMul(rendertimefrac, thing->y - thing->old_y);
|
||||||
|
interpz = thing->old_z + FixedMul(rendertimefrac, thing->z - thing->old_z);
|
||||||
|
interpangle = mobjangle;
|
||||||
|
}
|
||||||
|
|
||||||
|
// hitlag vibrating (todo: interp somehow?)
|
||||||
|
if (thing->hitlag > 0 && (thing->eflags & MFE_DAMAGEHITLAG))
|
||||||
{
|
{
|
||||||
fixed_t mul = thing->hitlag * (FRACUNIT / 10);
|
fixed_t mul = thing->hitlag * (FRACUNIT / 10);
|
||||||
|
|
||||||
|
|
@ -5071,20 +5103,23 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||||
mul = -mul;
|
mul = -mul;
|
||||||
}
|
}
|
||||||
|
|
||||||
thingxpos += FixedMul(thing->momx, mul);
|
interpx += FixedMul(thing->momx, mul);
|
||||||
thingypos += FixedMul(thing->momy, mul);
|
interpy += FixedMul(thing->momy, mul);
|
||||||
thingzpos += FixedMul(thing->momz, mul);
|
interpz += FixedMul(thing->momz, mul);
|
||||||
}
|
}
|
||||||
|
|
||||||
dispoffset = thing->info->dispoffset;
|
// sprite offset
|
||||||
|
interpx += thing->sprxoff;
|
||||||
|
interpy += thing->spryoff;
|
||||||
|
interpz += thing->sprzoff;
|
||||||
|
|
||||||
this_scale = FIXED_TO_FLOAT(thing->scale);
|
this_scale = FIXED_TO_FLOAT(thing->scale);
|
||||||
spritexscale = FIXED_TO_FLOAT(thing->spritexscale);
|
spritexscale = FIXED_TO_FLOAT(thing->spritexscale);
|
||||||
spriteyscale = FIXED_TO_FLOAT(thing->spriteyscale);
|
spriteyscale = FIXED_TO_FLOAT(thing->spriteyscale);
|
||||||
|
|
||||||
// transform the origin point
|
// transform the origin point
|
||||||
tr_x = FIXED_TO_FLOAT(thingxpos) - gl_viewx;
|
tr_x = FIXED_TO_FLOAT(interpx) - gl_viewx;
|
||||||
tr_y = FIXED_TO_FLOAT(thingypos) - gl_viewy;
|
tr_y = FIXED_TO_FLOAT(interpy) - gl_viewy;
|
||||||
|
|
||||||
// rotation around vertical axis
|
// rotation around vertical axis
|
||||||
tz = (tr_x * gl_viewcos) + (tr_y * gl_viewsin);
|
tz = (tr_x * gl_viewcos) + (tr_y * gl_viewsin);
|
||||||
|
|
@ -5107,8 +5142,8 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||||
}
|
}
|
||||||
|
|
||||||
// The above can stay as it works for cutting sprites that are too close
|
// The above can stay as it works for cutting sprites that are too close
|
||||||
tr_x = FIXED_TO_FLOAT(thingxpos);
|
tr_x = FIXED_TO_FLOAT(interpx);
|
||||||
tr_y = FIXED_TO_FLOAT(thingypos);
|
tr_y = FIXED_TO_FLOAT(interpy);
|
||||||
|
|
||||||
// decide which patch to use for sprite relative to player
|
// decide which patch to use for sprite relative to player
|
||||||
#ifdef RANGECHECK
|
#ifdef RANGECHECK
|
||||||
|
|
@ -5156,7 +5191,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||||
I_Error("sprframes NULL for sprite %d\n", thing->sprite);
|
I_Error("sprframes NULL for sprite %d\n", thing->sprite);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ang = R_PointToAngle (thingxpos, thingypos) - mobjangle;
|
ang = R_PointToAngle (interpx, interpy) - interpangle;
|
||||||
if (mirrored)
|
if (mirrored)
|
||||||
ang = InvAngle(ang);
|
ang = InvAngle(ang);
|
||||||
|
|
||||||
|
|
@ -5303,12 +5338,12 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||||
|
|
||||||
if (vflip)
|
if (vflip)
|
||||||
{
|
{
|
||||||
gz = FIXED_TO_FLOAT(thingzpos + thing->height) - (FIXED_TO_FLOAT(spr_topoffset) * this_yscale);
|
gz = FIXED_TO_FLOAT(interpz + thing->height) - (FIXED_TO_FLOAT(spr_topoffset) * this_yscale);
|
||||||
gzt = gz + (FIXED_TO_FLOAT(spr_height) * this_yscale);
|
gzt = gz + (FIXED_TO_FLOAT(spr_height) * this_yscale);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gzt = FIXED_TO_FLOAT(thingzpos) + (FIXED_TO_FLOAT(spr_topoffset) * this_yscale);
|
gzt = FIXED_TO_FLOAT(interpz) + (FIXED_TO_FLOAT(spr_topoffset) * this_yscale);
|
||||||
gz = gzt - (FIXED_TO_FLOAT(spr_height) * this_yscale);
|
gz = gzt - (FIXED_TO_FLOAT(spr_height) * this_yscale);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -5319,7 +5354,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||||
}
|
}
|
||||||
|
|
||||||
heightsec = thing->subsector->sector->heightsec;
|
heightsec = thing->subsector->sector->heightsec;
|
||||||
if (viewplayer->mo && viewplayer->mo->subsector)
|
if (viewplayer && viewplayer->mo && viewplayer->mo->subsector)
|
||||||
phs = viewplayer->mo->subsector->sector->heightsec;
|
phs = viewplayer->mo->subsector->sector->heightsec;
|
||||||
else
|
else
|
||||||
phs = -1;
|
phs = -1;
|
||||||
|
|
@ -5327,12 +5362,12 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||||
if (heightsec != -1 && phs != -1) // only clip things which are in special sectors
|
if (heightsec != -1 && phs != -1) // only clip things which are in special sectors
|
||||||
{
|
{
|
||||||
if (gl_viewz < FIXED_TO_FLOAT(sectors[phs].floorheight) ?
|
if (gl_viewz < FIXED_TO_FLOAT(sectors[phs].floorheight) ?
|
||||||
FIXED_TO_FLOAT(thingzpos) >= FIXED_TO_FLOAT(sectors[heightsec].floorheight) :
|
FIXED_TO_FLOAT(interpz) >= FIXED_TO_FLOAT(sectors[heightsec].floorheight) :
|
||||||
gzt < FIXED_TO_FLOAT(sectors[heightsec].floorheight))
|
gzt < FIXED_TO_FLOAT(sectors[heightsec].floorheight))
|
||||||
return;
|
return;
|
||||||
if (gl_viewz > FIXED_TO_FLOAT(sectors[phs].ceilingheight) ?
|
if (gl_viewz > FIXED_TO_FLOAT(sectors[phs].ceilingheight) ?
|
||||||
gzt < FIXED_TO_FLOAT(sectors[heightsec].ceilingheight) && gl_viewz >= FIXED_TO_FLOAT(sectors[heightsec].ceilingheight) :
|
gzt < FIXED_TO_FLOAT(sectors[heightsec].ceilingheight) && gl_viewz >= FIXED_TO_FLOAT(sectors[heightsec].ceilingheight) :
|
||||||
FIXED_TO_FLOAT(thingzpos) >= FIXED_TO_FLOAT(sectors[heightsec].ceilingheight))
|
FIXED_TO_FLOAT(interpz) >= FIXED_TO_FLOAT(sectors[heightsec].ceilingheight))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -5401,7 +5436,11 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||||
vis->mobj = thing;
|
vis->mobj = thing;
|
||||||
|
|
||||||
//Hurdler: 25/04/2000: now support colormap in hardware mode
|
//Hurdler: 25/04/2000: now support colormap in hardware mode
|
||||||
if ((vis->mobj->flags & (MF_ENEMY|MF_BOSS)) && (vis->mobj->flags2 & MF2_FRET) && !(vis->mobj->flags & MF_GRENADEBOUNCE) && (leveltime & 1)) // Bosses "flash"
|
if (vis->mobj->hitlag > 0 && (vis->mobj->eflags & MFE_DAMAGEHITLAG))
|
||||||
|
{
|
||||||
|
vis->colormap = R_GetTranslationColormap(TC_HITLAG, 0, GTC_CACHE);
|
||||||
|
}
|
||||||
|
else if ((vis->mobj->flags & (MF_ENEMY|MF_BOSS)) && (vis->mobj->flags2 & MF2_FRET) && !(vis->mobj->flags & MF_GRENADEBOUNCE) && (leveltime & 1)) // Bosses "flash"
|
||||||
{
|
{
|
||||||
if (vis->mobj->type == MT_CYBRAKDEMON || vis->mobj->colorized)
|
if (vis->mobj->type == MT_CYBRAKDEMON || vis->mobj->colorized)
|
||||||
vis->colormap = R_GetTranslationColormap(TC_ALLWHITE, 0, GTC_CACHE);
|
vis->colormap = R_GetTranslationColormap(TC_ALLWHITE, 0, GTC_CACHE);
|
||||||
|
|
@ -5463,9 +5502,29 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing)
|
||||||
unsigned rot = 0;
|
unsigned rot = 0;
|
||||||
UINT8 flip;
|
UINT8 flip;
|
||||||
|
|
||||||
|
// uncapped/interpolation
|
||||||
|
fixed_t interpx;
|
||||||
|
fixed_t interpy;
|
||||||
|
fixed_t interpz;
|
||||||
|
|
||||||
|
if (!thing)
|
||||||
|
return;
|
||||||
|
|
||||||
|
interpx = thing->x;
|
||||||
|
interpy = thing->y;
|
||||||
|
interpz = thing->z;
|
||||||
|
|
||||||
|
// do interpolation
|
||||||
|
if (cv_frameinterpolation.value == 1 && !paused)
|
||||||
|
{
|
||||||
|
interpx = thing->old_x + FixedMul(rendertimefrac, thing->x - thing->old_x);
|
||||||
|
interpy = thing->old_y + FixedMul(rendertimefrac, thing->y - thing->old_y);
|
||||||
|
interpz = thing->old_z + FixedMul(rendertimefrac, thing->z - thing->old_z);
|
||||||
|
}
|
||||||
|
|
||||||
// transform the origin point
|
// transform the origin point
|
||||||
tr_x = FIXED_TO_FLOAT(thing->x) - gl_viewx;
|
tr_x = FIXED_TO_FLOAT(interpx) - gl_viewx;
|
||||||
tr_y = FIXED_TO_FLOAT(thing->y) - gl_viewy;
|
tr_y = FIXED_TO_FLOAT(interpy) - gl_viewy;
|
||||||
|
|
||||||
// rotation around vertical axis
|
// rotation around vertical axis
|
||||||
tz = (tr_x * gl_viewcos) + (tr_y * gl_viewsin);
|
tz = (tr_x * gl_viewcos) + (tr_y * gl_viewsin);
|
||||||
|
|
@ -5474,8 +5533,8 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing)
|
||||||
if (tz < ZCLIP_PLANE)
|
if (tz < ZCLIP_PLANE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
tr_x = FIXED_TO_FLOAT(thing->x);
|
tr_x = FIXED_TO_FLOAT(interpx);
|
||||||
tr_y = FIXED_TO_FLOAT(thing->y);
|
tr_y = FIXED_TO_FLOAT(interpy);
|
||||||
|
|
||||||
// decide which patch to use for sprite relative to player
|
// decide which patch to use for sprite relative to player
|
||||||
if ((unsigned)thing->sprite >= numsprites)
|
if ((unsigned)thing->sprite >= numsprites)
|
||||||
|
|
@ -5542,7 +5601,7 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// set top/bottom coords
|
// set top/bottom coords
|
||||||
vis->gzt = FIXED_TO_FLOAT(thing->z + spritecachedinfo[lumpoff].topoffset);
|
vis->gzt = FIXED_TO_FLOAT(interpz + spritecachedinfo[lumpoff].topoffset);
|
||||||
vis->gz = vis->gzt - FIXED_TO_FLOAT(spritecachedinfo[lumpoff].height);
|
vis->gz = vis->gzt - FIXED_TO_FLOAT(spritecachedinfo[lumpoff].height);
|
||||||
|
|
||||||
vis->precip = true;
|
vis->precip = true;
|
||||||
|
|
@ -6697,6 +6756,8 @@ void HWR_DoPostProcessor(player_t *player)
|
||||||
// 10 by 10 grid. 2 coordinates (xy)
|
// 10 by 10 grid. 2 coordinates (xy)
|
||||||
float v[SCREENVERTS][SCREENVERTS][2];
|
float v[SCREENVERTS][SCREENVERTS][2];
|
||||||
static double disStart = 0;
|
static double disStart = 0;
|
||||||
|
static fixed_t last_fractime = 0;
|
||||||
|
|
||||||
UINT8 x, y;
|
UINT8 x, y;
|
||||||
INT32 WAVELENGTH;
|
INT32 WAVELENGTH;
|
||||||
INT32 AMPLITUDE;
|
INT32 AMPLITUDE;
|
||||||
|
|
@ -6728,6 +6789,15 @@ void HWR_DoPostProcessor(player_t *player)
|
||||||
HWD.pfnPostImgRedraw(v);
|
HWD.pfnPostImgRedraw(v);
|
||||||
if (!(paused || P_AutoPause()))
|
if (!(paused || P_AutoPause()))
|
||||||
disStart += 1;
|
disStart += 1;
|
||||||
|
if (renderdeltatics > FRACUNIT)
|
||||||
|
{
|
||||||
|
disStart = disStart - FIXED_TO_FLOAT(last_fractime) + 1 + FIXED_TO_FLOAT(rendertimefrac);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
disStart = disStart - FIXED_TO_FLOAT(last_fractime) + FIXED_TO_FLOAT(rendertimefrac);
|
||||||
|
}
|
||||||
|
last_fractime = rendertimefrac;
|
||||||
|
|
||||||
// Capture the screen again for screen waving on the intermission
|
// Capture the screen again for screen waving on the intermission
|
||||||
if(gamestate != GS_INTERMISSION)
|
if(gamestate != GS_INTERMISSION)
|
||||||
|
|
|
||||||
|
|
@ -819,7 +819,12 @@ static void HWR_CreateBlendedTexture(patch_t *gpatch, patch_t *blendgpatch, GLMi
|
||||||
|
|
||||||
while (size--)
|
while (size--)
|
||||||
{
|
{
|
||||||
if (skinnum == TC_BOSS)
|
if (skinnum == TC_HITLAG)
|
||||||
|
{
|
||||||
|
cur->s.red = cur->s.green = cur->s.blue = K_HitlagColorValue(*image);
|
||||||
|
cur->s.alpha = image->s.alpha;
|
||||||
|
}
|
||||||
|
else if (skinnum == TC_BOSS)
|
||||||
{
|
{
|
||||||
// Turn everything below a certain threshold white
|
// Turn everything below a certain threshold white
|
||||||
if ((image->s.red == image->s.green) && (image->s.green == image->s.blue) && image->s.blue < 127)
|
if ((image->s.red == image->s.green) && (image->s.green == image->s.blue) && image->s.blue < 127)
|
||||||
|
|
@ -1350,10 +1355,6 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
|
||||||
|
|
||||||
// Look at HWR_ProjectSprite for more
|
// Look at HWR_ProjectSprite for more
|
||||||
{
|
{
|
||||||
fixed_t thingxpos = spr->mobj->x + spr->mobj->sprxoff;
|
|
||||||
fixed_t thingypos = spr->mobj->y + spr->mobj->spryoff;
|
|
||||||
fixed_t thingzpos = spr->mobj->z + spr->mobj->sprzoff;
|
|
||||||
|
|
||||||
patch_t *gpatch, *blendgpatch;
|
patch_t *gpatch, *blendgpatch;
|
||||||
GLPatch_t *hwrPatch = NULL, *hwrBlendPatch = NULL;
|
GLPatch_t *hwrPatch = NULL, *hwrBlendPatch = NULL;
|
||||||
INT32 durs = spr->mobj->state->tics;
|
INT32 durs = spr->mobj->state->tics;
|
||||||
|
|
@ -1366,8 +1367,20 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
|
||||||
INT32 mod;
|
INT32 mod;
|
||||||
float finalscale;
|
float finalscale;
|
||||||
|
|
||||||
|
fixed_t interpx = spr->mobj->x;
|
||||||
|
fixed_t interpy = spr->mobj->y;
|
||||||
|
fixed_t interpz = spr->mobj->z;
|
||||||
|
|
||||||
|
// do interpolation
|
||||||
|
if (cv_frameinterpolation.value == 1 && !paused)
|
||||||
|
{
|
||||||
|
interpx = spr->mobj->old_x + FixedMul(rendertimefrac, spr->mobj->x - spr->mobj->old_x);
|
||||||
|
interpy = spr->mobj->old_y + FixedMul(rendertimefrac, spr->mobj->y - spr->mobj->old_y);
|
||||||
|
interpz = spr->mobj->old_z + FixedMul(rendertimefrac, spr->mobj->z - spr->mobj->old_z);
|
||||||
|
}
|
||||||
|
|
||||||
// hitlag vibrating
|
// hitlag vibrating
|
||||||
if (spr->mobj->hitlag > 0)
|
if (spr->mobj->hitlag > 0 && (spr->mobj->eflags & MFE_DAMAGEHITLAG))
|
||||||
{
|
{
|
||||||
fixed_t mul = spr->mobj->hitlag * (FRACUNIT / 10);
|
fixed_t mul = spr->mobj->hitlag * (FRACUNIT / 10);
|
||||||
|
|
||||||
|
|
@ -1376,11 +1389,16 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
|
||||||
mul = -mul;
|
mul = -mul;
|
||||||
}
|
}
|
||||||
|
|
||||||
thingxpos += FixedMul(spr->mobj->momx, mul);
|
interpx += FixedMul(spr->mobj->momx, mul);
|
||||||
thingypos += FixedMul(spr->mobj->momy, mul);
|
interpy += FixedMul(spr->mobj->momy, mul);
|
||||||
thingzpos += FixedMul(spr->mobj->momz, mul);
|
interpy += FixedMul(spr->mobj->momz, mul);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// sprite offset
|
||||||
|
interpx += spr->mobj->sprxoff;
|
||||||
|
interpy += spr->mobj->spryoff;
|
||||||
|
interpz += spr->mobj->sprzoff;
|
||||||
|
|
||||||
// Apparently people don't like jump frames like that, so back it goes
|
// Apparently people don't like jump frames like that, so back it goes
|
||||||
//if (tics > durs)
|
//if (tics > durs)
|
||||||
//durs = tics;
|
//durs = tics;
|
||||||
|
|
@ -1486,7 +1504,11 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
|
||||||
{
|
{
|
||||||
INT32 skinnum = TC_DEFAULT;
|
INT32 skinnum = TC_DEFAULT;
|
||||||
|
|
||||||
if ((spr->mobj->flags & (MF_ENEMY|MF_BOSS)) && (spr->mobj->flags2 & MF2_FRET) && !(spr->mobj->flags & MF_GRENADEBOUNCE) && (leveltime & 1)) // Bosses "flash"
|
if (spr->mobj->hitlag > 0 && (spr->mobj->eflags & MFE_DAMAGEHITLAG))
|
||||||
|
{
|
||||||
|
skinnum = TC_HITLAG;
|
||||||
|
}
|
||||||
|
else if ((spr->mobj->flags & (MF_ENEMY|MF_BOSS)) && (spr->mobj->flags2 & MF2_FRET) && !(spr->mobj->flags & MF_GRENADEBOUNCE) && (leveltime & 1)) // Bosses "flash"
|
||||||
{
|
{
|
||||||
if (spr->mobj->type == MT_CYBRAKDEMON || spr->mobj->colorized)
|
if (spr->mobj->type == MT_CYBRAKDEMON || spr->mobj->colorized)
|
||||||
skinnum = TC_ALLWHITE;
|
skinnum = TC_ALLWHITE;
|
||||||
|
|
@ -1596,13 +1618,13 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Hurdler: it seems there is still a small problem with mobj angle
|
//Hurdler: it seems there is still a small problem with mobj angle
|
||||||
p.x = FIXED_TO_FLOAT(thingxpos);
|
p.x = FIXED_TO_FLOAT(interpx);
|
||||||
p.y = FIXED_TO_FLOAT(thingypos) + md2->offset;
|
p.y = FIXED_TO_FLOAT(interpy) + md2->offset;
|
||||||
|
|
||||||
if (flip)
|
if (flip)
|
||||||
p.z = FIXED_TO_FLOAT(spr->mobj->z + spr->mobj->height);
|
p.z = FIXED_TO_FLOAT(spr->mobj->z + spr->mobj->height);
|
||||||
else
|
else
|
||||||
p.z = FIXED_TO_FLOAT(thingzpos);
|
p.z = FIXED_TO_FLOAT(interpz);
|
||||||
|
|
||||||
if (spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
|
if (spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
|
||||||
sprdef = &((skin_t *)spr->mobj->skin)->sprites[spr->mobj->sprite2];
|
sprdef = &((skin_t *)spr->mobj->skin)->sprites[spr->mobj->sprite2];
|
||||||
|
|
@ -1622,7 +1644,7 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const fixed_t anglef = AngleFixed((R_PointToAngle(thingxpos, thingypos))-ANGLE_180);
|
const fixed_t anglef = AngleFixed((R_PointToAngle(interpx, interpy))-ANGLE_180);
|
||||||
p.angley = FIXED_TO_FLOAT(anglef);
|
p.angley = FIXED_TO_FLOAT(anglef);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,10 @@ UINT32 I_GetFreeMem(UINT32 *total);
|
||||||
*/
|
*/
|
||||||
tic_t I_GetTime(void);
|
tic_t I_GetTime(void);
|
||||||
|
|
||||||
|
/** \brief Get the current time as a fraction of a tic since the last tic.
|
||||||
|
*/
|
||||||
|
fixed_t I_GetTimeFrac(void);
|
||||||
|
|
||||||
/** \brief Returns precise time value for performance measurement.
|
/** \brief Returns precise time value for performance measurement.
|
||||||
*/
|
*/
|
||||||
precise_t I_GetPreciseTime(void);
|
precise_t I_GetPreciseTime(void);
|
||||||
|
|
|
||||||
36
src/info.c
36
src/info.c
|
|
@ -727,6 +727,7 @@ char sprnames[NUMSPRITES + 1][5] =
|
||||||
"FWRK",
|
"FWRK",
|
||||||
"MXCL",
|
"MXCL",
|
||||||
"RGSP",
|
"RGSP",
|
||||||
|
"LENS",
|
||||||
"DRAF",
|
"DRAF",
|
||||||
"GRES",
|
"GRES",
|
||||||
|
|
||||||
|
|
@ -5178,6 +5179,11 @@ state_t states[NUMSTATES] =
|
||||||
{SPR_RGSP, FF_PAPERSPRITE|FF_FULLBRIGHT|13, 1, {NULL}, 0, 0, S_RINGSPARKS15}, // S_RINGSPARKS14
|
{SPR_RGSP, FF_PAPERSPRITE|FF_FULLBRIGHT|13, 1, {NULL}, 0, 0, S_RINGSPARKS15}, // S_RINGSPARKS14
|
||||||
{SPR_RGSP, FF_PAPERSPRITE|FF_FULLBRIGHT|14, 1, {NULL}, 0, 0, S_NULL}, // S_RINGSPARKS15
|
{SPR_RGSP, FF_PAPERSPRITE|FF_FULLBRIGHT|14, 1, {NULL}, 0, 0, S_NULL}, // S_RINGSPARKS15
|
||||||
|
|
||||||
|
{SPR_LENS, FF_FULLBRIGHT|FF_ADD|FF_TRANS10|FF_ANIMATE|11, -1, {NULL}, 3, 1, S_NULL}, // S_GAINAX_TINY
|
||||||
|
{SPR_LENS, FF_FULLBRIGHT|FF_ADD|FF_TRANS10|FF_ANIMATE, 5, {NULL}, 5, 1, S_GAINAX_MID1}, // S_GAINAX_HUGE
|
||||||
|
{SPR_LENS, FF_FULLBRIGHT|FF_ADD|FF_TRANS10|FF_ANIMATE|5, 14, {NULL}, 14, 1, S_GAINAX_MID2}, // S_GAINAX_MID1
|
||||||
|
{SPR_LENS, FF_FULLBRIGHT|FF_ADD|FF_TRANS10|FF_ANIMATE|19, -1, {NULL}, 1, 1, S_NULL}, // S_GAINAX_MID2
|
||||||
|
|
||||||
{SPR_DRAF, 0, 2, {NULL}, 0, 0, S_DRAFTDUST2}, // S_DRAFTDUST1
|
{SPR_DRAF, 0, 2, {NULL}, 0, 0, S_DRAFTDUST2}, // S_DRAFTDUST1
|
||||||
{SPR_DRAF, 1, 1, {NULL}, 0, 0, S_DRAFTDUST3}, // S_DRAFTDUST2
|
{SPR_DRAF, 1, 1, {NULL}, 0, 0, S_DRAFTDUST3}, // S_DRAFTDUST2
|
||||||
{SPR_DRAF, 2, 1, {NULL}, 0, 0, S_DRAFTDUST4}, // S_DRAFTDUST3
|
{SPR_DRAF, 2, 1, {NULL}, 0, 0, S_DRAFTDUST4}, // S_DRAFTDUST3
|
||||||
|
|
@ -8680,7 +8686,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
20*FRACUNIT, // mass
|
20*FRACUNIT, // mass
|
||||||
0, // damage
|
0, // damage
|
||||||
sfx_None, // activesound
|
sfx_None, // activesound
|
||||||
MF_NOGRAVITY, // flags
|
MF_SPECIAL|MF_NOGRAVITY, // flags
|
||||||
S_BALLOONPOP1 // raisestate
|
S_BALLOONPOP1 // raisestate
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -9193,7 +9199,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
0, // mass
|
0, // mass
|
||||||
0, // damage
|
0, // damage
|
||||||
sfx_None, // activesound
|
sfx_None, // activesound
|
||||||
MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_NOTHINK|MF_DONTENCOREMAP, // flags
|
MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags
|
||||||
S_NULL // raisestate
|
S_NULL // raisestate
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -28683,6 +28689,32 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags
|
MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags
|
||||||
S_NULL // raisestate
|
S_NULL // raisestate
|
||||||
},
|
},
|
||||||
|
{ // MT_GAINAX
|
||||||
|
-1, // doomednum
|
||||||
|
S_INVISIBLE, // spawnstate
|
||||||
|
1000, // spawnhealth
|
||||||
|
S_NULL, // seestate
|
||||||
|
sfx_None, // seesound
|
||||||
|
8, // reactiontime
|
||||||
|
sfx_None, // attacksound
|
||||||
|
S_NULL, // painstate
|
||||||
|
0, // painchance
|
||||||
|
sfx_None, // painsound
|
||||||
|
S_NULL, // meleestate
|
||||||
|
S_NULL, // missilestate
|
||||||
|
S_NULL, // deathstate
|
||||||
|
S_NULL, // xdeathstate
|
||||||
|
sfx_None, // deathsound
|
||||||
|
0, // speed
|
||||||
|
8<<FRACBITS, // radius
|
||||||
|
16<<FRACBITS, // height
|
||||||
|
1, // display offset
|
||||||
|
100, // mass
|
||||||
|
0, // damage
|
||||||
|
sfx_None, // activesound
|
||||||
|
MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags
|
||||||
|
S_NULL // raisestate
|
||||||
|
},
|
||||||
|
|
||||||
{ // MT_DRAFTDUST
|
{ // MT_DRAFTDUST
|
||||||
-1, // doomednum
|
-1, // doomednum
|
||||||
|
|
|
||||||
|
|
@ -1268,6 +1268,7 @@ typedef enum sprite
|
||||||
SPR_FWRK,
|
SPR_FWRK,
|
||||||
SPR_MXCL,
|
SPR_MXCL,
|
||||||
SPR_RGSP,
|
SPR_RGSP,
|
||||||
|
SPR_LENS,
|
||||||
SPR_DRAF,
|
SPR_DRAF,
|
||||||
SPR_GRES,
|
SPR_GRES,
|
||||||
|
|
||||||
|
|
@ -5586,6 +5587,11 @@ typedef enum state
|
||||||
S_RINGSPARKS14,
|
S_RINGSPARKS14,
|
||||||
S_RINGSPARKS15,
|
S_RINGSPARKS15,
|
||||||
|
|
||||||
|
S_GAINAX_TINY,
|
||||||
|
S_GAINAX_HUGE,
|
||||||
|
S_GAINAX_MID1,
|
||||||
|
S_GAINAX_MID2,
|
||||||
|
|
||||||
S_DRAFTDUST1,
|
S_DRAFTDUST1,
|
||||||
S_DRAFTDUST2,
|
S_DRAFTDUST2,
|
||||||
S_DRAFTDUST3,
|
S_DRAFTDUST3,
|
||||||
|
|
@ -6740,6 +6746,7 @@ typedef enum mobj_type
|
||||||
|
|
||||||
MT_KARMAFIREWORK,
|
MT_KARMAFIREWORK,
|
||||||
MT_RINGSPARKS,
|
MT_RINGSPARKS,
|
||||||
|
MT_GAINAX,
|
||||||
MT_DRAFTDUST,
|
MT_DRAFTDUST,
|
||||||
MT_SPBDUST,
|
MT_SPBDUST,
|
||||||
MT_TIREGREASE,
|
MT_TIREGREASE,
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,7 @@ mobj_t *K_SpawnChaosEmerald(fixed_t x, fixed_t y, fixed_t z, angle_t angle, SINT
|
||||||
|
|
||||||
P_Thrust(emerald,
|
P_Thrust(emerald,
|
||||||
FixedAngle(P_RandomFixed() * 180) + angle,
|
FixedAngle(P_RandomFixed() * 180) + angle,
|
||||||
32 * mapobjectscale);
|
24 * mapobjectscale);
|
||||||
|
|
||||||
emerald->momz = flip * 24 * mapobjectscale;
|
emerald->momz = flip * 24 * mapobjectscale;
|
||||||
if (emerald->eflags & MFE_UNDERWATER)
|
if (emerald->eflags & MFE_UNDERWATER)
|
||||||
|
|
@ -288,12 +288,6 @@ void K_RunPaperItemSpawners(void)
|
||||||
|
|
||||||
if (overtime == true)
|
if (overtime == true)
|
||||||
{
|
{
|
||||||
if (battleovertime.radius < 512*mapobjectscale)
|
|
||||||
{
|
|
||||||
// Barrier has closed in too much
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Double frequency of items
|
// Double frequency of items
|
||||||
interval /= 2;
|
interval /= 2;
|
||||||
}
|
}
|
||||||
|
|
@ -557,10 +551,12 @@ void K_RunBattleOvertime(void)
|
||||||
}
|
}
|
||||||
else if (battleovertime.radius > 0)
|
else if (battleovertime.radius > 0)
|
||||||
{
|
{
|
||||||
if (battleovertime.radius > 2*mapobjectscale)
|
const fixed_t minradius = 768 * mapobjectscale;
|
||||||
|
|
||||||
|
if (battleovertime.radius > minradius)
|
||||||
battleovertime.radius -= 2*mapobjectscale;
|
battleovertime.radius -= 2*mapobjectscale;
|
||||||
else
|
else
|
||||||
battleovertime.radius = 0;
|
battleovertime.radius = minradius;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (battleovertime.radius > 0)
|
if (battleovertime.radius > 0)
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,59 @@ void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------
|
||||||
|
UINT8 K_HitlagColorValue(RGBA_t color)
|
||||||
|
|
||||||
|
See header file for description.
|
||||||
|
--------------------------------------------------*/
|
||||||
|
UINT8 K_HitlagColorValue(RGBA_t color)
|
||||||
|
{
|
||||||
|
// Outputs a raw brightness value (makes OGL support easier)
|
||||||
|
INT32 output = K_ColorRelativeLuminance(color.s.red, color.s.green, color.s.blue);
|
||||||
|
|
||||||
|
// Invert the color
|
||||||
|
output = 255 - output;
|
||||||
|
|
||||||
|
// Increase the contrast
|
||||||
|
output = ((output-128) * 2) + 128;
|
||||||
|
|
||||||
|
// Make sure to cap it.
|
||||||
|
if (output > 255)
|
||||||
|
{
|
||||||
|
output = 255;
|
||||||
|
}
|
||||||
|
else if (output < 0)
|
||||||
|
{
|
||||||
|
output = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------
|
||||||
|
void K_HitlagColormap(UINT8 *dest_colormap)
|
||||||
|
|
||||||
|
See header file for description.
|
||||||
|
--------------------------------------------------*/
|
||||||
|
void K_HitlagColormap(UINT8 *dest_colormap)
|
||||||
|
{
|
||||||
|
RGBA_t color;
|
||||||
|
UINT8 v, offset;
|
||||||
|
INT32 i;
|
||||||
|
|
||||||
|
// for every colour in the palette, invert, greyscale, and increase the contrast.
|
||||||
|
for (i = 0; i < NUM_PALETTE_ENTRIES; i++)
|
||||||
|
{
|
||||||
|
color = V_GetColor(i);
|
||||||
|
v = K_HitlagColorValue(color);
|
||||||
|
|
||||||
|
// Convert raw brightness value to an offset from the greyscale palette line
|
||||||
|
offset = (255 - v) / 8;
|
||||||
|
|
||||||
|
dest_colormap[i] = offset; // Starts from 0, add it if greyscale moves.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*--------------------------------------------------
|
/*--------------------------------------------------
|
||||||
void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color)
|
void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color)
|
||||||
|
|
||||||
|
|
@ -100,13 +153,18 @@ void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color)
|
||||||
INT32 i;
|
INT32 i;
|
||||||
INT32 starttranscolor;
|
INT32 starttranscolor;
|
||||||
|
|
||||||
// Handle a couple of simple special cases
|
if (skinnum == TC_HITLAG)
|
||||||
if (skinnum == TC_BOSS
|
{
|
||||||
|
K_HitlagColormap(dest_colormap);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (skinnum == TC_BOSS
|
||||||
|| skinnum == TC_ALLWHITE
|
|| skinnum == TC_ALLWHITE
|
||||||
|| skinnum == TC_METALSONIC
|
|| skinnum == TC_METALSONIC
|
||||||
|| skinnum == TC_BLINK
|
|| skinnum == TC_BLINK
|
||||||
|| color == SKINCOLOR_NONE)
|
|| color == SKINCOLOR_NONE)
|
||||||
{
|
{
|
||||||
|
// Handle a couple of simple special cases
|
||||||
for (i = 0; i < NUM_PALETTE_ENTRIES; i++)
|
for (i = 0; i < NUM_PALETTE_ENTRIES; i++)
|
||||||
{
|
{
|
||||||
if (skinnum == TC_ALLWHITE)
|
if (skinnum == TC_ALLWHITE)
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue