mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-04-13 21:52:45 +00:00
Merge remote-tracking branch 'origin/next' into playercontroldirection
This commit is contained in:
commit
434b119ccf
173 changed files with 7669 additions and 5400 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -13,11 +13,11 @@ Win32_LIB_ASM_Release
|
|||
*.dgb
|
||||
*.debug
|
||||
*.debug.txt
|
||||
/bin/VC10/
|
||||
/objs/VC10/
|
||||
*.user
|
||||
*.db
|
||||
*.opendb
|
||||
/.vs
|
||||
/debian
|
||||
/assets/debian
|
||||
/make
|
||||
/bin
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
cmake_minimum_required(VERSION 3.0)
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
# Enable CCache early
|
||||
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
|
||||
|
||||
# Prepend sources with current source directory
|
||||
function(prepend_sources SOURCE_FILES)
|
||||
foreach(SOURCE_FILE ${${SOURCE_FILES}})
|
||||
set(MODIFIED ${MODIFIED} ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_FILE})
|
||||
endforeach()
|
||||
set(${SOURCE_FILES} ${MODIFIED} PARENT_SCOPE)
|
||||
# Add sources from Sourcefile
|
||||
function(target_sourcefile type)
|
||||
file(STRINGS Sourcefile list
|
||||
REGEX "[-0-9A-Za-z_]+\.${type}")
|
||||
target_sources(SRB2SDL2 PRIVATE ${list})
|
||||
endfunction()
|
||||
|
||||
# Macro to add OSX framework
|
||||
|
|
8
Makefile
Normal file
8
Makefile
Normal file
|
@ -0,0 +1,8 @@
|
|||
ifdef SILENT
|
||||
MAKEFLAGS+=--no-print-directory
|
||||
endif
|
||||
|
||||
all :
|
||||
|
||||
% ::
|
||||
@$(MAKE) -C src $(MAKECMDGOALS)
|
|
@ -1,4 +1,5 @@
|
|||
# Sonic Robo Blast 2
|
||||
[](https://github.com/STJr/SRB2/releases/latest)
|
||||
|
||||
[](https://ci.appveyor.com/project/STJr/srb2)
|
||||
[](https://travis-ci.org/STJr/SRB2)
|
||||
|
|
34
appveyor.yml
34
appveyor.yml
|
@ -2,15 +2,11 @@ version: 2.2.9.{branch}-{build}
|
|||
os: MinGW
|
||||
|
||||
environment:
|
||||
CC: ccache
|
||||
CCACHE_CC: i686-w64-mingw32-gcc
|
||||
CCACHE_CC_64: x86_64-w64-mingw32-gcc
|
||||
CC: i686-w64-mingw32-gcc
|
||||
WINDRES: windres
|
||||
# c:\mingw-w64 i686 has gcc 6.3.0, so use c:\msys64 7.3.0 instead
|
||||
MINGW_SDK: c:\msys64\mingw32
|
||||
# c:\msys64 x86_64 has gcc 8.2.0, so use c:\mingw-w64 7.3.0 instead
|
||||
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
|
||||
CFLAGS: -Wno-implicit-fallthrough
|
||||
NASM_ZIP: nasm-2.12.01
|
||||
NASM_URL: http://www.nasm.us/pub/nasm/releasebuilds/2.12.01/win64/nasm-2.12.01-win64.zip
|
||||
UPX_ZIP: upx391w
|
||||
|
@ -19,8 +15,6 @@ environment:
|
|||
CCACHE_URL: http://alam.srb2.org/ccache.exe
|
||||
CCACHE_COMPRESS: true
|
||||
CCACHE_DIR: C:\Users\appveyor\.ccache
|
||||
# Disable UPX by default. The user can override this in their Appveyor project settings
|
||||
NOUPX: 1
|
||||
##############################
|
||||
# DEPLOYER VARIABLES
|
||||
# DPL_ENABLED=1 builds installers for branch names starting with `deployer`.
|
||||
|
@ -53,11 +47,6 @@ cache:
|
|||
- C:\Users\appveyor\srb2_cache
|
||||
|
||||
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"
|
||||
- 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
|
||||
|
@ -72,43 +61,31 @@ install:
|
|||
|
||||
configuration:
|
||||
- SDL
|
||||
- SDL64
|
||||
|
||||
before_build:
|
||||
- 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
|
||||
- if not [%X86_64%] == [1] ( nasm -v )
|
||||
- nasm -v
|
||||
- if not [%NOUPX%] == [1] ( upx -V )
|
||||
- ccache -V
|
||||
- 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%" )
|
||||
- cmd: git rev-parse --short %COMMIT%>%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
|
||||
- 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%" ) )
|
||||
- set "EXENAME=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"
|
||||
- set "SRB2_MFLAGS=-C src NOECHOFILENAMES=1 CCACHE=1 EXENAME=srb2win-%REPO%-%GITSHORT%.exe"
|
||||
|
||||
build_script:
|
||||
- cmd: mingw32-make.exe %SRB2_MFLAGS% clean
|
||||
- cmd: mingw32-make.exe %SRB2_MFLAGS% ERRORMODE=1 -k
|
||||
|
||||
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
|
||||
- set BUILD_ARCHIVE=%REPO%-%GITSHORT%-%CONFIGURATION%.7z
|
||||
- set BUILDSARCHIVE=%REPO%-%CONFIGURATION%.7z
|
||||
- cmd: 7z a %BUILD_ARCHIVE% %BUILD_PATH% -xr!.gitignore
|
||||
- cmd: 7z a %BUILD_ARCHIVE% bin -xr!.gitignore
|
||||
- appveyor PushArtifact %BUILD_ARCHIVE%
|
||||
#- cmd: copy %BUILD_ARCHIVE% %BUILDSARCHIVE%
|
||||
#- appveyor PushArtifact %BUILDSARCHIVE%
|
||||
|
@ -139,3 +116,4 @@ test: off
|
|||
on_finish:
|
||||
#- cmd: echo xfreerdp /u:appveyor /cert-ignore +clipboard /v:<ip>:<port>
|
||||
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
||||
# 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
|
3
bin/Mingw/Debug/.gitignore
vendored
3
bin/Mingw/Debug/.gitignore
vendored
|
@ -1,3 +0,0 @@
|
|||
*.exe
|
||||
*.mo
|
||||
r_opengl.dll
|
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
|
|
@ -640,22 +640,37 @@ linedeftypes
|
|||
prefix = "(63)";
|
||||
}
|
||||
|
||||
96
|
||||
{
|
||||
title = "Apply Tag to Tagged Sectors";
|
||||
prefix = "(96)";
|
||||
flags1024text = "[10] Offsets are target tags";
|
||||
flags8192text = "[13] Use front side offsets";
|
||||
flags32768text = "[15] Use back side offsets";
|
||||
}
|
||||
|
||||
97
|
||||
{
|
||||
title = "Apply Tag to Front Sector";
|
||||
prefix = "(97)";
|
||||
flags8192text = "[13] Use front side offsets";
|
||||
flags32768text = "[15] Use back side offsets";
|
||||
}
|
||||
|
||||
98
|
||||
{
|
||||
title = "Apply Tag to Back Sector";
|
||||
prefix = "(98)";
|
||||
flags8192text = "[13] Use front side offsets";
|
||||
flags32768text = "[15] Use back side offsets";
|
||||
}
|
||||
|
||||
99
|
||||
{
|
||||
title = "Apply Tag to Front and Back Sectors";
|
||||
prefix = "(99)";
|
||||
flags8192text = "[13] Use front side offsets";
|
||||
flags32768text = "[15] Use back side offsets";
|
||||
}
|
||||
|
||||
540
|
||||
|
@ -3574,6 +3589,7 @@ thingtypes
|
|||
sprite = "ARCHA1";
|
||||
width = 24;
|
||||
height = 32;
|
||||
flags8text = "[8] Don't jump away";
|
||||
}
|
||||
118
|
||||
{
|
||||
|
|
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,238 +1,14 @@
|
|||
# SRB2 Core
|
||||
|
||||
add_executable(SRB2SDL2 MACOSX_BUNDLE WIN32)
|
||||
|
||||
# Core sources
|
||||
set(SRB2_CORE_SOURCES
|
||||
am_map.c
|
||||
b_bot.c
|
||||
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
|
||||
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
|
||||
)
|
||||
target_sourcefile(c)
|
||||
target_sources(SRB2SDL2 PRIVATE comptime.c md5.c config.h)
|
||||
|
||||
set(SRB2_CORE_HEADERS
|
||||
am_map.h
|
||||
b_bot.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
|
||||
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
|
||||
|
||||
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
|
||||
)
|
||||
|
||||
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_ASM_SOURCES vid_copy.s)
|
||||
|
||||
set(SRB2_NASM_SOURCES tmap_mmx.nas tmap.nas)
|
||||
|
||||
### Configuration
|
||||
set(SRB2_CONFIG_HAVE_PNG ON CACHE BOOL
|
||||
|
@ -268,92 +44,7 @@ if(${CMAKE_SYSTEM} MATCHES "Windows") ###set on Windows only
|
|||
"Use SRB2's internal copies of required dependencies (SDL2, PNG, zlib, GME, OpenMPT).")
|
||||
endif()
|
||||
|
||||
set(SRB2_LUA_SOURCES
|
||||
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})
|
||||
add_subdirectory(blua)
|
||||
|
||||
if(${SRB2_CONFIG_HAVE_GME})
|
||||
if(${SRB2_CONFIG_USE_INTERNAL_LIBRARIES})
|
||||
|
@ -369,7 +60,7 @@ if(${SRB2_CONFIG_HAVE_GME})
|
|||
endif()
|
||||
if(${GME_FOUND})
|
||||
set(SRB2_HAVE_GME ON)
|
||||
add_definitions(-DHAVE_LIBGME)
|
||||
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_LIBGME)
|
||||
else()
|
||||
message(WARNING "You have specified that GME is available but it was not found.")
|
||||
endif()
|
||||
|
@ -389,7 +80,7 @@ if(${SRB2_CONFIG_HAVE_OPENMPT})
|
|||
endif()
|
||||
if(${OPENMPT_FOUND})
|
||||
set(SRB2_HAVE_OPENMPT ON)
|
||||
add_definitions(-DHAVE_OPENMPT)
|
||||
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_OPENMPT)
|
||||
else()
|
||||
message(WARNING "You have specified that OpenMPT is available but it was not found.")
|
||||
endif()
|
||||
|
@ -412,8 +103,7 @@ if(${SRB2_CONFIG_HAVE_MIXERX})
|
|||
endif()
|
||||
if(${MIXERX_FOUND})
|
||||
set(SRB2_HAVE_MIXERX ON)
|
||||
set(SRB2_SDL2_SOUNDIMPL mixer_sound.c)
|
||||
add_definitions(-DHAVE_MIXERX)
|
||||
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_MIXERX)
|
||||
else()
|
||||
message(WARNING "You have specified that SDL Mixer X is available but it was not found.")
|
||||
endif()
|
||||
|
@ -433,7 +123,7 @@ if(${SRB2_CONFIG_HAVE_ZLIB})
|
|||
endif()
|
||||
if(${ZLIB_FOUND})
|
||||
set(SRB2_HAVE_ZLIB ON)
|
||||
add_definitions(-DHAVE_ZLIB)
|
||||
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_ZLIB)
|
||||
else()
|
||||
message(WARNING "You have specified that ZLIB is available but it was not found. SRB2 may not compile correctly.")
|
||||
endif()
|
||||
|
@ -454,14 +144,9 @@ if(${SRB2_CONFIG_HAVE_PNG} AND ${SRB2_CONFIG_HAVE_ZLIB})
|
|||
endif()
|
||||
if(${PNG_FOUND})
|
||||
set(SRB2_HAVE_PNG ON)
|
||||
add_definitions(-DHAVE_PNG)
|
||||
add_definitions(-D_LARGEFILE64_SOURCE)
|
||||
set(SRB2_PNG_SOURCES 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})
|
||||
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_PNG)
|
||||
target_compile_definitions(SRB2SDL2 PRIVATE -D_LARGEFILE64_SOURCE)
|
||||
target_sources(SRB2SDL2 PRIVATE apng.c)
|
||||
else()
|
||||
message(WARNING "You have specified that PNG is available but it was not found. SRB2 may not compile correctly.")
|
||||
endif()
|
||||
|
@ -482,7 +167,7 @@ if(${SRB2_CONFIG_HAVE_CURL})
|
|||
endif()
|
||||
if(${CURL_FOUND})
|
||||
set(SRB2_HAVE_CURL ON)
|
||||
add_definitions(-DHAVE_CURL)
|
||||
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_CURL)
|
||||
else()
|
||||
message(WARNING "You have specified that CURL is available but it was not found. SRB2 may not compile correctly.")
|
||||
endif()
|
||||
|
@ -490,59 +175,19 @@ endif()
|
|||
|
||||
if(${SRB2_CONFIG_HAVE_THREADS})
|
||||
set(SRB2_HAVE_THREADS ON)
|
||||
set(SRB2_CORE_HEADERS ${SRB2_CORE_HEADERS} ${CMAKE_CURRENT_SOURCE_DIR}/i_threads.h)
|
||||
add_definitions(-DHAVE_THREADS)
|
||||
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_THREADS)
|
||||
endif()
|
||||
|
||||
if(${SRB2_CONFIG_HWRENDER})
|
||||
add_definitions(-DHWRENDER)
|
||||
set(SRB2_HWRENDER_SOURCES
|
||||
${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
|
||||
)
|
||||
|
||||
target_compile_definitions(SRB2SDL2 PRIVATE -DHWRENDER)
|
||||
add_subdirectory(hardware)
|
||||
endif()
|
||||
|
||||
if(${SRB2_CONFIG_HWRENDER} AND ${SRB2_CONFIG_STATIC_OPENGL})
|
||||
find_package(OpenGL)
|
||||
if(${OPENGL_FOUND})
|
||||
add_definitions(-DHWRENDER)
|
||||
add_definitions(-DSTATIC_OPENGL)
|
||||
target_compile_definitions(SRB2SDL2 PRIVATE -DHWRENDER)
|
||||
target_compile_definitions(SRB2SDL2 PRIVATE -DSTATIC_OPENGL)
|
||||
else()
|
||||
message(WARNING "You have specified static opengl but opengl was not found. Not setting HWRENDER.")
|
||||
endif()
|
||||
|
@ -563,12 +208,16 @@ if(${SRB2_CONFIG_USEASM})
|
|||
set(CMAKE_ASM_NASM_FLAGS "${SRB2_ASM_FLAGS}" CACHE STRING "Flags used by the assembler during all build types.")
|
||||
enable_language(ASM_NASM)
|
||||
endif()
|
||||
|
||||
set(SRB2_USEASM ON)
|
||||
add_definitions(-DUSEASM)
|
||||
target_compile_definitions(SRB2SDL2 PRIVATE -DUSEASM)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse3 -mfpmath=sse")
|
||||
|
||||
target_sources(SRB2SDL2 PRIVATE ${SRB2_ASM_SOURCES}
|
||||
${SRB2_NASM_SOURCES})
|
||||
else()
|
||||
set(SRB2_USEASM OFF)
|
||||
add_definitions(-DNONX86 -DNORUSEASM)
|
||||
target_compile_definitions(SRB2SDL2 PRIVATE -DNONX86 -DNORUSEASM)
|
||||
endif()
|
||||
|
||||
# Targets
|
||||
|
@ -606,7 +255,7 @@ endif()
|
|||
|
||||
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -Wno-trigraphs)
|
||||
|
||||
add_definitions(-DCMAKECONFIG)
|
||||
target_compile_definitions(SRB2SDL2 PRIVATE -DCMAKECONFIG)
|
||||
|
||||
#add_library(SRB2Core STATIC
|
||||
# ${SRB2_CORE_SOURCES}
|
||||
|
|
1101
src/Makefile
1101
src/Makefile
File diff suppressed because it is too large
Load diff
478
src/Makefile.cfg
478
src/Makefile.cfg
|
@ -1,478 +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 -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
|
||||
ifdef VCHELP
|
||||
WFLAGS+=-Wdeclaration-after-statement
|
||||
WFLAGS+=-Wno-error=declaration-after-statement
|
||||
endif
|
||||
WFLAGS+=-Wundef
|
||||
ifndef GCC295
|
||||
WFLAGS+=-Wendif-labels
|
||||
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
|
||||
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
|
103
src/Makefile.d/detect.mk
Normal file
103
src/Makefile.d/detect.mk
Normal file
|
@ -0,0 +1,103 @@
|
|||
#
|
||||
# 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))
|
||||
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),$(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
|
75
src/Makefile.d/features.mk
Normal file
75
src/Makefile.d/features.mk
Normal file
|
@ -0,0 +1,75 @@
|
|||
#
|
||||
# Makefile for feature flags.
|
||||
#
|
||||
|
||||
passthru_opts+=\
|
||||
NONET NO_IPV6 NOHW NOMD5 NOPOSTPROCESSING\
|
||||
MOBJCONSISTANCY PACKETDROP ZDEBUG\
|
||||
HAVE_MINIUPNPC\
|
||||
|
||||
# build with debugging information
|
||||
ifdef DEBUGMODE
|
||||
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
|
||||
|
||||
# (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))))
|
42
src/Makefile.d/nix.mk
Normal file
42
src/Makefile.d/nix.mk
Normal file
|
@ -0,0 +1,42 @@
|
|||
#
|
||||
# Makefile options for unices (linux, bsd...)
|
||||
#
|
||||
|
||||
EXENAME?=lsdl2srb2
|
||||
|
||||
opts+=-DUNIXCOMMON -DLUA_USE_POSIX
|
||||
# Use -rdynamic so a backtrace log shows function names
|
||||
# instead of addresses
|
||||
libs+=-lm -rdynamic
|
||||
|
||||
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,@)
|
177
src/Makefile.d/versions.mk
Normal file
177
src/Makefile.d/versions.mk
Normal file
|
@ -0,0 +1,177 @@
|
|||
#
|
||||
# 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 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
|
||||
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
|
99
src/Makefile.d/win32.mk
Normal file
99
src/Makefile.d/win32.mk
Normal file
|
@ -0,0 +1,99 @@
|
|||
#
|
||||
# Mingw, if you don't know, that's Win32/Win64
|
||||
#
|
||||
|
||||
ifndef MINGW64
|
||||
EXENAME?=srb2win.exe
|
||||
else
|
||||
EXENAME?=srb2win64.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 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 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))
|
98
src/Sourcefile
Normal file
98
src/Sourcefile
Normal file
|
@ -0,0 +1,98 @@
|
|||
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
|
||||
am_map.c
|
||||
command.c
|
||||
console.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_easing.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_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
|
||||
b_bot.c
|
||||
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
|
||||
lua_inputlib.c
|
|
@ -75,7 +75,7 @@ static void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd)
|
|||
return;
|
||||
|
||||
// Lua can handle it!
|
||||
if (LUAh_BotAI(sonic, tails, cmd))
|
||||
if (LUA_HookBotAI(sonic, tails, cmd))
|
||||
return;
|
||||
|
||||
if (tails->player->powers[pw_carry] == CR_MACESPIN || tails->player->powers[pw_carry] == CR_GENERIC)
|
||||
|
@ -363,7 +363,7 @@ void B_BuildTiccmd(player_t *player, ticcmd_t *cmd)
|
|||
CV_SetValue(&cv_analog[1], false);
|
||||
|
||||
// Let Lua scripts build ticcmds
|
||||
if (LUAh_BotTiccmd(player, cmd))
|
||||
if (LUA_HookTiccmd(player, cmd, HOOK(BotTiccmd)))
|
||||
return;
|
||||
|
||||
// We don't have any main character AI, sorry. D:
|
||||
|
@ -461,7 +461,7 @@ boolean B_CheckRespawn(player_t *player)
|
|||
|
||||
// B_RespawnBot doesn't do anything if the condition above this isn't met
|
||||
{
|
||||
UINT8 shouldForce = LUAh_BotRespawn(sonic, tails);
|
||||
UINT8 shouldForce = LUA_Hook2Mobj(sonic, tails, MOBJ_HOOK(BotRespawn));
|
||||
|
||||
if (P_MobjWasRemoved(sonic) || P_MobjWasRemoved(tails))
|
||||
return (shouldForce == 1); // mobj was removed
|
||||
|
|
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
|
|
@ -221,7 +221,7 @@ static void CONS_Bind_f(void)
|
|||
for (key = 0; key < NUMINPUTS; key++)
|
||||
if (bindtable[key])
|
||||
{
|
||||
CONS_Printf("%s : \"%s\"\n", G_KeynumToString(key), bindtable[key]);
|
||||
CONS_Printf("%s : \"%s\"\n", G_KeyNumToString(key), bindtable[key]);
|
||||
na = 1;
|
||||
}
|
||||
if (!na)
|
||||
|
@ -229,7 +229,7 @@ static void CONS_Bind_f(void)
|
|||
return;
|
||||
}
|
||||
|
||||
key = G_KeyStringtoNum(COM_Argv(1));
|
||||
key = G_KeyStringToNum(COM_Argv(1));
|
||||
if (key <= 0 || key >= NUMINPUTS)
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("Invalid key name\n"));
|
||||
|
@ -1697,7 +1697,10 @@ static void CON_DrawHudlines(void)
|
|||
{
|
||||
charflags = (*p & 0x7f) << V_CHARCOLORSHIFT;
|
||||
p++;
|
||||
c++;
|
||||
}
|
||||
if (c >= con_width)
|
||||
break;
|
||||
if (*p < HU_FONTSTART)
|
||||
;//charwidth = 4 * con_scalefactor;
|
||||
else
|
||||
|
@ -1818,7 +1821,10 @@ static void CON_DrawConsole(void)
|
|||
{
|
||||
charflags = (*p & 0x7f) << V_CHARCOLORSHIFT;
|
||||
p++;
|
||||
c++;
|
||||
}
|
||||
if (c >= con_width)
|
||||
break;
|
||||
V_DrawCharacter(x, y, (INT32)(*p) | charflags | cv_constextsize.value | V_NOSCALESTART, true);
|
||||
}
|
||||
}
|
||||
|
|
277
src/d_clisrv.c
277
src/d_clisrv.c
|
@ -1150,15 +1150,14 @@ static boolean CL_SendJoin(void)
|
|||
CONS_Printf(M_GetText("Sending join request...\n"));
|
||||
netbuffer->packettype = PT_CLIENTJOIN;
|
||||
|
||||
netbuffer->u.clientcfg.modversion = MODVERSION;
|
||||
strncpy(netbuffer->u.clientcfg.application,
|
||||
SRB2APPLICATION,
|
||||
sizeof netbuffer->u.clientcfg.application);
|
||||
|
||||
if (splitscreen || botingame)
|
||||
localplayers++;
|
||||
netbuffer->u.clientcfg.localplayers = localplayers;
|
||||
netbuffer->u.clientcfg._255 = 255;
|
||||
netbuffer->u.clientcfg.packetversion = PACKETVERSION;
|
||||
netbuffer->u.clientcfg.version = VERSION;
|
||||
netbuffer->u.clientcfg.subversion = SUBVERSION;
|
||||
strncpy(netbuffer->u.clientcfg.application, SRB2APPLICATION,
|
||||
sizeof netbuffer->u.clientcfg.application);
|
||||
|
||||
CleanupPlayerName(consoleplayer, cv_playername.zstring);
|
||||
if (splitscreen)
|
||||
|
@ -1201,6 +1200,21 @@ static INT32 FindRejoinerNum(SINT8 node)
|
|||
return -1;
|
||||
}
|
||||
|
||||
static UINT8
|
||||
GetRefuseReason (INT32 node)
|
||||
{
|
||||
if (!node || FindRejoinerNum(node) != -1)
|
||||
return 0;
|
||||
else if (bannednode && bannednode[node])
|
||||
return REFUSE_BANNED;
|
||||
else if (!cv_allownewplayer.value)
|
||||
return REFUSE_JOINS_DISABLED;
|
||||
else if (D_NumPlayers() >= cv_maxplayers.value)
|
||||
return REFUSE_SLOTS_FULL;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void SV_SendServerInfo(INT32 node, tic_t servertime)
|
||||
{
|
||||
UINT8 *p;
|
||||
|
@ -1219,14 +1233,7 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime)
|
|||
netbuffer->u.serverinfo.numberofplayer = (UINT8)D_NumPlayers();
|
||||
netbuffer->u.serverinfo.maxplayer = (UINT8)cv_maxplayers.value;
|
||||
|
||||
if (!node || FindRejoinerNum(node) != -1)
|
||||
netbuffer->u.serverinfo.refusereason = 0;
|
||||
else if (!cv_allownewplayer.value)
|
||||
netbuffer->u.serverinfo.refusereason = 1;
|
||||
else if (D_NumPlayers() >= cv_maxplayers.value)
|
||||
netbuffer->u.serverinfo.refusereason = 2;
|
||||
else
|
||||
netbuffer->u.serverinfo.refusereason = 0;
|
||||
netbuffer->u.serverinfo.refusereason = GetRefuseReason(node);
|
||||
|
||||
strncpy(netbuffer->u.serverinfo.gametypename, Gametype_Names[gametype],
|
||||
sizeof netbuffer->u.serverinfo.gametypename);
|
||||
|
@ -1344,9 +1351,6 @@ static boolean SV_SendServerConfig(INT32 node)
|
|||
|
||||
netbuffer->packettype = PT_SERVERCFG;
|
||||
|
||||
netbuffer->u.servercfg.version = VERSION;
|
||||
netbuffer->u.servercfg.subversion = SUBVERSION;
|
||||
|
||||
netbuffer->u.servercfg.serverplayer = (UINT8)serverplayer;
|
||||
netbuffer->u.servercfg.totalslotnum = (UINT8)(doomcom->numslots);
|
||||
netbuffer->u.servercfg.gametic = (tic_t)LONG(gametic);
|
||||
|
@ -1667,20 +1671,24 @@ static void SL_InsertServer(serverinfo_pak* info, SINT8 node)
|
|||
if (serverlistcount >= MAXSERVERLIST)
|
||||
return; // list full
|
||||
|
||||
if (info->_255 != 255)
|
||||
return;/* old packet format */
|
||||
/* check it later if connecting to this one */
|
||||
if (node != servernode)
|
||||
{
|
||||
if (info->_255 != 255)
|
||||
return;/* old packet format */
|
||||
|
||||
if (info->packetversion != PACKETVERSION)
|
||||
return;/* old new packet format */
|
||||
if (info->packetversion != PACKETVERSION)
|
||||
return;/* old new packet format */
|
||||
|
||||
if (info->version != VERSION)
|
||||
return; // Not same version.
|
||||
if (info->version != VERSION)
|
||||
return; // Not same version.
|
||||
|
||||
if (info->subversion != SUBVERSION)
|
||||
return; // Close, but no cigar.
|
||||
if (info->subversion != SUBVERSION)
|
||||
return; // Close, but no cigar.
|
||||
|
||||
if (strcmp(info->application, SRB2APPLICATION))
|
||||
return;/* that's a different mod */
|
||||
if (strcmp(info->application, SRB2APPLICATION))
|
||||
return;/* that's a different mod */
|
||||
}
|
||||
|
||||
i = serverlistcount++;
|
||||
}
|
||||
|
@ -1829,6 +1837,72 @@ void CL_UpdateServerList(boolean internetsearch, INT32 room)
|
|||
|
||||
#endif // ifndef NONET
|
||||
|
||||
static const char * InvalidServerReason (INT32 i)
|
||||
{
|
||||
#define EOT "\nPress ESC\n"
|
||||
|
||||
serverinfo_pak *info = &serverlist[i].info;
|
||||
|
||||
/* magic number for new packet format */
|
||||
if (info->_255 != 255)
|
||||
{
|
||||
return
|
||||
"Outdated server (version unknown).\n" EOT;
|
||||
}
|
||||
|
||||
if (strncmp(info->application, SRB2APPLICATION, sizeof
|
||||
info->application))
|
||||
{
|
||||
return va(
|
||||
"%s cannot connect\n"
|
||||
"to %s servers.\n" EOT,
|
||||
SRB2APPLICATION,
|
||||
info->application);
|
||||
}
|
||||
|
||||
if (
|
||||
info->packetversion != PACKETVERSION ||
|
||||
info->version != VERSION ||
|
||||
info->subversion != SUBVERSION
|
||||
){
|
||||
return va(
|
||||
"Incompatible %s versions.\n"
|
||||
"(server version %d.%d.%d)\n" EOT,
|
||||
SRB2APPLICATION,
|
||||
info->version / 100,
|
||||
info->version % 100,
|
||||
info->subversion);
|
||||
}
|
||||
|
||||
switch (info->refusereason)
|
||||
{
|
||||
case REFUSE_BANNED:
|
||||
return
|
||||
"You have been banned\n"
|
||||
"from the server.\n" EOT;
|
||||
case REFUSE_JOINS_DISABLED:
|
||||
return
|
||||
"The server is not accepting\n"
|
||||
"joins for the moment.\n" EOT;
|
||||
case REFUSE_SLOTS_FULL:
|
||||
return va(
|
||||
"Maximum players reached: %d\n" EOT,
|
||||
info->maxplayer);
|
||||
default:
|
||||
if (info->refusereason)
|
||||
{
|
||||
return
|
||||
"You can't join.\n"
|
||||
"I don't know why,\n"
|
||||
"but you can't join.\n" EOT;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
||||
#undef EOT
|
||||
}
|
||||
|
||||
/** Called by CL_ServerConnectionTicker
|
||||
*
|
||||
* \param asksent The last time we asked the server to join. We re-ask every second in case our request got lost in transmit.
|
||||
|
@ -1859,23 +1933,23 @@ static boolean CL_ServerConnectionSearchTicker(tic_t *asksent)
|
|||
return true;
|
||||
}
|
||||
|
||||
// Quit here rather than downloading files and being refused later.
|
||||
if (serverlist[i].info.refusereason)
|
||||
{
|
||||
D_QuitNetGame();
|
||||
CL_Reset();
|
||||
D_StartTitle();
|
||||
if (serverlist[i].info.refusereason == 1)
|
||||
M_StartMessage(M_GetText("The server is not accepting\njoins for the moment.\n\nPress ESC\n"), NULL, MM_NOTHING);
|
||||
else if (serverlist[i].info.refusereason == 2)
|
||||
M_StartMessage(va(M_GetText("Maximum players reached: %d\n\nPress ESC\n"), serverlist[i].info.maxplayer), NULL, MM_NOTHING);
|
||||
else
|
||||
M_StartMessage(M_GetText("You can't join.\nI don't know why,\nbut you can't join.\n\nPress ESC\n"), NULL, MM_NOTHING);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (client)
|
||||
{
|
||||
const char *reason = InvalidServerReason(i);
|
||||
|
||||
// Quit here rather than downloading files
|
||||
// and being refused later.
|
||||
if (reason)
|
||||
{
|
||||
char *message = Z_StrDup(reason);
|
||||
D_QuitNetGame();
|
||||
CL_Reset();
|
||||
D_StartTitle();
|
||||
M_StartMessage(message, NULL, MM_NOTHING);
|
||||
Z_Free(message);
|
||||
return false;
|
||||
}
|
||||
|
||||
D_ParseFileneeded(serverlist[i].info.fileneedednum,
|
||||
serverlist[i].info.fileneeded);
|
||||
CONS_Printf(M_GetText("Checking files...\n"));
|
||||
|
@ -2536,14 +2610,14 @@ static void CL_RemovePlayer(INT32 playernum, kickreason_t reason)
|
|||
}
|
||||
}
|
||||
|
||||
LUAh_PlayerQuit(&players[playernum], reason); // Lua hook for player quitting
|
||||
LUA_HookPlayerQuit(&players[playernum], reason); // Lua hook for player quitting
|
||||
|
||||
// don't look through someone's view who isn't there
|
||||
if (playernum == displayplayer)
|
||||
{
|
||||
// Call ViewpointSwitch hooks here.
|
||||
// The viewpoint was forcibly changed.
|
||||
LUAh_ViewpointSwitch(&players[consoleplayer], &players[consoleplayer], true);
|
||||
LUA_HookViewpointSwitch(&players[consoleplayer], &players[consoleplayer], true);
|
||||
displayplayer = consoleplayer;
|
||||
}
|
||||
|
||||
|
@ -2952,7 +3026,7 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
|
|||
{
|
||||
case KICK_MSG_GO_AWAY:
|
||||
if (!players[pnum].quittime)
|
||||
HU_AddChatText(va("\x82*%s has been kicked (Go away)", player_names[pnum]), false);
|
||||
HU_AddChatText(va("\x82*%s has been kicked (No reason given)", player_names[pnum]), false);
|
||||
kickreason = KR_KICK;
|
||||
break;
|
||||
case KICK_MSG_PING_HIGH:
|
||||
|
@ -2960,7 +3034,7 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
|
|||
kickreason = KR_PINGLIMIT;
|
||||
break;
|
||||
case KICK_MSG_CON_FAIL:
|
||||
HU_AddChatText(va("\x82*%s left the game (Synch Failure)", player_names[pnum]), false);
|
||||
HU_AddChatText(va("\x82*%s left the game (Synch failure)", player_names[pnum]), false);
|
||||
kickreason = KR_SYNCH;
|
||||
|
||||
if (M_CheckParm("-consisdump")) // Helps debugging some problems
|
||||
|
@ -3006,7 +3080,7 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
|
|||
kickreason = KR_LEAVE;
|
||||
break;
|
||||
case KICK_MSG_BANNED:
|
||||
HU_AddChatText(va("\x82*%s has been banned (Don't come back)", player_names[pnum]), false);
|
||||
HU_AddChatText(va("\x82*%s has been banned (No reason given)", player_names[pnum]), false);
|
||||
kickreason = KR_BAN;
|
||||
break;
|
||||
case KICK_MSG_CUSTOM_KICK:
|
||||
|
@ -3023,7 +3097,7 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
|
|||
|
||||
if (pnum == consoleplayer)
|
||||
{
|
||||
LUAh_GameQuit(false);
|
||||
LUA_HookBool(false, HOOK(GameQuit));
|
||||
#ifdef DUMPCONSISTENCY
|
||||
if (msg == KICK_MSG_CON_FAIL) SV_SavedGame();
|
||||
#endif
|
||||
|
@ -3443,7 +3517,7 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
|
|||
COM_BufAddText(va("sayto %d %s\n", newplayernum, motd));
|
||||
|
||||
if (!rejoined)
|
||||
LUAh_PlayerJoin(newplayernum);
|
||||
LUA_HookInt(newplayernum, HOOK(PlayerJoin));
|
||||
}
|
||||
|
||||
static boolean SV_AddWaitingPlayers(const char *name, const char *name2)
|
||||
|
@ -3620,6 +3694,78 @@ static size_t TotalTextCmdPerTic(tic_t tic)
|
|||
return total;
|
||||
}
|
||||
|
||||
static const char *
|
||||
ConnectionRefused (SINT8 node, INT32 rejoinernum)
|
||||
{
|
||||
clientconfig_pak *cc = &netbuffer->u.clientcfg;
|
||||
|
||||
boolean rejoining = (rejoinernum != -1);
|
||||
|
||||
if (!node)/* server connecting to itself */
|
||||
return NULL;
|
||||
|
||||
if (
|
||||
cc->modversion != MODVERSION ||
|
||||
strncmp(cc->application, SRB2APPLICATION,
|
||||
sizeof cc->application)
|
||||
){
|
||||
return/* this is probably client's fault */
|
||||
"Incompatible.";
|
||||
}
|
||||
else if (bannednode && bannednode[node])
|
||||
{
|
||||
return
|
||||
"You have been banned\n"
|
||||
"from the server.";
|
||||
}
|
||||
else if (cc->localplayers != 1)
|
||||
{
|
||||
return
|
||||
"Wrong player count.";
|
||||
}
|
||||
|
||||
if (!rejoining)
|
||||
{
|
||||
if (!cv_allownewplayer.value)
|
||||
{
|
||||
return
|
||||
"The server is not accepting\n"
|
||||
"joins for the moment.";
|
||||
}
|
||||
else if (D_NumPlayers() >= cv_maxplayers.value)
|
||||
{
|
||||
return va(
|
||||
"Maximum players reached: %d",
|
||||
cv_maxplayers.value);
|
||||
}
|
||||
}
|
||||
|
||||
if (luafiletransfers)
|
||||
{
|
||||
return
|
||||
"The serveris broadcasting a file\n"
|
||||
"requested by a Lua script.\n"
|
||||
"Please wait a bit and then\n"
|
||||
"try rejoining.";
|
||||
}
|
||||
|
||||
if (netgame)
|
||||
{
|
||||
const tic_t th = 2 * cv_joindelay.value * TICRATE;
|
||||
|
||||
if (joindelay > th)
|
||||
{
|
||||
return va(
|
||||
"Too many people are connecting.\n"
|
||||
"Please wait %d seconds and then\n"
|
||||
"try rejoining.",
|
||||
(joindelay - th) / TICRATE);
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/** Called when a PT_CLIENTJOIN packet is received
|
||||
*
|
||||
* \param node The packet sender
|
||||
|
@ -3630,33 +3776,14 @@ static void HandleConnect(SINT8 node)
|
|||
char names[MAXSPLITSCREENPLAYERS][MAXPLAYERNAME + 1];
|
||||
INT32 rejoinernum;
|
||||
INT32 i;
|
||||
const char *refuse;
|
||||
|
||||
rejoinernum = FindRejoinerNum(node);
|
||||
|
||||
if (bannednode && bannednode[node])
|
||||
SV_SendRefuse(node, M_GetText("You have been banned\nfrom the server."));
|
||||
else if (netbuffer->u.clientcfg._255 != 255 ||
|
||||
netbuffer->u.clientcfg.packetversion != PACKETVERSION)
|
||||
SV_SendRefuse(node, "Incompatible packet formats.");
|
||||
else if (strncmp(netbuffer->u.clientcfg.application, SRB2APPLICATION,
|
||||
sizeof netbuffer->u.clientcfg.application))
|
||||
SV_SendRefuse(node, "Different SRB2 modifications\nare not compatible.");
|
||||
else if (netbuffer->u.clientcfg.version != VERSION
|
||||
|| netbuffer->u.clientcfg.subversion != SUBVERSION)
|
||||
SV_SendRefuse(node, va(M_GetText("Different SRB2 versions cannot\nplay a netgame!\n(server version %d.%d.%d)"), VERSION/100, VERSION%100, SUBVERSION));
|
||||
else if (!cv_allownewplayer.value && node && rejoinernum == -1)
|
||||
SV_SendRefuse(node, M_GetText("The server is not accepting\njoins for the moment."));
|
||||
else if (D_NumPlayers() >= cv_maxplayers.value && rejoinernum == -1)
|
||||
SV_SendRefuse(node, va(M_GetText("Maximum players reached: %d"), cv_maxplayers.value));
|
||||
else if (netgame && netbuffer->u.clientcfg.localplayers > 1) // Hacked client?
|
||||
SV_SendRefuse(node, M_GetText("Too many players from\nthis node."));
|
||||
else if (netgame && !netbuffer->u.clientcfg.localplayers) // Stealth join?
|
||||
SV_SendRefuse(node, M_GetText("No players from\nthis node."));
|
||||
else if (luafiletransfers)
|
||||
SV_SendRefuse(node, M_GetText("The server is broadcasting a file\nrequested by a Lua script.\nPlease wait a bit and then\ntry rejoining."));
|
||||
else if (netgame && joindelay > 2 * (tic_t)cv_joindelay.value * TICRATE)
|
||||
SV_SendRefuse(node, va(M_GetText("Too many people are connecting.\nPlease wait %d seconds and then\ntry rejoining."),
|
||||
(joindelay - 2 * cv_joindelay.value * TICRATE) / TICRATE));
|
||||
refuse = ConnectionRefused(node, rejoinernum);
|
||||
|
||||
if (refuse)
|
||||
SV_SendRefuse(node, refuse);
|
||||
else
|
||||
{
|
||||
#ifndef NONET
|
||||
|
@ -3723,7 +3850,7 @@ static void HandleConnect(SINT8 node)
|
|||
static void HandleShutdown(SINT8 node)
|
||||
{
|
||||
(void)node;
|
||||
LUAh_GameQuit(false);
|
||||
LUA_HookBool(false, HOOK(GameQuit));
|
||||
D_QuitNetGame();
|
||||
CL_Reset();
|
||||
D_StartTitle();
|
||||
|
@ -3738,7 +3865,7 @@ static void HandleShutdown(SINT8 node)
|
|||
static void HandleTimeout(SINT8 node)
|
||||
{
|
||||
(void)node;
|
||||
LUAh_GameQuit(false);
|
||||
LUA_HookBool(false, HOOK(GameQuit));
|
||||
D_QuitNetGame();
|
||||
CL_Reset();
|
||||
D_StartTitle();
|
||||
|
|
|
@ -22,11 +22,15 @@
|
|||
#include "mserv.h"
|
||||
|
||||
/*
|
||||
The 'packet version' is used to distinguish packet formats.
|
||||
This version is independent of VERSION and SUBVERSION. Different
|
||||
applications may follow different packet versions.
|
||||
The 'packet version' is used to distinguish packet
|
||||
formats. This version is independent of VERSION and
|
||||
SUBVERSION. Different applications may follow different
|
||||
packet versions.
|
||||
|
||||
If you change the struct or the meaning of a field
|
||||
therein, increment this number.
|
||||
*/
|
||||
#define PACKETVERSION 3
|
||||
#define PACKETVERSION 4
|
||||
|
||||
// Network play related stuff.
|
||||
// There is a data struct that stores network
|
||||
|
@ -141,9 +145,6 @@ typedef struct
|
|||
|
||||
typedef struct
|
||||
{
|
||||
UINT8 version; // Different versions don't work
|
||||
UINT8 subversion; // Contains build version
|
||||
|
||||
// Server launch stuffs
|
||||
UINT8 serverplayer;
|
||||
UINT8 totalslotnum; // "Slots": highest player number in use plus one.
|
||||
|
@ -190,16 +191,19 @@ typedef struct
|
|||
|
||||
typedef struct
|
||||
{
|
||||
UINT8 _255;/* see serverinfo_pak */
|
||||
UINT8 packetversion;
|
||||
UINT8 modversion;
|
||||
char application[MAXAPPLICATION];
|
||||
UINT8 version; // Different versions don't work
|
||||
UINT8 subversion; // Contains build version
|
||||
UINT8 localplayers;
|
||||
UINT8 mode;
|
||||
char names[MAXSPLITSCREENPLAYERS][MAXPLAYERNAME];
|
||||
} ATTRPACK clientconfig_pak;
|
||||
|
||||
enum {
|
||||
REFUSE_JOINS_DISABLED = 1,
|
||||
REFUSE_SLOTS_FULL,
|
||||
REFUSE_BANNED,
|
||||
};
|
||||
|
||||
#define MAXSERVERNAME 32
|
||||
#define MAXFILENEEDED 915
|
||||
// This packet is too large
|
||||
|
@ -217,7 +221,7 @@ typedef struct
|
|||
UINT8 subversion;
|
||||
UINT8 numberofplayer;
|
||||
UINT8 maxplayer;
|
||||
UINT8 refusereason; // 0: joinable, 1: joins disabled, 2: full
|
||||
UINT8 refusereason; // 0: joinable, REFUSE enum
|
||||
char gametypename[24];
|
||||
UINT8 modifiedgame;
|
||||
UINT8 cheatsenabled;
|
||||
|
|
63
src/d_main.c
63
src/d_main.c
|
@ -175,10 +175,53 @@ void D_ProcessEvents(void)
|
|||
|
||||
boolean eaten;
|
||||
|
||||
// Reset possibly stale mouse info
|
||||
G_SetMouseDeltas(0, 0, 1);
|
||||
G_SetMouseDeltas(0, 0, 2);
|
||||
mouse.buttons &= ~(MB_SCROLLUP|MB_SCROLLDOWN);
|
||||
mouse2.buttons &= ~(MB_SCROLLUP|MB_SCROLLDOWN);
|
||||
|
||||
for (; eventtail != eventhead; eventtail = (eventtail+1) & (MAXEVENTS-1))
|
||||
{
|
||||
boolean hooked = false;
|
||||
|
||||
ev = &events[eventtail];
|
||||
|
||||
// Set mouse buttons early in case event is eaten later
|
||||
if (ev->type == ev_keydown || ev->type == ev_keyup)
|
||||
{
|
||||
// Mouse buttons
|
||||
if ((UINT32)(ev->data1 - KEY_MOUSE1) < MOUSEBUTTONS)
|
||||
{
|
||||
if (ev->type == ev_keydown)
|
||||
mouse.buttons |= 1 << (ev->data1 - KEY_MOUSE1);
|
||||
else
|
||||
mouse.buttons &= ~(1 << (ev->data1 - KEY_MOUSE1));
|
||||
}
|
||||
else if ((UINT32)(ev->data1 - KEY_2MOUSE1) < MOUSEBUTTONS)
|
||||
{
|
||||
if (ev->type == ev_keydown)
|
||||
mouse2.buttons |= 1 << (ev->data1 - KEY_2MOUSE1);
|
||||
else
|
||||
mouse2.buttons &= ~(1 << (ev->data1 - KEY_2MOUSE1));
|
||||
}
|
||||
// Scroll (has no keyup event)
|
||||
else switch (ev->data1) {
|
||||
case KEY_MOUSEWHEELUP:
|
||||
mouse.buttons |= MB_SCROLLUP;
|
||||
break;
|
||||
case KEY_MOUSEWHEELDOWN:
|
||||
mouse.buttons |= MB_SCROLLDOWN;
|
||||
break;
|
||||
case KEY_2MOUSEWHEELUP:
|
||||
mouse2.buttons |= MB_SCROLLUP;
|
||||
break;
|
||||
case KEY_2MOUSEWHEELDOWN:
|
||||
mouse2.buttons |= MB_SCROLLDOWN;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Screenshots over everything so that they can be taken anywhere.
|
||||
if (M_ScreenshotResponder(ev))
|
||||
continue; // ate the event
|
||||
|
@ -189,6 +232,12 @@ void D_ProcessEvents(void)
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!CON_Ready() && !menuactive) {
|
||||
if (G_LuaResponder(ev))
|
||||
continue;
|
||||
hooked = true;
|
||||
}
|
||||
|
||||
// Menu input
|
||||
#ifdef HAVE_THREADS
|
||||
I_lock_mutex(&m_menu_mutex);
|
||||
|
@ -203,6 +252,12 @@ void D_ProcessEvents(void)
|
|||
if (eaten)
|
||||
continue; // menu ate the event
|
||||
|
||||
if (!hooked && !CON_Ready()) {
|
||||
if (G_LuaResponder(ev))
|
||||
continue;
|
||||
hooked = true;
|
||||
}
|
||||
|
||||
// console input
|
||||
#ifdef HAVE_THREADS
|
||||
I_lock_mutex(&con_mutex);
|
||||
|
@ -217,8 +272,16 @@ void D_ProcessEvents(void)
|
|||
if (eaten)
|
||||
continue; // ate the event
|
||||
|
||||
if (!hooked && G_LuaResponder(ev))
|
||||
continue;
|
||||
|
||||
G_Responder(ev);
|
||||
}
|
||||
|
||||
if (mouse.rdx || mouse.rdy)
|
||||
G_SetMouseDeltas(mouse.rdx, mouse.rdy, 1);
|
||||
if (mouse2.rdx || mouse2.rdy)
|
||||
G_SetMouseDeltas(mouse2.rdx, mouse2.rdy, 2);
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -1313,8 +1313,9 @@ static void SendNameAndColor(void)
|
|||
cv_skin.value = R_SkinAvailable(cv_skin.string);
|
||||
if ((cv_skin.value < 0) || !R_SkinUsable(consoleplayer, cv_skin.value))
|
||||
{
|
||||
CV_StealthSet(&cv_skin, DEFAULTSKIN);
|
||||
cv_skin.value = 0;
|
||||
INT32 defaultSkinNum = GetPlayerDefaultSkin(consoleplayer);
|
||||
CV_StealthSet(&cv_skin, skins[defaultSkinNum].name);
|
||||
cv_skin.value = defaultSkinNum;
|
||||
}
|
||||
|
||||
// Finally write out the complete packet and send it off.
|
||||
|
@ -1475,7 +1476,8 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
|
|||
if (server && (p != &players[consoleplayer] && p != &players[secondarydisplayplayer]))
|
||||
{
|
||||
boolean kick = false;
|
||||
INT32 s;
|
||||
UINT32 unlockShift = 0;
|
||||
UINT32 i;
|
||||
|
||||
// team colors
|
||||
if (G_GametypeHasTeams())
|
||||
|
@ -1491,12 +1493,29 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
|
|||
kick = true;
|
||||
|
||||
// availabilities
|
||||
for (s = 0; s < MAXSKINS; s++)
|
||||
for (i = 0; i < MAXUNLOCKABLES; i++)
|
||||
{
|
||||
if (!skins[s].availability && (p->availabilities & (1 << s)))
|
||||
if (unlockables[i].type != SECRET_SKIN)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
unlockShift++;
|
||||
}
|
||||
|
||||
// If they set an invalid bit to true, then likely a modified client
|
||||
if (unlockShift < 32) // 32 is the max the data type allows
|
||||
{
|
||||
UINT32 illegalMask = UINT32_MAX;
|
||||
|
||||
for (i = 0; i < unlockShift; i++)
|
||||
{
|
||||
illegalMask &= ~(1 << i);
|
||||
}
|
||||
|
||||
if ((p->availabilities & illegalMask) != 0)
|
||||
{
|
||||
kick = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2098,7 +2117,7 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
|
|||
}
|
||||
|
||||
mapnumber = M_MapNumber(mapname[3], mapname[4]);
|
||||
LUAh_MapChange(mapnumber);
|
||||
LUA_HookInt(mapnumber, HOOK(MapChange));
|
||||
|
||||
G_InitNew(ultimatemode, mapname, resetplayer, skipprecutscene, FLS);
|
||||
if (demoplayback && !timingdemo)
|
||||
|
@ -2683,7 +2702,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
|||
}
|
||||
|
||||
// Don't switch team, just go away, please, go awaayyyy, aaauuauugghhhghgh
|
||||
if (!LUAh_TeamSwitch(&players[playernum], NetPacket.packet.newteam, players[playernum].spectator, NetPacket.packet.autobalance, NetPacket.packet.scrambled))
|
||||
if (!LUA_HookTeamSwitch(&players[playernum], NetPacket.packet.newteam, players[playernum].spectator, NetPacket.packet.autobalance, NetPacket.packet.scrambled))
|
||||
return;
|
||||
|
||||
//no status changes after hidetime
|
||||
|
@ -2844,7 +2863,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
|||
// Call ViewpointSwitch hooks here.
|
||||
// The viewpoint was forcibly changed.
|
||||
if (displayplayer != consoleplayer) // You're already viewing yourself. No big deal.
|
||||
LUAh_ViewpointSwitch(&players[consoleplayer], &players[consoleplayer], true);
|
||||
LUA_HookViewpointSwitch(&players[consoleplayer], &players[consoleplayer], true);
|
||||
displayplayer = consoleplayer;
|
||||
}
|
||||
|
||||
|
@ -3607,7 +3626,7 @@ static void Command_Playintro_f(void)
|
|||
*/
|
||||
FUNCNORETURN static ATTRNORETURN void Command_Quit_f(void)
|
||||
{
|
||||
LUAh_GameQuit(true);
|
||||
LUA_HookBool(true, HOOK(GameQuit));
|
||||
I_Quit();
|
||||
}
|
||||
|
||||
|
@ -4269,7 +4288,7 @@ void Command_ExitGame_f(void)
|
|||
{
|
||||
INT32 i;
|
||||
|
||||
LUAh_GameQuit(false);
|
||||
LUA_HookBool(false, HOOK(GameQuit));
|
||||
|
||||
D_QuitNetGame();
|
||||
CL_Reset();
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
#pragma interface
|
||||
#endif
|
||||
|
||||
#define MAXPREDICTTICS 12
|
||||
|
||||
// Button/action code definitions.
|
||||
typedef enum
|
||||
{
|
||||
|
@ -63,6 +65,7 @@ typedef struct
|
|||
INT16 angleturn; // <<16 for angle delta - saved as 1 byte into demos
|
||||
INT16 aiming; // vertical aiming, see G_BuildTicCmd
|
||||
UINT16 buttons;
|
||||
UINT8 latency; // Netgames: how many tics ago was this ticcmd generated from this player's end?
|
||||
} ATTRPACK ticcmd_t;
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
|
|
|
@ -127,6 +127,33 @@ static float searchfvalue(const char *s)
|
|||
#endif
|
||||
|
||||
// These are for clearing all of various things
|
||||
void clear_emblems(void)
|
||||
{
|
||||
INT32 i;
|
||||
|
||||
for (i = 0; i < MAXEMBLEMS; ++i)
|
||||
{
|
||||
Z_Free(emblemlocations[i].stringVar);
|
||||
emblemlocations[i].stringVar = NULL;
|
||||
}
|
||||
|
||||
memset(&emblemlocations, 0, sizeof(emblemlocations));
|
||||
numemblems = 0;
|
||||
}
|
||||
|
||||
void clear_unlockables(void)
|
||||
{
|
||||
INT32 i;
|
||||
|
||||
for (i = 0; i < MAXUNLOCKABLES; ++i)
|
||||
{
|
||||
Z_Free(unlockables[i].stringVar);
|
||||
unlockables[i].stringVar = NULL;
|
||||
}
|
||||
|
||||
memset(&unlockables, 0, sizeof(unlockables));
|
||||
}
|
||||
|
||||
void clear_conditionsets(void)
|
||||
{
|
||||
UINT8 i;
|
||||
|
@ -2978,7 +3005,12 @@ void reademblemdata(MYFILE *f, INT32 num)
|
|||
else if (fastcmp(word, "COLOR"))
|
||||
emblemlocations[num-1].color = get_number(word2);
|
||||
else if (fastcmp(word, "VAR"))
|
||||
{
|
||||
Z_Free(emblemlocations[num-1].stringVar);
|
||||
emblemlocations[num-1].stringVar = Z_StrDup(word2);
|
||||
|
||||
emblemlocations[num-1].var = get_number(word2);
|
||||
}
|
||||
else
|
||||
deh_warning("Emblem %d: unknown word '%s'", num, word);
|
||||
}
|
||||
|
@ -3180,11 +3212,16 @@ void readunlockable(MYFILE *f, INT32 num)
|
|||
unlockables[num].type = SECRET_WARP;
|
||||
else if (fastcmp(word2, "SOUNDTEST"))
|
||||
unlockables[num].type = SECRET_SOUNDTEST;
|
||||
else if (fastcmp(word2, "SKIN"))
|
||||
unlockables[num].type = SECRET_SKIN;
|
||||
else
|
||||
unlockables[num].type = (INT16)i;
|
||||
}
|
||||
else if (fastcmp(word, "VAR"))
|
||||
{
|
||||
Z_Free(unlockables[num].stringVar);
|
||||
unlockables[num].stringVar = Z_StrDup(word2);
|
||||
|
||||
// Support using the actual map name,
|
||||
// i.e., Level AB, Level FZ, etc.
|
||||
|
||||
|
|
|
@ -81,6 +81,8 @@ void readskincolor(MYFILE *f, INT32 num);
|
|||
void readthing(MYFILE *f, INT32 num);
|
||||
void readfreeslots(MYFILE *f);
|
||||
void readPlayer(MYFILE *f, INT32 num);
|
||||
void clear_emblems(void);
|
||||
void clear_unlockables(void);
|
||||
void clear_levels(void);
|
||||
void clear_conditionsets(void);
|
||||
#endif
|
||||
|
|
|
@ -22,6 +22,9 @@
|
|||
#include "v_video.h" // video flags (for lua)
|
||||
#include "i_sound.h" // musictype_t (for lua)
|
||||
#include "g_state.h" // gamestate_t (for lua)
|
||||
#include "g_game.h" // Joystick axes (for lua)
|
||||
#include "i_joy.h"
|
||||
#include "g_input.h" // Game controls (for lua)
|
||||
|
||||
#include "deh_tables.h"
|
||||
|
||||
|
@ -5455,6 +5458,76 @@ struct int_const_s const INT_CONST[] = {
|
|||
{"GS_DEDICATEDSERVER",GS_DEDICATEDSERVER},
|
||||
{"GS_WAITINGPLAYERS",GS_WAITINGPLAYERS},
|
||||
|
||||
// Joystick axes
|
||||
{"JA_NONE",JA_NONE},
|
||||
{"JA_TURN",JA_TURN},
|
||||
{"JA_MOVE",JA_MOVE},
|
||||
{"JA_LOOK",JA_LOOK},
|
||||
{"JA_STRAFE",JA_STRAFE},
|
||||
{"JA_DIGITAL",JA_DIGITAL},
|
||||
{"JA_JUMP",JA_JUMP},
|
||||
{"JA_SPIN",JA_SPIN},
|
||||
{"JA_FIRE",JA_FIRE},
|
||||
{"JA_FIRENORMAL",JA_FIRENORMAL},
|
||||
{"JOYAXISRANGE",JOYAXISRANGE},
|
||||
|
||||
// Game controls
|
||||
{"gc_null",gc_null},
|
||||
{"gc_forward",gc_forward},
|
||||
{"gc_backward",gc_backward},
|
||||
{"gc_strafeleft",gc_strafeleft},
|
||||
{"gc_straferight",gc_straferight},
|
||||
{"gc_turnleft",gc_turnleft},
|
||||
{"gc_turnright",gc_turnright},
|
||||
{"gc_weaponnext",gc_weaponnext},
|
||||
{"gc_weaponprev",gc_weaponprev},
|
||||
{"gc_wepslot1",gc_wepslot1},
|
||||
{"gc_wepslot2",gc_wepslot2},
|
||||
{"gc_wepslot3",gc_wepslot3},
|
||||
{"gc_wepslot4",gc_wepslot4},
|
||||
{"gc_wepslot5",gc_wepslot5},
|
||||
{"gc_wepslot6",gc_wepslot6},
|
||||
{"gc_wepslot7",gc_wepslot7},
|
||||
{"gc_wepslot8",gc_wepslot8},
|
||||
{"gc_wepslot9",gc_wepslot9},
|
||||
{"gc_wepslot10",gc_wepslot10},
|
||||
{"gc_fire",gc_fire},
|
||||
{"gc_firenormal",gc_firenormal},
|
||||
{"gc_tossflag",gc_tossflag},
|
||||
{"gc_spin",gc_spin},
|
||||
{"gc_camtoggle",gc_camtoggle},
|
||||
{"gc_camreset",gc_camreset},
|
||||
{"gc_lookup",gc_lookup},
|
||||
{"gc_lookdown",gc_lookdown},
|
||||
{"gc_centerview",gc_centerview},
|
||||
{"gc_mouseaiming",gc_mouseaiming},
|
||||
{"gc_talkkey",gc_talkkey},
|
||||
{"gc_teamkey",gc_teamkey},
|
||||
{"gc_scores",gc_scores},
|
||||
{"gc_jump",gc_jump},
|
||||
{"gc_console",gc_console},
|
||||
{"gc_pause",gc_pause},
|
||||
{"gc_systemmenu",gc_systemmenu},
|
||||
{"gc_screenshot",gc_screenshot},
|
||||
{"gc_recordgif",gc_recordgif},
|
||||
{"gc_viewpoint",gc_viewpoint},
|
||||
{"gc_custom1",gc_custom1},
|
||||
{"gc_custom2",gc_custom2},
|
||||
{"gc_custom3",gc_custom3},
|
||||
{"num_gamecontrols",num_gamecontrols},
|
||||
|
||||
// Mouse buttons
|
||||
{"MB_BUTTON1",MB_BUTTON1},
|
||||
{"MB_BUTTON2",MB_BUTTON2},
|
||||
{"MB_BUTTON3",MB_BUTTON3},
|
||||
{"MB_BUTTON4",MB_BUTTON4},
|
||||
{"MB_BUTTON5",MB_BUTTON5},
|
||||
{"MB_BUTTON6",MB_BUTTON6},
|
||||
{"MB_BUTTON7",MB_BUTTON7},
|
||||
{"MB_BUTTON8",MB_BUTTON8},
|
||||
{"MB_SCROLLUP",MB_SCROLLUP},
|
||||
{"MB_SCROLLDOWN",MB_SCROLLDOWN},
|
||||
|
||||
{NULL,0}
|
||||
};
|
||||
|
||||
|
|
|
@ -547,13 +547,10 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
|
|||
}
|
||||
|
||||
if (clearall || fastcmp(word2, "UNLOCKABLES"))
|
||||
memset(&unlockables, 0, sizeof(unlockables));
|
||||
clear_unlockables();
|
||||
|
||||
if (clearall || fastcmp(word2, "EMBLEMS"))
|
||||
{
|
||||
memset(&emblemlocations, 0, sizeof(emblemlocations));
|
||||
numemblems = 0;
|
||||
}
|
||||
clear_emblems();
|
||||
|
||||
if (clearall || fastcmp(word2, "EXTRAEMBLEMS"))
|
||||
{
|
||||
|
|
|
@ -337,9 +337,9 @@ typedef struct
|
|||
fixed_t gravity; ///< Map-wide gravity.
|
||||
|
||||
// Title card.
|
||||
char ltzzpatch[8]; ///< Zig zag patch.
|
||||
char ltzztext[8]; ///< Zig zag text.
|
||||
char ltactdiamond[8]; ///< Act diamond.
|
||||
char ltzzpatch[9]; ///< Zig zag patch.
|
||||
char ltzztext[9]; ///< Zig zag text.
|
||||
char ltactdiamond[9]; ///< Act diamond.
|
||||
|
||||
// Freed animals stuff.
|
||||
UINT8 numFlickies; ///< Internal. For freed flicky support.
|
||||
|
@ -496,7 +496,7 @@ extern UINT32 lastcustomtol;
|
|||
|
||||
extern tic_t totalplaytime;
|
||||
|
||||
extern UINT8 stagefailed;
|
||||
extern boolean stagefailed;
|
||||
|
||||
// Emeralds stored as bits to throw savegame hackers off.
|
||||
extern UINT16 emeralds;
|
||||
|
|
|
@ -356,6 +356,8 @@ typedef UINT32 tic_t;
|
|||
#define UINT2RGBA(a) (UINT32)((a&0xff)<<24)|((a&0xff00)<<8)|((a&0xff0000)>>8)|(((UINT32)a&0xff000000)>>24)
|
||||
#endif
|
||||
|
||||
#define TOSTR(x) #x
|
||||
|
||||
/* preprocessor dumb and needs second macro to expand input */
|
||||
#define WSTRING2(s) L ## s
|
||||
#define WSTRING(s) WSTRING2 (s)
|
||||
|
|
|
@ -1063,7 +1063,7 @@ boolean F_IntroResponder(event_t *event)
|
|||
// CREDITS
|
||||
// =========
|
||||
static const char *credits[] = {
|
||||
"\1Sonic Robo Blast II",
|
||||
"\1Sonic Robo Blast 2",
|
||||
"\1Credits",
|
||||
"",
|
||||
"\1Game Design",
|
||||
|
@ -1166,7 +1166,6 @@ static const char *credits[] = {
|
|||
"Alexander \"DrTapeworm\" Moench-Ford",
|
||||
"Stefan \"Stuf\" Rimalia",
|
||||
"Shane Mychal Sexton",
|
||||
"\"Spazzo\"",
|
||||
"David \"Big Wave Dave\" Spencer Sr.",
|
||||
"David \"Instant Sonic\" Spencer Jr.",
|
||||
"\"SSNTails\"",
|
||||
|
@ -1191,7 +1190,6 @@ static const char *credits[] = {
|
|||
"\"Revan\"",
|
||||
"Anna \"QueenDelta\" Sandlin",
|
||||
"Wessel \"sphere\" Smit",
|
||||
"\"Spazzo\"",
|
||||
"\"SSNTails\"",
|
||||
"Rob Tisdell",
|
||||
"\"Torgo\"",
|
||||
|
|
14
src/g_demo.c
14
src/g_demo.c
|
@ -109,6 +109,7 @@ demoghost *ghosts = NULL;
|
|||
#define ZT_ANGLE 0x04
|
||||
#define ZT_BUTTONS 0x08
|
||||
#define ZT_AIMING 0x10
|
||||
#define ZT_LATENCY 0x20
|
||||
#define DEMOMARKER 0x80 // demoend
|
||||
#define METALDEATH 0x44
|
||||
#define METALSNICE 0x69
|
||||
|
@ -181,6 +182,8 @@ void G_ReadDemoTiccmd(ticcmd_t *cmd, INT32 playernum)
|
|||
oldcmd.buttons = (oldcmd.buttons & (BT_CAMLEFT|BT_CAMRIGHT)) | (READUINT16(demo_p) & ~(BT_CAMLEFT|BT_CAMRIGHT));
|
||||
if (ziptic & ZT_AIMING)
|
||||
oldcmd.aiming = READINT16(demo_p);
|
||||
if (ziptic & ZT_LATENCY)
|
||||
oldcmd.latency = READUINT8(demo_p);
|
||||
|
||||
G_CopyTiccmd(cmd, &oldcmd, 1);
|
||||
players[playernum].angleturn = cmd->angleturn;
|
||||
|
@ -238,6 +241,13 @@ void G_WriteDemoTiccmd(ticcmd_t *cmd, INT32 playernum)
|
|||
ziptic |= ZT_AIMING;
|
||||
}
|
||||
|
||||
if (cmd->latency != oldcmd.latency)
|
||||
{
|
||||
WRITEUINT8(demo_p,cmd->latency);
|
||||
oldcmd.latency = cmd->latency;
|
||||
ziptic |= ZT_LATENCY;
|
||||
}
|
||||
|
||||
*ziptic_p = ziptic;
|
||||
|
||||
// attention here for the ticcmd size!
|
||||
|
@ -679,6 +689,8 @@ void G_GhostTicker(void)
|
|||
g->p += 2;
|
||||
if (ziptic & ZT_AIMING)
|
||||
g->p += 2;
|
||||
if (ziptic & ZT_LATENCY)
|
||||
g->p++;
|
||||
|
||||
// Grab ghost data.
|
||||
ziptic = READUINT8(g->p);
|
||||
|
@ -1956,7 +1968,7 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
// Set skin
|
||||
SetPlayerSkin(0, skin);
|
||||
|
||||
LUAh_MapChange(gamemap);
|
||||
LUA_HookInt(gamemap, HOOK(MapChange));
|
||||
displayplayer = consoleplayer = 0;
|
||||
memset(playeringame,0,sizeof(playeringame));
|
||||
playeringame[0] = true;
|
||||
|
|
188
src/g_game.c
188
src/g_game.c
|
@ -169,7 +169,7 @@ static boolean exitgame = false;
|
|||
static boolean retrying = false;
|
||||
static boolean retryingmodeattack = false;
|
||||
|
||||
UINT8 stagefailed; // Used for GEMS BONUS? Also to see if you beat the stage.
|
||||
boolean stagefailed = false; // Used for GEMS BONUS? Also to see if you beat the stage.
|
||||
|
||||
UINT16 emeralds;
|
||||
INT32 luabanks[NUM_LUABANKS];
|
||||
|
@ -406,22 +406,6 @@ consvar_t cv_cam_lockonboss[2] = {
|
|||
CVAR_INIT ("cam2_lockaimassist", "Bosses", CV_SAVE, lockedassist_cons_t, NULL),
|
||||
};
|
||||
|
||||
typedef enum
|
||||
{
|
||||
AXISNONE = 0,
|
||||
AXISTURN,
|
||||
AXISMOVE,
|
||||
AXISLOOK,
|
||||
AXISSTRAFE,
|
||||
|
||||
AXISDIGITAL, // axes below this use digital deadzone
|
||||
|
||||
AXISJUMP,
|
||||
AXISSPIN,
|
||||
AXISFIRE,
|
||||
AXISFIRENORMAL,
|
||||
} axis_input_e;
|
||||
|
||||
consvar_t cv_turnaxis = CVAR_INIT ("joyaxis_turn", "X-Rudder", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_moveaxis = CVAR_INIT ("joyaxis_move", "Y-Axis", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_sideaxis = CVAR_INIT ("joyaxis_side", "X-Axis", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
|
@ -841,7 +825,7 @@ INT16 G_SoftwareClipAimingPitch(INT32 *aiming)
|
|||
return (INT16)((*aiming)>>16);
|
||||
}
|
||||
|
||||
static INT32 JoyAxis(axis_input_e axissel)
|
||||
INT32 JoyAxis(joyaxis_e axissel)
|
||||
{
|
||||
INT32 retaxis;
|
||||
INT32 axisval;
|
||||
|
@ -850,28 +834,28 @@ static INT32 JoyAxis(axis_input_e axissel)
|
|||
//find what axis to get
|
||||
switch (axissel)
|
||||
{
|
||||
case AXISTURN:
|
||||
case JA_TURN:
|
||||
axisval = cv_turnaxis.value;
|
||||
break;
|
||||
case AXISMOVE:
|
||||
case JA_MOVE:
|
||||
axisval = cv_moveaxis.value;
|
||||
break;
|
||||
case AXISLOOK:
|
||||
case JA_LOOK:
|
||||
axisval = cv_lookaxis.value;
|
||||
break;
|
||||
case AXISSTRAFE:
|
||||
case JA_STRAFE:
|
||||
axisval = cv_sideaxis.value;
|
||||
break;
|
||||
case AXISJUMP:
|
||||
case JA_JUMP:
|
||||
axisval = cv_jumpaxis.value;
|
||||
break;
|
||||
case AXISSPIN:
|
||||
case JA_SPIN:
|
||||
axisval = cv_spinaxis.value;
|
||||
break;
|
||||
case AXISFIRE:
|
||||
case JA_FIRE:
|
||||
axisval = cv_fireaxis.value;
|
||||
break;
|
||||
case AXISFIRENORMAL:
|
||||
case JA_FIRENORMAL:
|
||||
axisval = cv_firenaxis.value;
|
||||
break;
|
||||
default:
|
||||
|
@ -903,7 +887,7 @@ static INT32 JoyAxis(axis_input_e axissel)
|
|||
if (retaxis > (+JOYAXISRANGE))
|
||||
retaxis = +JOYAXISRANGE;
|
||||
|
||||
if (!Joystick.bGamepadStyle && axissel > AXISDIGITAL)
|
||||
if (!Joystick.bGamepadStyle && axissel >= JA_DIGITAL)
|
||||
{
|
||||
const INT32 jdeadzone = ((JOYAXISRANGE-1) * cv_digitaldeadzone.value) >> FRACBITS;
|
||||
if (-jdeadzone < retaxis && retaxis < jdeadzone)
|
||||
|
@ -914,7 +898,7 @@ static INT32 JoyAxis(axis_input_e axissel)
|
|||
return retaxis;
|
||||
}
|
||||
|
||||
static INT32 Joy2Axis(axis_input_e axissel)
|
||||
INT32 Joy2Axis(joyaxis_e axissel)
|
||||
{
|
||||
INT32 retaxis;
|
||||
INT32 axisval;
|
||||
|
@ -923,28 +907,28 @@ static INT32 Joy2Axis(axis_input_e axissel)
|
|||
//find what axis to get
|
||||
switch (axissel)
|
||||
{
|
||||
case AXISTURN:
|
||||
case JA_TURN:
|
||||
axisval = cv_turnaxis2.value;
|
||||
break;
|
||||
case AXISMOVE:
|
||||
case JA_MOVE:
|
||||
axisval = cv_moveaxis2.value;
|
||||
break;
|
||||
case AXISLOOK:
|
||||
case JA_LOOK:
|
||||
axisval = cv_lookaxis2.value;
|
||||
break;
|
||||
case AXISSTRAFE:
|
||||
case JA_STRAFE:
|
||||
axisval = cv_sideaxis2.value;
|
||||
break;
|
||||
case AXISJUMP:
|
||||
case JA_JUMP:
|
||||
axisval = cv_jumpaxis2.value;
|
||||
break;
|
||||
case AXISSPIN:
|
||||
case JA_SPIN:
|
||||
axisval = cv_spinaxis2.value;
|
||||
break;
|
||||
case AXISFIRE:
|
||||
case JA_FIRE:
|
||||
axisval = cv_fireaxis2.value;
|
||||
break;
|
||||
case AXISFIRENORMAL:
|
||||
case JA_FIRENORMAL:
|
||||
axisval = cv_firenaxis2.value;
|
||||
break;
|
||||
default:
|
||||
|
@ -978,7 +962,7 @@ static INT32 Joy2Axis(axis_input_e axissel)
|
|||
if (retaxis > (+JOYAXISRANGE))
|
||||
retaxis = +JOYAXISRANGE;
|
||||
|
||||
if (!Joystick2.bGamepadStyle && axissel > AXISDIGITAL)
|
||||
if (!Joystick2.bGamepadStyle && axissel >= JA_DIGITAL)
|
||||
{
|
||||
const INT32 jdeadzone = ((JOYAXISRANGE-1) * cv_digitaldeadzone2.value) >> FRACBITS;
|
||||
if (-jdeadzone < retaxis && retaxis < jdeadzone)
|
||||
|
@ -1094,7 +1078,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
angle_t drawangleoffset = (player->powers[pw_carry] == CR_ROLLOUT) ? ANGLE_180 : 0;
|
||||
INT32 chasecam, chasefreelook, alwaysfreelook, usejoystick, invertmouse, turnmultiplier, mousemove;
|
||||
controlstyle_e controlstyle = G_ControlStyle(ssplayer);
|
||||
INT32 *mx; INT32 *my; INT32 *mly;
|
||||
INT32 mdx, mdy, mldy;
|
||||
|
||||
static INT32 turnheld[2]; // for accelerative turning
|
||||
static boolean keyboard_look[2]; // true if lookup/down using keyboard
|
||||
|
@ -1117,9 +1101,9 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
invertmouse = cv_invertmouse.value;
|
||||
turnmultiplier = cv_cam_turnmultiplier.value;
|
||||
mousemove = cv_mousemove.value;
|
||||
mx = &mousex;
|
||||
my = &mousey;
|
||||
mly = &mlooky;
|
||||
mdx = mouse.dx;
|
||||
mdy = -mouse.dy;
|
||||
mldy = -mouse.mlookdy;
|
||||
G_CopyTiccmd(cmd, I_BaseTiccmd(), 1); // empty, or external driver
|
||||
}
|
||||
else
|
||||
|
@ -1131,12 +1115,15 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
invertmouse = cv_invertmouse2.value;
|
||||
turnmultiplier = cv_cam2_turnmultiplier.value;
|
||||
mousemove = cv_mousemove2.value;
|
||||
mx = &mouse2x;
|
||||
my = &mouse2y;
|
||||
mly = &mlook2y;
|
||||
mdx = mouse2.dx;
|
||||
mdy = -mouse2.dy;
|
||||
mldy = -mouse2.mlookdy;
|
||||
G_CopyTiccmd(cmd, I_BaseTiccmd2(), 1); // empty, or external driver
|
||||
}
|
||||
|
||||
if (menuactive || CON_Ready() || chat_on)
|
||||
mdx = mdy = mldy = 0;
|
||||
|
||||
strafeisturn = controlstyle == CS_SIMPLE && ticcmd_centerviewdown[forplayer] &&
|
||||
((cv_cam_lockedinput[forplayer].value && !ticcmd_ztargetfocus[forplayer]) || (player->pflags & PF_STARTDASH)) &&
|
||||
!player->climbing && player->powers[pw_carry] != CR_MINECART;
|
||||
|
@ -1179,10 +1166,10 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
*myaiming = 0;
|
||||
joyaiming[forplayer] = thisjoyaiming;
|
||||
|
||||
turnaxis = PlayerJoyAxis(ssplayer, AXISTURN);
|
||||
turnaxis = PlayerJoyAxis(ssplayer, JA_TURN);
|
||||
if (strafeisturn)
|
||||
turnaxis += PlayerJoyAxis(ssplayer, AXISSTRAFE);
|
||||
lookaxis = PlayerJoyAxis(ssplayer, AXISLOOK);
|
||||
turnaxis += PlayerJoyAxis(ssplayer, JA_STRAFE);
|
||||
lookaxis = PlayerJoyAxis(ssplayer, JA_LOOK);
|
||||
lookjoystickvector.xaxis = turnaxis;
|
||||
lookjoystickvector.yaxis = lookaxis;
|
||||
G_HandleAxisDeadZone(forplayer, &lookjoystickvector);
|
||||
|
@ -1261,8 +1248,8 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
tta_factor[forplayer] = 0; // suspend turn to angle
|
||||
}
|
||||
|
||||
strafeaxis = strafeisturn ? 0 : PlayerJoyAxis(ssplayer, AXISSTRAFE);
|
||||
moveaxis = PlayerJoyAxis(ssplayer, AXISMOVE);
|
||||
strafeaxis = strafeisturn ? 0 : PlayerJoyAxis(ssplayer, JA_STRAFE);
|
||||
moveaxis = PlayerJoyAxis(ssplayer, JA_MOVE);
|
||||
movejoystickvector.xaxis = strafeaxis;
|
||||
movejoystickvector.yaxis = moveaxis;
|
||||
G_HandleAxisDeadZone(forplayer, &movejoystickvector);
|
||||
|
@ -1318,12 +1305,12 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
}
|
||||
|
||||
// fire with any button/key
|
||||
axis = PlayerJoyAxis(ssplayer, AXISFIRE);
|
||||
axis = PlayerJoyAxis(ssplayer, JA_FIRE);
|
||||
if (PLAYERINPUTDOWN(ssplayer, gc_fire) || (usejoystick && axis > 0))
|
||||
cmd->buttons |= BT_ATTACK;
|
||||
|
||||
// fire normal with any button/key
|
||||
axis = PlayerJoyAxis(ssplayer, AXISFIRENORMAL);
|
||||
axis = PlayerJoyAxis(ssplayer, JA_FIRENORMAL);
|
||||
if (PLAYERINPUTDOWN(ssplayer, gc_firenormal) || (usejoystick && axis > 0))
|
||||
cmd->buttons |= BT_FIRENORMAL;
|
||||
|
||||
|
@ -1339,7 +1326,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
cmd->buttons |= BT_CUSTOM3;
|
||||
|
||||
// use with any button/key
|
||||
axis = PlayerJoyAxis(ssplayer, AXISSPIN);
|
||||
axis = PlayerJoyAxis(ssplayer, JA_SPIN);
|
||||
if (PLAYERINPUTDOWN(ssplayer, gc_spin) || (usejoystick && axis > 0))
|
||||
cmd->buttons |= BT_SPIN;
|
||||
|
||||
|
@ -1457,7 +1444,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
|
||||
|
||||
// jump button
|
||||
axis = PlayerJoyAxis(ssplayer, AXISJUMP);
|
||||
axis = PlayerJoyAxis(ssplayer, JA_JUMP);
|
||||
if (PLAYERINPUTDOWN(ssplayer, gc_jump) || (usejoystick && axis > 0))
|
||||
cmd->buttons |= BT_JUMP;
|
||||
|
||||
|
@ -1476,7 +1463,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
keyboard_look[forplayer] = false;
|
||||
|
||||
// looking up/down
|
||||
*myaiming += (*mly<<19)*player_invert*screen_invert;
|
||||
*myaiming += (mldy<<19)*player_invert*screen_invert;
|
||||
}
|
||||
|
||||
if (analogjoystickmove && joyaiming[forplayer] && lookjoystickvector.yaxis != 0 && configlookaxis != 0)
|
||||
|
@ -1510,24 +1497,22 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
}
|
||||
|
||||
if (!mouseaiming && mousemove)
|
||||
forward += *my;
|
||||
forward += mdy;
|
||||
|
||||
if ((!demoplayback && (player->pflags & PF_SLIDING))) // Analog for mouse
|
||||
side += *mx*2;
|
||||
side += mdx*2;
|
||||
else if (controlstyle == CS_LMAOGALOG)
|
||||
{
|
||||
if (*mx)
|
||||
if (mdx)
|
||||
{
|
||||
if (*mx > 0)
|
||||
if (mdx > 0)
|
||||
cmd->buttons |= BT_CAMRIGHT;
|
||||
else
|
||||
cmd->buttons |= BT_CAMLEFT;
|
||||
}
|
||||
}
|
||||
else
|
||||
cmd->angleturn = (INT16)(cmd->angleturn - (*mx*8));
|
||||
|
||||
*mx = *my = *mly = 0;
|
||||
cmd->angleturn = (INT16)(cmd->angleturn - (mdx*8));
|
||||
|
||||
if (forward > MAXPLMOVE)
|
||||
forward = MAXPLMOVE;
|
||||
|
@ -1687,12 +1672,16 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
|
||||
cmd->angleturn = orighookangle;
|
||||
|
||||
LUAh_PlayerCmd(player, cmd);
|
||||
LUA_HookTiccmd(player, cmd, HOOK(PlayerCmd));
|
||||
|
||||
extra = cmd->angleturn - orighookangle;
|
||||
cmd->angleturn = origangle + extra;
|
||||
*myangle += extra << 16;
|
||||
*myaiming += (cmd->aiming - origaiming) << 16;
|
||||
|
||||
// Send leveltime when this tic was generated to the server for control lag calculations.
|
||||
// Only do this when in a level. Also do this after the hook, so that it can't overwrite this.
|
||||
cmd->latency = (leveltime & 0xFF);
|
||||
}
|
||||
|
||||
//Reset away view if a command is given.
|
||||
|
@ -1701,7 +1690,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
{
|
||||
// Call ViewpointSwitch hooks here.
|
||||
// The viewpoint was forcibly changed.
|
||||
LUAh_ViewpointSwitch(player, &players[consoleplayer], true);
|
||||
LUA_HookViewpointSwitch(player, &players[consoleplayer], true);
|
||||
displayplayer = consoleplayer;
|
||||
}
|
||||
|
||||
|
@ -1724,6 +1713,7 @@ ticcmd_t *G_MoveTiccmd(ticcmd_t* dest, const ticcmd_t* src, const size_t n)
|
|||
dest[i].angleturn = SHORT(src[i].angleturn);
|
||||
dest[i].aiming = (INT16)SHORT(src[i].aiming);
|
||||
dest[i].buttons = (UINT16)SHORT(src[i].buttons);
|
||||
dest[i].latency = src[i].latency;
|
||||
}
|
||||
return dest;
|
||||
}
|
||||
|
@ -1873,8 +1863,8 @@ void G_DoLoadLevel(boolean resetplayer)
|
|||
joyxmove[i] = joyymove[i] = 0;
|
||||
joy2xmove[i] = joy2ymove[i] = 0;
|
||||
}
|
||||
mousex = mousey = 0;
|
||||
mouse2x = mouse2y = 0;
|
||||
G_SetMouseDeltas(0, 0, 1);
|
||||
G_SetMouseDeltas(0, 0, 2);
|
||||
|
||||
// clear hud messages remains (usually from game startup)
|
||||
CON_ClearHUD();
|
||||
|
@ -2074,7 +2064,7 @@ boolean G_Responder(event_t *ev)
|
|||
continue;
|
||||
|
||||
// Call ViewpointSwitch hooks here.
|
||||
canSwitchView = LUAh_ViewpointSwitch(&players[consoleplayer], &players[displayplayer], false);
|
||||
canSwitchView = LUA_HookViewpointSwitch(&players[consoleplayer], &players[displayplayer], false);
|
||||
if (canSwitchView == 1) // Set viewpoint to this player
|
||||
break;
|
||||
else if (canSwitchView == 2) // Skip this player
|
||||
|
@ -2198,6 +2188,16 @@ boolean G_Responder(event_t *ev)
|
|||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// G_LuaResponder
|
||||
// Let Lua handle key events.
|
||||
//
|
||||
boolean G_LuaResponder(event_t *ev)
|
||||
{
|
||||
return (ev->type == ev_keydown && LUA_HookKey(ev->data1, HOOK(KeyDown))) ||
|
||||
(ev->type == ev_keyup && LUA_HookKey(ev->data1, HOOK(KeyUp)));
|
||||
}
|
||||
|
||||
//
|
||||
// G_Ticker
|
||||
// Make ticcmd_ts for the players.
|
||||
|
@ -2306,6 +2306,9 @@ void G_Ticker(boolean run)
|
|||
|
||||
players[i].cmd.angleturn &= ~TICCMD_RECEIVED;
|
||||
players[i].cmd.angleturn |= received;
|
||||
|
||||
// Use the leveltime sent in the player's ticcmd to determine control lag
|
||||
players[i].cmd.latency = min(((leveltime & 0xFF) - players[i].cmd.latency) & 0xFF, MAXPREDICTTICS-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2745,7 +2748,7 @@ void G_SpawnPlayer(INT32 playernum)
|
|||
|
||||
P_SpawnPlayer(playernum);
|
||||
G_MovePlayerToSpawnOrStarpost(playernum);
|
||||
LUAh_PlayerSpawn(&players[playernum]); // Lua hook for player spawning :)
|
||||
LUA_HookPlayer(&players[playernum], HOOK(PlayerSpawn)); // Lua hook for player spawning :)
|
||||
}
|
||||
|
||||
void G_MovePlayerToSpawnOrStarpost(INT32 playernum)
|
||||
|
@ -3095,8 +3098,8 @@ void G_DoReborn(INT32 playernum)
|
|||
joyxmove[i] = joyymove[i] = 0;
|
||||
joy2xmove[i] = joy2ymove[i] = 0;
|
||||
}
|
||||
mousex = mousey = 0;
|
||||
mouse2x = mouse2y = 0;
|
||||
G_SetMouseDeltas(0, 0, 1);
|
||||
G_SetMouseDeltas(0, 0, 2);
|
||||
|
||||
// clear hud messages remains (usually from game startup)
|
||||
CON_ClearHUD();
|
||||
|
@ -3124,7 +3127,7 @@ void G_DoReborn(INT32 playernum)
|
|||
}
|
||||
else
|
||||
{
|
||||
LUAh_MapChange(gamemap);
|
||||
LUA_HookInt(gamemap, HOOK(MapChange));
|
||||
titlecardforreload = true;
|
||||
G_DoLoadLevel(true);
|
||||
titlecardforreload = false;
|
||||
|
@ -3743,7 +3746,7 @@ static void G_UpdateVisited(void)
|
|||
// Update visitation flags?
|
||||
if ((!modifiedgame || savemoddata) // Not modified
|
||||
&& !multiplayer && !demoplayback && (gametype == GT_COOP) // SP/RA/NiGHTS mode
|
||||
&& !(spec && stagefailed)) // Not failed the special stage
|
||||
&& !stagefailed) // Did not fail the stage
|
||||
{
|
||||
UINT8 earnedEmblems;
|
||||
|
||||
|
@ -3928,12 +3931,13 @@ static void G_DoCompleted(void)
|
|||
{
|
||||
token--;
|
||||
|
||||
for (i = 0; i < 7; i++)
|
||||
if (!(emeralds & (1<<i)))
|
||||
{
|
||||
nextmap = ((netgame || multiplayer) ? smpstage_start : sstage_start) + i - 1; // to special stage!
|
||||
break;
|
||||
}
|
||||
if (!nextmapoverride)
|
||||
for (i = 0; i < 7; i++)
|
||||
if (!(emeralds & (1<<i)))
|
||||
{
|
||||
nextmap = ((netgame || multiplayer) ? smpstage_start : sstage_start) + i - 1; // to special stage!
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == 7)
|
||||
{
|
||||
|
@ -3964,7 +3968,7 @@ static void G_DoCompleted(void)
|
|||
// If the current gametype has no intermission screen set, then don't start it.
|
||||
Y_DetermineIntermissionType();
|
||||
|
||||
if ((skipstats && !modeattacking) || (spec && modeattacking && stagefailed) || (intertype == int_none))
|
||||
if ((skipstats && !modeattacking) || (modeattacking && stagefailed) || (intertype == int_none))
|
||||
{
|
||||
G_UpdateVisited();
|
||||
G_HandleSaveLevel();
|
||||
|
@ -3996,8 +4000,15 @@ void G_AfterIntermission(void)
|
|||
|
||||
HU_ClearCEcho();
|
||||
|
||||
if ((gametyperules & GTR_CUTSCENES) && mapheaderinfo[gamemap-1]->cutscenenum && !modeattacking && skipstats <= 1 && (gamecomplete || !(marathonmode & MA_NOCUTSCENES))) // Start a custom cutscene.
|
||||
if ((gametyperules & GTR_CUTSCENES) && mapheaderinfo[gamemap-1]->cutscenenum
|
||||
&& !modeattacking
|
||||
&& skipstats <= 1
|
||||
&& (gamecomplete || !(marathonmode & MA_NOCUTSCENES))
|
||||
&& stagefailed == false)
|
||||
{
|
||||
// Start a custom cutscene.
|
||||
F_StartCustomCutscene(mapheaderinfo[gamemap-1]->cutscenenum-1, false, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (nextmap < 1100-1)
|
||||
|
@ -4619,6 +4630,9 @@ void G_SaveGameOver(UINT32 slot, boolean modifylives)
|
|||
UINT8 *end_p = savebuffer + length;
|
||||
UINT8 *lives_p;
|
||||
SINT8 pllives;
|
||||
#ifdef NEWSKINSAVES
|
||||
INT16 backwardsCompat = 0;
|
||||
#endif
|
||||
|
||||
save_p = savebuffer;
|
||||
// Version check
|
||||
|
@ -4637,9 +4651,23 @@ void G_SaveGameOver(UINT32 slot, boolean modifylives)
|
|||
|
||||
// P_UnArchivePlayer()
|
||||
CHECKPOS
|
||||
(void)READUINT16(save_p);
|
||||
#ifdef NEWSKINSAVES
|
||||
backwardsCompat = READUINT16(save_p);
|
||||
CHECKPOS
|
||||
|
||||
if (backwardsCompat == NEWSKINSAVES) // New save, read skin names
|
||||
#endif
|
||||
{
|
||||
char ourSkinName[SKINNAMESIZE+1];
|
||||
char botSkinName[SKINNAMESIZE+1];
|
||||
|
||||
READSTRINGN(save_p, ourSkinName, SKINNAMESIZE);
|
||||
CHECKPOS
|
||||
|
||||
READSTRINGN(save_p, botSkinName, SKINNAMESIZE);
|
||||
CHECKPOS
|
||||
}
|
||||
|
||||
WRITEUINT8(save_p, numgameovers);
|
||||
CHECKPOS
|
||||
|
||||
|
|
20
src/g_game.h
20
src/g_game.h
|
@ -85,6 +85,25 @@ typedef enum
|
|||
} lockassist_e;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
JA_NONE = 0,
|
||||
JA_TURN,
|
||||
JA_MOVE,
|
||||
JA_LOOK,
|
||||
JA_STRAFE,
|
||||
|
||||
JA_DIGITAL, // axes henceforth use digital deadzone
|
||||
|
||||
JA_JUMP = JA_DIGITAL,
|
||||
JA_SPIN,
|
||||
JA_FIRE,
|
||||
JA_FIRENORMAL,
|
||||
} joyaxis_e;
|
||||
|
||||
INT32 JoyAxis(joyaxis_e axissel);
|
||||
INT32 Joy2Axis(joyaxis_e axissel);
|
||||
|
||||
// mouseaiming (looking up/down with the mouse or keyboard)
|
||||
#define KB_LOOKSPEED (1<<25)
|
||||
#define MAXPLMOVE (50)
|
||||
|
@ -204,6 +223,7 @@ void G_EndGame(void); // moved from y_inter.c/h and renamed
|
|||
|
||||
void G_Ticker(boolean run);
|
||||
boolean G_Responder(event_t *ev);
|
||||
boolean G_LuaResponder(event_t *ev);
|
||||
|
||||
void G_AddPlayer(INT32 playernum);
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue