mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-30 04:50:55 +00:00
Merge branch 'zarrotsu' of http://git.magicalgirl.moe/KartKrew/Kart into zarrotsu
This commit is contained in:
commit
89f239b601
155 changed files with 1990 additions and 1290 deletions
60
.circleci/config.yml
Normal file
60
.circleci/config.yml
Normal file
|
@ -0,0 +1,60 @@
|
|||
version: 2
|
||||
jobs:
|
||||
build:
|
||||
working_directory: /root/SRB2
|
||||
docker:
|
||||
- image: debian:jessie
|
||||
environment:
|
||||
CC: ccache gcc -m32
|
||||
PKG_CONFIG_LIBDIR: /usr/lib/i386-linux-gnu/pkgconfig
|
||||
LIBGME_CFLAGS: -I/usr/include
|
||||
LIBGME_LDFLAGS: -lgme
|
||||
CCACHE_COMPRESS: true
|
||||
WFLAGS: -Wno-unsuffixed-float-constants
|
||||
GCC49: true
|
||||
#- image: ubuntu:trusty
|
||||
# environment:
|
||||
# CC: ccache gcc -m32
|
||||
# PKG_CONFIG_LIBDIR: /usr/lib/i386-linux-gnu/pkgconfig
|
||||
# LIBGME_CFLAGS: -I/usr/include
|
||||
# LIBGME_LDFLAGS: -lgme
|
||||
# CCACHE_COMPRESS: true
|
||||
# WFLAGS: -Wno-unsuffixed-float-constants
|
||||
# GCC48: true
|
||||
steps:
|
||||
- run:
|
||||
name: Add i386 arch
|
||||
command: dpkg --add-architecture i386
|
||||
- run:
|
||||
name: Update APT listing
|
||||
command: apt-get -qq update
|
||||
- run:
|
||||
name: Support S3 upload
|
||||
command: apt-get -qq -y install ca-certificates
|
||||
- restore_cache:
|
||||
keys:
|
||||
- v1-SRB2-APT
|
||||
- run:
|
||||
name: Install SDK
|
||||
command: apt-get -qq -y install git build-essential nasm libpng12-dev:i386 libsdl2-mixer-dev:i386 libgme-dev:i386 gettext ccache wget gcc-multilib upx
|
||||
- save_cache:
|
||||
key: v1-SRB2-APT
|
||||
paths:
|
||||
- /var/cache/apt/archives
|
||||
- checkout
|
||||
- run:
|
||||
name: Clean build
|
||||
command: make -C src LINUX=1 clean
|
||||
- restore_cache:
|
||||
keys:
|
||||
- v1-SRB2-{{ .Branch }}-{{ checksum "objs/Linux/SDL/Release/depend.dep" }}
|
||||
- run:
|
||||
name: Compile
|
||||
command: make -C src LINUX=1 ERRORMODE=1 -k
|
||||
- store_artifacts:
|
||||
path: /root/SRB2/bin/Linux/Release/
|
||||
destination: bin
|
||||
- save_cache:
|
||||
key: v1-SRB2-{{ .Branch }}-{{ checksum "objs/Linux/SDL/Release/depend.dep" }}
|
||||
paths:
|
||||
- /root/.ccache
|
67
.travis.yml
67
.travis.yml
|
@ -100,6 +100,21 @@ matrix:
|
|||
compiler: gcc-6
|
||||
env: WFLAGS="-Wno-tautological-compare"
|
||||
#gcc-6 (Ubuntu 6.1.1-3ubuntu11~14.04.1) 6.1.1 20160511
|
||||
- os: linux
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- libsdl2-mixer-dev
|
||||
- libpng-dev
|
||||
- libgl1-mesa-dev
|
||||
- libgme-dev
|
||||
- p7zip-full
|
||||
- gcc-7
|
||||
compiler: gcc-7
|
||||
env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wimplicit-fallthrough=3"
|
||||
#gcc-7 (Ubuntu 7.2.0-1ubuntu1~14.04) 7.2.0 20170802
|
||||
- os: linux
|
||||
compiler: clang
|
||||
#clang version 3.5.0 (tags/RELEASE_350/final)
|
||||
|
@ -162,6 +177,51 @@ matrix:
|
|||
- clang-3.8
|
||||
compiler: clang-3.8
|
||||
#clang version 3.8.1-svn271127-1~exp1 (branches/release_38)
|
||||
- os: linux
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- llvm-toolchain-precise-3.9
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- libsdl2-mixer-dev
|
||||
- libpng-dev
|
||||
- libgl1-mesa-dev
|
||||
- libgme-dev
|
||||
- p7zip-full
|
||||
- clang-3.9
|
||||
compiler: clang-3.9
|
||||
#clang version 3.9.X
|
||||
# - os: linux
|
||||
# addons:
|
||||
# apt:
|
||||
# sources:
|
||||
# - llvm-toolchain-precise-4.0
|
||||
# - ubuntu-toolchain-r-test
|
||||
# packages:
|
||||
# - libsdl2-mixer-dev
|
||||
# - libpng-dev
|
||||
# - libgl1-mesa-dev
|
||||
# - libgme-dev
|
||||
# - p7zip-full
|
||||
# - clang-4.0
|
||||
# compiler: clang-4.0
|
||||
# #clang version 4.0.X
|
||||
# - os: linux
|
||||
# addons:
|
||||
# apt:
|
||||
# sources:
|
||||
# - llvm-toolchain-precise-5.0
|
||||
# - ubuntu-toolchain-r-test
|
||||
# packages:
|
||||
# - libsdl2-mixer-dev
|
||||
# - libpng-dev
|
||||
# - libgl1-mesa-dev
|
||||
# - libgme-dev
|
||||
# - p7zip-full
|
||||
# - clang-5.0
|
||||
# compiler: clang-5.0
|
||||
# #clang version 5.0.X
|
||||
# - os: osx
|
||||
# osx_image: beta-xcode6.1
|
||||
# #Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
|
||||
|
@ -192,6 +252,9 @@ matrix:
|
|||
- compiler: clang-3.6
|
||||
- compiler: clang-3.7
|
||||
- compiler: clang-3.8
|
||||
- compiler: clang-3.9
|
||||
- compiler: clang-4.0
|
||||
- compiler: clang-5.0
|
||||
|
||||
cache:
|
||||
apt: true
|
||||
|
@ -219,9 +282,9 @@ before_script:
|
|||
|
||||
before_install:
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2_mixer game-music-emu p7zip; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2 sdl2_mixer game-music-emu p7zip; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install cmake||true; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -O -L https://www.libsdl.org/release/SDL2-2.0.4.dmg; hdiutil attach SDL2-2.0.4.dmg; sudo cp -a /Volumes/SDL2/SDL2.framework /Library/Frameworks/; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -O -L https://www.libsdl.org/release/SDL2-2.0.6.dmg; hdiutil attach SDL2-2.0.6.dmg; sudo cp -a /Volumes/SDL2/SDL2.framework /Library/Frameworks/; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -O -L https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.dmg; hdiutil attach SDL2_mixer-2.0.1.dmg; sudo cp -a /Volumes/SDL2_mixer/SDL2_mixer.framework /Library/Frameworks/; fi
|
||||
- mkdir -p $HOME/srb2_cache
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
cmake_minimum_required(VERSION 3.0)
|
||||
project(SRB2
|
||||
VERSION 2.1.17
|
||||
VERSION 2.1.19
|
||||
LANGUAGES C)
|
||||
|
||||
if(${PROJECT_SOURCE_DIR} MATCHES ${PROJECT_BINARY_DIR})
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
[![Build status](https://ci.appveyor.com/api/projects/status/399d4hcw9yy7hg2y?svg=true)](https://ci.appveyor.com/project/STJr/srb2)
|
||||
[![Build status](https://travis-ci.org/STJr/SRB2.svg?branch=master)](https://travis-ci.org/STJr/SRB2)
|
||||
[![CircleCI](https://circleci.com/gh/STJr/SRB2/tree/master.svg?style=svg)](https://circleci.com/gh/STJr/SRB2/tree/master)
|
||||
|
||||
[Sonic Robo Blast 2](https://srb2.org/) is a 3D Sonic the Hedgehog fangame based on a modified version of [Doom Legacy](http://doomlegacy.sourceforge.net/).
|
||||
|
||||
|
|
37
appveyor.yml
37
appveyor.yml
|
@ -1,4 +1,4 @@
|
|||
version: 2.1.17.{branch}-{build}
|
||||
version: 2.1.19.{branch}-{build}
|
||||
os: MinGW
|
||||
|
||||
environment:
|
||||
|
@ -47,7 +47,7 @@ before_build:
|
|||
- upx -V
|
||||
- ccache -V
|
||||
- ccache -s
|
||||
- set SRB2_MFLAGS=-C src MINGW=1 WARNINGMODE=1 GCC53=1 CCACHE=1
|
||||
- set SRB2_MFLAGS=-C src MINGW=1 WARNINGMODE=1 GCC63=1 CCACHE=1 NOOBJDUMP=1
|
||||
|
||||
build_script:
|
||||
- cmd: mingw32-make.exe %SRB2_MFLAGS% %CONFIGURATION%=1 clean
|
||||
|
@ -58,26 +58,29 @@ after_build:
|
|||
- cmd: git rev-parse --short %APPVEYOR_REPO_COMMIT%>%TMP%/gitshort.txt
|
||||
- cmd: set /P GITSHORT=<%TMP%/gitshort.txt
|
||||
- set BUILD_ARCHIVE=%APPVEYOR_REPO_BRANCH%-%GITSHORT%-%CONFIGURATION%.7z
|
||||
- set BUILDSARCHIVE=%APPVEYOR_REPO_BRANCH%-%CONFIGURATION%.7z
|
||||
- cmd: 7z a %BUILD_ARCHIVE% bin\Mingw\Release -xr!.gitignore
|
||||
- appveyor PushArtifact %BUILD_ARCHIVE%
|
||||
- cmd: copy %BUILD_ARCHIVE% %BUILDSARCHIVE%
|
||||
- appveyor PushArtifact %BUILDSARCHIVE%
|
||||
|
||||
test: off
|
||||
|
||||
deploy:
|
||||
- provider: FTP
|
||||
protocol: ftps
|
||||
host:
|
||||
secure: NsLJEPIBvmwCOj8Tg8RoRQ==
|
||||
username:
|
||||
secure: ejxi5mvk7oLYu7QtbYojajEPigMy0mokaKhuEVuDZcA=
|
||||
password:
|
||||
secure: Hbn6Uy3lT0YZ88yFJ3aW4w==
|
||||
folder: appveyor
|
||||
application:
|
||||
active_mode: false
|
||||
on:
|
||||
branch: master
|
||||
appveyor_repo_tag: true
|
||||
#deploy:
|
||||
# - provider: FTP
|
||||
# protocol: ftps
|
||||
# host:
|
||||
# secure: NsLJEPIBvmwCOj8Tg8RoRQ==
|
||||
# username:
|
||||
# secure: ejxi5mvk7oLYu7QtbYojajEPigMy0mokaKhuEVuDZcA=
|
||||
# password:
|
||||
# secure: Hbn6Uy3lT0YZ88yFJ3aW4w==
|
||||
# folder: appveyor
|
||||
# application:
|
||||
# active_mode: false
|
||||
# on:
|
||||
# branch: master
|
||||
# appveyor_repo_tag: true
|
||||
|
||||
|
||||
on_finish:
|
||||
|
|
2
bin/DC/.gitignore
vendored
Normal file
2
bin/DC/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/Dos/Debug/.gitignore
vendored
Normal file
2
bin/Dos/Debug/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/Dos/Release/.gitignore
vendored
Normal file
2
bin/Dos/Release/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/FreeBSD/Debug/.gitignore
vendored
Normal file
2
bin/FreeBSD/Debug/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/FreeBSD/Release/.gitignore
vendored
Normal file
2
bin/FreeBSD/Release/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
6
bin/Mingw/Debug/.gitignore
vendored
6
bin/Mingw/Debug/.gitignore
vendored
|
@ -1,3 +1,3 @@
|
|||
/srb2sdl.exe
|
||||
/srb2win.exe
|
||||
/r_opengl.dll
|
||||
*.exe
|
||||
*.mo
|
||||
r_opengl.dll
|
||||
|
|
6
bin/Mingw/Release/.gitignore
vendored
6
bin/Mingw/Release/.gitignore
vendored
|
@ -1,3 +1,3 @@
|
|||
/srb2sdl.exe
|
||||
/srb2win.exe
|
||||
/r_opengl.dll
|
||||
*.exe
|
||||
*.mo
|
||||
r_opengl.dll
|
||||
|
|
2
bin/SDL/Debug/.gitignore
vendored
Normal file
2
bin/SDL/Debug/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/SDL/Release/.gitignore
vendored
Normal file
2
bin/SDL/Release/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/ARMV4Dbg/.gitignore
vendored
Normal file
2
bin/WinCE/ARMV4Dbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/ARMV4IDbg/.gitignore
vendored
Normal file
2
bin/WinCE/ARMV4IDbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/ARMV4IRel/.gitignore
vendored
Normal file
2
bin/WinCE/ARMV4IRel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/ARMV4Rel/.gitignore
vendored
Normal file
2
bin/WinCE/ARMV4Rel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/ARMV4TDbg/.gitignore
vendored
Normal file
2
bin/WinCE/ARMV4TDbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/ARMV4TRel/.gitignore
vendored
Normal file
2
bin/WinCE/ARMV4TRel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/MIPS16Dbg/.gitignore
vendored
Normal file
2
bin/WinCE/MIPS16Dbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/MIPS16Rel/.gitignore
vendored
Normal file
2
bin/WinCE/MIPS16Rel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/MIPSIIDbg/.gitignore
vendored
Normal file
2
bin/WinCE/MIPSIIDbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/MIPSIIRel/.gitignore
vendored
Normal file
2
bin/WinCE/MIPSIIRel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/MIPSII_FPDbg/.gitignore
vendored
Normal file
2
bin/WinCE/MIPSII_FPDbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/MIPSII_FPRel/.gitignore
vendored
Normal file
2
bin/WinCE/MIPSII_FPRel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/MIPSIVDbg/.gitignore
vendored
Normal file
2
bin/WinCE/MIPSIVDbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/MIPSIVRel/.gitignore
vendored
Normal file
2
bin/WinCE/MIPSIVRel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/MIPSIV_FPDbg/.gitignore
vendored
Normal file
2
bin/WinCE/MIPSIV_FPDbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/MIPSIV_FPRel/.gitignore
vendored
Normal file
2
bin/WinCE/MIPSIV_FPRel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/Release/.gitignore
vendored
Normal file
2
bin/WinCE/Release/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/SH3Dbg/.gitignore
vendored
Normal file
2
bin/WinCE/SH3Dbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/SH3Rel/.gitignore
vendored
Normal file
2
bin/WinCE/SH3Rel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/SH4Dbg/.gitignore
vendored
Normal file
2
bin/WinCE/SH4Dbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/SH4Rel/.gitignore
vendored
Normal file
2
bin/WinCE/SH4Rel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/X86Dbg/.gitignore
vendored
Normal file
2
bin/WinCE/X86Dbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/X86Rel/.gitignore
vendored
Normal file
2
bin/WinCE/X86Rel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/emulatorDbg/.gitignore
vendored
Normal file
2
bin/WinCE/emulatorDbg/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/WinCE/emulatorRel/.gitignore
vendored
Normal file
2
bin/WinCE/emulatorRel/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
bin/dummy/.gitignore
vendored
Normal file
2
bin/dummy/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
8
objs/.gitignore
vendored
Normal file
8
objs/.gitignore
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
#All folders
|
||||
SRB2.res
|
||||
depend.dep
|
||||
depend.ped
|
||||
*.o
|
||||
#VC9 folder only
|
||||
/VC9/Win32
|
||||
/VC9/x64
|
3
objs/DC/SDL/Debug/.gitignore
vendored
3
objs/DC/SDL/Debug/.gitignore
vendored
|
@ -1 +1,2 @@
|
|||
/depend.dep
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
|
|
3
objs/DC/SDL/Release/.gitignore
vendored
3
objs/DC/SDL/Release/.gitignore
vendored
|
@ -1 +1,2 @@
|
|||
/depend.dep
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
|
|
2
objs/FreeBSD/SDL/Debug/.gitignore
vendored
Normal file
2
objs/FreeBSD/SDL/Debug/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
objs/FreeBSD/SDL/Release/.gitignore
vendored
Normal file
2
objs/FreeBSD/SDL/Release/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
4
objs/Linux/SDL/Debug/.gitignore
vendored
4
objs/Linux/SDL/Debug/.gitignore
vendored
|
@ -1,2 +1,2 @@
|
|||
/depend.dep
|
||||
/*.o
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
|
|
4
objs/Linux/SDL/Release/.gitignore
vendored
4
objs/Linux/SDL/Release/.gitignore
vendored
|
@ -1,2 +1,2 @@
|
|||
/depend.dep
|
||||
/*.o
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
|
|
4
objs/Linux64/SDL/Debug/.gitignore
vendored
4
objs/Linux64/SDL/Debug/.gitignore
vendored
|
@ -1,2 +1,2 @@
|
|||
/depend.dep
|
||||
/*.o
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
|
|
4
objs/Linux64/SDL/Release/.gitignore
vendored
4
objs/Linux64/SDL/Release/.gitignore
vendored
|
@ -1,2 +1,2 @@
|
|||
/depend.dep
|
||||
/*.o
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
|
|
2
objs/MasterClient/.gitignore
vendored
Normal file
2
objs/MasterClient/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
objs/MasterServer/.gitignore
vendored
Normal file
2
objs/MasterServer/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
5
objs/Mingw/Debug/.gitignore
vendored
5
objs/Mingw/Debug/.gitignore
vendored
|
@ -1,3 +1,2 @@
|
|||
/SRB2.res
|
||||
/depend.dep
|
||||
/*.o
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
|
|
5
objs/Mingw/Release/.gitignore
vendored
5
objs/Mingw/Release/.gitignore
vendored
|
@ -1,3 +1,2 @@
|
|||
/SRB2.res
|
||||
/depend.dep
|
||||
/*.o
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
|
|
5
objs/Mingw/SDL/Debug/.gitignore
vendored
5
objs/Mingw/SDL/Debug/.gitignore
vendored
|
@ -1,3 +1,2 @@
|
|||
/SRB2.res
|
||||
/depend.dep
|
||||
/*.o
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
|
|
5
objs/Mingw/SDL/Release/.gitignore
vendored
5
objs/Mingw/SDL/Release/.gitignore
vendored
|
@ -1,3 +1,2 @@
|
|||
/SRB2.res
|
||||
/depend.dep
|
||||
/*.o
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
|
|
5
objs/Mingw64/Debug/.gitignore
vendored
5
objs/Mingw64/Debug/.gitignore
vendored
|
@ -1,3 +1,2 @@
|
|||
/SRB2.res
|
||||
/depend.dep
|
||||
/*.o
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
|
|
5
objs/Mingw64/Release/.gitignore
vendored
5
objs/Mingw64/Release/.gitignore
vendored
|
@ -1,3 +1,2 @@
|
|||
/SRB2.res
|
||||
/depend.dep
|
||||
/*.o
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
|
|
5
objs/Mingw64/SDL/Debug/.gitignore
vendored
5
objs/Mingw64/SDL/Debug/.gitignore
vendored
|
@ -1,3 +1,2 @@
|
|||
/SRB2.res
|
||||
/depend.dep
|
||||
/*.o
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
|
|
5
objs/Mingw64/SDL/Release/.gitignore
vendored
5
objs/Mingw64/SDL/Release/.gitignore
vendored
|
@ -1,3 +1,2 @@
|
|||
/SRB2.res
|
||||
/depend.dep
|
||||
/*.o
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
|
|
4
objs/PS3/SDL/Debug/.gitignore
vendored
4
objs/PS3/SDL/Debug/.gitignore
vendored
|
@ -1,2 +1,2 @@
|
|||
/depend.dep
|
||||
/*.o
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
|
|
4
objs/PS3/SDL/Release/.gitignore
vendored
4
objs/PS3/SDL/Release/.gitignore
vendored
|
@ -1,2 +1,2 @@
|
|||
/depend.dep
|
||||
/*.o
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
|
|
3
objs/PSP/SDL/Release/.gitignore
vendored
3
objs/PSP/SDL/Release/.gitignore
vendored
|
@ -1 +1,2 @@
|
|||
/depend.dep
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
|
|
3
objs/SDL/Release/.gitignore
vendored
3
objs/SDL/Release/.gitignore
vendored
|
@ -1 +1,2 @@
|
|||
/depend.ped
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
|
|
2
objs/VC/.gitignore
vendored
2
objs/VC/.gitignore
vendored
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
4
objs/VC9/.gitignore
vendored
4
objs/VC9/.gitignore
vendored
|
@ -1,2 +1,2 @@
|
|||
/Win32
|
||||
/x64
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
|
|
4
objs/Wii/SDL/Debug/.gitignore
vendored
4
objs/Wii/SDL/Debug/.gitignore
vendored
|
@ -1,2 +1,2 @@
|
|||
/depend.dep
|
||||
/*.o
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
|
|
4
objs/Wii/SDL/Release/.gitignore
vendored
4
objs/Wii/SDL/Release/.gitignore
vendored
|
@ -1,2 +1,2 @@
|
|||
/depend.dep
|
||||
/*.o
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
|
|
3
objs/WinCE/SDL/Release/.gitignore
vendored
3
objs/WinCE/SDL/Release/.gitignore
vendored
|
@ -1 +1,2 @@
|
|||
/depend.dep
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
|
|
2
objs/XBOX/SDL/Debug/.gitignore
vendored
Normal file
2
objs/XBOX/SDL/Debug/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
objs/XBOX/SDL/Release/.gitignore
vendored
Normal file
2
objs/XBOX/SDL/Release/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
objs/cygwin/Debug/.gitignore
vendored
Normal file
2
objs/cygwin/Debug/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
objs/cygwin/Release/.gitignore
vendored
Normal file
2
objs/cygwin/Release/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
3
objs/djgppdos/Debug/.gitignore
vendored
3
objs/djgppdos/Debug/.gitignore
vendored
|
@ -1 +1,2 @@
|
|||
/depend.dep
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
|
|
3
objs/djgppdos/Release/.gitignore
vendored
3
objs/djgppdos/Release/.gitignore
vendored
|
@ -1 +1,2 @@
|
|||
/depend.dep
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
|
|
2
objs/dummy/.gitignore
vendored
Normal file
2
objs/dummy/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
4
objs/nds/Debug/.gitignore
vendored
4
objs/nds/Debug/.gitignore
vendored
|
@ -1,2 +1,2 @@
|
|||
/depend.dep
|
||||
/*.o
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
|
|
4
objs/nds/Release/.gitignore
vendored
4
objs/nds/Release/.gitignore
vendored
|
@ -1,2 +1,2 @@
|
|||
/depend.dep
|
||||
/*.o
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
|
|
10
src/Makefile
10
src/Makefile
|
@ -209,7 +209,13 @@ LIBS+=-lm
|
|||
endif
|
||||
|
||||
ifdef SDL
|
||||
include sdl/Makefile.cfg
|
||||
#SDL 2.0
|
||||
ifndef SDL12
|
||||
include sdl/Makefile.cfg
|
||||
#SDL 1.2
|
||||
else
|
||||
include sdl12/Makefile.cfg
|
||||
endif #ifndef SDL12
|
||||
endif #ifdef SDL
|
||||
|
||||
ifdef DISTCC
|
||||
|
@ -513,13 +519,11 @@ OBJS:=$(i_main_o) \
|
|||
# For reference, this is the command I use to build a srb2.pot file from the source code.
|
||||
# (The listed source files are the ones containing translated strings).
|
||||
# FILES=""; for file in `find ./ | grep "\.c" | grep -v svn`; do [ "`grep "M_GetText(" $file`" ] && FILES="$FILES $file"; done; xgettext -d srb2 -o locale/srb2.pot -kM_GetText -F --no-wrap $FILES
|
||||
ifndef NOGETTEXT
|
||||
ifdef GETTEXT
|
||||
POS:=$(BIN)/en.mo
|
||||
|
||||
OPTS+=-DGETTEXT
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef DJGPPDOS
|
||||
all: pre-build $(BIN)/$(EXENAME)
|
||||
|
|
|
@ -7,6 +7,38 @@
|
|||
# and other things
|
||||
#
|
||||
|
||||
ifdef GCC80
|
||||
GCC72=1
|
||||
endif
|
||||
|
||||
ifdef GCC72
|
||||
GCC71=1
|
||||
endif
|
||||
|
||||
ifdef GCC71
|
||||
GCC64=1
|
||||
endif
|
||||
|
||||
ifdef GCC64
|
||||
GCC64=1
|
||||
endif
|
||||
|
||||
ifdef GCC63
|
||||
GCC62=1
|
||||
endif
|
||||
|
||||
ifdef GCC62
|
||||
GCC61=1
|
||||
endif
|
||||
|
||||
ifdef GCC61
|
||||
GCC54=1
|
||||
endif
|
||||
|
||||
ifdef GCC54
|
||||
GCC53=1
|
||||
endif
|
||||
|
||||
ifdef GCC53
|
||||
GCC52=1
|
||||
endif
|
||||
|
@ -164,19 +196,29 @@ ifdef GCC45
|
|||
WFLAGS+=-Wunsuffixed-float-constants
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef NOLDWARNING
|
||||
LDFLAGS+=-Wl,--as-needed
|
||||
endif
|
||||
|
||||
ifdef ERRORMODE
|
||||
WFLAGS+=-Werror
|
||||
endif
|
||||
|
||||
WFLAGS+=$(OLDWFLAGS)
|
||||
|
||||
ifdef GCC43
|
||||
#WFLAGS+=-Wno-error=clobbered
|
||||
endif
|
||||
ifdef GCC46
|
||||
WFLAGS+=-Wno-error=suggest-attribute=noreturn
|
||||
endif
|
||||
WFLAGS+=$(OLDWFLAGS)
|
||||
ifdef GCC54
|
||||
WFLAGS+=-Wno-logical-op -Wno-error=logical-op
|
||||
endif
|
||||
ifdef GCC61
|
||||
WFLAGS+=-Wno-tautological-compare -Wno-error=tautological-compare
|
||||
endif
|
||||
|
||||
|
||||
#indicate platform and what interface use with
|
||||
|
@ -256,9 +298,6 @@ else
|
|||
ifdef LINUX
|
||||
NASMFORMAT=elf -DLINUX
|
||||
SDL=1
|
||||
ifndef NOGETTEXT
|
||||
GETTEXT=1
|
||||
endif
|
||||
ifdef LINUX64
|
||||
OBJDIR:=$(OBJDIR)/Linux64
|
||||
BIN:=$(BIN)/Linux64
|
||||
|
@ -294,29 +333,28 @@ else
|
|||
ifdef MINGW64
|
||||
INTERFACE=win32
|
||||
#NASMFORMAT=win64
|
||||
ifndef NOGETTEXT
|
||||
#GETTEXT=1
|
||||
endif
|
||||
OBJDIR:=$(OBJDIR)/Mingw64
|
||||
BIN:=$(BIN)/Mingw64
|
||||
else
|
||||
ifdef WII
|
||||
INTERFACE=sdl
|
||||
INTERFACE=sdl12
|
||||
NONX86=1
|
||||
STATIC=1
|
||||
PREFIX?=powerpc-eabi
|
||||
SDL=1
|
||||
SDL12=1
|
||||
SDLMAIN=1
|
||||
OBJDIR:=$(OBJDIR)/Wii
|
||||
BIN:=$(BIN)/Wii
|
||||
NOUPX=1
|
||||
else
|
||||
ifdef PS3N
|
||||
INTERFACE=sdl
|
||||
INTERFACE=sdl12
|
||||
NONX86=1
|
||||
STATIC=1
|
||||
PREFIX?=ppu
|
||||
SDL=1
|
||||
SDL12=1
|
||||
# unsure?
|
||||
#SDLMAIN=1
|
||||
# can't compile SDL_mixer for ps3...
|
||||
|
@ -327,41 +365,42 @@ else
|
|||
ifdef MINGW
|
||||
INTERFACE=win32
|
||||
NASMFORMAT=win32
|
||||
ifndef NOGETTEXT
|
||||
GETTEXT=1
|
||||
endif
|
||||
OBJDIR:=$(OBJDIR)/Mingw
|
||||
BIN:=$(BIN)/Mingw
|
||||
else
|
||||
ifdef XBOX
|
||||
INTERFACE=sdl
|
||||
INTERFACE=sdl12
|
||||
NASMFORMAT=win32
|
||||
PREFIX?=/usr/local/openxdk/bin/i386-pc-xbox
|
||||
SDL=1
|
||||
SDL12=1
|
||||
OBJDIR:=$(OBJDIR)/XBOX
|
||||
BIN:=$(BIN)/XBOX
|
||||
else
|
||||
ifdef PSP
|
||||
INTERFACE=sdl
|
||||
INTERFACE=sdl12
|
||||
NONX86=1
|
||||
SDL=1
|
||||
SDL12=1
|
||||
OBJDIR:=$(OBJDIR)/PSP
|
||||
BIN:=$(BIN)/PSP
|
||||
NOUPX=1
|
||||
else
|
||||
ifdef DC
|
||||
INTERFACE=sdl
|
||||
INTERFACE=sdl12
|
||||
NONX86=1
|
||||
SDL=1
|
||||
SDL12=1
|
||||
OBJDIR:=$(OBJDIR)/DC
|
||||
BIN:=$(BIN)/DC
|
||||
NOUPX=1
|
||||
else
|
||||
ifdef WINCE
|
||||
INTERFACE=sdl
|
||||
INTERFACE=sdl12
|
||||
NONX86=1
|
||||
PREFIX?=arm-wince-pe
|
||||
SDL=1
|
||||
SDL12=1
|
||||
OBJDIR:=$(OBJDIR)/WinCE
|
||||
BIN:=$(BIN)/WinCE
|
||||
else
|
||||
|
@ -386,6 +425,12 @@ endif
|
|||
endif
|
||||
endif
|
||||
|
||||
ifdef GP2X
|
||||
ifdef SDL
|
||||
SDL12=1
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef ARCHNAME
|
||||
OBJDIR:=$(OBJDIR)/$(ARCHNAME)
|
||||
BIN:=$(BIN)/$(ARCHNAME)
|
||||
|
@ -419,7 +464,13 @@ OBJDUMP_OPTS?=--wide --source --line-numbers
|
|||
LD=$(CC)
|
||||
|
||||
ifdef SDL
|
||||
# SDL 2.0
|
||||
ifndef SDL12
|
||||
INTERFACE=sdl
|
||||
# SDL 1.2
|
||||
else
|
||||
INTERFACE=sdl12
|
||||
endif
|
||||
OBJDIR:=$(OBJDIR)/SDL
|
||||
endif
|
||||
|
||||
|
|
|
@ -412,7 +412,7 @@ static Instruction symbexec (const Proto *pt, int lastpc, int reg) {
|
|||
case OP_FORLOOP:
|
||||
case OP_FORPREP:
|
||||
checkreg(pt, a+3);
|
||||
/* go through */
|
||||
/* FALLTHRU */
|
||||
case OP_JMP: {
|
||||
int dest = pc+1+b;
|
||||
/* not full check and jump is forward and do not skip `lastpc'? */
|
||||
|
|
|
@ -306,11 +306,12 @@ static void read_string (LexState *ls, int del, SemInfo *seminfo) {
|
|||
save_and_next(ls); /* skip $ */
|
||||
seminfo->ts = luaX_newstring(ls, luaZ_buffer(ls->buff) + 1,
|
||||
luaZ_bufflen(ls->buff) - 2);
|
||||
ls->refstr++; /* expect '\' anytime soon */
|
||||
ls->refstr++; /* expect '\' anytime soon */
|
||||
lua_assert(ls->lookahead.token == TK_EOS);
|
||||
ls->lookahead.token = TK_CONCAT;
|
||||
return;
|
||||
}
|
||||
ls->lookahead.token = TK_CONCAT;
|
||||
return;
|
||||
}
|
||||
/* FALLTHRU */
|
||||
default: {
|
||||
if (!isdigit(ls->current))
|
||||
save_and_next(ls); /* handles \\, \", \', and \? */
|
||||
|
@ -340,7 +341,8 @@ static void read_string (LexState *ls, int del, SemInfo *seminfo) {
|
|||
};
|
||||
|
||||
switch (i) {
|
||||
case 4: save( ls, (c>>8) & 0xff ); // pass-through..
|
||||
case 4: save( ls, (c>>8) & 0xff );
|
||||
/* FALLTHRU */
|
||||
case 2: save( ls, c&0xff );
|
||||
break;
|
||||
case 5:
|
||||
|
@ -350,7 +352,7 @@ static void read_string (LexState *ls, int del, SemInfo *seminfo) {
|
|||
}
|
||||
continue;
|
||||
|
||||
// "\u0000".."\x10FFFF": UTF-8 encoded Unicode
|
||||
// "\u0000".."\x10FFFF": UTF-8 encoded Unicode
|
||||
//
|
||||
// Note that although codes are entered like this (must have min. four digit,
|
||||
// just to tease you!) the actual outcome in the string will vary between
|
||||
|
@ -482,20 +484,22 @@ static int llex (LexState *ls, SemInfo *seminfo) {
|
|||
else if (sep == -1) return '[';
|
||||
else luaX_lexerror(ls, "invalid long string delimiter", TK_STRING);
|
||||
}
|
||||
/* FALLTHRU */
|
||||
case '=': {
|
||||
next(ls);
|
||||
if (ls->current != '=') return '=';
|
||||
else { next(ls); return TK_EQ; }
|
||||
}
|
||||
/* FALLTHRU */
|
||||
case '<': {
|
||||
next(ls);
|
||||
if (ls->current == '<') { next(ls); return TK_SHL; }
|
||||
if (ls->current == '<') { next(ls); return TK_SHL; }
|
||||
if (ls->current != '=') return '<';
|
||||
else { next(ls); return TK_LE; }
|
||||
}
|
||||
case '>': {
|
||||
next(ls);
|
||||
if (ls->current == '>') { next(ls); return TK_SHR; }
|
||||
if (ls->current == '>') { next(ls); return TK_SHR; }
|
||||
if (ls->current != '=') return '>';
|
||||
else { next(ls); return TK_GE; }
|
||||
}
|
||||
|
@ -547,9 +551,10 @@ static int llex (LexState *ls, SemInfo *seminfo) {
|
|||
}
|
||||
case '\\': if (ls->refstr) {
|
||||
ls->refstr--;
|
||||
ls->current = '"'; /* whacky! */
|
||||
return TK_CONCAT;
|
||||
ls->current = '"'; /* whacky! */
|
||||
return TK_CONCAT;
|
||||
}
|
||||
/* FALLTHRU */
|
||||
default: {
|
||||
if (isspace(ls->current)) {
|
||||
lua_assert(!currIsNewline(ls));
|
||||
|
|
|
@ -478,6 +478,7 @@ static TValue *newkey (lua_State *L, Table *t, const TValue *key) {
|
|||
return luaH_getnum(t, k); /* use specialized version */
|
||||
/* else go through */
|
||||
}
|
||||
/* FALLTHRU */
|
||||
default: {
|
||||
Node *n = mainposition(t, key);
|
||||
do { /* check whether `key' is somewhere in the chain */
|
||||
|
|
|
@ -1188,7 +1188,10 @@ finish:
|
|||
CONS_Printf(M_GetText("%s set to %s\n"), var->name, var->string);
|
||||
var->flags &= ~CV_SHOWMODIFONETIME;
|
||||
}
|
||||
DEBFILE(va("%s set to %s\n", var->name, var->string));
|
||||
else // display message in debug file only
|
||||
{
|
||||
DEBFILE(va("%s set to %s\n", var->name, var->string));
|
||||
}
|
||||
var->flags |= CV_MODIFIED;
|
||||
// raise 'on change' code
|
||||
#ifdef HAVE_BLUA
|
||||
|
|
183
src/d_clisrv.c
183
src/d_clisrv.c
|
@ -51,7 +51,7 @@
|
|||
#endif
|
||||
|
||||
#ifdef _XBOX
|
||||
#include "sdl/SRB2XBOX/xboxhelp.h"
|
||||
#include "sdl12/SRB2XBOX/xboxhelp.h"
|
||||
#endif
|
||||
|
||||
//
|
||||
|
@ -1748,9 +1748,7 @@ static boolean CL_ServerConnectionSearchTicker(boolean viams, tic_t *asksent)
|
|||
{
|
||||
#ifndef NONET
|
||||
INT32 i;
|
||||
#endif
|
||||
|
||||
#ifndef NONET
|
||||
// serverlist is updated by GetPacket function
|
||||
if (serverlistcount > 0)
|
||||
{
|
||||
|
@ -1784,7 +1782,20 @@ static boolean CL_ServerConnectionSearchTicker(boolean viams, tic_t *asksent)
|
|||
serverlist[i].info.fileneeded);
|
||||
CONS_Printf(M_GetText("Checking files...\n"));
|
||||
i = CL_CheckFiles();
|
||||
if (i == 2) // cannot join for some reason
|
||||
if (i == 3) // too many files
|
||||
{
|
||||
D_QuitNetGame();
|
||||
CL_Reset();
|
||||
D_StartTitle();
|
||||
M_StartMessage(M_GetText(
|
||||
"You have too many WAD files loaded\n"
|
||||
"to add ones the server is using.\n"
|
||||
"Please restart SRB2 before connecting.\n\n"
|
||||
"Press ESC\n"
|
||||
), NULL, MM_NOTHING);
|
||||
return false;
|
||||
}
|
||||
else if (i == 2) // cannot join for some reason
|
||||
{
|
||||
D_QuitNetGame();
|
||||
CL_Reset();
|
||||
|
@ -1887,6 +1898,7 @@ static boolean CL_ServerConnectionTicker(boolean viams, const char *tmpsave, tic
|
|||
break; // exit the case
|
||||
|
||||
cl_mode = CL_ASKJOIN; // don't break case continue to cljoin request now
|
||||
/* FALLTHRU */
|
||||
|
||||
case CL_ASKJOIN:
|
||||
CL_LoadServerFiles();
|
||||
|
@ -2529,12 +2541,18 @@ static void Command_Nodes(void)
|
|||
|
||||
static void Command_Ban(void)
|
||||
{
|
||||
if (COM_Argc() == 1)
|
||||
if (COM_Argc() < 2)
|
||||
{
|
||||
CONS_Printf(M_GetText("Ban <playername/playernum> <reason>: ban and kick a player\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!netgame) // Don't kick Tails in splitscreen!
|
||||
{
|
||||
CONS_Printf(M_GetText("This only works in a netgame.\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (server || adminplayer == consoleplayer)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[3 + MAX_REASONLENGTH];
|
||||
|
@ -2544,9 +2562,10 @@ static void Command_Ban(void)
|
|||
|
||||
if (pn == -1 || pn == 0)
|
||||
return;
|
||||
else
|
||||
WRITEUINT8(p, pn);
|
||||
if (I_Ban && !I_Ban(node))
|
||||
|
||||
WRITEUINT8(p, pn);
|
||||
|
||||
if (server && I_Ban && !I_Ban(node)) // only the server is allowed to do this right now
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Too many bans! Geez, that's a lot of people you're excluding...\n"));
|
||||
WRITEUINT8(p, KICK_MSG_GO_AWAY);
|
||||
|
@ -2554,7 +2573,8 @@ static void Command_Ban(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
Ban_Add(COM_Argv(2));
|
||||
if (server) // only the server is allowed to do this right now
|
||||
Ban_Add(COM_Argv(2));
|
||||
|
||||
if (COM_Argc() == 2)
|
||||
{
|
||||
|
@ -2587,21 +2607,27 @@ static void Command_Ban(void)
|
|||
|
||||
static void Command_Kick(void)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[3 + MAX_REASONLENGTH];
|
||||
UINT8 *p = buf;
|
||||
|
||||
if (COM_Argc() == 1)
|
||||
if (COM_Argc() < 2)
|
||||
{
|
||||
CONS_Printf(M_GetText("kick <playername/playernum> <reason>: kick a player\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!netgame) // Don't kick Tails in splitscreen!
|
||||
{
|
||||
CONS_Printf(M_GetText("This only works in a netgame.\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (server || adminplayer == consoleplayer)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[3 + MAX_REASONLENGTH];
|
||||
UINT8 *p = buf;
|
||||
const SINT8 pn = nametonum(COM_Argv(1));
|
||||
WRITESINT8(p, pn);
|
||||
|
||||
if (pn == -1 || pn == 0)
|
||||
return;
|
||||
|
||||
// Special case if we are trying to kick a player who is downloading the game state:
|
||||
// trigger a timeout instead of kicking them, because a kick would only
|
||||
// take effect after they have finished downloading
|
||||
|
@ -2610,6 +2636,9 @@ static void Command_Kick(void)
|
|||
Net_ConnectionTimeout(playernode[pn]);
|
||||
return;
|
||||
}
|
||||
|
||||
WRITESINT8(p, pn);
|
||||
|
||||
if (COM_Argc() == 2)
|
||||
{
|
||||
WRITEUINT8(p, KICK_MSG_GO_AWAY);
|
||||
|
@ -2711,12 +2740,14 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
|
|||
|
||||
// If a verified admin banned someone, the server needs to know about it.
|
||||
// If the playernum isn't zero (the server) then the server needs to record the ban.
|
||||
if (server && playernum && msg == KICK_MSG_BANNED)
|
||||
if (server && playernum && (msg == KICK_MSG_BANNED || msg == KICK_MSG_CUSTOM_BAN))
|
||||
{
|
||||
if (I_Ban && !I_Ban(playernode[(INT32)pnum]))
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Too many bans! Geez, that's a lot of people you're excluding...\n"));
|
||||
}
|
||||
#ifndef NONET
|
||||
else
|
||||
Ban_Add(reason);
|
||||
#endif
|
||||
}
|
||||
|
||||
switch (msg)
|
||||
|
@ -3414,17 +3445,42 @@ static void HandlePacketFromAwayNode(SINT8 node)
|
|||
if (node != servernode)
|
||||
DEBFILE(va("Received packet from unknown host %d\n", node));
|
||||
|
||||
// macro for packets that should only be sent by the server
|
||||
// if it is NOT from the server, bail out and close the connection!
|
||||
#define SERVERONLY \
|
||||
if (node != servernode) \
|
||||
{ \
|
||||
Net_CloseConnection(node); \
|
||||
break; \
|
||||
}
|
||||
switch (netbuffer->packettype)
|
||||
{
|
||||
case PT_ASKINFOVIAMS:
|
||||
#if 0
|
||||
if (server && serverrunning)
|
||||
{
|
||||
INT32 clientnode = I_NetMakeNode(netbuffer->u.msaskinfo.clientaddr);
|
||||
SV_SendServerInfo(clientnode, (tic_t)LONG(netbuffer->u.msaskinfo.time));
|
||||
SV_SendPlayerInfo(clientnode); // Send extra info
|
||||
Net_CloseConnection(clientnode);
|
||||
// Don't close connection to MS.
|
||||
INT32 clientnode;
|
||||
if (ms_RoomId < 0) // ignore if we're not actually on the MS right now
|
||||
{
|
||||
Net_CloseConnection(node); // and yes, close connection
|
||||
return;
|
||||
}
|
||||
clientnode = I_NetMakeNode(netbuffer->u.msaskinfo.clientaddr);
|
||||
if (clientnode != -1)
|
||||
{
|
||||
SV_SendServerInfo(clientnode, (tic_t)LONG(netbuffer->u.msaskinfo.time));
|
||||
SV_SendPlayerInfo(clientnode); // Send extra info
|
||||
Net_CloseConnection(clientnode);
|
||||
// Don't close connection to MS...
|
||||
}
|
||||
else
|
||||
Net_CloseConnection(node); // ...unless the IP address is not valid
|
||||
}
|
||||
else
|
||||
Net_CloseConnection(node); // you're not supposed to get it, so ignore it
|
||||
#else
|
||||
Net_CloseConnection(node);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case PT_ASKINFO:
|
||||
|
@ -3432,8 +3488,8 @@ static void HandlePacketFromAwayNode(SINT8 node)
|
|||
{
|
||||
SV_SendServerInfo(node, (tic_t)LONG(netbuffer->u.askinfo.time));
|
||||
SV_SendPlayerInfo(node); // Send extra info
|
||||
Net_CloseConnection(node);
|
||||
}
|
||||
Net_CloseConnection(node);
|
||||
break;
|
||||
|
||||
case PT_SERVERREFUSE: // Negative response of client join request
|
||||
|
@ -3442,6 +3498,7 @@ static void HandlePacketFromAwayNode(SINT8 node)
|
|||
Net_CloseConnection(node);
|
||||
break;
|
||||
}
|
||||
SERVERONLY
|
||||
if (cl_mode == CL_WAITJOINRESPONSE)
|
||||
{
|
||||
// Save the reason so it can be displayed after quitting the netgame
|
||||
|
@ -3473,6 +3530,7 @@ static void HandlePacketFromAwayNode(SINT8 node)
|
|||
Net_CloseConnection(node);
|
||||
break;
|
||||
}
|
||||
SERVERONLY
|
||||
/// \note how would this happen? and is it doing the right thing if it does?
|
||||
if (cl_mode != CL_WAITJOINRESPONSE)
|
||||
break;
|
||||
|
@ -3536,13 +3594,18 @@ static void HandlePacketFromAwayNode(SINT8 node)
|
|||
Net_CloseConnection(node);
|
||||
break;
|
||||
}
|
||||
else
|
||||
Got_Filetxpak();
|
||||
SERVERONLY
|
||||
Got_Filetxpak();
|
||||
break;
|
||||
|
||||
case PT_REQUESTFILE:
|
||||
if (server)
|
||||
Got_RequestFilePak(node);
|
||||
{
|
||||
if (!cv_downloading.value || !Got_RequestFilePak(node))
|
||||
Net_CloseConnection(node); // close connection if one of the requested files could not be sent, or you disabled downloading anyway
|
||||
}
|
||||
else
|
||||
Net_CloseConnection(node); // nope
|
||||
break;
|
||||
|
||||
case PT_NODETIMEOUT:
|
||||
|
@ -3558,6 +3621,7 @@ static void HandlePacketFromAwayNode(SINT8 node)
|
|||
// Do not remove my own server (we have just get a out of order packet)
|
||||
if (node == servernode)
|
||||
break;
|
||||
/* FALLTHRU */
|
||||
|
||||
default:
|
||||
DEBFILE(va("unknown packet received (%d) from unknown host\n",netbuffer->packettype));
|
||||
|
@ -3565,6 +3629,7 @@ static void HandlePacketFromAwayNode(SINT8 node)
|
|||
break; // Ignore it
|
||||
|
||||
}
|
||||
#undef SERVERONLY
|
||||
}
|
||||
|
||||
/** Handles a packet received from a node that is in game
|
||||
|
@ -3597,6 +3662,8 @@ FILESTAMP
|
|||
{
|
||||
// -------------------------------------------- SERVER RECEIVE ----------
|
||||
case PT_RESYNCHGET:
|
||||
if (client)
|
||||
break;
|
||||
SV_AcknowledgeResynchAck(netconsole, netbuffer->u.resynchgot);
|
||||
break;
|
||||
case PT_CLIENTCMD:
|
||||
|
@ -3663,7 +3730,8 @@ FILESTAMP
|
|||
}
|
||||
|
||||
// Splitscreen cmd
|
||||
if (netbuffer->packettype == PT_CLIENT2CMD && nodetoplayer2[node] >= 0)
|
||||
if ((netbuffer->packettype == PT_CLIENT2CMD || netbuffer->packettype == PT_CLIENT2MIS)
|
||||
&& nodetoplayer2[node] >= 0)
|
||||
G_MoveTiccmd(&netcmds[maketic%BACKUPTICS][(UINT8)nodetoplayer2[node]],
|
||||
&netbuffer->u.client2pak.cmd2, 1);
|
||||
|
||||
|
@ -3710,6 +3778,7 @@ FILESTAMP
|
|||
break;
|
||||
case PT_TEXTCMD2: // splitscreen special
|
||||
netconsole = nodetoplayer2[node];
|
||||
/* FALLTHRU */
|
||||
case PT_TEXTCMD:
|
||||
if (client)
|
||||
break;
|
||||
|
@ -3722,6 +3791,27 @@ FILESTAMP
|
|||
tic_t tic = maketic;
|
||||
UINT8 *textcmd;
|
||||
|
||||
// ignore if the textcmd has a reported size of zero
|
||||
// this shouldn't be sent at all
|
||||
if (!netbuffer->u.textcmd[0])
|
||||
{
|
||||
DEBFILE(va("GetPacket: Textcmd with size 0 detected! (node %u, player %d)\n",
|
||||
node, netconsole));
|
||||
Net_UnAcknowledgePacket(node);
|
||||
break;
|
||||
}
|
||||
|
||||
// ignore if the textcmd size var is actually larger than it should be
|
||||
// BASEPACKETSIZE + 1 (for size) + textcmd[0] should == datalength
|
||||
if (netbuffer->u.textcmd[0] > (size_t)doomcom->datalength-BASEPACKETSIZE-1)
|
||||
{
|
||||
DEBFILE(va("GetPacket: Bad Textcmd packet size! (expected %d, actual %s, node %u, player %d)\n",
|
||||
netbuffer->u.textcmd[0], sizeu1((size_t)doomcom->datalength-BASEPACKETSIZE-1),
|
||||
node, netconsole));
|
||||
Net_UnAcknowledgePacket(node);
|
||||
break;
|
||||
}
|
||||
|
||||
// check if tic that we are making isn't too large else we cannot send it :(
|
||||
// doomcom->numslots+1 "+1" since doomcom->numslots can change within this time and sent time
|
||||
j = software_MAXPACKETLENGTH
|
||||
|
@ -3915,7 +4005,7 @@ FILESTAMP
|
|||
if (client)
|
||||
{
|
||||
INT32 i;
|
||||
for (i = 0; i < MAXNETNODES; i++)
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
if (playeringame[i])
|
||||
playerpingtable[i] = (tic_t)netbuffer->u.pingtable[i];
|
||||
}
|
||||
|
@ -3925,6 +4015,21 @@ FILESTAMP
|
|||
case PT_SERVERCFG:
|
||||
break;
|
||||
case PT_FILEFRAGMENT:
|
||||
// Only accept PT_FILEFRAGMENT from the server.
|
||||
if (node != servernode)
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, M_GetText("%s received from non-host %d\n"), "PT_FILEFRAGMENT", node);
|
||||
|
||||
if (server)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
buf[0] = (UINT8)node;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
if (client)
|
||||
Got_Filetxpak();
|
||||
break;
|
||||
|
@ -4028,7 +4133,10 @@ static INT16 Consistancy(void)
|
|||
|
||||
#ifdef MOBJCONSISTANCY
|
||||
if (!thinkercap.next)
|
||||
{
|
||||
DEBFILE(va("Consistancy = %u\n", ret));
|
||||
return ret;
|
||||
}
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
|
@ -4097,6 +4205,8 @@ static INT16 Consistancy(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
DEBFILE(va("Consistancy = %u\n", (ret & 0xFFFF)));
|
||||
|
||||
return (INT16)(ret & 0xFFFF);
|
||||
}
|
||||
|
||||
|
@ -4458,8 +4568,8 @@ static inline void PingUpdate(void)
|
|||
}
|
||||
|
||||
//send out our ping packets
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
if (playeringame[i])
|
||||
for (i = 0; i < MAXNETNODES; i++)
|
||||
if (nodeingame[i])
|
||||
HSendPacket(i, true, 0, sizeof(INT32) * MAXPLAYERS);
|
||||
|
||||
pingmeasurecount = 1; //Reset count
|
||||
|
@ -4489,20 +4599,15 @@ void NetUpdate(void)
|
|||
|
||||
gametime = nowtime;
|
||||
|
||||
if (!(gametime % 255) && netgame && server)
|
||||
{
|
||||
#ifdef NEWPING
|
||||
PingUpdate();
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef NEWPING
|
||||
if (server)
|
||||
{
|
||||
if (netgame && !(gametime % 255))
|
||||
PingUpdate();
|
||||
// update node latency values so we can take an average later.
|
||||
for (i = 0; i < MAXNETNODES; i++)
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
if (playeringame[i])
|
||||
realpingtable[i] += G_TicsToMilliseconds(GetLag(i));
|
||||
realpingtable[i] += G_TicsToMilliseconds(GetLag(playernode[i]));
|
||||
pingmeasurecount++;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -82,7 +82,7 @@ int snprintf(char *str, size_t n, const char *fmt, ...);
|
|||
#endif
|
||||
|
||||
#ifdef _XBOX
|
||||
#include "sdl/SRB2XBOX/xboxhelp.h"
|
||||
#include "sdl12/SRB2XBOX/xboxhelp.h"
|
||||
#endif
|
||||
|
||||
#ifdef HWRENDER
|
||||
|
|
18
src/d_net.c
18
src/d_net.c
|
@ -711,11 +711,24 @@ void Net_CloseConnection(INT32 node)
|
|||
#else
|
||||
INT32 i;
|
||||
boolean forceclose = (node & FORCECLOSE) != 0;
|
||||
|
||||
if (node == -1)
|
||||
{
|
||||
DEBFILE(M_GetText("Net_CloseConnection: node -1 detected!\n"));
|
||||
return; // nope, just ignore it
|
||||
}
|
||||
|
||||
node &= ~FORCECLOSE;
|
||||
|
||||
if (!node)
|
||||
return;
|
||||
|
||||
if (node < 0 || node >= MAXNETNODES) // prevent invalid nodes from crashing the game
|
||||
{
|
||||
DEBFILE(va(M_GetText("Net_CloseConnection: invalid node %d detected!\n"), node));
|
||||
return;
|
||||
}
|
||||
|
||||
nodes[node].flags |= NF_CLOSE;
|
||||
|
||||
// try to Send ack back (two army problem)
|
||||
|
@ -991,12 +1004,14 @@ void Command_Droprate(void)
|
|||
packetdroprate = droprate;
|
||||
}
|
||||
|
||||
#ifndef NONET
|
||||
static boolean ShouldDropPacket(void)
|
||||
{
|
||||
return (packetdropquantity[netbuffer->packettype])
|
||||
|| (packetdroprate != 0 && rand() < (RAND_MAX * (packetdroprate / 100.f))) || packetdroprate == 100;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// HSendPacket
|
||||
|
@ -1013,6 +1028,7 @@ boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum, size_t packetlen
|
|||
#endif
|
||||
return false;
|
||||
}
|
||||
netbuffer->ack = netbuffer->ackreturn = 0; // don't hold over values from last packet sent/received
|
||||
M_Memcpy(&reboundstore[rebound_head], netbuffer,
|
||||
doomcom->datalength);
|
||||
reboundsize[rebound_head] = doomcom->datalength;
|
||||
|
@ -1348,7 +1364,7 @@ boolean D_CheckNetGame(void)
|
|||
#else
|
||||
if (M_CheckParm("-debugfile"))
|
||||
{
|
||||
char filename[20];
|
||||
char filename[21];
|
||||
INT32 k = doomcom->consoleplayer - 1;
|
||||
if (M_IsNextParm())
|
||||
k = atoi(M_GetNextParm()) - 1;
|
||||
|
|
|
@ -1606,8 +1606,13 @@ void D_MapChange(INT32 mapnum, INT32 newgametype, boolean pultmode, boolean rese
|
|||
mapchangepending = 0;
|
||||
// spawn the server if needed
|
||||
// reset players if there is a new one
|
||||
if (!(adminplayer == consoleplayer) && SV_SpawnServer())
|
||||
buf[0] &= ~(1<<1);
|
||||
if (!(adminplayer == consoleplayer))
|
||||
{
|
||||
if (SV_SpawnServer())
|
||||
buf[0] &= ~(1<<1);
|
||||
if (!Playing()) // you failed to start a server somehow, so cancel the map change
|
||||
return;
|
||||
}
|
||||
|
||||
// Kick bot from special stages
|
||||
if (botskin)
|
||||
|
@ -2153,7 +2158,7 @@ static void Command_Teamchange_f(void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!cv_allowteamchange.value && !NetPacket.packet.newteam) // allow swapping to spectator even in locked teams.
|
||||
if (!cv_allowteamchange.value && NetPacket.packet.newteam) // allow swapping to spectator even in locked teams.
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("The server is not allowing team changes at the moment.\n"));
|
||||
return;
|
||||
|
@ -2250,7 +2255,7 @@ static void Command_Teamchange2_f(void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!cv_allowteamchange.value && !NetPacket.packet.newteam) // allow swapping to spectator even in locked teams.
|
||||
if (!cv_allowteamchange.value && NetPacket.packet.newteam) // allow swapping to spectator even in locked teams.
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("The server is not allowing team changes at the moment.\n"));
|
||||
return;
|
||||
|
@ -2485,7 +2490,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
|||
error = true;
|
||||
break;
|
||||
}
|
||||
//fall down
|
||||
/* FALLTHRU */
|
||||
case GT_TAG:
|
||||
switch (NetPacket.packet.newteam)
|
||||
{
|
||||
|
@ -3004,6 +3009,7 @@ static void Command_Addfile(void)
|
|||
XBOXSTATIC char buf[256];
|
||||
char *buf_p = buf;
|
||||
INT32 i;
|
||||
int musiconly; // W_VerifyNMUSlumps isn't boolean
|
||||
|
||||
if (COM_Argc() != 2)
|
||||
{
|
||||
|
@ -3018,7 +3024,9 @@ static void Command_Addfile(void)
|
|||
if (!isprint(fn[i]) || fn[i] == ';')
|
||||
return;
|
||||
|
||||
if (!W_VerifyNMUSlumps(fn))
|
||||
musiconly = W_VerifyNMUSlumps(fn);
|
||||
|
||||
if (!musiconly)
|
||||
{
|
||||
// ... But only so long as they contain nothing more then music and sprites.
|
||||
if (netgame && !(server || adminplayer == consoleplayer))
|
||||
|
@ -3030,7 +3038,7 @@ static void Command_Addfile(void)
|
|||
}
|
||||
|
||||
// Add file on your client directly if it is trivial, or you aren't in a netgame.
|
||||
if (!(netgame || multiplayer) || W_VerifyNMUSlumps(fn))
|
||||
if (!(netgame || multiplayer) || musiconly)
|
||||
{
|
||||
P_AddWadFile(fn, NULL);
|
||||
return;
|
||||
|
@ -3050,9 +3058,7 @@ static void Command_Addfile(void)
|
|||
#else
|
||||
FILE *fhandle;
|
||||
|
||||
fhandle = fopen(fn, "rb");
|
||||
|
||||
if (fhandle)
|
||||
if ((fhandle = W_OpenWadFile(&fn, true)) != NULL)
|
||||
{
|
||||
tic_t t = I_GetTime();
|
||||
CONS_Debug(DBG_SETUP, "Making MD5 for %s\n",fn);
|
||||
|
@ -3060,11 +3066,8 @@ static void Command_Addfile(void)
|
|||
CONS_Debug(DBG_SETUP, "MD5 calc for %s took %f second\n", fn, (float)(I_GetTime() - t)/TICRATE);
|
||||
fclose(fhandle);
|
||||
}
|
||||
else
|
||||
{
|
||||
CONS_Printf(M_GetText("File %s not found.\n"), fn);
|
||||
else // file not found
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
WRITEMEM(buf_p, md5sum, 16);
|
||||
}
|
||||
|
@ -3117,7 +3120,13 @@ static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum)
|
|||
filestatus_t ncs = FS_NOTFOUND;
|
||||
UINT8 md5sum[16];
|
||||
boolean kick = false;
|
||||
boolean toomany = false;
|
||||
INT32 i;
|
||||
size_t packetsize = 0;
|
||||
serverinfo_pak *dummycheck = NULL;
|
||||
|
||||
// Shut the compiler up.
|
||||
(void)dummycheck;
|
||||
|
||||
READSTRINGN(*cp, filename, 240);
|
||||
READMEM(*cp, md5sum, 16);
|
||||
|
@ -3143,13 +3152,25 @@ static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum)
|
|||
return;
|
||||
}
|
||||
|
||||
ncs = findfile(filename,md5sum,true);
|
||||
// See W_LoadWadFile in w_wad.c
|
||||
for (i = 0; i < numwadfiles; i++)
|
||||
packetsize += nameonlylength(wadfiles[i]->filename) + 22;
|
||||
|
||||
if (ncs != FS_FOUND)
|
||||
packetsize += nameonlylength(filename) + 22;
|
||||
|
||||
if ((numwadfiles >= MAX_WADFILES)
|
||||
|| (packetsize > sizeof(dummycheck->fileneeded)))
|
||||
toomany = true;
|
||||
else
|
||||
ncs = findfile(filename,md5sum,true);
|
||||
|
||||
if (ncs != FS_FOUND || toomany)
|
||||
{
|
||||
char message[256];
|
||||
|
||||
if (ncs == FS_NOTFOUND)
|
||||
if (toomany)
|
||||
sprintf(message, M_GetText("Too many files loaded to add %s\n"), filename);
|
||||
else if (ncs == FS_NOTFOUND)
|
||||
sprintf(message, M_GetText("The server doesn't have %s\n"), filename);
|
||||
else if (ncs == FS_MD5SUMBAD)
|
||||
sprintf(message, M_GetText("Checksum mismatch on %s\n"), filename);
|
||||
|
@ -3219,10 +3240,15 @@ static void Got_Addfilecmd(UINT8 **cp, INT32 playernum)
|
|||
|
||||
ncs = findfile(filename,md5sum,true);
|
||||
|
||||
if (ncs != FS_FOUND)
|
||||
if (ncs != FS_FOUND || !P_AddWadFile(filename, NULL))
|
||||
{
|
||||
Command_ExitGame_f();
|
||||
if (ncs == FS_NOTFOUND)
|
||||
if (ncs == FS_FOUND)
|
||||
{
|
||||
CONS_Printf(M_GetText("The server tried to add %s,\nbut you have too many files added.\nRestart the game to clear loaded files\nand play on this server."), filename);
|
||||
M_StartMessage(va("The server added a file \n(%s)\nbut you have too many files added.\nRestart the game to clear loaded files.\n\nPress ESC\n",filename), NULL, MM_NOTHING);
|
||||
}
|
||||
else if (ncs == FS_NOTFOUND)
|
||||
{
|
||||
CONS_Printf(M_GetText("The server tried to add %s,\nbut you don't have this file.\nYou need to find it in order\nto play on this server."), filename);
|
||||
M_StartMessage(va("The server added a file \n(%s)\nthat you do not have.\n\nPress ESC\n",filename), NULL, MM_NOTHING);
|
||||
|
@ -3240,7 +3266,6 @@ static void Got_Addfilecmd(UINT8 **cp, INT32 playernum)
|
|||
return;
|
||||
}
|
||||
|
||||
P_AddWadFile(filename, NULL);
|
||||
G_SetGameModified(true);
|
||||
}
|
||||
|
||||
|
@ -4139,7 +4164,8 @@ static void Skin_OnChange(void)
|
|||
if (!Playing())
|
||||
return; // do whatever you want
|
||||
|
||||
if (!(cv_debug || devparm) && !(multiplayer || netgame)) // In single player.
|
||||
if (!(cv_debug || devparm) && !(multiplayer || netgame) // In single player.
|
||||
&& (gamestate != GS_WAITINGPLAYERS)) // allows command line -warp x +skin y
|
||||
{
|
||||
CV_StealthSet(&cv_skin, skins[players[consoleplayer].skin].name);
|
||||
return;
|
||||
|
@ -4182,8 +4208,7 @@ static void Color_OnChange(void)
|
|||
if (!Playing())
|
||||
return; // do whatever you want
|
||||
|
||||
if (!(cv_debug || devparm) && !(multiplayer || netgame) // In single player.
|
||||
&& (gamestate == GS_LEVEL || gamestate == GS_INTERMISSION || gamestate == GS_CONTINUING))
|
||||
if (!(cv_debug || devparm) && !(multiplayer || netgame)) // In single player.
|
||||
{
|
||||
CV_StealthSet(&cv_skin, skins[players[consoleplayer].skin].name);
|
||||
return;
|
||||
|
|
|
@ -62,7 +62,8 @@
|
|||
|
||||
#include <errno.h>
|
||||
|
||||
static void SV_SendFile(INT32 node, const char *filename, UINT8 fileid);
|
||||
// Prototypes
|
||||
static boolean SV_SendFile(INT32 node, const char *filename, UINT8 fileid);
|
||||
|
||||
// Sender structure
|
||||
typedef struct filetx_s
|
||||
|
@ -303,7 +304,8 @@ boolean CL_SendRequestFile(void)
|
|||
}
|
||||
|
||||
// get request filepak and put it on the send queue
|
||||
void Got_RequestFilePak(INT32 node)
|
||||
// returns false if a requested file was not found or cannot be sent
|
||||
boolean Got_RequestFilePak(INT32 node)
|
||||
{
|
||||
char wad[MAX_WADPATH+1];
|
||||
UINT8 *p = netbuffer->u.textcmd;
|
||||
|
@ -314,8 +316,13 @@ void Got_RequestFilePak(INT32 node)
|
|||
if (id == 0xFF)
|
||||
break;
|
||||
READSTRINGN(p, wad, MAX_WADPATH);
|
||||
SV_SendFile(node, wad, id);
|
||||
if (!SV_SendFile(node, wad, id))
|
||||
{
|
||||
SV_AbortSendFiles(node);
|
||||
return false; // don't read the rest of the files
|
||||
}
|
||||
}
|
||||
return true; // no problems with any files
|
||||
}
|
||||
|
||||
/** Checks if the files needed aren't already loaded or on the disk
|
||||
|
@ -330,6 +337,12 @@ INT32 CL_CheckFiles(void)
|
|||
INT32 i, j;
|
||||
char wadfilename[MAX_WADPATH];
|
||||
INT32 ret = 1;
|
||||
size_t packetsize = 0;
|
||||
size_t filestoget = 0;
|
||||
serverinfo_pak *dummycheck = NULL;
|
||||
|
||||
// Shut the compiler up.
|
||||
(void)dummycheck;
|
||||
|
||||
// if (M_CheckParm("-nofiles"))
|
||||
// return 1;
|
||||
|
@ -378,6 +391,10 @@ INT32 CL_CheckFiles(void)
|
|||
return 1;
|
||||
}
|
||||
|
||||
// See W_LoadWadFile in w_wad.c
|
||||
for (i = 0; i < numwadfiles; i++)
|
||||
packetsize += nameonlylength(wadfiles[i]->filename) + 22;
|
||||
|
||||
for (i = 1; i < fileneedednum; i++)
|
||||
{
|
||||
CONS_Debug(DBG_NETPLAY, "searching for '%s' ", fileneeded[i].filename);
|
||||
|
@ -397,6 +414,14 @@ INT32 CL_CheckFiles(void)
|
|||
if (fileneeded[i].status != FS_NOTFOUND || !fileneeded[i].important)
|
||||
continue;
|
||||
|
||||
packetsize += nameonlylength(fileneeded[i].filename) + 22;
|
||||
|
||||
if ((numwadfiles+filestoget >= MAX_WADFILES)
|
||||
|| (packetsize > sizeof(dummycheck->fileneeded)))
|
||||
return 3;
|
||||
|
||||
filestoget++;
|
||||
|
||||
fileneeded[i].status = findfile(fileneeded[i].filename, fileneeded[i].md5sum, true);
|
||||
CONS_Debug(DBG_NETPLAY, "found %d\n", fileneeded[i].status);
|
||||
if (fileneeded[i].status != FS_FOUND)
|
||||
|
@ -480,7 +505,7 @@ static INT32 filestosend = 0;
|
|||
* \sa SV_SendRam
|
||||
*
|
||||
*/
|
||||
static void SV_SendFile(INT32 node, const char *filename, UINT8 fileid)
|
||||
static boolean SV_SendFile(INT32 node, const char *filename, UINT8 fileid)
|
||||
{
|
||||
filetx_t **q; // A pointer to the "next" field of the last file in the list
|
||||
filetx_t *p; // The new file request
|
||||
|
@ -488,7 +513,7 @@ static void SV_SendFile(INT32 node, const char *filename, UINT8 fileid)
|
|||
char wadfilename[MAX_WADPATH];
|
||||
|
||||
if (cv_noticedownload.value)
|
||||
CONS_Printf("Sending file \"%s\" to node %d\n", filename, node);
|
||||
CONS_Printf("Sending file \"%s\" to node %d (%s)\n", filename, node, I_GetNodeAddress(node));
|
||||
|
||||
// Find the last file in the list and set a pointer to its "next" field
|
||||
q = &transfer[node].txlist;
|
||||
|
@ -537,7 +562,7 @@ static void SV_SendFile(INT32 node, const char *filename, UINT8 fileid)
|
|||
free(p->id.filename);
|
||||
free(p);
|
||||
*q = NULL;
|
||||
return;
|
||||
return false; // cancel the rest of the requests
|
||||
}
|
||||
|
||||
// Handle huge file requests (i.e. bigger than cv_maxsend.value KB)
|
||||
|
@ -549,7 +574,7 @@ static void SV_SendFile(INT32 node, const char *filename, UINT8 fileid)
|
|||
free(p->id.filename);
|
||||
free(p);
|
||||
*q = NULL;
|
||||
return;
|
||||
return false; // cancel the rest of the requests
|
||||
}
|
||||
|
||||
DEBFILE(va("Sending file %s (id=%d) to %d\n", filename, fileid, node));
|
||||
|
@ -557,6 +582,7 @@ static void SV_SendFile(INT32 node, const char *filename, UINT8 fileid)
|
|||
p->fileid = fileid;
|
||||
p->next = NULL; // End of list
|
||||
filestosend++;
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Adds a memory block to the file list for a node
|
||||
|
|
|
@ -69,7 +69,7 @@ boolean SV_SendingFile(INT32 node);
|
|||
|
||||
boolean CL_CheckDownloadable(void);
|
||||
boolean CL_SendRequestFile(void);
|
||||
void Got_RequestFilePak(INT32 node);
|
||||
boolean Got_RequestFilePak(INT32 node);
|
||||
|
||||
void SV_AbortSendFiles(INT32 node);
|
||||
void CloseNetFile(void);
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
/// \brief Load dehacked file and change tables and text
|
||||
|
||||
#include "doomdef.h"
|
||||
#include "d_main.h" // for srb2home
|
||||
#include "g_game.h"
|
||||
#include "sounds.h"
|
||||
#include "info.h"
|
||||
|
@ -3081,6 +3082,8 @@ static void readmaincfg(MYFILE *f)
|
|||
|
||||
strncpy(savegamename, timeattackfolder, sizeof (timeattackfolder));
|
||||
strlcat(savegamename, "%u.ssg", sizeof(savegamename));
|
||||
// can't use sprintf since there is %u in savegamename
|
||||
strcatbf(savegamename, srb2home, PATHSEP);
|
||||
|
||||
gamedataadded = true;
|
||||
}
|
||||
|
@ -6966,7 +6969,7 @@ static const char *const MOBJFLAG_LIST[] = {
|
|||
"SHOOTABLE",
|
||||
"NOSECTOR",
|
||||
"NOBLOCKMAP",
|
||||
"AMBUSH",
|
||||
"PAPERCOLLISION",
|
||||
"PUSHABLE",
|
||||
"BOSS",
|
||||
"SPAWNCEILING",
|
||||
|
@ -7024,6 +7027,7 @@ static const char *const MOBJFLAG2_LIST[] = {
|
|||
"BOSSNOTRAP", // No Egg Trap after boss
|
||||
"BOSSFLEE", // Boss is fleeing!
|
||||
"BOSSDEAD", // Boss is dead! (Not necessarily fleeing, if a fleeing point doesn't exist.)
|
||||
"AMBUSH", // Alternate behaviour typically set by MTF_AMBUSH
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -7355,6 +7359,7 @@ struct {
|
|||
|
||||
// Frame settings
|
||||
{"FF_FRAMEMASK",FF_FRAMEMASK},
|
||||
{"FF_PAPERSPRITE",FF_PAPERSPRITE},
|
||||
{"FF_ANIMATE",FF_ANIMATE},
|
||||
{"FF_FULLBRIGHT",FF_FULLBRIGHT},
|
||||
{"FF_TRANSMASK",FF_TRANSMASK},
|
||||
|
|
|
@ -536,4 +536,8 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
|
|||
/// \note You should leave this enabled unless you're working with a future SRB2 version.
|
||||
#define MUSICSLOT_COMPATIBILITY
|
||||
|
||||
/// Handle touching sector specials in P_PlayerAfterThink instead of P_PlayerThink.
|
||||
/// \note Required for proper collision with moving sloped surfaces that have sector specials on them.
|
||||
#define SECTORSPECIALSAFTERTHINK
|
||||
|
||||
#endif // __DOOMDEF__
|
||||
|
|
|
@ -94,7 +94,7 @@ static fixed_t paldiv;
|
|||
* \return fademask_t for lump
|
||||
*/
|
||||
static fademask_t *F_GetFadeMask(UINT8 masknum, UINT8 scrnnum) {
|
||||
static char lumpname[9] = "FADEmmss";
|
||||
static char lumpname[10] = "FADEmmss";
|
||||
static fademask_t fm = {NULL,0,0,0,0,0};
|
||||
lumpnum_t lumpnum;
|
||||
UINT8 *lump, *mask;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include <windows.h>
|
||||
#endif
|
||||
#ifdef _WIN32_WCE
|
||||
#include "sdl/SRB2CE/cehelp.h"
|
||||
#include "sdl12/SRB2CE/cehelp.h"
|
||||
#else
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
|
17
src/g_game.c
17
src/g_game.c
|
@ -717,7 +717,7 @@ void G_SetGameModified(boolean silent)
|
|||
*/
|
||||
const char *G_BuildMapName(INT32 map)
|
||||
{
|
||||
static char mapname[9] = "MAPXX"; // internal map name (wad resource name)
|
||||
static char mapname[10] = "MAPXX"; // internal map name (wad resource name)
|
||||
|
||||
I_Assert(map > 0);
|
||||
I_Assert(map <= NUMMAPS);
|
||||
|
@ -1657,11 +1657,6 @@ static void Analog_OnChange(void)
|
|||
|
||||
// cameras are not initialized at this point
|
||||
|
||||
if (leveltime > 1)
|
||||
CV_SetValue(&cv_cam_dist, 128);
|
||||
if (cv_analog.value || demoplayback)
|
||||
CV_SetValue(&cv_cam_dist, 192);
|
||||
|
||||
if (!cv_chasecam.value && cv_analog.value) {
|
||||
CV_SetValue(&cv_analog, 0);
|
||||
return;
|
||||
|
@ -1682,11 +1677,6 @@ static void Analog2_OnChange(void)
|
|||
|
||||
// cameras are not initialized at this point
|
||||
|
||||
if (leveltime > 1)
|
||||
CV_SetValue(&cv_cam2_dist, 128);
|
||||
if (cv_analog2.value)
|
||||
CV_SetValue(&cv_cam2_dist, 192);
|
||||
|
||||
if (!cv_chasecam2.value && cv_analog2.value) {
|
||||
CV_SetValue(&cv_analog2, 0);
|
||||
return;
|
||||
|
@ -2430,6 +2420,9 @@ void G_SpawnPlayer(INT32 playernum, boolean starpost)
|
|||
if (starpost) //Don't even bother with looking for a place to spawn.
|
||||
{
|
||||
P_MovePlayerToStarpost(playernum);
|
||||
#ifdef HAVE_BLUA
|
||||
LUAh_PlayerSpawn(&players[playernum]); // Lua hook for player spawning :)
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -4019,7 +4012,7 @@ void G_GhostAddColor(ghostcolor_t color)
|
|||
ghostext.color = (UINT8)color;
|
||||
}
|
||||
|
||||
void G_GhostAddScale(UINT16 scale)
|
||||
void G_GhostAddScale(fixed_t scale)
|
||||
{
|
||||
if (!demorecording || !(demoflags & DF_GHOST))
|
||||
return;
|
||||
|
|
|
@ -139,7 +139,7 @@ void G_GhostAddSpin(void);
|
|||
void G_GhostAddRev(void);
|
||||
void G_GhostAddColor(ghostcolor_t color);
|
||||
void G_GhostAddFlip(void);
|
||||
void G_GhostAddScale(UINT16 scale);
|
||||
void G_GhostAddScale(fixed_t scale);
|
||||
void G_GhostAddHit(mobj_t *victim);
|
||||
void G_WriteGhostTic(mobj_t *ghost);
|
||||
void G_ConsGhostTic(void);
|
||||
|
|
|
@ -64,7 +64,7 @@ typedef struct GLMipmap_s GLMipmap_t;
|
|||
//
|
||||
struct GLTexture_s
|
||||
{
|
||||
GLMipmap_t mipmap;
|
||||
GLMipmap_t mipmap;
|
||||
float scaleX; //used for scaling textures on walls
|
||||
float scaleY;
|
||||
};
|
||||
|
@ -88,7 +88,7 @@ struct GLPatch_s
|
|||
UINT16 wadnum; // the software patch lump num for when the hardware patch
|
||||
UINT16 lumpnum; // was flushed, and we need to re-create it
|
||||
GLMipmap_t mipmap;
|
||||
} ATTRPACK;
|
||||
};
|
||||
typedef struct GLPatch_s GLPatch_t;
|
||||
|
||||
#endif //_HWR_DATA_
|
||||
|
|
|
@ -78,6 +78,7 @@ typedef struct gr_vissprite_s
|
|||
//Hurdler: 25/04/2000: now support colormap in hardware mode
|
||||
UINT8 *colormap;
|
||||
INT32 dispoffset; // copy of info->dispoffset, affects ordering but not drawing
|
||||
float z1, z2;
|
||||
} gr_vissprite_t;
|
||||
|
||||
// --------
|
||||
|
|
|
@ -1084,9 +1084,9 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum,
|
|||
float endheight = 0.0f, endbheight = 0.0f;
|
||||
|
||||
fixed_t v1x = FLOAT_TO_FIXED(wallVerts[0].x);
|
||||
fixed_t v1y = FLOAT_TO_FIXED(wallVerts[0].y);
|
||||
fixed_t v1y = FLOAT_TO_FIXED(wallVerts[0].z); // not a typo
|
||||
fixed_t v2x = FLOAT_TO_FIXED(wallVerts[1].x);
|
||||
fixed_t v2y = FLOAT_TO_FIXED(wallVerts[1].y);
|
||||
fixed_t v2y = FLOAT_TO_FIXED(wallVerts[1].z); // not a typo
|
||||
// compiler complains when P_GetZAt is used in FLOAT_TO_FIXED directly
|
||||
// use this as a temp var to store P_GetZAt's return value each time
|
||||
fixed_t temp;
|
||||
|
@ -3722,6 +3722,9 @@ static void HWR_Subsector(size_t num)
|
|||
|
||||
while (count--)
|
||||
{
|
||||
#ifdef POLYOBJECTS
|
||||
if (!line->polyseg) // ignore segs that belong to polyobjects
|
||||
#endif
|
||||
HWR_AddLine(line);
|
||||
line++;
|
||||
}
|
||||
|
@ -4227,6 +4230,7 @@ static void HWR_DrawSprite(gr_vissprite_t *spr)
|
|||
GLPatch_t *gpatch; // sprite patch converted to hardware
|
||||
FSurfaceInfo Surf;
|
||||
const boolean hires = (spr->mobj && spr->mobj->skin && ((skin_t *)spr->mobj->skin)->flags & SF_HIRES);
|
||||
//const boolean papersprite = (spr->mobj && (spr->mobj->frame & FF_PAPERSPRITE));
|
||||
if (spr->mobj)
|
||||
this_scale = FIXED_TO_FLOAT(spr->mobj->scale);
|
||||
if (hires)
|
||||
|
@ -4270,7 +4274,8 @@ static void HWR_DrawSprite(gr_vissprite_t *spr)
|
|||
|
||||
// make a wall polygon (with 2 triangles), using the floor/ceiling heights,
|
||||
// and the 2d map coords of start/end vertices
|
||||
wallVerts[0].z = wallVerts[1].z = wallVerts[2].z = wallVerts[3].z = spr->tz;
|
||||
wallVerts[0].z = wallVerts[3].z = spr->z1;
|
||||
wallVerts[2].z = wallVerts[1].z = spr->z2;
|
||||
|
||||
// transform
|
||||
wv = wallVerts;
|
||||
|
@ -5064,6 +5069,10 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
UINT8 flip;
|
||||
angle_t ang;
|
||||
INT32 heightsec, phs;
|
||||
const boolean papersprite = (thing->frame & FF_PAPERSPRITE);
|
||||
float offset;
|
||||
float ang_scale = 1.0f, ang_scalez = 0.0f;
|
||||
float z1, z2;
|
||||
|
||||
if (!thing)
|
||||
return;
|
||||
|
@ -5078,7 +5087,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
tz = (tr_x * gr_viewcos) + (tr_y * gr_viewsin);
|
||||
|
||||
// thing is behind view plane?
|
||||
if (tz < ZCLIP_PLANE && (!cv_grmd2.value || md2_models[thing->sprite].notfound == true)) //Yellow: Only MD2's dont disappear
|
||||
if (tz < ZCLIP_PLANE && !papersprite && (!cv_grmd2.value || md2_models[thing->sprite].notfound == true)) //Yellow: Only MD2's dont disappear
|
||||
return;
|
||||
|
||||
tx = (tr_x * gr_viewsin) - (tr_y * gr_viewcos);
|
||||
|
@ -5116,31 +5125,60 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
I_Error("sprframes NULL for sprite %d\n", thing->sprite);
|
||||
#endif
|
||||
|
||||
if (sprframe->rotate)
|
||||
if (papersprite)
|
||||
{
|
||||
// choose a different rotation based on player view
|
||||
ang = R_PointToAngle(thing->x, thing->y); // uses viewx,viewy
|
||||
rot = (ang-thing->angle+ANGLE_202h)>>29;
|
||||
//Fab: lumpid is the index for spritewidth,spriteoffset... tables
|
||||
lumpoff = sprframe->lumpid[rot];
|
||||
flip = sprframe->flip & (1<<rot);
|
||||
// Use the actual view angle, rather than the angle formed
|
||||
// between the view point and the thing
|
||||
// this makes sure paper sprites always appear at the right angle!
|
||||
// Note: DO NOT do this in software mode version, it actually
|
||||
// makes papersprites look WORSE there (I know, I've tried)
|
||||
// Monster Iestyn - 13/05/17
|
||||
ang = dup_viewangle - thing->angle;
|
||||
ang_scale = FIXED_TO_FLOAT(FINESINE(ang>>ANGLETOFINESHIFT));
|
||||
ang_scalez = FIXED_TO_FLOAT(FINECOSINE(ang>>ANGLETOFINESHIFT));
|
||||
|
||||
if (ang_scale < 0)
|
||||
{
|
||||
ang_scale = -ang_scale;
|
||||
ang_scalez = -ang_scalez;
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (sprframe->rotate != SRF_SINGLE)
|
||||
ang = R_PointToAngle (thing->x, thing->y) - thing->angle;
|
||||
|
||||
if (sprframe->rotate == SRF_SINGLE)
|
||||
{
|
||||
// use single rotation for all views
|
||||
rot = 0; //Fab: for vis->patch below
|
||||
lumpoff = sprframe->lumpid[0]; //Fab: see note above
|
||||
flip = sprframe->flip; // Will only be 0x00 or 0xFF
|
||||
}
|
||||
else
|
||||
{
|
||||
// choose a different rotation based on player view
|
||||
if ((ang < ANGLE_180) && (sprframe->rotate & SRF_RIGHT)) // See from right
|
||||
rot = 6; // F7 slot
|
||||
else if ((ang >= ANGLE_180) && (sprframe->rotate & SRF_LEFT)) // See from left
|
||||
rot = 2; // F3 slot
|
||||
else // Normal behaviour
|
||||
rot = (ang+ANGLE_202h)>>29;
|
||||
|
||||
//Fab: lumpid is the index for spritewidth,spriteoffset... tables
|
||||
lumpoff = sprframe->lumpid[rot];
|
||||
flip = sprframe->flip & (1<<rot);
|
||||
}
|
||||
|
||||
if (thing->skin && ((skin_t *)thing->skin)->flags & SF_HIRES)
|
||||
this_scale = this_scale * FIXED_TO_FLOAT(((skin_t *)thing->skin)->highresscale);
|
||||
|
||||
// calculate edges of the shape
|
||||
if (flip)
|
||||
tx -= FIXED_TO_FLOAT(spritecachedinfo[lumpoff].width - spritecachedinfo[lumpoff].offset) * this_scale;
|
||||
offset = FIXED_TO_FLOAT(spritecachedinfo[lumpoff].width - spritecachedinfo[lumpoff].offset) * this_scale;
|
||||
else
|
||||
tx -= FIXED_TO_FLOAT(spritecachedinfo[lumpoff].offset) * this_scale;
|
||||
offset = FIXED_TO_FLOAT(spritecachedinfo[lumpoff].offset) * this_scale;
|
||||
|
||||
z1 = tz - (offset * ang_scalez);
|
||||
tx -= offset * ang_scale;
|
||||
|
||||
// project x
|
||||
x1 = gr_windowcenterx + (tx * gr_centerx / tz);
|
||||
|
@ -5151,7 +5189,14 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
|
||||
x1 = tx;
|
||||
|
||||
tx += FIXED_TO_FLOAT(spritecachedinfo[lumpoff].width) * this_scale;
|
||||
offset = FIXED_TO_FLOAT(spritecachedinfo[lumpoff].width) * this_scale;
|
||||
|
||||
z2 = z1 + (offset * ang_scalez);
|
||||
tx += offset * ang_scale;
|
||||
|
||||
if (papersprite && max(z1, z2) < ZCLIP_PLANE)
|
||||
return;
|
||||
|
||||
x2 = gr_windowcenterx + (tx * gr_centerx / tz);
|
||||
|
||||
if (thing->eflags & MFE_VERTICALFLIP)
|
||||
|
@ -5200,6 +5245,8 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
vis->patchlumpnum = sprframe->lumppat[rot];
|
||||
vis->flip = flip;
|
||||
vis->mobj = thing;
|
||||
vis->z1 = z1;
|
||||
vis->z2 = z2;
|
||||
|
||||
//Hurdler: 25/04/2000: now support colormap in hardware mode
|
||||
if ((vis->mobj->flags & MF_BOSS) && (vis->mobj->flags2 & MF2_FRET) && (leveltime & 1)) // Bosses "flash"
|
||||
|
|
|
@ -244,6 +244,7 @@ FUNCPRINTF void DBG_Printf(const char *lpFmt, ...)
|
|||
#define pglMaterialfv glMaterialfv
|
||||
|
||||
/* Raster functions */
|
||||
#define pglPixelStorei glPixelStorei
|
||||
#define pglReadPixels glReadPixels
|
||||
|
||||
/* Texture mapping */
|
||||
|
@ -262,15 +263,8 @@ FUNCPRINTF void DBG_Printf(const char *lpFmt, ...)
|
|||
/* texture mapping */ //GL_EXT_copy_texture
|
||||
#ifndef KOS_GL_COMPATIBILITY
|
||||
#define pglCopyTexImage2D glCopyTexImage2D
|
||||
#endif
|
||||
|
||||
/* GLU functions */
|
||||
#define pgluBuild2DMipmaps gluBuild2DMipmaps
|
||||
#endif
|
||||
#ifndef MINI_GL_COMPATIBILITY
|
||||
/* 1.3 functions for multitexturing */
|
||||
#define pglActiveTexture glActiveTexture
|
||||
#define pglMultiTexCoord2f glMultiTexCoord2f
|
||||
#endif
|
||||
#else //!STATIC_OPENGL
|
||||
|
||||
/* 1.0 functions */
|
||||
|
@ -365,6 +359,8 @@ typedef void (APIENTRY * PFNglMaterialfv) (GLint face, GLenum pname, GLfloat *pa
|
|||
static PFNglMaterialfv pglMaterialfv;
|
||||
|
||||
/* Raster functions */
|
||||
typedef void (APIENTRY * PFNglPixelStorei) (GLenum pname, GLint param);
|
||||
static PFNglPixelStorei pglPixelStorei;
|
||||
typedef void (APIENTRY * PFNglReadPixels) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
|
||||
static PFNglReadPixels pglReadPixels;
|
||||
|
||||
|
@ -391,7 +387,7 @@ static PFNglBindTexture pglBindTexture;
|
|||
/* texture mapping */ //GL_EXT_copy_texture
|
||||
typedef void (APIENTRY * PFNglCopyTexImage2D) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||
static PFNglCopyTexImage2D pglCopyTexImage2D;
|
||||
|
||||
#endif
|
||||
/* GLU functions */
|
||||
typedef GLint (APIENTRY * PFNgluBuild2DMipmaps) (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data);
|
||||
static PFNgluBuild2DMipmaps pgluBuild2DMipmaps;
|
||||
|
@ -403,7 +399,6 @@ static PFNglActiveTexture pglActiveTexture;
|
|||
typedef void (APIENTRY *PFNglMultiTexCoord2f) (GLenum, GLfloat, GLfloat);
|
||||
static PFNglMultiTexCoord2f pglMultiTexCoord2f;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef MINI_GL_COMPATIBILITY
|
||||
/* 1.2 Parms */
|
||||
|
@ -494,6 +489,7 @@ boolean SetupGLfunc(void)
|
|||
GETOPENGLFUNC(pglLightModelfv , glLightModelfv)
|
||||
GETOPENGLFUNC(pglMaterialfv , glMaterialfv)
|
||||
|
||||
GETOPENGLFUNC(pglPixelStorei , glPixelStorei)
|
||||
GETOPENGLFUNC(pglReadPixels , glReadPixels)
|
||||
|
||||
GETOPENGLFUNC(pglTexEnvi , glTexEnvi)
|
||||
|
@ -519,35 +515,23 @@ boolean SetupGLfunc(void)
|
|||
// This has to be done after the context is created so the version number can be obtained
|
||||
boolean SetupGLFunc13(void)
|
||||
{
|
||||
#ifdef MINI_GL_COMPATIBILITY
|
||||
return false;
|
||||
#else
|
||||
const GLubyte *version = pglGetString(GL_VERSION);
|
||||
int glmajor, glminor;
|
||||
|
||||
gl13 = false;
|
||||
#ifdef MINI_GL_COMPATIBILITY
|
||||
return false;
|
||||
#else
|
||||
#ifdef STATIC_OPENGL
|
||||
gl13 = true;
|
||||
#else
|
||||
|
||||
// Parse the GL version
|
||||
if (version != NULL)
|
||||
{
|
||||
if (sscanf((const char*)version, "%d.%d", &glmajor, &glminor) == 2)
|
||||
{
|
||||
// Look, we gotta prepare for the inevitable arrival of GL 2.0 code...
|
||||
switch (glmajor)
|
||||
{
|
||||
case 1:
|
||||
if (glminor == 3) gl13 = true;
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
gl13 = true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (glmajor == 1 && glminor >= 3)
|
||||
gl13 = true;
|
||||
else if (glmajor > 1)
|
||||
gl13 = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -568,9 +552,6 @@ boolean SetupGLFunc13(void)
|
|||
}
|
||||
else
|
||||
DBG_Printf("GL_ARB_multitexture support: disabled\n");
|
||||
#undef GETOPENGLFUNC
|
||||
|
||||
#endif
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
@ -897,7 +878,9 @@ EXPORT void HWRAPI(ReadRect) (INT32 x, INT32 y, INT32 width, INT32 height,
|
|||
GLubyte*top = (GLvoid*)dst_data, *bottom = top + dst_stride * (height - 1);
|
||||
GLubyte *row = malloc(dst_stride);
|
||||
if (!row) return;
|
||||
pglPixelStorei(GL_PACK_ALIGNMENT, 1);
|
||||
pglReadPixels(x, y, width, height, GL_RGB, GL_UNSIGNED_BYTE, dst_data);
|
||||
pglPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
for(i = 0; i < height/2; i++)
|
||||
{
|
||||
memcpy(row, top, dst_stride);
|
||||
|
@ -913,7 +896,9 @@ EXPORT void HWRAPI(ReadRect) (INT32 x, INT32 y, INT32 width, INT32 height,
|
|||
INT32 j;
|
||||
GLubyte *image = malloc(width*height*3*sizeof (*image));
|
||||
if (!image) return;
|
||||
pglPixelStorei(GL_PACK_ALIGNMENT, 1);
|
||||
pglReadPixels(x, y, width, height, GL_RGB, GL_UNSIGNED_BYTE, image);
|
||||
pglPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
for (i = height-1; i >= 0; i--)
|
||||
{
|
||||
for (j = 0; j < width; j++)
|
||||
|
@ -1815,13 +1800,11 @@ EXPORT void HWRAPI(SetSpecialState) (hwdspecialstate_t IdState, INT32 Value)
|
|||
min_filter = GL_NEAREST;
|
||||
#endif
|
||||
}
|
||||
#ifndef STATIC_OPENGL
|
||||
if (!pgluBuild2DMipmaps)
|
||||
{
|
||||
MipMap = GL_FALSE;
|
||||
min_filter = GL_LINEAR;
|
||||
}
|
||||
#endif
|
||||
Flush(); //??? if we want to change filter mode by texture, remove this
|
||||
break;
|
||||
|
||||
|
@ -1836,7 +1819,7 @@ EXPORT void HWRAPI(SetSpecialState) (hwdspecialstate_t IdState, INT32 Value)
|
|||
}
|
||||
}
|
||||
|
||||
static inline void DrawMD2Ex(INT32 *gl_cmd_buffer, md2_frame_t *frame, UINT32 duration, UINT32 tics, md2_frame_t *nextframe, FTransform *pos, float scale, UINT8 flipped, UINT8 *color)
|
||||
static void DrawMD2Ex(INT32 *gl_cmd_buffer, md2_frame_t *frame, UINT32 duration, UINT32 tics, md2_frame_t *nextframe, FTransform *pos, float scale, UINT8 flipped, UINT8 *color)
|
||||
{
|
||||
INT32 val, count, pindex;
|
||||
GLfloat s, t;
|
||||
|
|
|
@ -97,7 +97,7 @@
|
|||
#include <time.h>
|
||||
|
||||
#ifdef _arch_dreamcast
|
||||
#include "sdl/SRB2DC/dchelp.h"
|
||||
#include "sdl12/SRB2DC/dchelp.h"
|
||||
#endif
|
||||
|
||||
#if (defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||
|
@ -192,7 +192,7 @@ static UINT8 UPNP_support = TRUE;
|
|||
#define close closesocket
|
||||
|
||||
#ifdef _WIN32_WCE
|
||||
#include "sdl/SRB2CE/cehelp.h"
|
||||
#include "sdl12/SRB2CE/cehelp.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue