Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a8df763823 | ||
|
|
58af8f84b9 | ||
|
|
b0395ad539 | ||
|
|
b712cba62d | ||
|
|
16c0b48f4a |
No files matched your search
@@ -0,0 +1,73 @@
|
|||||||
|
version: 2
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
working_directory: /root/SRB2
|
||||||
|
docker:
|
||||||
|
- image: debian:stretch
|
||||||
|
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: Add STJr PPA
|
||||||
|
command: |
|
||||||
|
apt-get -qq update
|
||||||
|
apt-get -qq -y install dirmngr
|
||||||
|
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0B1702D71499D9C25F986507F240F4449D3B0EC6
|
||||||
|
echo "deb http://ppa.launchpad.net/stjr/srb2/ubuntu trusty main" >> /etc/apt/sources.list
|
||||||
|
- 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 --no-install-recommends install git build-essential libpng-dev:i386 libsdl2-mixer-dev:i386 libgme-dev:i386 libcurl4-openssl-dev:i386 libopenmpt-dev:i386 gettext ccache wget gcc-multilib upx openssh-client
|
||||||
|
- save_cache:
|
||||||
|
key: v1-SRB2-APT
|
||||||
|
paths:
|
||||||
|
- /var/cache/apt/archives
|
||||||
|
- checkout
|
||||||
|
#- run:
|
||||||
|
# name: Compile without network support and BLUA
|
||||||
|
# command: make -C src LINUX=1 ERRORMODE=1 -k NONET=1 NO_LUA=1
|
||||||
|
#- run:
|
||||||
|
# name: wipe build
|
||||||
|
# command: make -C src LINUX=1 cleandep
|
||||||
|
- run:
|
||||||
|
name: rebuild depend
|
||||||
|
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
|
||||||
+436
@@ -0,0 +1,436 @@
|
|||||||
|
default:
|
||||||
|
image: debian:stable-slim
|
||||||
|
|
||||||
|
stages: # List of stages for jobs, and their order of execution
|
||||||
|
- build
|
||||||
|
|
||||||
|
variables:
|
||||||
|
GIT_STRATEGY: clone
|
||||||
|
GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_CONCURRENT_ID/$CI_PROJECT_PATH
|
||||||
|
|
||||||
|
.job_template: &job_build # This job runs in the build stage, which runs first.
|
||||||
|
|
||||||
|
stage: build
|
||||||
|
|
||||||
|
cache:
|
||||||
|
- key: ccache-$CI_PROJECT_PATH_SLUG-$CI_JOB_NAME_SLUG
|
||||||
|
fallback_keys:
|
||||||
|
- cache-$CI_PROJECT_PATH_SLUG-$CI_DEFAULT_BRANCH
|
||||||
|
- cache-$CI_PROJECT_PATH_SLUG-default
|
||||||
|
paths:
|
||||||
|
- ccache
|
||||||
|
- ccache_statslog
|
||||||
|
|
||||||
|
- key: apt-$CI_JOB_IMAGE
|
||||||
|
paths:
|
||||||
|
- apt-cache
|
||||||
|
unprotect: true
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- - |
|
||||||
|
# debconf
|
||||||
|
echo -e "\e[0Ksection_start:`date +%s`:debconf[collapsed=true]\r\e[0KSetup debconf's environment"
|
||||||
|
- export DEBIAN_FRONTEND="noninteractive"
|
||||||
|
- export DEBIAN_PRIORITY="low"
|
||||||
|
- export DEBCONF_NONINTERACTIVE_SEEN="true"
|
||||||
|
- |
|
||||||
|
# debconf
|
||||||
|
echo -e "\e[0Ksection_end:`date +%s`:debconf\r\e[0K"
|
||||||
|
- - |
|
||||||
|
# dpkg_aa
|
||||||
|
echo -e "\e[0Ksection_start:`date +%s`:dpkg_aa[collapsed=true]\r\e[0KAdding architectures to dpkg"
|
||||||
|
- dpkg --add-architecture i386
|
||||||
|
- dpkg --add-architecture amd64
|
||||||
|
- dpkg --add-architecture arm64
|
||||||
|
- |
|
||||||
|
# dpkg_aa
|
||||||
|
echo -e "\e[0Ksection_end:`date +%s`:dpkg_aa\r\e[0K"
|
||||||
|
- - |
|
||||||
|
# apt_conf
|
||||||
|
echo -e "\e[0Ksection_start:`date +%s`:apt_conf[collapsed=true]\r\e[0KSetting up APT conf"
|
||||||
|
- export APT_CACHE_DIR=`pwd`/apt-cache
|
||||||
|
- mkdir --parents --verbose $APT_CACHE_DIR/partial/
|
||||||
|
- touch /etc/apt/apt.conf.d/99build
|
||||||
|
- |
|
||||||
|
# apt.conf
|
||||||
|
echo Adding options to apt.conf':'
|
||||||
|
- |
|
||||||
|
# APT::Install-Recommends
|
||||||
|
echo APT::Install-Recommends "false"\; | tee --append /etc/apt/apt.conf.d/99build
|
||||||
|
- |
|
||||||
|
# quit
|
||||||
|
echo quiet "1"\; | tee --append /etc/apt/apt.conf.d/99build
|
||||||
|
- |
|
||||||
|
# APT::Get::Assume-Yes
|
||||||
|
echo APT::Get::Assume-Yes "true"\; | tee --append /etc/apt/apt.conf.d/99build
|
||||||
|
- |
|
||||||
|
# Dir::Cache::Archives
|
||||||
|
echo Dir::Cache::Archives "$APT_CACHE_DIR"\; | tee --append /etc/apt/apt.conf.d/99build
|
||||||
|
- |
|
||||||
|
# apt_conf
|
||||||
|
echo -e "\e[0Ksection_end:`date +%s`:apt_conf\r\e[0K"
|
||||||
|
- - |
|
||||||
|
# apt_update
|
||||||
|
echo -e "\e[0Ksection_start:`date +%s`:apt_update[collapsed=true]\r\e[0KUpdating APT listing"
|
||||||
|
- apt-get update
|
||||||
|
- |
|
||||||
|
# apt_update
|
||||||
|
echo -e "\e[0Ksection_end:`date +%s`:apt_update\r\e[0K"
|
||||||
|
|
||||||
|
- - |
|
||||||
|
# apt_pre
|
||||||
|
echo -e "\e[0Ksection_start:`date +%s`:apt_pre[collapsed=true]\r\e[0KInstalling pre packages"
|
||||||
|
- apt-get install apt-utils
|
||||||
|
- |
|
||||||
|
# apt_pre
|
||||||
|
echo -e "\e[0Ksection_end:`date +%s`:apt_pre\r\e[0K"
|
||||||
|
|
||||||
|
- - |
|
||||||
|
# apt_upgrade
|
||||||
|
echo -e "\e[0Ksection_start:`date +%s`:apt_upgrade[collapsed=true]\r\e[0KUpdating existing packages"
|
||||||
|
- apt-get upgrade
|
||||||
|
- |
|
||||||
|
# apt_update
|
||||||
|
echo -e "\e[0Ksection_end:`date +%s`:apt_upgrade\r\e[0K"
|
||||||
|
|
||||||
|
- - |
|
||||||
|
# apt_common
|
||||||
|
echo -e "\e[0Ksection_start:`date +%s`:apt_common[collapsed=true]\r\e[0KInstalling common packages"
|
||||||
|
- apt-get install make git ccache
|
||||||
|
- |
|
||||||
|
# apt_common
|
||||||
|
echo -e "\e[0Ksection_end:`date +%s`:apt_common\r\e[0K"
|
||||||
|
|
||||||
|
- - |
|
||||||
|
# ccache_config
|
||||||
|
echo -e "\e[0Ksection_start:`date +%s`:ccache_config[collapsed=true]\r\e[0KSetting up ccache config"
|
||||||
|
- mkdir --parents --verbose ~/.ccache/
|
||||||
|
- touch ~/.ccache/ccache.conf
|
||||||
|
- |
|
||||||
|
# cache.conf
|
||||||
|
echo Adding ccache configution option
|
||||||
|
- |
|
||||||
|
# base_dir
|
||||||
|
echo base_dir = $PWD | tee --append ~/.ccache/ccache.conf
|
||||||
|
- |
|
||||||
|
# cache_dir
|
||||||
|
echo cache_dir = $PWD/ccache | tee --append ~/.ccache/ccache.conf
|
||||||
|
- |
|
||||||
|
# compiler_check
|
||||||
|
echo compiler_check = content | tee --append ~/.ccache/ccache.conf
|
||||||
|
- |
|
||||||
|
# stats_log
|
||||||
|
echo stats_log = $PWD/ccache_statslog | tee --append ~/.ccache/ccache.conf
|
||||||
|
- |
|
||||||
|
# max_size
|
||||||
|
echo max_size = 50M | tee --append ~/.ccache/ccache.conf
|
||||||
|
- |
|
||||||
|
# ccache_config
|
||||||
|
echo -e "\e[0Ksection_end:`date +%s`:ccache_config\r\e[0K"
|
||||||
|
|
||||||
|
- - |
|
||||||
|
# cache_reset
|
||||||
|
echo -e "\e[0Ksection_start:`date +%s`:ccache_reset[collapsed=true]\r\e[0KResetting ccache statistics"
|
||||||
|
- ccache --zero-stats
|
||||||
|
- ccache --show-stats
|
||||||
|
- |
|
||||||
|
# ccache_reset
|
||||||
|
echo -e "\e[0Ksection_end:`date +%s`:ccache_reset\r\e[0K"
|
||||||
|
|
||||||
|
after_script:
|
||||||
|
- - |
|
||||||
|
# apt_clean
|
||||||
|
echo -e "\e[0Ksection_start:`date +%s`:apt_clean[collapsed=true]\r\e[0KCleaning of unneeded APT packages"
|
||||||
|
- apt-get autoclean
|
||||||
|
- |
|
||||||
|
# apt_clean
|
||||||
|
echo -e "\e[0Ksection_end:`date +%s`:apt_clean\r\e[0K"
|
||||||
|
|
||||||
|
- - |
|
||||||
|
# ccache_stats
|
||||||
|
echo -e "\e[0Ksection_start:`date +%s`:ccache_stats[collapsed=true]\r\e[0Kccache statistics:"
|
||||||
|
- ccache --show-stats --verbose
|
||||||
|
- ccache --show-log-stats --verbose
|
||||||
|
- |
|
||||||
|
# ccahe_stats
|
||||||
|
echo -e "\e[0Ksection_end:`date +%s`:ccache_stats\r\e[0K"
|
||||||
|
|
||||||
|
Debian testing GCC:
|
||||||
|
<<: *job_build
|
||||||
|
image: debian:testing-slim
|
||||||
|
|
||||||
|
allow_failure: true
|
||||||
|
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- "bin/"
|
||||||
|
- "src/comptime.h"
|
||||||
|
expose_as: "Debian GCC testing"
|
||||||
|
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-testing-gcc"
|
||||||
|
|
||||||
|
variables:
|
||||||
|
CC: gcc
|
||||||
|
|
||||||
|
script:
|
||||||
|
- - |
|
||||||
|
# apt_toolchain
|
||||||
|
echo -e "\e[0Ksection_start:`date +%s`:apt_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
|
||||||
|
- apt-get install gcc
|
||||||
|
- |
|
||||||
|
# apt_toolchain
|
||||||
|
echo -e "\e[0Ksection_end:`date +%s`:apt_toolchain\r\e[0K"
|
||||||
|
|
||||||
|
- - |
|
||||||
|
# apt_development
|
||||||
|
echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages"
|
||||||
|
- apt-get install libsdl2-mixer-dev libpng-dev libcurl4-openssl-dev libgme-dev libopenmpt-dev
|
||||||
|
- |
|
||||||
|
# apt_development
|
||||||
|
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
|
||||||
|
|
||||||
|
- - |
|
||||||
|
# make
|
||||||
|
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
|
||||||
|
- make --directory=src --keep-going CCACHE=1 ERRORMODE=1 NONX86=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 NONX86=1
|
||||||
|
- |
|
||||||
|
# make
|
||||||
|
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
||||||
|
|
||||||
|
Windows x86:
|
||||||
|
<<: *job_build
|
||||||
|
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- "bin/"
|
||||||
|
- "src/comptime.h"
|
||||||
|
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-Win32"
|
||||||
|
|
||||||
|
variables:
|
||||||
|
PREFIX: i686-w64-mingw32
|
||||||
|
|
||||||
|
script:
|
||||||
|
- - |
|
||||||
|
# apt_toolchain
|
||||||
|
echo -e "\e[0Ksection_start:`date +%s`:apt_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
|
||||||
|
- apt-get install gcc-mingw-w64-i686-win32
|
||||||
|
- |
|
||||||
|
# apt_toolchain
|
||||||
|
echo -e "\e[0Ksection_end:`date +%s`:apt_toolchain\r\e[0K"
|
||||||
|
|
||||||
|
- - |
|
||||||
|
# make
|
||||||
|
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
|
||||||
|
- make --directory=src --keep-going CCACHE=1 ERRORMODE=1 MINGW=1 SDL=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 MINGW=1 SDL=1
|
||||||
|
- |
|
||||||
|
# make
|
||||||
|
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
||||||
|
|
||||||
|
Debian stable:amd64:
|
||||||
|
<<: *job_build
|
||||||
|
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- "bin/"
|
||||||
|
- "src/comptime.h"
|
||||||
|
expose_as: "Debian amd64"
|
||||||
|
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-x86-64"
|
||||||
|
|
||||||
|
variables:
|
||||||
|
CC: x86_64-linux-gnu-gcc
|
||||||
|
OBJCOPY: x86_64-linux-gnu-objcopy
|
||||||
|
OBJDUMP: x86_64-linux-gnu-objdump
|
||||||
|
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig
|
||||||
|
|
||||||
|
script:
|
||||||
|
- - |
|
||||||
|
# apt_toolchain
|
||||||
|
echo -e "\e[0Ksection_start:`date +%s`:apt_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
|
||||||
|
- apt-get install gcc-x86-64-linux-gnu || apt-get install gcc
|
||||||
|
- |
|
||||||
|
# apt_toolchain
|
||||||
|
echo -e "\e[0Ksection_end:`date +%s`:apt_toolchain\r\e[0K"
|
||||||
|
|
||||||
|
- - |
|
||||||
|
# apt_development
|
||||||
|
echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages"
|
||||||
|
- apt-get install libsdl2-mixer-dev:amd64 libpng-dev:amd64 libcurl4-openssl-dev:amd64 libgme-dev:amd64 libopenmpt-dev:amd64
|
||||||
|
- |
|
||||||
|
# apt_development
|
||||||
|
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
|
||||||
|
|
||||||
|
- - |
|
||||||
|
# make
|
||||||
|
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
|
||||||
|
- make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX64=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX64=1
|
||||||
|
- |
|
||||||
|
# make
|
||||||
|
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
||||||
|
|
||||||
|
Debian stable:i386:
|
||||||
|
<<: *job_build
|
||||||
|
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- "bin/"
|
||||||
|
- "src/comptime.h"
|
||||||
|
expose_as: "Debian i386"
|
||||||
|
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-i686"
|
||||||
|
|
||||||
|
variables:
|
||||||
|
CC: i686-linux-gnu-gcc
|
||||||
|
OBJCOPY: i686-linux-gnu-objcopy
|
||||||
|
OBJDUMP: i686-linux-gnu-objdump
|
||||||
|
PKG_CONFIG_PATH: /usr/lib/i386-linux-gnu/pkgconfig
|
||||||
|
|
||||||
|
script:
|
||||||
|
- - |
|
||||||
|
# apt_toolchain
|
||||||
|
echo -e "\e[0Ksection_start:`date +%s`:apt_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
|
||||||
|
- apt-get install gcc-i686-linux-gnu || apt-get install gcc
|
||||||
|
- |
|
||||||
|
# apt_toolchain
|
||||||
|
echo -e "\e[0Ksection_end:`date +%s`:apt_toolchain\r\e[0K"
|
||||||
|
|
||||||
|
- - |
|
||||||
|
# apt_development
|
||||||
|
echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages"
|
||||||
|
- apt-get install libsdl2-mixer-dev:i386 libpng-dev:i386 libcurl4-openssl-dev:i386 libgme-dev:i386 libopenmpt-dev:i386
|
||||||
|
- |
|
||||||
|
# apt_development
|
||||||
|
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
|
||||||
|
|
||||||
|
- - |
|
||||||
|
# make
|
||||||
|
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
|
||||||
|
- make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX=1
|
||||||
|
- |
|
||||||
|
# make
|
||||||
|
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
||||||
|
|
||||||
|
Debian stable:arm64:
|
||||||
|
<<: *job_build
|
||||||
|
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- "bin/"
|
||||||
|
- "src/comptime.h"
|
||||||
|
expose_as: "Debian arm64"
|
||||||
|
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-aarch64"
|
||||||
|
|
||||||
|
variables:
|
||||||
|
CC: aarch64-linux-gnu-gcc
|
||||||
|
OBJCOPY: aarch64-linux-gnu-objcopy
|
||||||
|
OBJDUMP: aarch64-linux-gnu-objdump
|
||||||
|
PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig
|
||||||
|
|
||||||
|
script:
|
||||||
|
- - |
|
||||||
|
# apt_toolchain
|
||||||
|
echo -e "\e[0Ksection_start:`date +%s`:apt_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
|
||||||
|
- apt-get install gcc-aarch64-linux-gnu || apt-get install gcc
|
||||||
|
- |
|
||||||
|
# apt_toolchain
|
||||||
|
echo -e "\e[0Ksection_end:`date +%s`:apt_toolchain\r\e[0K"
|
||||||
|
|
||||||
|
- - |
|
||||||
|
# apt_development
|
||||||
|
echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages"
|
||||||
|
- apt-get install libsdl2-mixer-dev:arm64 libpng-dev:arm64 libcurl4-openssl-dev:arm64 libgme-dev:arm64 libopenmpt-dev:arm64
|
||||||
|
- |
|
||||||
|
# apt_development
|
||||||
|
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
|
||||||
|
|
||||||
|
- - |
|
||||||
|
# make
|
||||||
|
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
|
||||||
|
- make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX64=1 ERRORMODE=1 NONX86=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX64=1 NONX86=1
|
||||||
|
- |
|
||||||
|
# make
|
||||||
|
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
||||||
|
|
||||||
|
Windows x64:
|
||||||
|
<<: *job_build
|
||||||
|
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- "bin/"
|
||||||
|
- "src/comptime.h"
|
||||||
|
expose_as: "Win64"
|
||||||
|
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-Win64"
|
||||||
|
|
||||||
|
variables:
|
||||||
|
PREFIX: x86_64-w64-mingw32
|
||||||
|
|
||||||
|
script:
|
||||||
|
- - |
|
||||||
|
# apt_toolchain
|
||||||
|
echo -e "\e[0Ksection_start:`date +%s`:apt_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
|
||||||
|
- apt-get install gcc-mingw-w64-x86-64-win32
|
||||||
|
- |
|
||||||
|
# apt_toolchain
|
||||||
|
echo -e "\e[0Ksection_end:`date +%s`:apt_toolchain\r\e[0K"
|
||||||
|
|
||||||
|
- - |
|
||||||
|
# make
|
||||||
|
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
|
||||||
|
- make --directory=src --keep-going CCACHE=1 ERRORMODE=1 MINGW64=1 SDL=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 MINGW64=1 SDL=1
|
||||||
|
- |
|
||||||
|
# make
|
||||||
|
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
||||||
|
|
||||||
|
Debian stable Clang:
|
||||||
|
<<: *job_build
|
||||||
|
|
||||||
|
allow_failure: true
|
||||||
|
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- "bin/"
|
||||||
|
- "src/comptime.h"
|
||||||
|
expose_as: "Debian Clang"
|
||||||
|
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-clang"
|
||||||
|
|
||||||
|
variables:
|
||||||
|
CC: clang
|
||||||
|
WFLAGS: -Wno-cast-align
|
||||||
|
|
||||||
|
script:
|
||||||
|
- - |
|
||||||
|
# apt_toolchain
|
||||||
|
echo -e "\e[0Ksection_start:`date +%s`:apt_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
|
||||||
|
- apt-get install clang
|
||||||
|
- |
|
||||||
|
# apt_toolchain
|
||||||
|
echo -e "\e[0Ksection_end:`date +%s`:apt_toolchain\r\e[0K"
|
||||||
|
|
||||||
|
- - |
|
||||||
|
# apt_development
|
||||||
|
echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages"
|
||||||
|
- apt-get install libsdl2-mixer-dev libpng-dev libcurl4-openssl-dev libgme-dev libopenmpt-dev
|
||||||
|
- |
|
||||||
|
# apt_development
|
||||||
|
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
|
||||||
|
|
||||||
|
- - |
|
||||||
|
# make
|
||||||
|
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
|
||||||
|
- make --directory=src --keep-going CCACHE=1 ERRORMODE=1 NONX86=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 NONX86=1
|
||||||
|
- |
|
||||||
|
# make
|
||||||
|
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
||||||
|
|
||||||
|
Debian testing Clang:
|
||||||
|
extends: Debian stable Clang
|
||||||
|
|
||||||
|
image: debian:testing-slim
|
||||||
|
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- "bin/"
|
||||||
|
- "src/comptime.h"
|
||||||
|
expose_as: "Debina Clang testing"
|
||||||
|
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-testing-clang"
|
||||||
|
|
||||||
|
variables:
|
||||||
|
CC: clang
|
||||||
|
WFLAGS: -Wno-cast-align -Wno-deprecated-non-prototype
|
||||||
+712
@@ -0,0 +1,712 @@
|
|||||||
|
# Travis-CI Config
|
||||||
|
#
|
||||||
|
# You may use the Deployer to upload packages and builds to external servers.
|
||||||
|
# See deployer/travis/deployer_defaults.sh for environment variables to configure.
|
||||||
|
|
||||||
|
language: c
|
||||||
|
sudo: required
|
||||||
|
dist: trusty
|
||||||
|
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
################################
|
||||||
|
# Test Buildbots
|
||||||
|
# Deployer does not operate on these. See Deployer Buildbots, below.
|
||||||
|
# These bots are disabled when a deployment is triggered by 'deployer' branch name AND DPL_TERMINATE_TESTS=1.
|
||||||
|
# These bots remain enabled when a deployment is triggered by release tag.
|
||||||
|
################################
|
||||||
|
- os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- libsdl2-mixer-dev
|
||||||
|
- libpng-dev
|
||||||
|
- libgl1-mesa-dev
|
||||||
|
- libgme-dev
|
||||||
|
- libcurl4-openssl-dev
|
||||||
|
- p7zip-full
|
||||||
|
- gcc-4.4
|
||||||
|
compiler: gcc-4.4
|
||||||
|
env: GCC44=1
|
||||||
|
if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
|
||||||
|
#gcc-4.4 (Ubuntu/Linaro 4.4.7-8ubuntu1) 4.4.7
|
||||||
|
- os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- libsdl2-mixer-dev
|
||||||
|
- libpng-dev
|
||||||
|
- libgl1-mesa-dev
|
||||||
|
- libgme-dev
|
||||||
|
- libcurl4-openssl-dev
|
||||||
|
- p7zip-full
|
||||||
|
- gcc-4.6
|
||||||
|
compiler: gcc-4.6
|
||||||
|
env: GCC46=1
|
||||||
|
if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
|
||||||
|
#gcc-4.6 (Ubuntu/Linaro 4.6.4-6ubuntu2) 4.6.4
|
||||||
|
- os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- libsdl2-mixer-dev
|
||||||
|
- libpng-dev
|
||||||
|
- libgl1-mesa-dev
|
||||||
|
- libgme-dev
|
||||||
|
- libcurl4-openssl-dev
|
||||||
|
- p7zip-full
|
||||||
|
- gcc-4.7
|
||||||
|
compiler: gcc-4.7
|
||||||
|
env: GCC47=1
|
||||||
|
if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
|
||||||
|
#gcc-4.7
|
||||||
|
- os: linux
|
||||||
|
compiler: gcc
|
||||||
|
env: GCC48=1
|
||||||
|
if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
|
||||||
|
#gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
|
||||||
|
- os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- libsdl2-mixer-dev
|
||||||
|
- libpng-dev
|
||||||
|
- libgl1-mesa-dev
|
||||||
|
- libgme-dev
|
||||||
|
- libcurl4-openssl-dev
|
||||||
|
- p7zip-full
|
||||||
|
- gcc-4.8
|
||||||
|
compiler: gcc-4.8
|
||||||
|
env: GCC48=1
|
||||||
|
if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
|
||||||
|
#gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
|
||||||
|
- os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- libsdl2-mixer-dev
|
||||||
|
- libpng-dev
|
||||||
|
- libgl1-mesa-dev
|
||||||
|
- libgme-dev
|
||||||
|
- libcurl4-openssl-dev
|
||||||
|
- p7zip-full
|
||||||
|
- gcc-7
|
||||||
|
compiler: gcc-7
|
||||||
|
env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wno-implicit-fallthrough" GCC72=1
|
||||||
|
if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
|
||||||
|
#gcc-7 (Ubuntu 7.2.0-1ubuntu1~14.04) 7.2.0 20170802
|
||||||
|
- os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- libsdl2-mixer-dev
|
||||||
|
- libpng-dev
|
||||||
|
- libgl1-mesa-dev
|
||||||
|
- libgme-dev
|
||||||
|
- libcurl4-openssl-dev
|
||||||
|
- p7zip-full
|
||||||
|
- gcc-8
|
||||||
|
compiler: gcc-8
|
||||||
|
env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wno-implicit-fallthrough -Wno-error=format-overflow -Wno-error=format-truncation" GCC81=1
|
||||||
|
if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
|
||||||
|
#gcc-8 (Ubuntu 7.2.0-1ubuntu1~14.04) 8.1.0
|
||||||
|
- os: linux
|
||||||
|
compiler: clang
|
||||||
|
if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
|
||||||
|
#clang version 3.5.0 (tags/RELEASE_350/final)
|
||||||
|
- os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- llvm-toolchain-precise-3.5
|
||||||
|
packages:
|
||||||
|
- libsdl2-mixer-dev
|
||||||
|
- libpng-dev
|
||||||
|
- libgl1-mesa-dev
|
||||||
|
- libgme-dev
|
||||||
|
- libcurl4-openssl-dev
|
||||||
|
- p7zip-full
|
||||||
|
- clang-3.5
|
||||||
|
compiler: clang-3.5
|
||||||
|
if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
|
||||||
|
#Ubuntu clang version 3.5.0-4ubuntu2~trusty2 (tags/RELEASE_350/final) (based on LLVM 3.5.0)
|
||||||
|
- os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- llvm-toolchain-precise-3.6
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- libsdl2-mixer-dev
|
||||||
|
- libpng-dev
|
||||||
|
- libgl1-mesa-dev
|
||||||
|
- libgme-dev
|
||||||
|
- libcurl4-openssl-dev
|
||||||
|
- p7zip-full
|
||||||
|
- clang-3.6
|
||||||
|
compiler: clang-3.6
|
||||||
|
if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
|
||||||
|
#Ubuntu clang version 3.6.2-svn240577-1~exp1 (branches/release_36) (based on LLVM 3.6.2)
|
||||||
|
- os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- llvm-toolchain-precise-3.7
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- libsdl2-mixer-dev
|
||||||
|
- libpng-dev
|
||||||
|
- libgl1-mesa-dev
|
||||||
|
- libgme-dev
|
||||||
|
- libcurl4-openssl-dev
|
||||||
|
- p7zip-full
|
||||||
|
- clang-3.7
|
||||||
|
compiler: clang-3.7
|
||||||
|
if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
|
||||||
|
#Ubuntu clang version 3.7.1-svn253571-1~exp1 (branches/release_37) (based on LLVM 3.7.1)
|
||||||
|
- os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- llvm-toolchain-precise-3.8
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- libsdl2-mixer-dev
|
||||||
|
- libpng-dev
|
||||||
|
- libgl1-mesa-dev
|
||||||
|
- libgme-dev
|
||||||
|
- libcurl4-openssl-dev
|
||||||
|
- p7zip-full
|
||||||
|
- clang-3.8
|
||||||
|
compiler: clang-3.8
|
||||||
|
if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
|
||||||
|
#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
|
||||||
|
- libcurl4-openssl-dev
|
||||||
|
- p7zip-full
|
||||||
|
- clang-3.9
|
||||||
|
compiler: clang-3.9
|
||||||
|
if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
|
||||||
|
#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
|
||||||
|
# if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
|
||||||
|
# #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
|
||||||
|
# if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
|
||||||
|
# #clang version 5.0.X
|
||||||
|
# - os: osx
|
||||||
|
# osx_image: beta-xcode6.1
|
||||||
|
# if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
|
||||||
|
# #Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
|
||||||
|
# - os: osx
|
||||||
|
# osx_image: beta-xcode6.2
|
||||||
|
# compiler: gcc
|
||||||
|
# if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
|
||||||
|
# #Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
|
||||||
|
## - os: osx
|
||||||
|
## osx_image: beta-xcode6.3
|
||||||
|
## if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
|
||||||
|
## #I think xcode.6.3 VM is broken, it does not boot
|
||||||
|
# - os: osx
|
||||||
|
# osx_image: xcode6.4
|
||||||
|
# if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
|
||||||
|
# #Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
|
||||||
|
# - os: osx
|
||||||
|
# osx_image: xcode7
|
||||||
|
# if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
|
||||||
|
# #Apple LLVM version 7.0.0 (clang-700.0.72)
|
||||||
|
# - os: osx
|
||||||
|
# osx_image: xcode7.1
|
||||||
|
# if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
|
||||||
|
# #Apple LLVM version 7.0.0 (clang-700.1.76)
|
||||||
|
# - os: osx
|
||||||
|
# osx_image: xcode7.2
|
||||||
|
# if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
|
||||||
|
# #Apple LLVM version 7.0.2 (clang-700.1.81)
|
||||||
|
# - os: osx
|
||||||
|
# osx_image: xcode7.3
|
||||||
|
# #Apple LLVM version 7.3.0 (clang-703.0.31)
|
||||||
|
# - os: osx
|
||||||
|
# osx_image: xcode7.3
|
||||||
|
# #Apple LLVM version 7.3.0 (clang-703.0.31)
|
||||||
|
- os: osx
|
||||||
|
if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
|
||||||
|
#Default: macOS 10.13 and Xcode 9.4.1
|
||||||
|
|
||||||
|
|
||||||
|
################################
|
||||||
|
# Deployer Buildbots - OSX
|
||||||
|
################################
|
||||||
|
- os: osx
|
||||||
|
if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1")
|
||||||
|
AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1"))
|
||||||
|
AND env(DPL_TERMINATE_MAIN) != "1"
|
||||||
|
env:
|
||||||
|
- _DPL_JOB_ENABLED=1
|
||||||
|
- _DPL_JOB_NAME=osx
|
||||||
|
- _DPL_FTP_TARGET=1
|
||||||
|
- _DPL_PACKAGE_BINARY=1
|
||||||
|
#Apple LLVM version 7.3.0 (clang-703.0.31)
|
||||||
|
|
||||||
|
|
||||||
|
################################
|
||||||
|
# Deployer Buildbots - Linux assets
|
||||||
|
# Set DPL_TERMINATE_ASSETS to disable all of these
|
||||||
|
# List Ubuntu LTS next, newest to oldest
|
||||||
|
# Then list non-LTS, newest to oldest
|
||||||
|
################################
|
||||||
|
- os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- libsdl2-mixer-dev
|
||||||
|
- libpng-dev
|
||||||
|
- libgl1-mesa-dev
|
||||||
|
- libgme-dev
|
||||||
|
- libcurl4-openssl-dev
|
||||||
|
- p7zip-full
|
||||||
|
- gcc-4.8
|
||||||
|
compiler: gcc-4.8
|
||||||
|
dist: xenial
|
||||||
|
if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1")
|
||||||
|
AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1"))
|
||||||
|
AND env(DPL_TERMINATE_ASSETS) != "1"
|
||||||
|
env:
|
||||||
|
- _DPL_JOB_ENABLED=1
|
||||||
|
- _DPL_JOB_NAME=bionic-asset
|
||||||
|
- _DPL_DPUT_TARGET=1
|
||||||
|
- _DPL_PACKAGE_SOURCE=1
|
||||||
|
- _DPL_PACKAGE_MAIN=0
|
||||||
|
- _DPL_PACKAGE_ASSET=1
|
||||||
|
- PACKAGE_DISTRO=bionic
|
||||||
|
#- PACKAGE_SUBVERSION=~18.04bionic
|
||||||
|
#gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
|
||||||
|
|
||||||
|
################################
|
||||||
|
# The below asset bots produce packages that occupy too much space.
|
||||||
|
# It would be nice if the asset files were not included in the source package itself,
|
||||||
|
# so these can deploy to each Ubuntu target without manual intervention.
|
||||||
|
#
|
||||||
|
# Currently, to get around Launchpad's space limitation,
|
||||||
|
# copy the packages from *one* bot and the space usage is not increased.
|
||||||
|
################################
|
||||||
|
# - os: linux
|
||||||
|
# addons:
|
||||||
|
# apt:
|
||||||
|
# packages:
|
||||||
|
# - libsdl2-mixer-dev
|
||||||
|
# - libpng-dev
|
||||||
|
# - libgl1-mesa-dev
|
||||||
|
# - libgme-dev
|
||||||
|
# - p7zip-full
|
||||||
|
# - gcc-4.8
|
||||||
|
# compiler: gcc-4.8
|
||||||
|
# dist: trusty
|
||||||
|
# if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1")
|
||||||
|
# AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1"))
|
||||||
|
# AND env(DPL_TERMINATE_ASSETS) != "1"
|
||||||
|
# env:
|
||||||
|
# - _DPL_JOB_ENABLED=1
|
||||||
|
# - _DPL_JOB_NAME=trusty-asset
|
||||||
|
# - _DPL_DPUT_TARGET=1
|
||||||
|
# - _DPL_PACKAGE_SOURCE=1
|
||||||
|
# - _DPL_PACKAGE_MAIN=0
|
||||||
|
# - _DPL_PACKAGE_ASSET=1
|
||||||
|
# - PACKAGE_DISTRO=trusty
|
||||||
|
# #- PACKAGE_SUBVERSION=~14.04trusty
|
||||||
|
# #gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
|
||||||
|
# - os: linux
|
||||||
|
# addons:
|
||||||
|
# apt:
|
||||||
|
# packages:
|
||||||
|
# - libsdl2-mixer-dev
|
||||||
|
# - libpng-dev
|
||||||
|
# - libgl1-mesa-dev
|
||||||
|
# - libgme-dev
|
||||||
|
# - p7zip-full
|
||||||
|
# - gcc-4.8
|
||||||
|
# compiler: gcc-4.8
|
||||||
|
# dist: xenial
|
||||||
|
# if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1")
|
||||||
|
# AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1"))
|
||||||
|
# AND env(DPL_TERMINATE_ASSETS) != "1"
|
||||||
|
# env:
|
||||||
|
# - _DPL_JOB_ENABLED=1
|
||||||
|
# - _DPL_JOB_NAME=disco-asset
|
||||||
|
# - _DPL_DPUT_TARGET=1
|
||||||
|
# - _DPL_PACKAGE_SOURCE=1
|
||||||
|
# - _DPL_PACKAGE_MAIN=0
|
||||||
|
# - _DPL_PACKAGE_ASSET=1
|
||||||
|
# - PACKAGE_DISTRO=disco
|
||||||
|
# #- PACKAGE_SUBVERSION=~19.04disco
|
||||||
|
# #gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
|
||||||
|
# - os: linux
|
||||||
|
# addons:
|
||||||
|
# apt:
|
||||||
|
# packages:
|
||||||
|
# - libsdl2-mixer-dev
|
||||||
|
# - libpng-dev
|
||||||
|
# - libgl1-mesa-dev
|
||||||
|
# - libgme-dev
|
||||||
|
# - p7zip-full
|
||||||
|
# - gcc-4.8
|
||||||
|
# compiler: gcc-4.8
|
||||||
|
# dist: xenial
|
||||||
|
# if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1")
|
||||||
|
# AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1"))
|
||||||
|
# AND env(DPL_TERMINATE_ASSETS) != "1"
|
||||||
|
# env:
|
||||||
|
# - _DPL_JOB_ENABLED=1
|
||||||
|
# - _DPL_JOB_NAME=cosmic-asset
|
||||||
|
# - _DPL_DPUT_TARGET=1
|
||||||
|
# - _DPL_PACKAGE_SOURCE=1
|
||||||
|
# - _DPL_PACKAGE_MAIN=0
|
||||||
|
# - _DPL_PACKAGE_ASSET=1
|
||||||
|
# - PACKAGE_DISTRO=cosmic
|
||||||
|
# #- PACKAGE_SUBVERSION=~18.10cosmic
|
||||||
|
# #gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
|
||||||
|
# - os: linux
|
||||||
|
# addons:
|
||||||
|
# apt:
|
||||||
|
# packages:
|
||||||
|
# - libsdl2-mixer-dev
|
||||||
|
# - libpng-dev
|
||||||
|
# - libgl1-mesa-dev
|
||||||
|
# - libgme-dev
|
||||||
|
# - p7zip-full
|
||||||
|
# - gcc-4.8
|
||||||
|
# compiler: gcc-4.8
|
||||||
|
# dist: xenial
|
||||||
|
# if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1")
|
||||||
|
# AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1"))
|
||||||
|
# AND env(DPL_TERMINATE_ASSETS) != "1"
|
||||||
|
# env:
|
||||||
|
# - _DPL_JOB_ENABLED=1
|
||||||
|
# - _DPL_JOB_NAME=xenial-asset
|
||||||
|
# - _DPL_DPUT_TARGET=1
|
||||||
|
# - _DPL_PACKAGE_SOURCE=1
|
||||||
|
# - _DPL_PACKAGE_MAIN=0
|
||||||
|
# - _DPL_PACKAGE_ASSET=1
|
||||||
|
# - PACKAGE_DISTRO=xenial
|
||||||
|
# #- PACKAGE_SUBVERSION=~16.04xenial
|
||||||
|
# #gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
|
||||||
|
|
||||||
|
|
||||||
|
################################
|
||||||
|
# Deployer Buildbots - Linux binaries
|
||||||
|
# List Ubuntu LTS, newest to oldest
|
||||||
|
# Then list non-LTS, newest to oldest
|
||||||
|
################################
|
||||||
|
- os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- libsdl2-mixer-dev
|
||||||
|
- libpng-dev
|
||||||
|
- libgl1-mesa-dev
|
||||||
|
- libgme-dev
|
||||||
|
- libcurl4-openssl-dev
|
||||||
|
- p7zip-full
|
||||||
|
- gcc-4.8
|
||||||
|
compiler: gcc-4.8
|
||||||
|
dist: xenial
|
||||||
|
if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1")
|
||||||
|
AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1"))
|
||||||
|
AND env(DPL_TERMINATE_MAIN) != "1"
|
||||||
|
env:
|
||||||
|
- _DPL_JOB_ENABLED=1
|
||||||
|
- _DPL_JOB_NAME=focal
|
||||||
|
- _DPL_DPUT_TARGET=1
|
||||||
|
- _DPL_PACKAGE_SOURCE=1
|
||||||
|
- PACKAGE_DISTRO=focal
|
||||||
|
- PACKAGE_SUBVERSION=~20.04focal
|
||||||
|
#gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
|
||||||
|
- os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- libsdl2-mixer-dev
|
||||||
|
- libpng-dev
|
||||||
|
- libgl1-mesa-dev
|
||||||
|
- libgme-dev
|
||||||
|
- libcurl4-openssl-dev
|
||||||
|
- p7zip-full
|
||||||
|
- gcc-4.8
|
||||||
|
compiler: gcc-4.8
|
||||||
|
dist: xenial
|
||||||
|
if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1")
|
||||||
|
AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1"))
|
||||||
|
AND env(DPL_TERMINATE_MAIN) != "1"
|
||||||
|
env:
|
||||||
|
- _DPL_JOB_ENABLED=1
|
||||||
|
- _DPL_JOB_NAME=bionic
|
||||||
|
- _DPL_DPUT_TARGET=1
|
||||||
|
- _DPL_PACKAGE_SOURCE=1
|
||||||
|
- PACKAGE_DISTRO=bionic
|
||||||
|
- PACKAGE_SUBVERSION=~18.04bionic
|
||||||
|
#gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
|
||||||
|
- os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- libsdl2-mixer-dev
|
||||||
|
- libpng-dev
|
||||||
|
- libgl1-mesa-dev
|
||||||
|
- libgme-dev
|
||||||
|
- libcurl4-openssl-dev
|
||||||
|
- p7zip-full
|
||||||
|
- gcc-4.8
|
||||||
|
compiler: gcc-4.8
|
||||||
|
dist: xenial
|
||||||
|
if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1")
|
||||||
|
AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1"))
|
||||||
|
AND env(DPL_TERMINATE_MAIN) != "1"
|
||||||
|
env:
|
||||||
|
- _DPL_JOB_ENABLED=1
|
||||||
|
- _DPL_JOB_NAME=xenial
|
||||||
|
- _DPL_DPUT_TARGET=1
|
||||||
|
- _DPL_PACKAGE_SOURCE=1
|
||||||
|
- PACKAGE_DISTRO=xenial
|
||||||
|
- PACKAGE_SUBVERSION=~16.04xenial
|
||||||
|
#gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
|
||||||
|
- os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- libsdl2-mixer-dev
|
||||||
|
- libpng-dev
|
||||||
|
- libgl1-mesa-dev
|
||||||
|
- libgme-dev
|
||||||
|
- libcurl4-openssl-dev
|
||||||
|
- p7zip-full
|
||||||
|
- gcc-4.8
|
||||||
|
compiler: gcc-4.8
|
||||||
|
dist: trusty
|
||||||
|
if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1")
|
||||||
|
AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1"))
|
||||||
|
AND env(DPL_TERMINATE_MAIN) != "1"
|
||||||
|
env:
|
||||||
|
- _DPL_JOB_ENABLED=1
|
||||||
|
- _DPL_JOB_NAME=trusty
|
||||||
|
- _DPL_DPUT_TARGET=1
|
||||||
|
- _DPL_PACKAGE_SOURCE=1
|
||||||
|
- PACKAGE_DISTRO=trusty
|
||||||
|
- PACKAGE_SUBVERSION=~14.04trusty
|
||||||
|
#gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
|
||||||
|
- os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- libsdl2-mixer-dev
|
||||||
|
- libpng-dev
|
||||||
|
- libgl1-mesa-dev
|
||||||
|
- libgme-dev
|
||||||
|
- libcurl4-openssl-dev
|
||||||
|
- p7zip-full
|
||||||
|
- gcc-4.8
|
||||||
|
compiler: gcc-4.8
|
||||||
|
dist: xenial
|
||||||
|
if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1")
|
||||||
|
AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1"))
|
||||||
|
AND env(DPL_TERMINATE_MAIN) != "1"
|
||||||
|
env:
|
||||||
|
- _DPL_JOB_ENABLED=1
|
||||||
|
- _DPL_JOB_NAME=eoan
|
||||||
|
- _DPL_DPUT_TARGET=1
|
||||||
|
- _DPL_PACKAGE_SOURCE=1
|
||||||
|
- PACKAGE_DISTRO=eoan
|
||||||
|
- PACKAGE_SUBVERSION=~19.10eoan
|
||||||
|
#gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
|
||||||
|
allow_failures:
|
||||||
|
- compiler: clang-3.5
|
||||||
|
- compiler: clang-3.6
|
||||||
|
- compiler: clang-3.7
|
||||||
|
- compiler: clang-3.8
|
||||||
|
- compiler: clang-3.9
|
||||||
|
- compiler: clang-4.0
|
||||||
|
- compiler: clang-5.0
|
||||||
|
|
||||||
|
|
||||||
|
cache:
|
||||||
|
apt: true
|
||||||
|
ccache: true
|
||||||
|
directories:
|
||||||
|
- $HOME/srb2_cache
|
||||||
|
|
||||||
|
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- libsdl2-mixer-dev
|
||||||
|
- libpng-dev
|
||||||
|
- libgl1-mesa-dev
|
||||||
|
- libgme-dev
|
||||||
|
- zlib1g-dev
|
||||||
|
- libcurl4-openssl-dev
|
||||||
|
- p7zip-full
|
||||||
|
homebrew:
|
||||||
|
taps:
|
||||||
|
- mazmazz/srb2
|
||||||
|
packages:
|
||||||
|
- sdl2_mixer
|
||||||
|
- game-music-emu
|
||||||
|
- p7zip
|
||||||
|
- cmake
|
||||||
|
- curl
|
||||||
|
update: true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
# Initialize Deployer defaults
|
||||||
|
- . ./deployer/travis/deployer_defaults.sh
|
||||||
|
|
||||||
|
# Initialize Deployer; check if Deployer is enabled
|
||||||
|
# This needs to be run in the current shell so that $__DPL_ACTIVE is set for this session
|
||||||
|
- . ./deployer/travis/deployer.sh
|
||||||
|
|
||||||
|
# Also check if we should now terminate -- see `deployer.sh` for conditions.
|
||||||
|
# This should never happen on non-release buildbots when Deployer is not triggered.
|
||||||
|
- if [[ "$__DPL_TRY_TERMINATE_EARLY" == "1" ]]; then
|
||||||
|
if [[ "$__DPL_ACTIVE" != "1" ]]; then
|
||||||
|
echo "Exiting early because this job is not deploying.";
|
||||||
|
exit;
|
||||||
|
fi;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If we're triggered by release tag, force ASSET_FILES_OPTIONAL_GET=1
|
||||||
|
- if [[ "$__DPL_TAG_ELIGIBLE" = "1" ]]; then
|
||||||
|
ASSET_FILES_OPTIONAL_GET=1;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
|
||||||
|
install:
|
||||||
|
# Install OS X library dependencies via Homebrew
|
||||||
|
# Do this differently for release buildbots:
|
||||||
|
# * `brew install --build-bottle` builds libraries for x86_64's lowest common denominator CPU, core2
|
||||||
|
# * `sdl2_mixer` requires options from the formula tap https://github.com/mazmazz/homebrew-srb2
|
||||||
|
# * `brew postinstall` runs post-install scripts after building a bottle
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
||||||
|
if [[ "$__DPL_ACTIVE" == "1" ]]; then
|
||||||
|
brew install --build-bottle sdl2 game-music-emu;
|
||||||
|
brew install --build-bottle mazmazz/srb2/sdl2_mixer --with-flac --with-mpg123;
|
||||||
|
brew postinstall sdl2 game-music-emu mazmazz/srb2/sdl2_mixer;
|
||||||
|
fi;
|
||||||
|
fi
|
||||||
|
- mkdir -p $HOME/srb2_cache
|
||||||
|
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
# OLDPWD is root repo folder
|
||||||
|
- OLDPWD=$PWD
|
||||||
|
- __ASSET_DIRECTORY="$OLDPWD/assets/installer"
|
||||||
|
- mkdir -p "$__ASSET_DIRECTORY"
|
||||||
|
- cd "$HOME/srb2_cache"
|
||||||
|
|
||||||
|
# Get stat command so we know what the cached archive date is.
|
||||||
|
# stat is different for OSX
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
||||||
|
STATCMD="stat -f %m";
|
||||||
|
else
|
||||||
|
STATCMD="stat -c %y";
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Get asset files (required for MD5)
|
||||||
|
# See `deployer_defaults.sh` for asset download path
|
||||||
|
- if [[ "$ASSET_ARCHIVE_PATH" != "" ]]; then
|
||||||
|
if [ -f "$(basename $ASSET_ARCHIVE_PATH)" ]; then
|
||||||
|
echo "$(basename $ASSET_ARCHIVE_PATH) cache date -- $($STATCMD $(basename $ASSET_ARCHIVE_PATH))";
|
||||||
|
fi;
|
||||||
|
wget --verbose --server-response -N "$ASSET_ARCHIVE_PATH";
|
||||||
|
7z x "$(basename $ASSET_ARCHIVE_PATH)" -o"$__ASSET_DIRECTORY" -aos;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
# Get optional files too
|
||||||
|
- if [[ "$__DPL_ACTIVE" == "1" ]] && [[ "$ASSET_FILES_OPTIONAL_GET" == "1" ]] && [[ "$ASSET_ARCHIVE_OPTIONAL_PATH" != "" ]]; then
|
||||||
|
if [ -f "$(basename $ASSET_ARCHIVE_OPTIONAL_PATH)" ]; then
|
||||||
|
echo "$(basename $ASSET_ARCHIVE_OPTIONAL_PATH) cache date -- $($STATCMD $(basename $ASSET_ARCHIVE_OPTIONAL_PATH))";
|
||||||
|
fi;
|
||||||
|
wget --verbose --server-response -N "$ASSET_ARCHIVE_OPTIONAL_PATH";
|
||||||
|
7z x "$(basename $ASSET_ARCHIVE_OPTIONAL_PATH)" -o"$__ASSET_DIRECTORY" -aos;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
# Go back to root repo folder
|
||||||
|
- cd "$OLDPWD"
|
||||||
|
|
||||||
|
# Prepare CMake asset lists
|
||||||
|
- SRB2_ASSET_HASHED=$(echo ${ASSET_FILES_HASHED// /\;})
|
||||||
|
- SRB2_ASSET_DOCS=$(echo ${ASSET_FILES_DOCS// /\;})
|
||||||
|
- SRB2_ASSET_DIRECTORY="$__ASSET_DIRECTORY"
|
||||||
|
|
||||||
|
# Prepare CMake
|
||||||
|
- mkdir build
|
||||||
|
- cd build
|
||||||
|
- mkdir package
|
||||||
|
- export CFLAGS="-Wall -W -Werror $WFLAGS"
|
||||||
|
- export CCACHE_COMPRESS=true
|
||||||
|
# If OS X, set -march=core2 to build compatible binaries with old Macs
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
||||||
|
export CFLAGS="${CFLAGS} -march=core2";
|
||||||
|
fi;
|
||||||
|
- cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/bin -DCPACK_PACKAGE_DIRECTORY=$PWD/package
|
||||||
|
-DSRB2_ASSET_HASHED="${SRB2_ASSET_HASHED}" -DSRB2_ASSET_DOCS="${SRB2_ASSET_DOCS}"
|
||||||
|
-DSRB2_ASSET_DIRECTORY="${SRB2_ASSET_DIRECTORY}"
|
||||||
|
-DCPACK_PACKAGE_DESCRIPTION_SUMMARY="${PROGRAM_NAME}"
|
||||||
|
-DCPACK_PACKAGE_VENDOR="${PROGRAM_VENDOR}"
|
||||||
|
-DSRB2_SDL2_EXE_NAME="${PROGRAM_FILENAME}"
|
||||||
|
|
||||||
|
script:
|
||||||
|
# Build our Makefile from Cmake!
|
||||||
|
- if [[ "$__DPL_ACTIVE" == "1" ]]; then
|
||||||
|
. ../deployer/travis/deployer_build.sh;
|
||||||
|
else
|
||||||
|
make -k;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
after_success:
|
||||||
|
# Run the upload scripts
|
||||||
|
# These do nothing if Deployer is not triggered
|
||||||
|
- . ../deployer/travis/deployer_ftp.sh
|
||||||
|
- . ../deployer/travis/deployer_dput.sh
|
||||||
@@ -0,0 +1,269 @@
|
|||||||
|
# Doxyfile 1.4.3
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Project related configuration options
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
PROJECT_NAME = SRB2
|
||||||
|
PROJECT_NUMBER = 1.09
|
||||||
|
OUTPUT_DIRECTORY = ./doc/SRB2
|
||||||
|
CREATE_SUBDIRS = YES
|
||||||
|
OUTPUT_LANGUAGE = English
|
||||||
|
USE_WINDOWS_ENCODING = YES
|
||||||
|
BRIEF_MEMBER_DESC = YES
|
||||||
|
REPEAT_BRIEF = YES
|
||||||
|
ABBREVIATE_BRIEF = "The $name class" \
|
||||||
|
"The $name widget" \
|
||||||
|
"The $name file" \
|
||||||
|
is \
|
||||||
|
provides \
|
||||||
|
specifies \
|
||||||
|
contains \
|
||||||
|
represents \
|
||||||
|
a \
|
||||||
|
an \
|
||||||
|
the
|
||||||
|
ALWAYS_DETAILED_SEC = NO
|
||||||
|
INLINE_INHERITED_MEMB = NO
|
||||||
|
FULL_PATH_NAMES = YES
|
||||||
|
STRIP_FROM_PATH =
|
||||||
|
STRIP_FROM_INC_PATH =
|
||||||
|
SHORT_NAMES = NO
|
||||||
|
JAVADOC_AUTOBRIEF = NO
|
||||||
|
MULTILINE_CPP_IS_BRIEF = NO
|
||||||
|
DETAILS_AT_TOP = NO
|
||||||
|
INHERIT_DOCS = YES
|
||||||
|
DISTRIBUTE_GROUP_DOC = NO
|
||||||
|
SEPARATE_MEMBER_PAGES = NO
|
||||||
|
TAB_SIZE = 8
|
||||||
|
ALIASES =
|
||||||
|
OPTIMIZE_OUTPUT_FOR_C = YES
|
||||||
|
OPTIMIZE_OUTPUT_JAVA = NO
|
||||||
|
SUBGROUPING = YES
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Build related configuration options
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
EXTRACT_ALL = YES
|
||||||
|
EXTRACT_PRIVATE = YES
|
||||||
|
EXTRACT_STATIC = YES
|
||||||
|
EXTRACT_LOCAL_CLASSES = YES
|
||||||
|
EXTRACT_LOCAL_METHODS = NO
|
||||||
|
HIDE_UNDOC_MEMBERS = NO
|
||||||
|
HIDE_UNDOC_CLASSES = NO
|
||||||
|
HIDE_FRIEND_COMPOUNDS = NO
|
||||||
|
HIDE_IN_BODY_DOCS = NO
|
||||||
|
INTERNAL_DOCS = NO
|
||||||
|
CASE_SENSE_NAMES = NO
|
||||||
|
HIDE_SCOPE_NAMES = NO
|
||||||
|
SHOW_INCLUDE_FILES = YES
|
||||||
|
INLINE_INFO = YES
|
||||||
|
SORT_MEMBER_DOCS = YES
|
||||||
|
SORT_BRIEF_DOCS = NO
|
||||||
|
SORT_BY_SCOPE_NAME = NO
|
||||||
|
GENERATE_TODOLIST = YES
|
||||||
|
GENERATE_TESTLIST = YES
|
||||||
|
GENERATE_BUGLIST = YES
|
||||||
|
GENERATE_DEPRECATEDLIST= YES
|
||||||
|
ENABLED_SECTIONS =
|
||||||
|
MAX_INITIALIZER_LINES = 30
|
||||||
|
SHOW_USED_FILES = YES
|
||||||
|
SHOW_DIRECTORIES = YES
|
||||||
|
FILE_VERSION_FILTER =
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to warning and progress messages
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
QUIET = NO
|
||||||
|
WARNINGS = YES
|
||||||
|
WARN_IF_UNDOCUMENTED = YES
|
||||||
|
WARN_IF_DOC_ERROR = YES
|
||||||
|
WARN_NO_PARAMDOC = NO
|
||||||
|
WARN_FORMAT = "$file:$line: $text"
|
||||||
|
WARN_LOGFILE =
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the input files
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
INPUT = ./src
|
||||||
|
FILE_PATTERNS = *.c \
|
||||||
|
*.cc \
|
||||||
|
*.cxx \
|
||||||
|
*.cpp \
|
||||||
|
*.c++ \
|
||||||
|
*.d \
|
||||||
|
*.java \
|
||||||
|
*.ii \
|
||||||
|
*.ixx \
|
||||||
|
*.ipp \
|
||||||
|
*.i++ \
|
||||||
|
*.inl \
|
||||||
|
*.h \
|
||||||
|
*.hh \
|
||||||
|
*.hxx \
|
||||||
|
*.hpp \
|
||||||
|
*.h++ \
|
||||||
|
*.idl \
|
||||||
|
*.odl \
|
||||||
|
*.cs \
|
||||||
|
*.php \
|
||||||
|
*.php3 \
|
||||||
|
*.inc \
|
||||||
|
*.m \
|
||||||
|
*.mm \
|
||||||
|
*.dox
|
||||||
|
RECURSIVE = YES
|
||||||
|
EXCLUDE = ./src/sdl/IMG_xpm.c \
|
||||||
|
./src/sdl/SRB2DC/scramble.c
|
||||||
|
EXCLUDE_SYMLINKS = NO
|
||||||
|
EXCLUDE_PATTERNS = */src/hardware/*/* \
|
||||||
|
*/src/sdl/SDL_main/* \
|
||||||
|
*/src/*/*_private.h \
|
||||||
|
*/src/sdl/*/*help.? \
|
||||||
|
*/src/md5.? \
|
||||||
|
*/src/sdl/filter/*
|
||||||
|
EXAMPLE_PATH =
|
||||||
|
EXAMPLE_PATTERNS = *
|
||||||
|
EXAMPLE_RECURSIVE = NO
|
||||||
|
IMAGE_PATH =
|
||||||
|
INPUT_FILTER =
|
||||||
|
FILTER_PATTERNS =
|
||||||
|
FILTER_SOURCE_FILES = YES
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to source browsing
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
SOURCE_BROWSER = NO
|
||||||
|
INLINE_SOURCES = NO
|
||||||
|
STRIP_CODE_COMMENTS = YES
|
||||||
|
REFERENCED_BY_RELATION = NO
|
||||||
|
REFERENCES_RELATION = NO
|
||||||
|
#USE_HTAGS = NO
|
||||||
|
VERBATIM_HEADERS = YES
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the alphabetical class index
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
ALPHABETICAL_INDEX = NO
|
||||||
|
COLS_IN_ALPHA_INDEX = 5
|
||||||
|
IGNORE_PREFIX =
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the HTML output
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
GENERATE_HTML = YES
|
||||||
|
HTML_OUTPUT = html
|
||||||
|
HTML_FILE_EXTENSION = .html
|
||||||
|
HTML_HEADER =
|
||||||
|
HTML_FOOTER =
|
||||||
|
HTML_STYLESHEET =
|
||||||
|
HTML_ALIGN_MEMBERS = YES
|
||||||
|
GENERATE_HTMLHELP = NO
|
||||||
|
CHM_FILE =
|
||||||
|
HHC_LOCATION =
|
||||||
|
GENERATE_CHI = NO
|
||||||
|
BINARY_TOC = NO
|
||||||
|
TOC_EXPAND = NO
|
||||||
|
DISABLE_INDEX = NO
|
||||||
|
ENUM_VALUES_PER_LINE = 4
|
||||||
|
GENERATE_TREEVIEW = YES
|
||||||
|
TREEVIEW_WIDTH = 250
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the LaTeX output
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
GENERATE_LATEX = NO
|
||||||
|
LATEX_OUTPUT = latex
|
||||||
|
LATEX_CMD_NAME = latex
|
||||||
|
MAKEINDEX_CMD_NAME = makeindex
|
||||||
|
COMPACT_LATEX = NO
|
||||||
|
PAPER_TYPE = a4wide
|
||||||
|
EXTRA_PACKAGES =
|
||||||
|
LATEX_HEADER =
|
||||||
|
PDF_HYPERLINKS = NO
|
||||||
|
USE_PDFLATEX = NO
|
||||||
|
LATEX_BATCHMODE = NO
|
||||||
|
LATEX_HIDE_INDICES = NO
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the RTF output
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
GENERATE_RTF = NO
|
||||||
|
RTF_OUTPUT = rtf
|
||||||
|
COMPACT_RTF = NO
|
||||||
|
RTF_HYPERLINKS = NO
|
||||||
|
RTF_STYLESHEET_FILE =
|
||||||
|
RTF_EXTENSIONS_FILE =
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the man page output
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
GENERATE_MAN = NO
|
||||||
|
MAN_OUTPUT = man
|
||||||
|
MAN_EXTENSION = .3
|
||||||
|
MAN_LINKS = YES
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the XML output
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
GENERATE_XML = NO
|
||||||
|
XML_OUTPUT = xml
|
||||||
|
XML_SCHEMA =
|
||||||
|
XML_DTD =
|
||||||
|
XML_PROGRAMLISTING = YES
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options for the AutoGen Definitions output
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
GENERATE_AUTOGEN_DEF = NO
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the Perl module output
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
GENERATE_PERLMOD = NO
|
||||||
|
PERLMOD_LATEX = NO
|
||||||
|
PERLMOD_PRETTY = YES
|
||||||
|
PERLMOD_MAKEVAR_PREFIX =
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Configuration options related to the preprocessor
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
ENABLE_PREPROCESSING = YES
|
||||||
|
MACRO_EXPANSION = NO
|
||||||
|
EXPAND_ONLY_PREDEF = NO
|
||||||
|
SEARCH_INCLUDES = YES
|
||||||
|
INCLUDE_PATH =
|
||||||
|
INCLUDE_FILE_PATTERNS =
|
||||||
|
PREDEFINED = DOXYGEN \
|
||||||
|
HWRENDER \
|
||||||
|
DIRECTFULLSCREEN \
|
||||||
|
HW3SOUND \
|
||||||
|
LOGMESSAGES \
|
||||||
|
WALLSPLATS \
|
||||||
|
FLOORSPLATS
|
||||||
|
EXPAND_AS_DEFINED =
|
||||||
|
SKIP_FUNCTION_MACROS = YES
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Configuration::additions related to external references
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
TAGFILES =
|
||||||
|
GENERATE_TAGFILE =
|
||||||
|
ALLEXTERNALS = NO
|
||||||
|
EXTERNAL_GROUPS = YES
|
||||||
|
PERL_PATH = /usr/bin/perl
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Configuration options related to the dot tool
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
CLASS_DIAGRAMS = YES
|
||||||
|
HIDE_UNDOC_RELATIONS = YES
|
||||||
|
HAVE_DOT = NO
|
||||||
|
CLASS_GRAPH = YES
|
||||||
|
COLLABORATION_GRAPH = YES
|
||||||
|
GROUP_GRAPHS = YES
|
||||||
|
UML_LOOK = NO
|
||||||
|
TEMPLATE_RELATIONS = NO
|
||||||
|
INCLUDE_GRAPH = YES
|
||||||
|
INCLUDED_BY_GRAPH = YES
|
||||||
|
CALL_GRAPH = NO
|
||||||
|
GRAPHICAL_HIERARCHY = YES
|
||||||
|
DIRECTORY_GRAPH = YES
|
||||||
|
DOT_IMAGE_FORMAT = png
|
||||||
|
DOT_PATH =
|
||||||
|
DOTFILE_DIRS =
|
||||||
|
MAX_DOT_GRAPH_WIDTH = 1024
|
||||||
|
MAX_DOT_GRAPH_HEIGHT = 1024
|
||||||
|
MAX_DOT_GRAPH_DEPTH = 1000
|
||||||
|
DOT_TRANSPARENT = NO
|
||||||
|
DOT_MULTI_TARGETS = NO
|
||||||
|
GENERATE_LEGEND = YES
|
||||||
|
DOT_CLEANUP = YES
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Configuration::additions related to the search engine
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
SEARCHENGINE = NO
|
||||||
@@ -1,35 +1,103 @@
|
|||||||
# SRB2Kart-Saturn
|
# SRB2Kart: Saturn
|
||||||
|
|
||||||
SRB2Kart-Saturn is a modification of SRB2Kart with a focus on new Features, Fixes, Optimizations and general Improvements, all while retaining 100% compatibility with vanilla SRB2Kart.
|
|
||||||
|
|
||||||
[SRB2Kart](https://srb2.org/mods/) is a kart racing mod based on the 3D Sonic the Hedgehog fangame [Sonic Robo Blast 2](https://srb2.org/), based on a modified version of [Doom Legacy](http://doomlegacy.sourceforge.net/).
|
[SRB2Kart](https://srb2.org/mods/) is a kart racing mod based on the 3D Sonic the Hedgehog fangame [Sonic Robo Blast 2](https://srb2.org/), based on a modified version of [Doom Legacy](http://doomlegacy.sourceforge.net/).
|
||||||
|
|
||||||
For more information on Saturn´s features check out the changelogs on the [Releases](https://github.com/Indev450/SRB2Kart-Saturn/releases) page and the ingame "Saturn Options" menu.
|
## Saturn Features (Take a look at the "Saturn Options" menu c;)
|
||||||
|
|
||||||
Also be sure to check the LUASTUFF file for more information on all the extra lua features Saturn has.
|
- Sprites player rotation on slopes; going on hills, levitate, going down, and so on alters your sprites (configurable)
|
||||||
|
- You can alter all the base kart HUD element offsets on the fly in the Saturn Options settings menu
|
||||||
|
- `addfilelocal` Command, for those who want to use things like their custom hud in netgames (Same as addfile but completely client sided)
|
||||||
|
- Palette rendering, make the OpenGL renderer (almost) look like software mode!
|
||||||
|
- OpenMPT for Tracker module playback instead of GME
|
||||||
|
- Fixes looping and sounds better
|
||||||
|
- Allows filter configuration
|
||||||
|
- Colourize your Kart HUD, to either your player color or whichever colour you like! (optional / requieres extra2.kart file)
|
||||||
|
- The minimal brightness with Shaders can be configured, now you can seeeee in dark areas (0-255 , uses Sector brightness values)
|
||||||
|
- Lua HUD hooks for Intermission (ex: You can make hostmod votes still visible during intermission!)
|
||||||
|
- Lua HUD hooks for Vote Screen (ex: You can make hostmod votes still visible during map vote screen!)
|
||||||
|
- Saltyhop! do a funny hop
|
||||||
|
- Smaller Speedometer (optional / requieres extra.kart file)
|
||||||
|
- Record Attack input display can now be used everywhere
|
||||||
|
- Smaller minimap icons and also show player names on the minimap (toggable)
|
||||||
|
- Support for animated votescreens!
|
||||||
|
- `showmusiccredit` command, shows you the current music track again
|
||||||
|
- `listskins` show a list of all skins currently loaded
|
||||||
|
- Visual Portals from Haya's HEP Client
|
||||||
|
- Horizonline effect in OpenGL (watch the endless bricks on SNES Bowsers Castle!)
|
||||||
|
- Localskins! use whatever skin you like!
|
||||||
|
- Toggable lowercase menu's also from Haya's HEP client
|
||||||
|
- Everything that Galaxy has
|
||||||
|
|
||||||
We also have a Flatpak available on [Flathub](https://flathub.org/en/apps/org.srb2.SRB2Kart-Saturn)! (many thanks to riomccloud!)
|
## Improvements / Bug fixes
|
||||||
|
|
||||||
|
- Replay size has been increased to 10MiB minimum, to make replay overflows very unlikely to happen
|
||||||
|
- can be set to 100MiB max with `maxdemosize` command in console
|
||||||
|
- Music changes now properly show the music credits (ex: Kart maps with easter eggs that alter the music)
|
||||||
|
- The mapper still has to provide a MusicDEF for this to work.
|
||||||
|
- Configurable chatlog length (yay can read those messages from 30 mins ago without opening log.txt)
|
||||||
|
- Configurable timeout for waiting to join a full server (in vanilla this is capped to 5 minutes before it boots you out)
|
||||||
|
- Characters now spin in skin selection menu (configurable)
|
||||||
|
- HTTP Addon download speed has been raised dramatically
|
||||||
|
- configurable with `downloadspeed` command
|
||||||
|
- HWR Drawnodes have been refactored, this should fix a few rare crashes esp in regards to OpenGL Visportals
|
||||||
|
- The Position Number in the corner is alot smaller now (half the size!)
|
||||||
|
- Toggable Lap animation
|
||||||
|
- Main menu shows the current renderer being used
|
||||||
|
- MSAA and A2C Antialiasing support (Configurable in renderer.txt file)
|
||||||
|
- A simple button to rejoin your last visited server
|
||||||
|
- Ability to show ALL maps in the mapselect screen, this includes hidden or hellmaps "showallmaps yes/no"
|
||||||
|
- Ability to toggle the Stagetitlecard "maptitles on/off"
|
||||||
|
|
||||||
|
## Performance / Debugging
|
||||||
|
|
||||||
|
- Access for `mobj_t` and `player_t` fields from Lua has been completely rewritten, for much better performance with many Lua scripts
|
||||||
|
- Lua shows Tracebacks whenever an error occurs
|
||||||
|
- The Lua Perfstats page now has multiple pages and is more organized (ps_thinkframe_page X in console)
|
||||||
|
- People with lower end hardware can disable "screen textures" with "gr_screentextures" command, huge performance gain with minimal visual loss
|
||||||
|
- Intermission backgrounds, heat wave effects and etc are broken with this
|
||||||
|
- `ffloorclip`, exclusive to Software, which boosts performance on maps with many Floor over Floor sectors
|
||||||
|
|
||||||
|
## Technical fixes
|
||||||
|
|
||||||
|
- ZFigthing Textures in Opengl mode have been fixed in engine (well almost all of it)
|
||||||
|
- FOFs intersecting with slopes have less issues and now render correctly in Opengl
|
||||||
|
- Midtextures on slopes in Opengl are fixed, many weird guardrails and fences, aswell as some of those sticking out textures from the ground on some maps should be gone
|
||||||
|
- The annoying depraction messages for `P_TeleportMove` and `P_AproxDistance` have been silenced
|
||||||
|
- Silenced the annoying "cant find next map..." messages as theyre super useless and annoying anyways
|
||||||
|
- Added a small cooldown on `map` command due to spamming causing a SIGSEGV
|
||||||
|
- Many bugfixes to the Software renderer, so its much less prone to crashing
|
||||||
|
- Many bugfixes to the OpenGL renderer (too many too list all of them here; check the changelogs for more information)
|
||||||
|
- Bugfixes to the soundsystem, mainly regarding Sound muting
|
||||||
|
- Refactored Zone Memory Allocations (helps a bit with large maps)
|
||||||
|
- Many many more crash fixes and other bugfixes to the basegame (too many too list all of them here; check the changelogs for more information)
|
||||||
|
|
||||||
|
- Crash Backtraces have been replaced by libbacktrace (except for 32bit Windows builds)
|
||||||
|
Crashlogs now contain alot more informations. and even more if your build has debug symbols
|
||||||
|
Also allows 64bit Windows builds to produce Crashlogs!
|
||||||
|
|
||||||
|
## MISC
|
||||||
|
- Bird's Camera Tilting feature is no longer turned on by default
|
||||||
|
- Bird's warning on the title screen has been removed
|
||||||
|
|
||||||
|
## Bugs
|
||||||
|
- On maps which change the song multiple times on map start (exp: Wandering Falls) may show multiple music credits appearing
|
||||||
|
- A2C antialiasing makes transparent surfaces even more transparent
|
||||||
|
- You tell us! c:
|
||||||
|
|
||||||
|
## Note
|
||||||
|
Check the LUASTUFF file for more information on all the lua things Saturn has.
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
- SDL2 (Linux/OS X only)
|
- SDL2 (Linux/OS X only)
|
||||||
- SDL2-Mixer (Linux/OS X only)
|
- SDL2-Mixer (Linux/OS X only)
|
||||||
|
- libupnp (Linux/OS X only)
|
||||||
- libgme (Linux/OS X only)
|
- libgme (Linux/OS X only)
|
||||||
- libopenmpt (Linux/OS X only)
|
- libopenmpt (Linux/OS X only)
|
||||||
- libbacktrace (Linux/OS X only, optional, disable support with NOLIBBACKTRACE)
|
- libbacktrace (Linux/OS X only)
|
||||||
- libupnp (Linux/OS X only, optional, enable support with HAVE_MINIUPNPC)
|
|
||||||
|
|
||||||
## Compiling
|
## Compiling
|
||||||
|
|
||||||
See [SRB2 Wiki/Source code compiling](http://wiki.srb2.org/wiki/Source_code_compiling). The compiling process for SRB2Kart is largely identical to SRB2.
|
See [SRB2 Wiki/Source code compiling](http://wiki.srb2.org/wiki/Source_code_compiling). The compiling process for SRB2Kart is largely identical to SRB2.
|
||||||
|
|
||||||
Currently only the Makefile build system with GCC or Clang compiler is supported.
|
|
||||||
|
|
||||||
Visual C++ (MSVC) is unsupported.
|
|
||||||
|
|
||||||
64-bit Windows builds are supported and recommended over 32-bit builds, they will build automatically when using the MSYS2 MinGW 64-bit executable (requires the mingw-w64-x86_64-gcc package), no extra flags needed!
|
|
||||||
The specific DLLs can be found under /libs/dll-binaries/(i686 for 32bit/x86_64 for 64-bit)/ or in the Release packages
|
|
||||||
|
|
||||||
Alternatively the [srb2bld](https://github.com/Bijman/srb2bld) script by Bijman can be used aswell!
|
|
||||||
|
|
||||||
## Disclaimer
|
## Disclaimer
|
||||||
Kart Krew is in no way affiliated with SEGA or Sonic Team. We do not claim ownership of any of SEGA's intellectual property used in SRB2.
|
Kart Krew is in no way affiliated with SEGA or Sonic Team. We do not claim ownership of any of SEGA's intellectual property used in SRB2.
|
||||||
+133
@@ -0,0 +1,133 @@
|
|||||||
|
version: 1.3.{branch}-{build}
|
||||||
|
os: MinGW
|
||||||
|
|
||||||
|
environment:
|
||||||
|
CC: ccache
|
||||||
|
CCACHE_CC: i686-w64-mingw32-gcc
|
||||||
|
CCACHE_CC_64: x86_64-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
|
||||||
|
UPX_ZIP: upx391w
|
||||||
|
UPX_URL: http://upx.sourceforge.net/download/upx391w.zip
|
||||||
|
CCACHE_EXE: ccache.exe
|
||||||
|
CCACHE_URL: http://alam.srb2.org/ccache.exe
|
||||||
|
CCACHE_COMPRESS: true
|
||||||
|
CCACHE_DIR: C:\Users\appveyor\.ccache
|
||||||
|
# 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`.
|
||||||
|
# DPL_TAG_ENABLED=1 will also build installers for release tags. DPL_ENABLED=1 must also be set.
|
||||||
|
# Set these in the Appveyor project settings
|
||||||
|
##############################
|
||||||
|
DPL_ENABLED: 0
|
||||||
|
DPL_TAG_ENABLED: 0
|
||||||
|
DPL_INSTALLER_NAME: srb2kart-v13
|
||||||
|
# Asset handling is barebones vs. Travis Deployer. We operate on 7z only.
|
||||||
|
# Include the README files and the OpenGL batch in the main and patch archives.
|
||||||
|
# The x86/x64 archives contain the DLL binaries.
|
||||||
|
ASSET_ARCHIVE_PATH: https://github.com/mazmazz/Kart-Public/releases/download/kart_assets/srb2kart-v102-assets.7z
|
||||||
|
ASSET_ARCHIVE_PATCH_PATH: https://github.com/mazmazz/Kart-Public/releases/download/kart_assets/srb2kart-v102-patch-assets.7z
|
||||||
|
ASSET_ARCHIVE_X86_PATH: https://github.com/mazmazz/Kart-Public/releases/download/kart_assets/srb2kart-v102-x86-assets.7z
|
||||||
|
ASSET_ARCHIVE_X64_PATH: https://github.com/mazmazz/Kart-Public/releases/download/kart_assets/srb2kart-v102-x64-assets.7z
|
||||||
|
ASSET_ARCHIVE_OPTIONAL_PATH: https://github.com/mazmazz/Kart-Public/releases/download/kart_assets/srb2kart-v102-optional-assets.7z
|
||||||
|
# This is overridden to 1 for release tag builds
|
||||||
|
ASSET_FILES_OPTIONAL_GET: 0
|
||||||
|
# For patches, also include the X86/X64 DLLs.
|
||||||
|
PACKAGE_PATCH_DLL_GET: 0
|
||||||
|
# Delete all asset downloads so they can be redownloaded
|
||||||
|
ASSET_CLEAN: 0
|
||||||
|
|
||||||
|
cache:
|
||||||
|
- upx391w.zip
|
||||||
|
- ccache.exe
|
||||||
|
- C:\Users\appveyor\.ccache
|
||||||
|
- 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 "%UPX_ZIP%.zip" appveyor DownloadFile "%UPX_URL%" -FileName "%UPX_ZIP%.zip"
|
||||||
|
- 7z x -y "%UPX_ZIP%.zip" -o%TMP% >null
|
||||||
|
- robocopy /S /xx /ns /nc /nfl /ndl /np /njh /njs "%TMP%\%UPX_ZIP%" "%MINGW_SDK%\bin" upx.exe || exit 0
|
||||||
|
|
||||||
|
- if not exist "%CCACHE_EXE%" appveyor DownloadFile "%CCACHE_URL%" -FileName "%CCACHE_EXE%"
|
||||||
|
- ccache -M 99M
|
||||||
|
- xcopy /Y /V /I ccache.exe "%MINGW_SDK%\bin"
|
||||||
|
|
||||||
|
configuration:
|
||||||
|
- SDL
|
||||||
|
#- 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 [%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"
|
||||||
|
|
||||||
|
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
|
||||||
|
- appveyor PushArtifact %BUILD_ARCHIVE%
|
||||||
|
- cmd: copy %BUILD_ARCHIVE% %BUILDSARCHIVE%
|
||||||
|
- appveyor PushArtifact %BUILDSARCHIVE%
|
||||||
|
##############################
|
||||||
|
# DEPLOYER SCRIPT
|
||||||
|
##############################
|
||||||
|
- if [%DPL_ENABLED%] == [1] ( call "deployer\appveyor\deployer.bat" )
|
||||||
|
|
||||||
|
test: off
|
||||||
|
|
||||||
|
#deploy:
|
||||||
|
# - provider: FTP
|
||||||
|
# protocol: ftps
|
||||||
|
# host:
|
||||||
|
# secure: NsLJEPIBvmwCOj8Tg8RoRQ==
|
||||||
|
# username:
|
||||||
|
# secure: ejxi5mvk7oLYu7QtbYojajEPigMy0mokaKhuEVuDZcA=
|
||||||
|
# password:
|
||||||
|
# secure: Hbn6Uy3lT0YZ88yFJ3aW4w==
|
||||||
|
# folder: appveyor
|
||||||
|
# application:
|
||||||
|
# active_mode: false
|
||||||
|
# on:
|
||||||
|
# branch: master
|
||||||
|
# appveyor_repo_tag: true
|
||||||
|
|
||||||
|
|
||||||
|
on_finish:
|
||||||
|
#- cmd: echo xfreerdp /u:appveyor /cert-ignore +clipboard /v:<ip>:<port>
|
||||||
|
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
srb2 for Debian
|
||||||
|
---------------
|
||||||
|
|
||||||
|
SRB2 Debian package!
|
||||||
|
Hi there, to rebuild these packages just use debuild in the root source directory (not /src!).
|
||||||
|
You can build these with or without a key if you want, but if you want to put these on a repo,
|
||||||
|
generate your own GnuPG key as per the https://help.ubuntu.com/community/GnuPrivacyGuardHowto
|
||||||
|
instructions and pass the -k<keyid> command to debuild. Make sure you export the key footprint
|
||||||
|
and give them to your users to install with apt-key add. Thanks!
|
||||||
|
|
||||||
|
-- Callum Dickinson <gcfreak_ag20@hotmail.com> Fri, 26 Nov 2010 18:25:31 +1300
|
||||||
|
|
||||||
|
---------------
|
||||||
|
|
||||||
|
|
||||||
|
Templating
|
||||||
|
|
||||||
|
Note that you MUST run [repo-root]/debian_template.sh before running debuild
|
||||||
|
on these scripts! debian_template.sh fills these template files with working values.
|
||||||
|
|
||||||
|
You should also set PACKAGE_NAME_EMAIL="John Doe <jdoe@example.com>" to match
|
||||||
|
the identity of the key you will use to sign the package.
|
||||||
|
|
||||||
|
|
||||||
|
Building for Launchpad PPA
|
||||||
|
|
||||||
|
Use these steps to prepare building a source package for Launchpad:
|
||||||
|
|
||||||
|
1. cd [repo-root]
|
||||||
|
2. git reset --hard; git clean -fd; git clean -fx;
|
||||||
|
* Resets your repo folder to a committed state and removes untracked files
|
||||||
|
* If you built srb2-data in the assets/ folder, MAKE SURE THAT FOLDER DOES NOT HAVE ASSETS,
|
||||||
|
OR THEY MAY BE INCLUDED IN THE MAIN SOURCE PACKAGE!
|
||||||
|
|
||||||
|
Build the source package:
|
||||||
|
|
||||||
|
1. source [repo-root]/debian_template.sh
|
||||||
|
* Initializes defaults for the package variables and fills in templates.
|
||||||
|
2. debuild -S (builds the source package for Launchpad)
|
||||||
|
|
||||||
|
|
||||||
|
Signing for Launchpad PPA
|
||||||
|
|
||||||
|
First, follow Callum's instructions to generate a GnuPG key with your identity. You will need
|
||||||
|
to publish the fingerprint of that key to Ubuntu's key server.
|
||||||
|
|
||||||
|
https://help.ubuntu.com/community/GnuPrivacyGuardHowto#Uploading_the_key_to_Ubuntu_keyserver
|
||||||
|
|
||||||
|
Next, you will have to add that key fingerprint to your Launchpad account. Go to your Launchpad
|
||||||
|
profile and click the yellow Edit button next to "OpenPGP keys". Once you add the key, you can
|
||||||
|
upload signed source packages and publish them onto your PPA.
|
||||||
|
|
||||||
|
IF YOU UPLOAD A PACKAGE and Launchpad does NOT send you a confirmation or rejection email, that
|
||||||
|
means your key is not set up correctly with your Launchpad account.
|
||||||
|
|
||||||
|
Finally, if your packages have not already been signed, follow these steps:
|
||||||
|
|
||||||
|
1. cd ..
|
||||||
|
* Packages are located in the parent folder of where debuild was called
|
||||||
|
2. debsign "srb2_[version]_source.changes"
|
||||||
|
* You may need to specify -k [key-fingerprint]
|
||||||
|
|
||||||
|
|
||||||
|
Uploading for Launchpad PPA
|
||||||
|
|
||||||
|
Follow the instructions at <https://help.launchpad.net/Packaging/PPA/Uploading> to upload
|
||||||
|
to your PPA and have Launchpad build your binary deb packages.
|
||||||
|
|
||||||
|
|
||||||
|
-- Marco Zafra <marco.a.zafra@gmail.com> Mon, 26 Nov 2018 21:13:00 -0500
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
srb2 for Debian
|
||||||
|
---------------
|
||||||
|
|
||||||
|
Here it is! SRB2 v2.1.2 source code!
|
||||||
|
|
||||||
|
GNU/Linux
|
||||||
|
~~~
|
||||||
|
|
||||||
|
Dependencies:
|
||||||
|
SDL 1.2.7 or better (from libsdl.org)
|
||||||
|
SDL_Mixer 1.2.2(.7 for file-less music playback) (from libsdl.org)
|
||||||
|
Nasm (use NOASM=1 if you don't have it or have an non-i386 system, I think)
|
||||||
|
libPNG 1.2.7
|
||||||
|
Zlib 1.2.3
|
||||||
|
The Xiph.org libogg and libvorbis libraries
|
||||||
|
The OpenGL headers (from Mesa, usually shipped with your X.org or XFree
|
||||||
|
installation, so you needn't worry, most likely)
|
||||||
|
GCC 3.x toolchain and binutils
|
||||||
|
GNU Make
|
||||||
|
|
||||||
|
Build instructions:
|
||||||
|
|
||||||
|
make -C src LINUX=1
|
||||||
|
|
||||||
|
Build instructions for non-X86 devices (such as X64):
|
||||||
|
|
||||||
|
make -C src LINUX=1 NONX86=1
|
||||||
|
|
||||||
|
Build instructions to build for Wii Linux/SRB2Wii on a PowerPC system,
|
||||||
|
follow cross-compiling instructions for cross-compiling on a x86 system:
|
||||||
|
|
||||||
|
make -C src LINUX=1 WIILINUX=1
|
||||||
|
|
||||||
|
Build instructions to build for Pandora (Linux) on a ARM system,
|
||||||
|
follow cross-compiling instructions for cross-compiling on a x86 system:
|
||||||
|
|
||||||
|
make -C src PANDORA=1
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
binaries will turn in up in bin/
|
||||||
|
|
||||||
|
note: read the src/makefile for more options
|
||||||
|
|
||||||
|
- Sonic Team Junior
|
||||||
|
http://www.srb2.org
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
${PACKAGE_NAME} (${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION}) ${PACKAGE_DISTRO}; urgency=${PACKAGE_URGENCY}
|
||||||
|
|
||||||
|
* ${PROGRAM_NAME} v${PROGRAM_VERSION} program build
|
||||||
|
|
||||||
|
-- ${PACKAGE_NAME_EMAIL} ${__PACKAGE_DATETIME}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
7
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
# SRB2 Debian package control file.
|
||||||
|
|
||||||
|
Source: ${PACKAGE_NAME}
|
||||||
|
Section: games
|
||||||
|
Priority: extra
|
||||||
|
Maintainer: ${PACKAGE_GROUP_NAME_EMAIL}
|
||||||
|
Build-Depends: debhelper (>= 7.0.50~),
|
||||||
|
libsdl2-dev,
|
||||||
|
libsdl2-mixer-dev,
|
||||||
|
libpng-dev | libpng16-dev | libpng12-dev (>= 1.2.7),
|
||||||
|
zlib1g-dev,
|
||||||
|
libgme-dev,
|
||||||
|
libcurl4-openssl-dev,
|
||||||
|
libglu1-dev | libglu-dev,
|
||||||
|
libosmesa6-dev | libgl-dev,
|
||||||
|
nasm [i386]
|
||||||
|
Standards-Version: 3.8.4
|
||||||
|
Homepage: ${PACKAGE_WEBSITE}
|
||||||
|
|
||||||
|
Package: ${PACKAGE_NAME}
|
||||||
|
Architecture: any
|
||||||
|
Depends: ${SHLIBS_DEPENDS}, ${MISC_DEPENDS},
|
||||||
|
${PACKAGE_NAME}-data (>> ${PACKAGE_ASSET_MINVERSION}), ${PACKAGE_NAME}-data (<< ${PACKAGE_ASSET_MAXVERSION}),
|
||||||
|
libsdl2-2.0-0,
|
||||||
|
libsdl2-mixer-2.0-0,
|
||||||
|
zlib1g,
|
||||||
|
libgme0,
|
||||||
|
libcurl4,
|
||||||
|
libpng | libpng16-16 | libpng12-0
|
||||||
|
Description: A cross-platform 3D Sonic fangame
|
||||||
|
Sonic Robo Blast 2 is a 3D open-source Sonic the Hedgehog
|
||||||
|
fangame built using a modified version of the Doom Legacy
|
||||||
|
port of Doom. SRB2 is closely inspired by the original
|
||||||
|
Sonic games from the Sega Genesis, and attempts to recreate
|
||||||
|
the design in 3D. It features tons of levels, enemies, speed,
|
||||||
|
and quite a lot of the fun that the original Sonic games provided.
|
||||||
|
|
||||||
|
|
||||||
|
Package: ${PACKAGE_NAME}-dbg
|
||||||
|
Architecture: any
|
||||||
|
# FIXME: should be Depends: ${SHLIBS_DEPENDS}, ${MISC_DEPENDS}, srb2-data (= 2.1.14), srb2 but dh_shlibdeps is being an asshat
|
||||||
|
Depends: libc6, ${MISC_DEPENDS}, ${PACKAGE_NAME}-data (>> ${PACKAGE_ASSET_MINVERSION}), ${PACKAGE_NAME}-data (<< ${PACKAGE_ASSET_MAXVERSION}), ${PACKAGE_NAME}
|
||||||
|
Description: A cross-platform 3D Sonic fangame
|
||||||
|
Sonic Robo Blast 2 is a 3D open-source Sonic the Hedgehog
|
||||||
|
fangame built using a modified version of the Doom Legacy
|
||||||
|
port of Doom. SRB2 is closely inspired by the original
|
||||||
|
Sonic games from the Sega Genesis, and attempts to recreate
|
||||||
|
the design in 3D. It features tons of levels, enemies, speed,
|
||||||
|
and quite a lot of the fun that the original Sonic games provided.
|
||||||
|
This is a debug binary; its symbols will be loaded by gdb
|
||||||
|
when the user starts the game with gdb for debugging.
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
This work was packaged for Debian by:
|
||||||
|
|
||||||
|
${PACKAGE_NAME_EMAIL} ${__PACKAGE_DATETIME}
|
||||||
|
|
||||||
|
It was downloaded from:
|
||||||
|
|
||||||
|
${PACKAGE_WEBSITE}
|
||||||
|
|
||||||
|
Upstream Author(s):
|
||||||
|
|
||||||
|
${PACKAGE_GROUP_NAME_EMAIL}
|
||||||
|
|
||||||
|
Copyright:
|
||||||
|
|
||||||
|
Copyright (C) 1998-2018 by Sonic Team Junior
|
||||||
|
|
||||||
|
License:
|
||||||
|
|
||||||
|
GNU General Public License, version 2
|
||||||
|
|
||||||
|
The Debian packaging is:
|
||||||
|
|
||||||
|
Copyright (C) 2010 Callum Dickinson <gcfreak_ag20@hotmail.com>
|
||||||
|
Copyright (C) 2010-2018 by Sonic Team Junior <stjr@srb2.org>
|
||||||
|
|
||||||
|
and is licensed under the GPL version 2,
|
||||||
|
see "/usr/share/common-licenses/GPL-2".
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
README.md
|
||||||
|
assets/README.txt
|
||||||
|
assets/LICENSE.txt
|
||||||
|
assets/LICENSE-3RD-PARTY.txt
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
#!/usr/bin/make -f
|
||||||
|
# -*- makefile -*-
|
||||||
|
|
||||||
|
#############################################################################
|
||||||
|
#
|
||||||
|
# GNU Make Debian package makefile for SRB2
|
||||||
|
#
|
||||||
|
# Copyright (C) 1998-2010 by Callum Dickinson
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# This file most likely will not need to be modified to make
|
||||||
|
# branches of SRB2 capable of making their own Debian packages,
|
||||||
|
# instead look at the /debian/control file for configuration.
|
||||||
|
#
|
||||||
|
#############################################################################
|
||||||
|
|
||||||
|
#############################################################################
|
||||||
|
#
|
||||||
|
# !!!!!!!!!! DEPLOYER NOTE !!!!!!!!!!
|
||||||
|
#
|
||||||
|
# Variables to be templated are curly-braced ${PACKAGE_INSTALL_PATH}
|
||||||
|
# Variables used by the rules script are parenthese'd $(PKGDIR)
|
||||||
|
# See [repo-root]/debian_template.sh
|
||||||
|
#
|
||||||
|
#############################################################################
|
||||||
|
|
||||||
|
# Uncomment this to turn on verbose mode.
|
||||||
|
#export DH_VERBOSE=1
|
||||||
|
|
||||||
|
# user/group of to-be-installed files
|
||||||
|
ROOT_USER := 0
|
||||||
|
ROOT_GROUP := 0
|
||||||
|
|
||||||
|
# determine cross-compile (may need some work)
|
||||||
|
CROSS_COMPILE_BUILD := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
|
||||||
|
CROSS_COMPILE_HOST := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
|
||||||
|
CROSS_COMPILE := $(shell test "$(CROSS_COMPILE_BUILD)" != "$(CROSS_COMPILE_HOST)" && echo "$(CROSS_COMPILE_HOST)")
|
||||||
|
|
||||||
|
MKDIR = mkdir -p
|
||||||
|
MAKE = make
|
||||||
|
INSTALL = install -o $(ROOT_USER) -g $(ROOT_GROUP) -m 644
|
||||||
|
MV = mv
|
||||||
|
RM = rm -rf
|
||||||
|
STRIPARGS = --strip-unneeded
|
||||||
|
ifdef CROSS_COMPILE
|
||||||
|
STRIP = $(CROSS_COMPILE_HOST)-strip $(STRIPARGS)
|
||||||
|
else
|
||||||
|
STRIP = strip $(STRIPARGS)
|
||||||
|
endif
|
||||||
|
DIR := $(shell pwd)
|
||||||
|
|
||||||
|
# FIXME: hate hate hate head/tail hack :(
|
||||||
|
CONTROLF = $(DIR)/debian/control
|
||||||
|
PACKAGE = ${PACKAGE_NAME}
|
||||||
|
DBGPKG = ${PACKAGE}-dbg
|
||||||
|
TITLE = ${PROGRAM_NAME}
|
||||||
|
SECTION = Games/Action
|
||||||
|
EXENAME = ${PROGRAM_FILENAME}
|
||||||
|
DBGNAME = debug/$(EXENAME)
|
||||||
|
|
||||||
|
PKGDIR = $(shell echo "${PACKAGE_INSTALL_PATH}" | sed -e 's/^\///')
|
||||||
|
DBGDIR = usr/lib/debug/$(PKGDIR)
|
||||||
|
LINKDIR = $(shell echo "${PACKAGE_LINK_PATH}" | sed -e 's/^\///')
|
||||||
|
PIXMAPS_DIR = usr/share/pixmaps
|
||||||
|
DESKTOP_DIR = usr/share/applications
|
||||||
|
PREFIX = $(shell test "$(CROSS_COMPILE_BUILD)" != "$(CROSS_COMPILE_HOST)" && echo "PREFIX=$(CROSS_COMPILE_HOST)")
|
||||||
|
OS = LINUX=1
|
||||||
|
NONX86 = $(shell test "`echo $(CROSS_COMPILE_HOST) | grep 'i[3-6]86'`" || echo "NONX86=1")
|
||||||
|
MAKEARGS = $(OS) $(NONX86) $(PREFIX) EXENAME=$(EXENAME) DBGNAME=$(DBGNAME) NOOBJDUMP=1 # SDL_PKGCONFIG=sdl2 PNG_PKGCONFIG=libpng
|
||||||
|
MENUFILE1 = ?package($(PACKAGE)):needs="X11" section="$(SECTION)"
|
||||||
|
MENUFILE2 = title="$(TITLE)" command="/$(PKGDIR)/$(PACKAGE)"
|
||||||
|
BINDIR := $(DIR)/bin/Linux/Release
|
||||||
|
|
||||||
|
# FIXME pkg-config dir hacks
|
||||||
|
# Launchpad doesn't need this; it actually makes i386 builds fail due to cross-compile
|
||||||
|
# export PKG_CONFIG_LIBDIR = /usr/lib/$(CROSS_COMPILE_HOST)/pkgconfig
|
||||||
|
LDFLAGS += "-Wl,-rpath=/usr/lib/$(CROSS_COMPILE_HOST)"
|
||||||
|
|
||||||
|
# Some libgme-dev packages don't use pkg-config yet, so include the linker flag ourselves
|
||||||
|
PKG_CONFIG?=pkg-config
|
||||||
|
LIBGME_PKGCONFIG?=libgme
|
||||||
|
LIBGME_LDFLAGS?=$(shell $(PKG_CONFIG) $(LIBGME_PKGCONFIG) --libs)
|
||||||
|
|
||||||
|
ifeq ($(LIBGME_LDFLAGS),)
|
||||||
|
MAKEARGS += LIBGME_LDFLAGS=-lgme
|
||||||
|
endif
|
||||||
|
|
||||||
|
build:
|
||||||
|
$(MKDIR) $(BINDIR)/debug
|
||||||
|
$(MAKE) -C $(DIR)/src $(MAKEARGS)
|
||||||
|
$(STRIP) $(BINDIR)/$(EXENAME)
|
||||||
|
|
||||||
|
binary-indep:
|
||||||
|
# only here to kill Lintian warning
|
||||||
|
echo "no need to do any arch-independent stuff"
|
||||||
|
|
||||||
|
binary-arch:
|
||||||
|
# create ddirs
|
||||||
|
$(MKDIR) $(DIR)/debian/tmp/$(PKGDIR) $(DIR)/debian/tmp/$(DBGDIR)
|
||||||
|
$(MKDIR) $(DIR)/debian/tmp/$(PKGDIR) $(DIR)/debian/tmp/$(DESKTOP_DIR)
|
||||||
|
$(MKDIR) $(DIR)/debian/tmp/$(PKGDIR) $(DIR)/debian/tmp/$(PIXMAPS_DIR)
|
||||||
|
# install main binaries
|
||||||
|
$(INSTALL) $(BINDIR)/$(EXENAME) $(DIR)/debian/tmp/$(PKGDIR)/$(PACKAGE)
|
||||||
|
$(INSTALL) $(BINDIR)/$(DBGNAME) $(DIR)/debian/tmp/$(DBGDIR)/$(PACKAGE)
|
||||||
|
# Install desktop file and banner image
|
||||||
|
$(INSTALL) $(DIR)/srb2.png $(DIR)/debian/tmp/usr/share/pixmaps/${PROGRAM_FILENAME}.png
|
||||||
|
$(INSTALL) $(DIR)/debian/srb2.desktop $(DIR)/debian/tmp/usr/share/applications/${PROGRAM_FILENAME}.desktop
|
||||||
|
# add compiled binaries to include-binaries
|
||||||
|
echo $(BINDIR)/$(EXENAME) >> $(DIR)/debian/source/include-binaries
|
||||||
|
echo $(BINDIR)/$(EXENAME) >> $(DIR)/debian/source/include-binaries
|
||||||
|
# Generate install folder files
|
||||||
|
echo $(PKGDIR) > $(DIR)/debian/$(PACKAGE).install
|
||||||
|
echo $(DESKTOP_DIR) >> $(DIR)/debian/$(PACKAGE).install
|
||||||
|
echo $(PIXMAPS_DIR) >> $(DIR)/debian/$(PACKAGE).install
|
||||||
|
echo $(DBGDIR) > $(DIR)/debian/$(DBGPKG).install
|
||||||
|
# Launchpad only calls binary-arch, so just move everything up
|
||||||
|
#binary: binary-arch
|
||||||
|
# Generate .desktop specifications
|
||||||
|
echo "`echo '$(MENUFILE1)\\'`" > $(DIR)/debian/menu
|
||||||
|
echo " `echo '$(MENUFILE2)'`" >> $(DIR)/debian/menu
|
||||||
|
dh_testdir
|
||||||
|
dh_testroot
|
||||||
|
dh_installchangelogs
|
||||||
|
dh_installdocs
|
||||||
|
# dh_installexamples
|
||||||
|
dh_install --sourcedir=$(DIR)/debian/tmp
|
||||||
|
dh_installmenu
|
||||||
|
# dh_installdebconf
|
||||||
|
# dh_installlogrotate
|
||||||
|
# dh_installemacsen
|
||||||
|
# dh_installpam
|
||||||
|
# dh_installmime
|
||||||
|
# dh_python
|
||||||
|
# dh_installinit
|
||||||
|
# dh_installcron
|
||||||
|
# dh_installinfo
|
||||||
|
# dh_installman
|
||||||
|
dh_link $(PKGDIR)/$(EXENAME) $(LINKDIR)/$(EXENAME)
|
||||||
|
dh_compress
|
||||||
|
dh_fixperms
|
||||||
|
# dh_perl
|
||||||
|
# dh_makeshlibs
|
||||||
|
dh_installdeb
|
||||||
|
-dh_shlibdeps
|
||||||
|
dh_gencontrol
|
||||||
|
dh_md5sums
|
||||||
|
dh_builddeb
|
||||||
|
|
||||||
|
binary: binary-arch
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(MAKE) -C $(DIR)/src $(MAKEARGS) clean cleandep
|
||||||
|
$(RM) $(BINDIR)/*
|
||||||
|
$(RM) $(DIR)/debian/$(PACKAGE)/*
|
||||||
|
$(RM) $(DIR)/debian/$(DBGPKG)/*
|
||||||
|
$(RM) $(DIR)/debian/tmp/*
|
||||||
|
$(RM) $(DIR)/debian/$(PACKAGE).install
|
||||||
|
$(RM) $(DIR)/debian/$(DBGPKG).install
|
||||||
|
$(RM) $(DIR)/debian/menu
|
||||||
|
$(RM) $(DIR)/debian/files
|
||||||
|
$(RM) $(DIR)/debian/source/include-binaries
|
||||||
|
|
||||||
|
.PHONY: all clean binary binary-indep build
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
3.0 (native)
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
tar-ignore = "assets/*.srb"
|
||||||
|
tar-ignore = "assets/*.pk3"
|
||||||
|
tar-ignore = "assets/*.dta"
|
||||||
|
tar-ignore = "assets/*.wad"
|
||||||
|
tar-ignore = "assets/*.kart"
|
||||||
|
tar-ignore = "assets/debian/${PACKAGE_NAME}-data/*"
|
||||||
|
tar-ignore = "assets/debian/tmp/*"
|
||||||
|
tar-ignore = "*.obj"
|
||||||
|
tar-ignore = "*.dep"
|
||||||
|
tar-ignore = ".git/*"
|
||||||
|
tar-ignore = ".git*"
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Name=${PROGRAM_NAME}
|
||||||
|
Comment=${PROGRAM_DESCRIPTION}
|
||||||
|
Encoding=UTF-8
|
||||||
|
Exec=${PACKAGE_INSTALL_PATH}/${PROGRAM_FILENAME}
|
||||||
|
Icon=/usr/share/pixmaps/${PROGRAM_FILENAME}.png
|
||||||
|
Terminal=false
|
||||||
|
Type=Application
|
||||||
|
StartupNotify=false
|
||||||
|
Categories=Application;Game;
|
||||||
@@ -0,0 +1,166 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Deployer for Travis-CI
|
||||||
|
# Debian package templating
|
||||||
|
#
|
||||||
|
# Call this script BEFORE running debuild!
|
||||||
|
# source ./debian_template.sh [clean] [main/asset]
|
||||||
|
#
|
||||||
|
# Before running this script,
|
||||||
|
# you should also set PACKAGE_NAME_EMAIL="John Doe <jdoe@example.com>" to match
|
||||||
|
# the identity of the key you will use to sign the package.
|
||||||
|
#
|
||||||
|
|
||||||
|
# Get script's actual path
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
|
||||||
|
|
||||||
|
# Recursive function for directory crawling
|
||||||
|
# $1 = Directory root to crawl
|
||||||
|
# $2 = Code to eval on file
|
||||||
|
# $3 = Code to eval on directory
|
||||||
|
# Exposes $dirtails, $dirlevel, and $dirtailname
|
||||||
|
dirlevel=0 # initialize
|
||||||
|
dirtails=()
|
||||||
|
|
||||||
|
# Utility function to make dira/dirb/dirc string
|
||||||
|
makedirtailname () {
|
||||||
|
dirtailname=""
|
||||||
|
for tail in $dirtails; do
|
||||||
|
if [[ "$dirtailname" == "" ]]; then
|
||||||
|
dirtailname="/$tail";
|
||||||
|
else
|
||||||
|
dirtailname="$dirtailname/$tail";
|
||||||
|
fi;
|
||||||
|
done;
|
||||||
|
}
|
||||||
|
|
||||||
|
evaldirectory () {
|
||||||
|
if [ -d "$1" ]; then
|
||||||
|
# Set contextual variables
|
||||||
|
# dirtails is an array of directory basenames after the crawl root
|
||||||
|
if (( $dirlevel > 0 )); then
|
||||||
|
dirtails+=( "$(basename $1)" );
|
||||||
|
else
|
||||||
|
dirtails=();
|
||||||
|
fi;
|
||||||
|
dirlevel=$((dirlevel+1));
|
||||||
|
|
||||||
|
# Generate directory path after the crawl root
|
||||||
|
makedirtailname;
|
||||||
|
|
||||||
|
# Eval our directory with the latest contextual info
|
||||||
|
# Don't eval on root
|
||||||
|
if (( $dirlevel > 1 )) && [[ "$3" != "" ]]; then
|
||||||
|
eval "$3";
|
||||||
|
fi;
|
||||||
|
|
||||||
|
# Iterate entries
|
||||||
|
for name in $1/*; do
|
||||||
|
if [ -d "$name" ]; then
|
||||||
|
# Name is a directory, but don't eval yet
|
||||||
|
# Recurse so our vars are updated
|
||||||
|
evaldirectory "$name" "$2" "$3";
|
||||||
|
|
||||||
|
# Decrement our directory level and remove a dirtail
|
||||||
|
unset 'dirtails[ ${#dirtails[@]}-1 ]';
|
||||||
|
dirlevel=$((dirlevel-1));
|
||||||
|
makedirtailname;
|
||||||
|
else
|
||||||
|
# Name is a file
|
||||||
|
if [ -f "$name" ] && [[ "$2" != "" ]]; then
|
||||||
|
eval "$2";
|
||||||
|
fi;
|
||||||
|
fi;
|
||||||
|
done;
|
||||||
|
|
||||||
|
# Reset our variables; we're done iterating
|
||||||
|
if (( $dirlevel == 1 )); then
|
||||||
|
dirlevel=0;
|
||||||
|
fi;
|
||||||
|
fi;
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Initialize package parameter defaults
|
||||||
|
#
|
||||||
|
if [[ "$__DEBIAN_PARAMETERS_INITIALIZED" != "1" ]]; then
|
||||||
|
. ${DIR}/deployer/travis/deployer_defaults.sh;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
# Clean up after ourselves; we only expect to run this script once
|
||||||
|
# during buildboting
|
||||||
|
__DEBIAN_PARAMETERS_INITIALIZED=0
|
||||||
|
|
||||||
|
# for envsubst
|
||||||
|
export __PACKAGE_DATETIME="$(date '+%a, %d %b %Y %H:%M:%S %z')"
|
||||||
|
export __PACKAGE_DATETIME_DIGIT="$(date -u '+%Y%m%d%H%M%S')"
|
||||||
|
|
||||||
|
if [[ "$PACKAGE_REVISION" == "" ]]; then
|
||||||
|
PACKAGE_REVISION="-$__PACKAGE_DATETIME_DIGIT";
|
||||||
|
__PACKAGE_REVISION_BY_DATE=1;
|
||||||
|
export PACKAGE_REVISION=${PACKAGE_REVISION}; # for envsubst
|
||||||
|
fi;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Clean the old debian/ directories
|
||||||
|
#
|
||||||
|
if [[ "$1" == "clean" ]]; then
|
||||||
|
toclean=$2;
|
||||||
|
else
|
||||||
|
toclean=$1;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
if [[ "$toclean" == "" ]] || [[ "$toclean" == "main" ]]; then
|
||||||
|
echo "Cleaning main package scripts";
|
||||||
|
if [[ ! -f ${DIR}/debian ]]; then
|
||||||
|
rm -rf ${DIR}/debian;
|
||||||
|
fi;
|
||||||
|
fi;
|
||||||
|
if [[ "$toclean" == "" ]] || [[ "$toclean" == "asset" ]]; then
|
||||||
|
echo "Cleaning asset package scripts";
|
||||||
|
if [[ ! -f ${DIR}/assets/debian ]]; then
|
||||||
|
rm -rf ${DIR}/assets/debian;
|
||||||
|
fi;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Make new templates
|
||||||
|
#
|
||||||
|
if [[ "$1" != "clean" ]]; then
|
||||||
|
totemplate=$1;
|
||||||
|
|
||||||
|
# HACK: ${shlibs:Depends} in the templates make the templating fail
|
||||||
|
# So just define replacemment variables
|
||||||
|
export SHLIBS_DEPENDS=${SHLIBS_DEPENDS};
|
||||||
|
export MISC_DEPENDS=${MISC_DEPENDS};
|
||||||
|
export DEBFILEVAR='$$file'; # used in assets/debian/rules
|
||||||
|
|
||||||
|
# Package parameters are exported for envsubst in deployer_defaults.sh
|
||||||
|
|
||||||
|
if [[ "$totemplate" == "" ]] || [[ "$totemplate" == "main" ]]; then
|
||||||
|
echo "Generating main package scripts";
|
||||||
|
fromroot=${DIR}/debian-template;
|
||||||
|
toroot=${DIR}/debian;
|
||||||
|
mkdir ${toroot};
|
||||||
|
|
||||||
|
evaldirectory ${fromroot} \
|
||||||
|
"cat \$name | envsubst > ${toroot}\${dirtailname}/\$( basename \$name )" \
|
||||||
|
"mkdir \"${toroot}\${dirtailname}\"";
|
||||||
|
fi;
|
||||||
|
|
||||||
|
if [[ "$totemplate" == "" ]] || [[ "$totemplate" == "asset" ]]; then
|
||||||
|
echo "Generating asset package scripts";
|
||||||
|
fromroot=${DIR}/assets/debian-template;
|
||||||
|
toroot=${DIR}/assets/debian;
|
||||||
|
mkdir ${toroot};
|
||||||
|
|
||||||
|
# Root dir to crawl; file eval; directory eval
|
||||||
|
evaldirectory ${fromroot} \
|
||||||
|
"cat \$name | envsubst > ${toroot}\${dirtailname}/\$( basename \$name )" \
|
||||||
|
"mkdir \"${toroot}\${dirtailname}\"";
|
||||||
|
fi;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
if [[ "$__DPL_ACTIVE" != "1" ]] && [[ "$__PACKAGE_REVISION_BY_DATE" == "1" ]]; then
|
||||||
|
unset PACKAGE_REVISION; # so we can reset the date on subsequent runs
|
||||||
|
fi;
|
||||||
@@ -0,0 +1,195 @@
|
|||||||
|
@setlocal enableextensions enabledelayedexpansion
|
||||||
|
|
||||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
: Appveyor Deployer
|
||||||
|
: See appveyor.yml for default variables
|
||||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
|
||||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
: Evaluate whether we should be deploying
|
||||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
|
||||||
|
if not [%DPL_ENABLED%] == [1] (
|
||||||
|
echo Deployer is not enabled...
|
||||||
|
exit /b
|
||||||
|
)
|
||||||
|
|
||||||
|
: Don't do DD installs because fmodex DLL handling is not implemented.
|
||||||
|
if [%CONFIGURATION%] == [DD] (
|
||||||
|
echo Deployer does not support DD builds...
|
||||||
|
exit /b
|
||||||
|
)
|
||||||
|
|
||||||
|
if [%CONFIGURATION%] == [DD64] (
|
||||||
|
echo Deployer does not support DD builds...
|
||||||
|
exit /b
|
||||||
|
)
|
||||||
|
|
||||||
|
: Substring match from https://stackoverflow.com/questions/7005951/batch-file-find-if-substring-is-in-string-not-in-a-file
|
||||||
|
: The below line says "if deployer is NOT in string"
|
||||||
|
: Note that APPVEYOR_REPO_BRANCH for pull request builds is the BASE branch that PR is merging INTO
|
||||||
|
if x%APPVEYOR_REPO_BRANCH:deployer=%==x%APPVEYOR_REPO_BRANCH% (
|
||||||
|
if not [%APPVEYOR_REPO_TAG%] == [true] (
|
||||||
|
echo Deployer is enabled but we are not in a release tag or a 'deployer' branch...
|
||||||
|
exit /b
|
||||||
|
) else (
|
||||||
|
if not [%DPL_TAG_ENABLED%] == [1] (
|
||||||
|
echo Deployer is not enabled for release tags...
|
||||||
|
exit /b
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
: Release tags always get optional assets (music.dta)
|
||||||
|
if [%APPVEYOR_REPO_TAG%] == [true] (
|
||||||
|
set "ASSET_FILES_OPTIONAL_GET=1"
|
||||||
|
)
|
||||||
|
|
||||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
: Get asset archives
|
||||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
|
||||||
|
if exist "C:\Users\appveyor\srb2_cache\archives\" (
|
||||||
|
if [%ASSET_CLEAN%] == [1] (
|
||||||
|
echo Cleaning asset archives...
|
||||||
|
rmdir /s /q "C:\Users\appveyor\srb2_cache\archives"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
if not exist "C:\Users\appveyor\srb2_cache\archives\" mkdir "C:\Users\appveyor\srb2_cache\archives"
|
||||||
|
|
||||||
|
goto EXTRACT_ARCHIVES
|
||||||
|
|
||||||
|
::::::::::::::::::::::::::::::::
|
||||||
|
: ARCHIVE_NAME_PARTS
|
||||||
|
: Call this like a function. %archivepath% is the path to extract parts from.
|
||||||
|
::::::::::::::::::::::::::::::::
|
||||||
|
|
||||||
|
for %%a in (%archivepath%) do (
|
||||||
|
set "file=%%~fa"
|
||||||
|
set "filepath=%%~dpa"
|
||||||
|
set "filename=%%~nxa"
|
||||||
|
)
|
||||||
|
|
||||||
|
set "localarchivepath=C:\Users\appveyor\srb2_cache\archives\%filename%"
|
||||||
|
|
||||||
|
goto EOF
|
||||||
|
|
||||||
|
::::::::::::::::::::::::::::::::
|
||||||
|
: EXTRACT_ARCHIVES
|
||||||
|
::::::::::::::::::::::::::::::::
|
||||||
|
|
||||||
|
set "archivepath=%ASSET_ARCHIVE_PATH%"
|
||||||
|
call :ARCHIVE_NAME_PARTS
|
||||||
|
set "ASSET_ARCHIVE_PATH_LOCAL=%localarchivepath%"
|
||||||
|
if not exist "%localarchivepath%" appveyor DownloadFile "%ASSET_ARCHIVE_PATH%" -FileName "%localarchivepath%"
|
||||||
|
|
||||||
|
set "archivepath=%ASSET_ARCHIVE_PATCH_PATH%"
|
||||||
|
call :ARCHIVE_NAME_PARTS
|
||||||
|
set "ASSET_ARCHIVE_PATCH_PATH_LOCAL=%localarchivepath%"
|
||||||
|
if not exist "%localarchivepath%" appveyor DownloadFile "%ASSET_ARCHIVE_PATCH_PATH%" -FileName "%localarchivepath%"
|
||||||
|
|
||||||
|
if not [%X86_64%] == [1] (
|
||||||
|
set "archivepath=%ASSET_ARCHIVE_X86_PATH%"
|
||||||
|
call :ARCHIVE_NAME_PARTS
|
||||||
|
set "ASSET_ARCHIVE_X86_PATH_LOCAL=!localarchivepath!"
|
||||||
|
if not exist "!localarchivepath!" appveyor DownloadFile "%ASSET_ARCHIVE_X86_PATH%" -FileName "!localarchivepath!"
|
||||||
|
)
|
||||||
|
|
||||||
|
if [%X86_64%] == [1] (
|
||||||
|
set "archivepath=%ASSET_ARCHIVE_X64_PATH%"
|
||||||
|
call :ARCHIVE_NAME_PARTS
|
||||||
|
set "ASSET_ARCHIVE_X64_PATH_LOCAL=!localarchivepath!"
|
||||||
|
if not exist "!localarchivepath!" appveyor DownloadFile "%ASSET_ARCHIVE_X64_PATH%" -FileName "!localarchivepath!"
|
||||||
|
)
|
||||||
|
|
||||||
|
if [%ASSET_FILES_OPTIONAL_GET%] == [1] (
|
||||||
|
set "archivepath=%ASSET_ARCHIVE_OPTIONAL_PATH%"
|
||||||
|
call :ARCHIVE_NAME_PARTS
|
||||||
|
set "ASSET_ARCHIVE_OPTIONAL_PATH_LOCAL=!localarchivepath!"
|
||||||
|
if not exist "!localarchivepath!" appveyor DownloadFile "%ASSET_ARCHIVE_OPTIONAL_PATH%" -FileName "!localarchivepath!"
|
||||||
|
)
|
||||||
|
|
||||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
: Build the installers
|
||||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
|
||||||
|
mkdir "assets\installer"
|
||||||
|
mkdir "assets\patch"
|
||||||
|
|
||||||
|
7z x -y "%ASSET_ARCHIVE_PATH_LOCAL%" -o"assets\installer" >null
|
||||||
|
7z x -y "%ASSET_ARCHIVE_PATCH_PATH_LOCAL%" -o"assets\patch" >null
|
||||||
|
|
||||||
|
: Copy optional files to full installer (music.dta)
|
||||||
|
if [%ASSET_FILES_OPTIONAL_GET%] == [1] (
|
||||||
|
7z x -y "%ASSET_ARCHIVE_OPTIONAL_PATH_LOCAL%" -o"assets\installer" >null
|
||||||
|
)
|
||||||
|
|
||||||
|
: Copy EXE -- BUILD_PATH is from appveyor.yml
|
||||||
|
robocopy /S /ns /nc /nfl /ndl /np /njh /njs "%BUILD_PATH%" "assets\installer" /XF "*.debug" ".gitignore"
|
||||||
|
robocopy /S /ns /nc /nfl /ndl /np /njh /njs "%BUILD_PATH%" "assets\patch" /XF "*.debug" ".gitignore"
|
||||||
|
|
||||||
|
: Are we building DD? (we were supposed to exit earlier!)
|
||||||
|
if [%CONFIGURATION%] == [DD] ( set "DPL_INSTALLER_NAME=%DPL_INSTALLER_NAME%-DD" )
|
||||||
|
if [%CONFIGURATION%] == [DD64] ( set "DPL_INSTALLER_NAME=%DPL_INSTALLER_NAME%-DD" )
|
||||||
|
|
||||||
|
: If we are not a release tag, suffix the filename
|
||||||
|
if not [%APPVEYOR_REPO_TAG%] == [true] (
|
||||||
|
set "INSTALLER_SUFFIX=-%APPVEYOR_REPO_BRANCH%-%GITSHORT%-%CONFIGURATION%"
|
||||||
|
) else (
|
||||||
|
set "INSTALLER_SUFFIX="
|
||||||
|
)
|
||||||
|
|
||||||
|
if not [%X86_64%] == [1] ( goto X86_INSTALL )
|
||||||
|
|
||||||
|
::::::::::::::::::::::::::::::::
|
||||||
|
: X64_INSTALL
|
||||||
|
::::::::::::::::::::::::::::::::
|
||||||
|
|
||||||
|
: Extract DLL binaries
|
||||||
|
7z x -y "%ASSET_ARCHIVE_X64_PATH_LOCAL%" -o"assets\installer" >null
|
||||||
|
if [%PACKAGE_PATCH_DLL_GET%] == [1] (
|
||||||
|
7z x -y "!ASSET_ARCHIVE_X64_PATH_LOCAL!" -o"assets\patch" >null
|
||||||
|
)
|
||||||
|
|
||||||
|
: Build the installer
|
||||||
|
7z a -sfx7z.sfx "%DPL_INSTALLER_NAME%-x64-Installer%INSTALLER_SUFFIX%.exe" .\assets\installer\*
|
||||||
|
|
||||||
|
: Build the patch
|
||||||
|
7z a "%DPL_INSTALLER_NAME%-x64-Patch%INSTALLER_SUFFIX%.zip" .\assets\patch\*
|
||||||
|
|
||||||
|
: Upload artifacts
|
||||||
|
appveyor PushArtifact "%DPL_INSTALLER_NAME%-x64-Installer%INSTALLER_SUFFIX%.exe"
|
||||||
|
appveyor PushArtifact "%DPL_INSTALLER_NAME%-x64-Patch%INSTALLER_SUFFIX%.zip"
|
||||||
|
|
||||||
|
: We only do x86 OR x64, one at a time, so exit now.
|
||||||
|
goto EOF
|
||||||
|
|
||||||
|
::::::::::::::::::::::::::::::::
|
||||||
|
: X86_INSTALL
|
||||||
|
::::::::::::::::::::::::::::::::
|
||||||
|
|
||||||
|
: Extract DLL binaries
|
||||||
|
7z x -y "%ASSET_ARCHIVE_X86_PATH_LOCAL%" -o"assets\installer" >null
|
||||||
|
if [%PACKAGE_PATCH_DLL_GET%] == [1] (
|
||||||
|
7z x -y "!ASSET_ARCHIVE_X86_PATH_LOCAL!" -o"assets\patch" >null
|
||||||
|
)
|
||||||
|
|
||||||
|
: Build the installer
|
||||||
|
7z a -sfx7z.sfx "%DPL_INSTALLER_NAME%-Installer%INSTALLER_SUFFIX%.exe" .\assets\installer\*
|
||||||
|
|
||||||
|
: Build the patch
|
||||||
|
7z a "%DPL_INSTALLER_NAME%-Patch%INSTALLER_SUFFIX%.zip" .\assets\patch\*
|
||||||
|
|
||||||
|
: Upload artifacts
|
||||||
|
appveyor PushArtifact "%DPL_INSTALLER_NAME%-Installer%INSTALLER_SUFFIX%.exe"
|
||||||
|
appveyor PushArtifact "%DPL_INSTALLER_NAME%-Patch%INSTALLER_SUFFIX%.zip"
|
||||||
|
|
||||||
|
: We only do x86 OR x64, one at a time, so exit now
|
||||||
|
goto EOF
|
||||||
|
|
||||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
: EOF
|
||||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
|
||||||
|
endlocal
|
||||||
@@ -0,0 +1,157 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Deployer for Travis-CI
|
||||||
|
# Initialization
|
||||||
|
#
|
||||||
|
# Performs validity checks to ensure that Deployer is allowed to run
|
||||||
|
# e.g., is an FTP hostname specified? Are we whitelisted by OSNAMES and BRANCHES?
|
||||||
|
#
|
||||||
|
# Set these environment variables in your Travis-CI settings, where they are stored securely.
|
||||||
|
# See other shell scripts for more options.
|
||||||
|
#
|
||||||
|
# DPL_ENABLED = 1 (leave blank to disable)
|
||||||
|
# DPL_TAG_ENABLED = 1 (run Deployer on all tags)
|
||||||
|
# DPL_JOB_ENABLE_ALL = 1 (run Deployer on all jobs; leave blank to act on specific jobs, see below)
|
||||||
|
# DPL_JOBNAMES = name1,name2 (whitelist of job names to allow uploading; leave blank to upload from all jobs)
|
||||||
|
# DPL_OSNAMES = osx (whitelist of OS names to allow uploading; leave blank to upload from all OSes)
|
||||||
|
# DPL_BRANCHES = master,branch1,branch2 (whitelist of branches to upload; leave blank to upload all branches)
|
||||||
|
#
|
||||||
|
# To enable Deployer on specific jobs, set _DPL_JOB_ENABLED=1 for that job. Example:
|
||||||
|
# - matrix:
|
||||||
|
# - os: osx
|
||||||
|
# env:
|
||||||
|
# - _DPL_JOB_ENABLED=1
|
||||||
|
#
|
||||||
|
# DO NOT set __DPL_ACTIVE, because that would bypass these validity checks.
|
||||||
|
|
||||||
|
# Validate Deployer state
|
||||||
|
if [[ "$DPL_ENABLED" == "1" ]] && [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then
|
||||||
|
# Test for base eligibility:
|
||||||
|
# Are we in a deployer branch? Or
|
||||||
|
# Are we in a release tag AND DPL_TAG_ENABLED=1?
|
||||||
|
if [[ $TRAVIS_BRANCH == *"deployer"* ]]; then
|
||||||
|
__DPL_BASE_ELIGIBLE=1;
|
||||||
|
__DPL_TERMINATE_EARLY_ELIGIBLE=1;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
if [[ "$TRAVIS_TAG" != "" ]] && [[ "$DPL_TAG_ENABLED" == "1" ]]; then
|
||||||
|
__DPL_BASE_ELIGIBLE=1;
|
||||||
|
__DPL_TAG_ELIGIBLE=1;
|
||||||
|
__DPL_TERMINATE_EARLY_ELIGIBLE=1;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
# Logging message for trigger word
|
||||||
|
if [[ "$__DPL_TAG_ELIGIBLE" != "1" ]] && [[ "$DPL_TRIGGER" != "" ]]; then
|
||||||
|
echo "Testing for trigger $DPL_TRIGGER, commit message: $TRAVIS_COMMIT_MESSAGE";
|
||||||
|
echo "[${DPL_TRIGGER}]";
|
||||||
|
echo "[${DPL_TRIGGER}-${_DPL_JOB_NAME}]";
|
||||||
|
echo "[${DPL_TRIGGER}-${TRAVIS_OS_NAME}]";
|
||||||
|
fi;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Search for the trigger word
|
||||||
|
# Force enable if release tags are eligible
|
||||||
|
#
|
||||||
|
if [[ "$__DPL_TAG_ELIGIBLE" == "1" ]] || [[ "$DPL_TRIGGER" == "" ]] \
|
||||||
|
|| [[ $TRAVIS_COMMIT_MESSAGE == *"[$DPL_TRIGGER]"* ]] \
|
||||||
|
|| [[ $TRAVIS_COMMIT_MESSAGE == *"[${DPL_TRIGGER}-${_DPL_JOB_NAME}]"* ]] \
|
||||||
|
|| [[ $TRAVIS_COMMIT_MESSAGE == *"[${DPL_TRIGGER}-${TRAVIS_OS_NAME}]"* ]]; then
|
||||||
|
#
|
||||||
|
# Whitelist by branch name
|
||||||
|
# Force enable if release tags are eligible
|
||||||
|
#
|
||||||
|
if [[ "$__DPL_TAG_ELIGIBLE" == "1" ]] || [[ "$DPL_BRANCHES" == "" ]] || [[ $DPL_BRANCHES == *"$TRAVIS_BRANCH"* ]]; then
|
||||||
|
# Set this so we only early-terminate builds when we are specifically deploying
|
||||||
|
# Trigger string and branch are encompassing conditions; the rest are job-specific
|
||||||
|
# This check only matters for deployer branches and when DPL_TERMINATE_TESTS=1,
|
||||||
|
# because we're filtering non-deployer jobs.
|
||||||
|
#
|
||||||
|
# __DPL_TRY_TERMINATE_EARLY is invalidated in .travis.yml if __DPL_ACTIVE=1
|
||||||
|
if [[ "$__DPL_TERMINATE_EARLY_ELIGIBLE" == "1" ]] && [[ "$DPL_TERMINATE_TESTS" == "1" ]]; then
|
||||||
|
__DPL_TRY_TERMINATE_EARLY=1;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Is the job enabled for deployment?
|
||||||
|
#
|
||||||
|
if [[ "$DPL_JOB_ENABLE_ALL" == "1" ]] || [[ "$_DPL_JOB_ENABLED" == "1" ]]; then
|
||||||
|
#
|
||||||
|
# Whitelist by job names
|
||||||
|
#
|
||||||
|
if [[ "$DPL_JOBNAMES" == "" ]] || [[ "$_DPL_JOB_NAME" == "" ]] || [[ $DPL_JOBNAMES == *"$_DPL_JOB_NAME"* ]]; then
|
||||||
|
#
|
||||||
|
# Whitelist by OS names
|
||||||
|
#
|
||||||
|
if [[ "$DPL_OSNAMES" == "" ]] || [[ $DPL_OSNAMES == *"$TRAVIS_OS_NAME"* ]]; then
|
||||||
|
# Base Deployer is eligible for becoming active
|
||||||
|
|
||||||
|
# Are we building for Linux?
|
||||||
|
if [[ "$_DPL_PACKAGE_BINARY" == "1" ]] || [[ "$_DPL_PACKAGE_SOURCE" == "1" ]]; then
|
||||||
|
if [[ "$_DPL_PACKAGE_MAIN" == "1" ]] || [[ "$_DPL_PACKAGE_ASSET" == "1" ]]; then
|
||||||
|
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
|
||||||
|
__DPL_DEBIAN_ACTIVE=1;
|
||||||
|
fi;
|
||||||
|
fi;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
# Now check for deployment targets
|
||||||
|
if [[ "$_DPL_FTP_TARGET" == "1" ]] && [[ "$DPL_FTP_HOSTNAME" != "" ]]; then
|
||||||
|
if [[ "$TRAVIS_OS_HOST" == "linux" ]] && [[ "$DPL_FTP_PROTOCOL" == "ftp" ]]; then
|
||||||
|
echo "Non-secure FTP will not work on Linux Travis-CI jobs!";
|
||||||
|
echo "Try SFTP or another target. Details:";
|
||||||
|
echo "https://blog.travis-ci.com/2018-07-23-the-tale-of-ftp-at-travis-ci";
|
||||||
|
else
|
||||||
|
if [[ "$__DPL_DEBIAN_ACTIVE" == "1" ]] || [[ "$_DPL_PACKAGE_BINARY" == "1" ]] || [[ "$_DPL_BINARY" == "1" ]]; then
|
||||||
|
echo "Deployer FTP target is enabled";
|
||||||
|
__DPL_FTP_ACTIVE=1;
|
||||||
|
else
|
||||||
|
echo "Deployer FTP target cannot be enabled: You must specify _DPL_PACKAGE_BINARY=1,";
|
||||||
|
echo "and/or _DPL_BINARY=1 in your job's environment variables.";
|
||||||
|
fi;
|
||||||
|
fi;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
if [[ "$_DPL_DPUT_TARGET" == "1" ]] && [[ "$__DPL_DEBIAN_ACTIVE" == "1" ]] \
|
||||||
|
&& [[ "$DPL_DPUT_INCOMING" != "" ]]; then
|
||||||
|
if [[ "$DPL_DPUT_METHOD" == "ftp" ]]; then
|
||||||
|
echo "DPUT will not work with non-secure FTP on Linux Travis-CI jobs!";
|
||||||
|
echo "Try SFTP or another method for DPUT. Details:";
|
||||||
|
echo "https://blog.travis-ci.com/2018-07-23-the-tale-of-ftp-at-travis-ci";
|
||||||
|
else
|
||||||
|
echo "Deployer DPUT target is enabled";
|
||||||
|
__DPL_DPUT_ACTIVE=1;
|
||||||
|
fi;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
# If any deployment targets are active, then so is the Deployer at large
|
||||||
|
if [[ "$__DPL_FTP_ACTIVE" == "1" ]] || [[ "$__DPL_DPUT_ACTIVE" == "1" ]]; then
|
||||||
|
__DPL_ACTIVE=1;
|
||||||
|
fi;
|
||||||
|
fi;
|
||||||
|
fi;
|
||||||
|
fi;
|
||||||
|
fi;
|
||||||
|
else
|
||||||
|
if [[ "$DPL_TRIGGER" != "" ]]; then
|
||||||
|
echo "Testing for global trigger [$DPL_TRIGGER, commit message: $TRAVIS_COMMIT_MESSAGE";
|
||||||
|
fi;
|
||||||
|
if [[ "$DPL_TRIGGER" != "" ]] && [[ $TRAVIS_COMMIT_MESSAGE == *"[$DPL_TRIGGER"* ]]; then
|
||||||
|
if [[ "$__DPL_TAG_ELIGIBLE" == "1" ]] || [[ "$DPL_BRANCHES" == "" ]] || [[ $DPL_BRANCHES == *"$TRAVIS_BRANCH"* ]]; then
|
||||||
|
# This check only matters for deployer branches and when DPL_TERMINATE_TESTS=1,
|
||||||
|
# because we're filtering non-deployer jobs.
|
||||||
|
if [[ "$__DPL_TERMINATE_EARLY_ELIGIBLE" == "1" ]] && [[ "$DPL_TERMINATE_TESTS" == "1" ]]; then
|
||||||
|
# Assume that some job received the trigger, so mark this for early termination
|
||||||
|
__DPL_TRY_TERMINATE_EARLY=1;
|
||||||
|
fi;
|
||||||
|
fi;
|
||||||
|
fi;
|
||||||
|
fi;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
if [[ "$__DPL_TRY_TERMINATE_EARLY" == "1" ]] && [[ "$__DPL_ACTIVE" != "1" ]]; then
|
||||||
|
echo "Deployer is active in another job";
|
||||||
|
fi;
|
||||||
|
|
||||||
|
if [[ "$__DPL_TRY_TERMINATE_EARLY" != "1" ]] && [[ "$__DPL_ACTIVE" != "1" ]]; then
|
||||||
|
echo "Deployer is not active";
|
||||||
|
fi;
|
||||||
@@ -0,0 +1,190 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Deployer for Travis-CI
|
||||||
|
# Build Script
|
||||||
|
#
|
||||||
|
# Builds the required targets depending on which sub-modules are enabled
|
||||||
|
|
||||||
|
if [[ "$__DPL_FTP_ACTIVE" == "1" ]] || [[ "$__DPL_DPUT_ACTIVE" == "1" ]]; then
|
||||||
|
if [[ "$__DPL_DEBIAN_ACTIVE" == "1" ]]; then
|
||||||
|
echo "Building Debian package(s)"
|
||||||
|
|
||||||
|
sudo apt-get install devscripts debhelper fakeroot secure-delete expect;
|
||||||
|
|
||||||
|
# Build source packages first, since they zip up the entire source folder,
|
||||||
|
# binaries and all
|
||||||
|
if [[ "$_DPL_PACKAGE_MAIN" == "1" ]]; then
|
||||||
|
. ../debian_template.sh main;
|
||||||
|
OLDPWD=$PWD; # [repo]/build
|
||||||
|
cd ..; # repo root
|
||||||
|
|
||||||
|
if [[ "$_DPL_PACKAGE_SOURCE" == "1" ]]; then
|
||||||
|
echo "Building main source Debian package";
|
||||||
|
expect <(cat <<EOD
|
||||||
|
spawn debuild -S -us -uc;
|
||||||
|
expect "continue anyway? (y/n)"
|
||||||
|
send "y\r"
|
||||||
|
interact
|
||||||
|
EOD
|
||||||
|
);
|
||||||
|
fi;
|
||||||
|
|
||||||
|
if [[ "$_DPL_PACKAGE_BINARY" == "1" ]]; then
|
||||||
|
echo "Building main binary Debian package";
|
||||||
|
expect <(cat <<EOD
|
||||||
|
spawn debuild -us -uc;
|
||||||
|
expect "continue anyway? (y/n)"
|
||||||
|
send "y\r"
|
||||||
|
interact
|
||||||
|
EOD
|
||||||
|
);
|
||||||
|
fi;
|
||||||
|
|
||||||
|
cd $OLDPWD;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
# Also an asset package
|
||||||
|
if [[ "$_DPL_PACKAGE_ASSET" == "1" ]]; then
|
||||||
|
. ../debian_template.sh asset;
|
||||||
|
OLDPWD=$PWD; # [repo]/build
|
||||||
|
cd ../assets;
|
||||||
|
|
||||||
|
# make sure the asset files exist, download them if they don't
|
||||||
|
#echo "Checking asset files for asset Debian package";
|
||||||
|
#debuild -T build;
|
||||||
|
|
||||||
|
if [[ "$_DPL_PACKAGE_SOURCE" == "1" ]]; then
|
||||||
|
echo "Building asset source Debian package";
|
||||||
|
expect <(cat <<EOD
|
||||||
|
spawn debuild -S -us -uc;
|
||||||
|
expect "continue anyway? (y/n)"
|
||||||
|
send "y\r"
|
||||||
|
interact
|
||||||
|
EOD
|
||||||
|
);
|
||||||
|
fi;
|
||||||
|
|
||||||
|
if [[ "$_DPL_PACKAGE_BINARY" == "1" ]]; then
|
||||||
|
echo "Building asset binary Debian package";
|
||||||
|
expect <(cat <<EOD
|
||||||
|
spawn debuild -us -uc;
|
||||||
|
expect "continue anyway? (y/n)"
|
||||||
|
send "y\r"
|
||||||
|
interact
|
||||||
|
EOD
|
||||||
|
);
|
||||||
|
fi;
|
||||||
|
|
||||||
|
cd $OLDPWD;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
# Now sign our packages
|
||||||
|
if [[ "$DPL_PGP_KEY_PRIVATE" != "" ]] && [[ "$DPL_PGP_KEY_PASSPHRASE" != "" ]]; then
|
||||||
|
# Get the key to sign
|
||||||
|
# Do this AFTER debuild so that we can specify the passphrase in command line
|
||||||
|
echo "$DPL_PGP_KEY_PRIVATE" | base64 --decode > key.asc;
|
||||||
|
echo "$DPL_PGP_KEY_PASSPHRASE" > phrase.txt;
|
||||||
|
gpg --import key.asc;
|
||||||
|
|
||||||
|
if [[ "$_DPL_PACKAGE_MAIN" == "1" ]]; then
|
||||||
|
echo "Signing main package(s)";
|
||||||
|
|
||||||
|
PACKAGEFILENAME=${PACKAGE_NAME}_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
PACKAGEDBGFILENAME=${PACKAGE_NAME}-dbg_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
#PACKAGENIGHTLYFILENAME=${PACKAGE_NAME}-nightly_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
#PACKAGENIGHTLYDBGFILENAME=${PACKAGE_NAME}-nightly-dbg_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
#PACKAGEPATCHFILENAME=${PACKAGE_NAME}-patch_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
#PACKAGEPATCHDBGFILENAME=${PACKAGE_NAME}-patch-dbg_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
#PACKAGEPATCHNIGHTLYFILENAME=${PACKAGE_NAME}-patch-nightly_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
#PACKAGEPATCHNIGHTLYDBGFILENAME=${PACKAGE_NAME}-patch-nightly-dbg_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
|
||||||
|
PACKAGEFILENAMES=(
|
||||||
|
$PACKAGEFILENAME
|
||||||
|
$PACKAGEDBGFILENAME
|
||||||
|
#$PACKAGENIGHTLYFILENAME
|
||||||
|
#$PACKAGENIGHTLYDBGFILENAME
|
||||||
|
#$PACKAGEPATCHFILENAME
|
||||||
|
#$PACKAGEPATCHDBGFILENAME
|
||||||
|
#$PACKAGEPATCHNIGHTLYFILENAME
|
||||||
|
#$PACKAGEPATCHNIGHTLYDBGFILENAME
|
||||||
|
);
|
||||||
|
|
||||||
|
# Main packages are in parent of root repo folder
|
||||||
|
OLDPWD=$PWD; # [repo]/build
|
||||||
|
cd ../..; # parent of repo root
|
||||||
|
|
||||||
|
for n in ${PACKAGEFILENAMES}; do
|
||||||
|
for f in ./$n*.changes; do
|
||||||
|
debsign --no-re-sign -p"gpg --passphrase-file $OLDPWD/phrase.txt --batch" "$f";
|
||||||
|
done;
|
||||||
|
done;
|
||||||
|
|
||||||
|
cd $OLDPWD;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
if [[ "$_DPL_PACKAGE_ASSET" == "1" ]]; then
|
||||||
|
echo "Signing asset package(s)";
|
||||||
|
|
||||||
|
PACKAGEFILENAME=${PACKAGE_NAME}-data_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
#PACKAGENIGHTLYFILENAME=${PACKAGE_NAME}-nightly-data_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
#PACKAGEPATCHFILENAME=${PACKAGE_NAME}-patch-data_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
#PACKAGEPATCHNIGHTLYFILENAME=${PACKAGE_NAME}-patch-nightly-data_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
|
||||||
|
PACKAGEFILENAMES=(
|
||||||
|
$PACKAGEFILENAME
|
||||||
|
#$PACKAGENIGHTLYFILENAME
|
||||||
|
#$PACKAGEPATCHFILENAME
|
||||||
|
#$PACKAGEPATCHNIGHTLYFILENAME
|
||||||
|
)
|
||||||
|
|
||||||
|
# Asset packages are in root repo folder
|
||||||
|
OLDPWD=$PWD; # [repo]/build
|
||||||
|
cd ..; # repo root
|
||||||
|
|
||||||
|
for n in ${PACKAGEFILENAMES}; do
|
||||||
|
for f in ./$n*.changes; do
|
||||||
|
debsign --no-re-sign -p"gpg --passphrase-file $OLDPWD/phrase.txt --batch" "$f";
|
||||||
|
done;
|
||||||
|
done;
|
||||||
|
|
||||||
|
cd $OLDPWD;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
# Delete the keys :eyes:
|
||||||
|
srm key.asc;
|
||||||
|
srm phrase.txt;
|
||||||
|
fi;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
# all other OSes
|
||||||
|
if [[ "$TRAVIS_OS_NAME" != "linux" ]]; then
|
||||||
|
#
|
||||||
|
# Check for binary building
|
||||||
|
#
|
||||||
|
if [[ "$_DPL_BINARY" == "1" ]]; then
|
||||||
|
echo "Building a Binary";
|
||||||
|
make -k;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Check for package building
|
||||||
|
#
|
||||||
|
if [[ "$_DPL_PACKAGE_BINARY" == "1" ]]; then
|
||||||
|
echo "Building a Package";
|
||||||
|
|
||||||
|
# Make an OSX package; superuser is required for library bundling
|
||||||
|
#
|
||||||
|
# HACK: OSX packaging can't write libraries to .app package unless we're superuser
|
||||||
|
# because the original library files don't have WRITE permission
|
||||||
|
# Bug may be sidestepped by using CHMOD_BUNDLE_ITEMS=TRUE
|
||||||
|
# But I don't know where this is set. Not `cmake -D...` because this var is ignored.
|
||||||
|
# https://cmake.org/Bug/view.php?id=9284
|
||||||
|
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
||||||
|
sudo make -k package;
|
||||||
|
else
|
||||||
|
# Some day, when Windows is supported, we'll just make a standard package
|
||||||
|
make -k package;
|
||||||
|
fi;
|
||||||
|
fi;
|
||||||
|
fi;
|
||||||
|
fi;
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Deployer for Travis-CI
|
||||||
|
# Default Variables
|
||||||
|
#
|
||||||
|
# Here are all of the user-set variables used by Deployer.
|
||||||
|
# See the "Cross-platform deployment" page on SRB2 Wiki for documentation.
|
||||||
|
|
||||||
|
# Core Parameters
|
||||||
|
: ${DPL_ENABLED} # Enable Deployer behavior; must be set for any deployment activity
|
||||||
|
: ${DPL_TAG_ENABLED} # Trigger Deployer for all tag releases
|
||||||
|
: ${DPL_JOB_ENABLE_ALL} # Enable all jobs for deployment
|
||||||
|
: ${DPL_TERMINATE_TESTS} # Terminate all build test jobs (used in .travis.yml)
|
||||||
|
: ${DPL_TRIGGER} # Use a [word] in the commit message to trigger Deployer
|
||||||
|
: ${DPL_JOBNAMES} # Trigger Deployer by job name
|
||||||
|
: ${DPL_OSNAMES} # Trigger Deployer by OS name (osx,linux)
|
||||||
|
: ${DPL_BRANCHES} # Trigger Deployer by git branch name
|
||||||
|
|
||||||
|
# Job Parameters
|
||||||
|
: ${_DPL_JOB_ENABLED} # Enable Deployer for this specific job. DPL_ENABLED must be set too.
|
||||||
|
: ${_DPL_JOB_NAME} # Identifier for the job, used for logging and trigger word matching
|
||||||
|
: ${_DPL_FTP_TARGET} # Deploy to FTP
|
||||||
|
: ${_DPL_DPUT_TARGET} # Deploy to DPUT
|
||||||
|
: ${_DPL_PACKAGE_SOURCE} # Build packages into a Source distribution. Linux only.
|
||||||
|
: ${_DPL_PACKAGE_BINARY} # Build packages into a Binary distribution.
|
||||||
|
: ${_DPL_PACKAGE_MAIN:=1} # Build main installation package. Linux only; OS X assumes this.
|
||||||
|
: ${_DPL_PACKAGE_ASSET} # Build asset installation package. Linux only.
|
||||||
|
|
||||||
|
# Asset File Parameters
|
||||||
|
: ${ASSET_ARCHIVE_PATH:=https://github.com/mazmazz/Kart-Public/releases/download/kart_assets/srb2kart-v102-assets.7z}
|
||||||
|
: ${ASSET_ARCHIVE_OPTIONAL_PATH:=https://github.com/mazmazz/Kart-Public/releases/download/kart_assets/srb2kart-v102-optional-assets.7z}
|
||||||
|
: ${ASSET_FILES_HASHED:=srb2.srb patch.kart gfx.kart textures.kart chars.kart maps.kart}
|
||||||
|
: ${ASSET_FILES_DOCS:=README.txt HISTORY.txt LICENSE.txt LICENSE-3RD-PARTY.txt}
|
||||||
|
: ${ASSET_FILES_OPTIONAL_GET:=0}
|
||||||
|
|
||||||
|
# FTP Parameters
|
||||||
|
: ${DPL_FTP_PROTOCOL}
|
||||||
|
: ${DPL_FTP_USER}
|
||||||
|
: ${DPL_FTP_PASS}
|
||||||
|
: ${DPL_FTP_HOSTNAME}
|
||||||
|
: ${DPL_FTP_PORT}
|
||||||
|
: ${DPL_FTP_PATH}
|
||||||
|
|
||||||
|
# DPUT Parameters
|
||||||
|
: ${DPL_DPUT_DOMAIN:=ppa.launchpad.net}
|
||||||
|
: ${DPL_DPUT_METHOD:=sftp}
|
||||||
|
: ${DPL_DPUT_INCOMING}
|
||||||
|
: ${DPL_DPUT_LOGIN:=anonymous}
|
||||||
|
: ${DPL_SSH_KEY_PRIVATE} # Base64-encoded private key file. Used to sign repository uploads
|
||||||
|
: ${DPL_SSH_KEY_PASSPHRASE} # Decodes the private key file.
|
||||||
|
|
||||||
|
# Package Parameters
|
||||||
|
: ${PACKAGE_NAME:=srb2kart}
|
||||||
|
: ${PACKAGE_VERSION:=1.0.2}
|
||||||
|
: ${PACKAGE_SUBVERSION} # Highly recommended to set this to reflect the distro series target (e.g., ~18.04bionic)
|
||||||
|
: ${PACKAGE_REVISION} # Defaults to UTC timestamp
|
||||||
|
: ${PACKAGE_INSTALL_PATH:=/usr/games/SRB2Kart}
|
||||||
|
: ${PACKAGE_LINK_PATH:=/usr/games}
|
||||||
|
: ${PACKAGE_DISTRO:=trusty}
|
||||||
|
: ${PACKAGE_URGENCY:=high}
|
||||||
|
: ${PACKAGE_NAME_EMAIL:=Kart Krew <stjr@srb2.org>}
|
||||||
|
: ${PACKAGE_GROUP_NAME_EMAIL:=Kart Krew <stjr@srb2.org>}
|
||||||
|
: ${PACKAGE_WEBSITE:=<https://mb.srb2.org/showthread.php?p=802695>}
|
||||||
|
|
||||||
|
: ${PACKAGE_ASSET_MINVERSION:=1.0.1} # Number this the version BEFORE the actual required version, because we do a > check
|
||||||
|
: ${PACKAGE_ASSET_MAXVERSION:=1.0.3} # Number this the version AFTER the actual required version, because we do a < check
|
||||||
|
|
||||||
|
: ${PROGRAM_NAME:=Sonic Robo Blast 2 Kart}
|
||||||
|
: ${PROGRAM_VENDOR:=Kart Krew}
|
||||||
|
: ${PROGRAM_VERSION:=1.0.2}
|
||||||
|
: ${PROGRAM_DESCRIPTION:=A kart racing mod based on the 3D Sonic the Hedgehog fangame Sonic Robo Blast 2.}
|
||||||
|
: ${PROGRAM_FILENAME:=srb2kart}
|
||||||
|
|
||||||
|
: ${DPL_PGP_KEY_PRIVATE} # Base64-encoded private key file. Used to sign Debian packages
|
||||||
|
: ${DPL_PGP_KEY_PASSPHRASE} # Decodes the private key file.
|
||||||
|
|
||||||
|
# Export Asset and Package Parameters for envsubst templating
|
||||||
|
|
||||||
|
export ASSET_ARCHIVE_PATH="${ASSET_ARCHIVE_PATH}"
|
||||||
|
export ASSET_ARCHIVE_OPTIONAL_PATH="${ASSET_ARCHIVE_OPTIONAL_PATH}"
|
||||||
|
export ASSET_FILES_HASHED="${ASSET_FILES_HASHED}"
|
||||||
|
export ASSET_FILES_DOCS="${ASSET_FILES_DOCS}"
|
||||||
|
export ASSET_FILES_OPTIONAL_GET="${ASSET_FILES_OPTIONAL_GET}"
|
||||||
|
|
||||||
|
export PACKAGE_NAME="${PACKAGE_NAME}"
|
||||||
|
export PACKAGE_VERSION="${PACKAGE_VERSION}"
|
||||||
|
export PACKAGE_SUBVERSION="${PACKAGE_SUBVERSION}" # in case we have this
|
||||||
|
export PACKAGE_REVISION="${PACKAGE_REVISION}"
|
||||||
|
export PACKAGE_ASSET_MINVERSION="${PACKAGE_ASSET_MINVERSION}"
|
||||||
|
export PACKAGE_ASSET_MAXVERSION="${PACKAGE_ASSET_MAXVERSION}"
|
||||||
|
export PACKAGE_INSTALL_PATH="${PACKAGE_INSTALL_PATH}"
|
||||||
|
export PACKAGE_LINK_PATH="${PACKAGE_LINK_PATH}"
|
||||||
|
export PACKAGE_DISTRO="${PACKAGE_DISTRO}"
|
||||||
|
export PACKAGE_URGENCY="${PACKAGE_URGENCY}"
|
||||||
|
export PACKAGE_NAME_EMAIL="${PACKAGE_NAME_EMAIL}"
|
||||||
|
export PACKAGE_GROUP_NAME_EMAIL="${PACKAGE_GROUP_NAME_EMAIL}"
|
||||||
|
export PACKAGE_WEBSITE="${PACKAGE_WEBSITE}"
|
||||||
|
|
||||||
|
export PROGRAM_NAME="${PROGRAM_NAME}"
|
||||||
|
export PROGRAM_VERSION="${PROGRAM_VERSION}"
|
||||||
|
export PROGRAM_DESCRIPTION="${PROGRAM_DESCRIPTION}"
|
||||||
|
export PROGRAM_FILENAME="${PROGRAM_FILENAME}"
|
||||||
|
|
||||||
|
# This file is called in debian_template.sh, so mark our completion so we don't run it again
|
||||||
|
__DEBIAN_PARAMETERS_INITIALIZED=1
|
||||||
@@ -0,0 +1,133 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Deployer for Travis-CI
|
||||||
|
# DPUT uploader (e.g., Launchpad PPA)
|
||||||
|
#
|
||||||
|
|
||||||
|
if [[ "$__DPL_DPUT_ACTIVE" == "1" ]]; then
|
||||||
|
# Install APT dependencies
|
||||||
|
# paramiko required for ssh
|
||||||
|
sudo apt-get install python-paramiko expect dput; # python-pip
|
||||||
|
#pip install paramiko;
|
||||||
|
|
||||||
|
# Output the DPUT config
|
||||||
|
# Dput only works if you're using secure FTP, so that's what we default to.
|
||||||
|
cat > "./dput.cf" << EOM
|
||||||
|
[deployer]
|
||||||
|
fqdn = ${DPL_DPUT_DOMAIN}
|
||||||
|
method = ${DPL_DPUT_METHOD}
|
||||||
|
incoming = ${DPL_DPUT_INCOMING}
|
||||||
|
login = ${DPL_DPUT_LOGIN}
|
||||||
|
allow_unsigned_uploads = 0
|
||||||
|
EOM
|
||||||
|
|
||||||
|
# Output SSH config
|
||||||
|
# Don't let SSH prompt us for untrusted hosts
|
||||||
|
cat >> "./ssh_config" << EOM
|
||||||
|
|
||||||
|
Host *
|
||||||
|
StrictHostKeyChecking no
|
||||||
|
UserKnownHostsFile=/dev/null
|
||||||
|
PubKeyAuthentication yes
|
||||||
|
IdentityFile ${PWD}/key.private
|
||||||
|
IdentitiesOnly yes
|
||||||
|
EOM
|
||||||
|
sudo sh -c "cat < ${PWD}/ssh_config >> /etc/ssh/ssh_config";
|
||||||
|
|
||||||
|
# Get the private key
|
||||||
|
echo "$DPL_SSH_KEY_PRIVATE" | base64 --decode > key.private;
|
||||||
|
chmod 700 ./key.private;
|
||||||
|
|
||||||
|
if [[ "$_DPL_PACKAGE_MAIN" == "1" ]]; then
|
||||||
|
PACKAGEFILENAME=${PACKAGE_NAME}_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
PACKAGEDBGFILENAME=${PACKAGE_NAME}-dbg_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
#PACKAGENIGHTLYFILENAME=${PACKAGE_NAME}-nightly_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
#PACKAGENIGHTLYDBGFILENAME=${PACKAGE_NAME}-nightly-dbg_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
#PACKAGEPATCHFILENAME=${PACKAGE_NAME}-patch_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
#PACKAGEPATCHDBGFILENAME=${PACKAGE_NAME}-patch-dbg_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
#PACKAGEPATCHNIGHTLYFILENAME=${PACKAGE_NAME}-patch-nightly_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
#PACKAGEPATCHNIGHTLYDBGFILENAME=${PACKAGE_NAME}-patch-nightly-dbg_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
|
||||||
|
PACKAGEFILENAMES=(
|
||||||
|
$PACKAGEFILENAME
|
||||||
|
$PACKAGEDBGFILENAME
|
||||||
|
#$PACKAGENIGHTLYFILENAME
|
||||||
|
#$PACKAGENIGHTLYDBGFILENAME
|
||||||
|
#$PACKAGEPATCHFILENAME
|
||||||
|
#$PACKAGEPATCHDBGFILENAME
|
||||||
|
#$PACKAGEPATCHNIGHTLYFILENAME
|
||||||
|
#$PACKAGEPATCHNIGHTLYDBGFILENAME
|
||||||
|
);
|
||||||
|
|
||||||
|
# Main packages are in parent of root repo folder
|
||||||
|
OLDPWD=$PWD; # [repo]/build
|
||||||
|
cd ../..;
|
||||||
|
|
||||||
|
# Enter passphrase if required
|
||||||
|
for n in ${PACKAGEFILENAMES}; do
|
||||||
|
for f in $n*.changes; do
|
||||||
|
# Binary builds also generate source builds, so exclude the source
|
||||||
|
# builds if desired
|
||||||
|
if [[ "$_DPL_PACKAGE_SOURCE" != "1" ]]; then
|
||||||
|
if [[ "$f" == *"_source"* ]] || [[ "$f" == *".tar.xz"* ]]; then
|
||||||
|
continue;
|
||||||
|
fi;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
expect <(cat <<EOD
|
||||||
|
spawn dput -c "${OLDPWD}/dput.cf" deployer "$f";
|
||||||
|
expect "Enter passphrase for key"
|
||||||
|
send "${DPL_SSH_KEY_PASSPHRASE}\r"
|
||||||
|
interact
|
||||||
|
EOD
|
||||||
|
);
|
||||||
|
done;
|
||||||
|
done;
|
||||||
|
|
||||||
|
# Go back to [repo]/build folder
|
||||||
|
cd $OLDPWD;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
if [[ "$_DPL_PACKAGE_ASSET" == "1" ]]; then
|
||||||
|
PACKAGEFILENAME=${PACKAGE_NAME}-data_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
#PACKAGENIGHTLYFILENAME=${PACKAGE_NAME}-nightly-data_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
#PACKAGEPATCHFILENAME=${PACKAGE_NAME}-patch-data_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
#PACKAGEPATCHNIGHTLYFILENAME=${PACKAGE_NAME}-patch-nightly-data_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
|
||||||
|
PACKAGEFILENAMES=(
|
||||||
|
$PACKAGEFILENAME
|
||||||
|
#$PACKAGENIGHTLYFILENAME
|
||||||
|
#$PACKAGEPATCHFILENAME
|
||||||
|
#$PACKAGEPATCHNIGHTLYFILENAME
|
||||||
|
)
|
||||||
|
|
||||||
|
# Asset packages are in root repo folder
|
||||||
|
OLDPWD=$PWD; # [repo]/build
|
||||||
|
cd ..;
|
||||||
|
|
||||||
|
# Enter passphrase if required
|
||||||
|
for n in ${PACKAGEFILENAMES}; do
|
||||||
|
for f in $n*.changes; do
|
||||||
|
# Binary builds also generate source builds, so exclude the source
|
||||||
|
# builds if desired
|
||||||
|
if [[ "$_DPL_PACKAGE_SOURCE" != "1" ]]; then
|
||||||
|
if [[ "$f" == *"_source"* ]] || [[ "$f" == *".tar.xz"* ]]; then
|
||||||
|
continue;
|
||||||
|
fi;
|
||||||
|
fi;
|
||||||
|
expect <(cat <<EOD
|
||||||
|
spawn dput -c "${OLDPWD}/dput.cf" deployer "$f";
|
||||||
|
expect "Enter passphrase for key"
|
||||||
|
send "${DPL_SSH_KEY_PASSPHRASE}\r"
|
||||||
|
interact
|
||||||
|
EOD
|
||||||
|
);
|
||||||
|
done;
|
||||||
|
done;
|
||||||
|
|
||||||
|
# Go back to [repo]/build folder
|
||||||
|
cd $OLDPWD;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
srm ./key.private;
|
||||||
|
fi;
|
||||||
@@ -0,0 +1,137 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Deployer for Travis-CI
|
||||||
|
# FTP Uploader
|
||||||
|
#
|
||||||
|
# Package files are uploaded to, e.g., ftp://username:password@example.com:21/path/to/upload/STJr/SRB2/master/460873812-151.1
|
||||||
|
# With file `commit.txt` and folder(s) `bin` and `package`
|
||||||
|
#
|
||||||
|
# Set these environment variables in your Travis-CI settings, where they are stored securely.
|
||||||
|
# See other shell scripts for more options.
|
||||||
|
#
|
||||||
|
# DPL_FTP_PROTOCOL = ftp (ftp or sftp or ftps or however your FTP URI begins)
|
||||||
|
# DPL_FTP_USER = username
|
||||||
|
# DPL_FTP_PASS = password
|
||||||
|
# DPL_FTP_HOSTNAME = example.com
|
||||||
|
# DPL_FTP_PORT = 21
|
||||||
|
# DPL_FTP_PATH = path/to/upload (do not add trailing slash)
|
||||||
|
|
||||||
|
if [[ "$__DPL_FTP_ACTIVE" == "1" ]]; then
|
||||||
|
if [[ "$TRAVIS_JOB_NAME" != "" ]]; then
|
||||||
|
JOBNAME=$TRAVIS_JOB_NAME;
|
||||||
|
else
|
||||||
|
if [[ "$_DPL_JOB_NAME" != "" ]]; then
|
||||||
|
JOBNAME=$_DPL_JOB_NAME;
|
||||||
|
else
|
||||||
|
JOBNAME=$TRAVIS_OS_NAME;
|
||||||
|
fi;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
# Generate commit.txt file
|
||||||
|
echo "Travis-CI Build $TRAVIS_OS_NAME - $TRAVIS_REPO_SLUG/$TRAVIS_BRANCH - $TRAVIS_JOB_NUMBER - $JOBNAME" > "commit.txt";
|
||||||
|
echo "Job ID $TRAVIS_JOB_ID" >> "commit.txt";
|
||||||
|
echo "" >> "commit.txt";
|
||||||
|
echo "Commit $TRAVIS_COMMIT" >> "commit.txt";
|
||||||
|
echo "$TRAVIS_COMMIT_MESSAGE" >> "commit.txt";
|
||||||
|
echo "" >> "commit.txt";
|
||||||
|
|
||||||
|
# Initialize FTP parameters
|
||||||
|
if [[ "$DPL_FTP_PORT" == "" ]]; then
|
||||||
|
DPL_FTP_PORT=21;
|
||||||
|
fi;
|
||||||
|
if [[ "$DPL_FTP_PROTOCOL" == "" ]]; then
|
||||||
|
DPL_FTP_PROTOCOL=ftp;
|
||||||
|
fi;
|
||||||
|
__DPL_FTP_LOCATION=$DPL_FTP_PROTOCOL://$DPL_FTP_HOSTNAME:$DPL_FTP_PORT/$DPL_FTP_PATH/$TRAVIS_REPO_SLUG/$TRAVIS_BRANCH/$TRAVIS_JOB_ID-$TRAVIS_JOB_NUMBER-$JOBNAME;
|
||||||
|
|
||||||
|
# Upload to FTP!
|
||||||
|
echo "Uploading to FTP...";
|
||||||
|
curl --ftp-create-dirs -T "commit.txt" -u $DPL_FTP_USER:$DPL_FTP_PASS "$__DPL_FTP_LOCATION/commit.txt";
|
||||||
|
|
||||||
|
if [[ "$__DPL_DEBIAN_ACTIVE" == "1" ]]; then
|
||||||
|
if [[ "$_DPL_PACKAGE_MAIN" == "1" ]]; then
|
||||||
|
PACKAGEFILENAME=${PACKAGE_NAME}_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
PACKAGEDBGFILENAME=${PACKAGE_NAME}-dbg_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
#PACKAGENIGHTLYFILENAME=${PACKAGE_NAME}-nightly_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
#PACKAGENIGHTLYDBGFILENAME=${PACKAGE_NAME}-nightly-dbg_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
#PACKAGEPATCHFILENAME=${PACKAGE_NAME}-patch_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
#PACKAGEPATCHDBGFILENAME=${PACKAGE_NAME}-patch-dbg_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
#PACKAGEPATCHNIGHTLYFILENAME=${PACKAGE_NAME}-patch-nightly_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
#PACKAGEPATCHNIGHTLYDBGFILENAME=${PACKAGE_NAME}-patch-nightly-dbg_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
|
||||||
|
PACKAGEFILENAMES=(
|
||||||
|
$PACKAGEFILENAME
|
||||||
|
$PACKAGEDBGFILENAME
|
||||||
|
#$PACKAGENIGHTLYFILENAME
|
||||||
|
#$PACKAGENIGHTLYDBGFILENAME
|
||||||
|
#$PACKAGEPATCHFILENAME
|
||||||
|
#$PACKAGEPATCHDBGFILENAME
|
||||||
|
#$PACKAGEPATCHNIGHTLYFILENAME
|
||||||
|
#$PACKAGEPATCHNIGHTLYDBGFILENAME
|
||||||
|
);
|
||||||
|
|
||||||
|
# Main packages are in parent of root repo folder
|
||||||
|
OLDPWD=$PWD; # [repo]/build
|
||||||
|
cd ../..;
|
||||||
|
|
||||||
|
for n in ${PACKAGEFILENAMES}; do
|
||||||
|
for f in ./$n*; do
|
||||||
|
# Binary builds also generate source builds, so exclude the source
|
||||||
|
# builds if desired
|
||||||
|
if [[ "$_DPL_PACKAGE_SOURCE" != "1" ]]; then
|
||||||
|
if [[ "$f" == *"_source"* ]] || [[ "$f" == *".tar.xz"* ]]; then
|
||||||
|
continue;
|
||||||
|
fi;
|
||||||
|
fi;
|
||||||
|
curl --ftp-create-dirs -T "$f" -u $DPL_FTP_USER:$DPL_FTP_PASS "$__DPL_FTP_LOCATION/package/main/$f";
|
||||||
|
done;
|
||||||
|
done;
|
||||||
|
|
||||||
|
# Go back to [repo]/build folder
|
||||||
|
cd $OLDPWD;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
if [[ "$_DPL_PACKAGE_ASSET" == "1" ]]; then
|
||||||
|
PACKAGEFILENAME=${PACKAGE_NAME}-data_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
#PACKAGENIGHTLYFILENAME=${PACKAGE_NAME}-nightly-data_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
#PACKAGEPATCHFILENAME=${PACKAGE_NAME}-patch-data_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
#PACKAGEPATCHNIGHTLYFILENAME=${PACKAGE_NAME}-patch-nightly-data_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
|
||||||
|
|
||||||
|
PACKAGEFILENAMES=(
|
||||||
|
$PACKAGEFILENAME
|
||||||
|
#$PACKAGENIGHTLYFILENAME
|
||||||
|
#$PACKAGEPATCHFILENAME
|
||||||
|
#$PACKAGEPATCHNIGHTLYFILENAME
|
||||||
|
)
|
||||||
|
|
||||||
|
# Asset packages are in root repo folder
|
||||||
|
OLDPWD=$PWD; # [repo]/build
|
||||||
|
cd ..;
|
||||||
|
|
||||||
|
for n in ${PACKAGEFILENAMES}; do
|
||||||
|
for f in ./$n*; do
|
||||||
|
# Binary builds also generate source builds, so exclude the source
|
||||||
|
# builds if desired
|
||||||
|
if [[ "$_DPL_PACKAGE_SOURCE" != "1" ]]; then
|
||||||
|
if [[ "$f" == *"_source"* ]] || [[ "$f" == *".tar.xz"* ]]; then
|
||||||
|
continue;
|
||||||
|
fi;
|
||||||
|
fi;
|
||||||
|
curl --ftp-create-dirs -T "$f" -u $DPL_FTP_USER:$DPL_FTP_PASS "$__DPL_FTP_LOCATION/package/asset/$f";
|
||||||
|
done;
|
||||||
|
done;
|
||||||
|
|
||||||
|
# Go back to [repo]/build folder
|
||||||
|
cd $OLDPWD;
|
||||||
|
fi;
|
||||||
|
else
|
||||||
|
if [[ "$_DPL_BINARY" == "1" ]]; then
|
||||||
|
find bin -type f -exec curl -u $DPL_FTP_USER:$DPL_FTP_PASS --ftp-create-dirs -T {} $__DPL_FTP_LOCATION/{} \;;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
if [[ "$_DPL_PACKAGE_BINARY" == "1" ]]; then
|
||||||
|
sudo rm -r package/_CPack_Packages
|
||||||
|
find package -type f -exec curl -u $DPL_FTP_USER:$DPL_FTP_PASS --ftp-create-dirs -T {} $__DPL_FTP_LOCATION/{} \;;
|
||||||
|
fi;
|
||||||
|
fi;
|
||||||
|
fi
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
================================================================
|
||||||
|
How to add Low-res modes to your XF86Config under Linux MANUALLY
|
||||||
|
================================================================
|
||||||
|
|
||||||
|
I TAKE NO RESPONSIBILITY FOR ANY DAMAGE DONE TO YOUR EQUIPMENT!!!
|
||||||
|
|
||||||
|
This document explains how to add low-res modes like 320x200 to your
|
||||||
|
X-Server configuration, because some new setup tools for the X-Server
|
||||||
|
do not support this. ONLY RECOMMENDED FOR USERS WHO KNOW WHAT THEY DO!
|
||||||
|
|
||||||
|
I do not take any responsibility for damage done to your monitor, your
|
||||||
|
videocard, your harddisk, your cat, your dog or anything else!!!
|
||||||
|
IMPORTANT IS, THAT YOUR "HorizSync" AND "VertRefresh" VALUES REALLY
|
||||||
|
MATCH YOUR MONITOR! OTHERWISE YOUR MONITOR CAN BLOW UP!!!
|
||||||
|
|
||||||
|
OK, if you have read up to here, you either know what you do or really
|
||||||
|
die-hard want those low-res modes. Here is what to do:
|
||||||
|
Look up your XF86Config. Is is either in /etc or in /etc/X11. Here is
|
||||||
|
what you have to add to the definition of your modeslines:
|
||||||
|
|
||||||
|
# Low-res Doublescan modes
|
||||||
|
# If your chipset does not support doublescan, you get a 'squashed'
|
||||||
|
# resolution like 320x400.
|
||||||
|
|
||||||
|
# 320x200 @ 70 Hz, 31.5 kHz hsync, 8:5 aspect ratio
|
||||||
|
Modeline "320x200" 12.588 320 336 384 400 200 204 205 225 Doublescan
|
||||||
|
# 320x240 @ 60 Hz, 31.5 kHz hsync, 4:3 aspect ratio
|
||||||
|
Modeline "320x240" 12.588 320 336 384 400 240 245 246 262 Doublescan
|
||||||
|
# 320x240 @ 72 Hz, 36.5 kHz hsync
|
||||||
|
Modeline "320x240" 15.750 320 336 384 400 240 244 246 262 Doublescan
|
||||||
|
# 400x300 @ 56 Hz, 35.2 kHz hsync, 4:3 aspect ratio
|
||||||
|
ModeLine "400x300" 18 400 416 448 512 300 301 302 312 Doublescan
|
||||||
|
# 400x300 @ 60 Hz, 37.8 kHz hsync
|
||||||
|
Modeline "400x300" 20 400 416 480 528 300 301 303 314 Doublescan
|
||||||
|
# 400x300 @ 72 Hz, 48.0 kHz hsync
|
||||||
|
Modeline "400x300" 25 400 424 488 520 300 319 322 333 Doublescan
|
||||||
|
|
||||||
|
If your video card only supports a specific set of discrete dotclocks
|
||||||
|
(RAMDAC) you may have to replace the dotclocks given here by one of the
|
||||||
|
specified (e.g in the first modeline the dotclock is 12.588 MHz). I believe
|
||||||
|
that nowadays all cards and monitors should work with these settings, but
|
||||||
|
if you have outdated hardware you better check the frequencies yourself. If
|
||||||
|
there is any uncertainty, please check the "XFree86 Video Timings HOWTO".
|
||||||
|
|
||||||
|
|
||||||
|
Then have a look at the section "Screen" with the appropriate driver
|
||||||
|
(usually either "svga" or "accel"). Under Subsection "Display" there
|
||||||
|
are modes for the given color depth. Add the desired modes. As an
|
||||||
|
example I give you my screens definition here with low-res modes in
|
||||||
|
16 bit color depth:
|
||||||
|
|
||||||
|
Section "Screen"
|
||||||
|
Driver "accel"
|
||||||
|
Device "3D Charger"
|
||||||
|
Monitor "Iiyama Pro 450"
|
||||||
|
DefaultColorDepth 16
|
||||||
|
|
||||||
|
Subsection "Display"
|
||||||
|
Depth 8
|
||||||
|
Modes "1280x1024" "1024x768" "800x600" "640x480"
|
||||||
|
ViewPort 0 0
|
||||||
|
Virtual 1280 1024
|
||||||
|
EndSubsection
|
||||||
|
Subsection "Display"
|
||||||
|
Depth 16
|
||||||
|
Modes "1152x864" "1024x768" "800x600" "640x480" "400x300" "320x200" <- THIS IS ACTUALLY WHAT YOU WANT!!!
|
||||||
|
ViewPort 0 0 ^^^^^^^^^^^^^^^^^^^
|
||||||
|
Virtual 1152 864
|
||||||
|
EndSubsection
|
||||||
|
Subsection "Display"
|
||||||
|
Depth 24
|
||||||
|
Modes "800x600" "640x480"
|
||||||
|
ViewPort 0 0
|
||||||
|
Virtual 800 600
|
||||||
|
EndSubsection
|
||||||
|
Subsection "Display"
|
||||||
|
Depth 32
|
||||||
|
Modes "800x600" "640x480"
|
||||||
|
ViewPort 0 0
|
||||||
|
Virtual 800 600
|
||||||
|
EndSubsection
|
||||||
|
EndSection
|
||||||
|
|
||||||
|
Once again: important is, that you edit the correct Screen section.
|
||||||
|
If you use the SVGA Server and edit the ACCEL Server, you might
|
||||||
|
wonder where your new modes have gone.
|
||||||
|
|
||||||
|
If everything went fine and you want to say thank you, just write
|
||||||
|
to "metzgermeister@users.sourceforge.net". If your monitor blew
|
||||||
|
up and you want to kill me, find me playing Legacy or Q3A on the net
|
||||||
|
and frag me (with your second monitor, hehe).
|
||||||
|
|
||||||
|
- metzgermeister
|
||||||
@@ -0,0 +1,212 @@
|
|||||||
|
1-99 : Player Starts
|
||||||
|
1 - Player 1 Start 1
|
||||||
|
2 - Player 2 Start 2
|
||||||
|
3 - Player 3 Start 3
|
||||||
|
4 - Player 4 Start 4
|
||||||
|
5 - Player 5 Start 4001
|
||||||
|
6 - Player 6 Start 4002
|
||||||
|
7 - Player 7 Start 4003
|
||||||
|
8 - Player 8 Start 4004
|
||||||
|
9 - Player 9 Start 4005
|
||||||
|
10 - Player 10 Start 4006
|
||||||
|
11 - Player 11 Start 4007
|
||||||
|
12 - Player 12 Start 4008
|
||||||
|
13 - Player 13 Start 4009
|
||||||
|
14 - Player 14 Start 4010
|
||||||
|
15 - Player 15 Start 4011
|
||||||
|
16 - Player 16 Start 4012
|
||||||
|
17 - Player 17 Start 4013
|
||||||
|
18 - Player 18 Start 4014
|
||||||
|
19 - Player 19 Start 4015
|
||||||
|
20 - Player 20 Start 4016
|
||||||
|
21 - Player 21 Start 4017
|
||||||
|
22 - Player 22 Start 4018
|
||||||
|
23 - Player 23 Start 4019
|
||||||
|
24 - Player 24 Start 4020
|
||||||
|
25 - Player 25 Start 4021
|
||||||
|
26 - Player 26 Start 4022
|
||||||
|
27 - Player 27 Start 4023
|
||||||
|
28 - Player 28 Start 4024
|
||||||
|
29 - Player 29 Start 4025
|
||||||
|
30 - Player 30 Start 4026
|
||||||
|
31 - Player 31 Start 4027
|
||||||
|
32 - Player 32 Start 4028
|
||||||
|
33 - Player Match Start 11
|
||||||
|
34 - Red Team Start 87
|
||||||
|
35 - Blue Team Start 89
|
||||||
|
36 - Tag start New
|
||||||
|
|
||||||
|
100 - 199 : Enemies
|
||||||
|
100 - Blue Crawla 3004
|
||||||
|
101 - Red Crawla 9
|
||||||
|
102 - GFZ Fish 58
|
||||||
|
103 - Gold Buzz 5005
|
||||||
|
104 - Red Buzz 5006
|
||||||
|
105 - Jetty-Syn Bomber 3005
|
||||||
|
106 - Jetty-Syn Gunner 22
|
||||||
|
107 - Crawla Commander 21
|
||||||
|
108 - Deton 71
|
||||||
|
109 - Skim 56
|
||||||
|
110 - THZ Turret 2004
|
||||||
|
111 - Pop-up Turret 42
|
||||||
|
|
||||||
|
200 - 299 : Bosses and their associated items (if any)
|
||||||
|
200 - Boss 1 16
|
||||||
|
201 - Boss 2 2008
|
||||||
|
290 - Boss Fly Point 17
|
||||||
|
291 - EggTrap Center 2049
|
||||||
|
|
||||||
|
300 - 399 : Collectibles
|
||||||
|
300 - Ring 2014
|
||||||
|
301 - Homing Ring 69
|
||||||
|
302 - Rail Ring 3003
|
||||||
|
303 - Infinity Ring 80
|
||||||
|
304 - Automatic Ring 26
|
||||||
|
305 - Explosion Ring 54
|
||||||
|
306 - Red CTF Flag 31
|
||||||
|
307 - Blue CTF Flag 34
|
||||||
|
308 - Special Stage Token 2013
|
||||||
|
309 - Emerald 1 420
|
||||||
|
310 - Emerald 2 421
|
||||||
|
311 - Emerald 3 422
|
||||||
|
312 - Emerald 4 423
|
||||||
|
313 - Emerald 5 424
|
||||||
|
314 - Emerald 6 425
|
||||||
|
315 - Emerald 7 426
|
||||||
|
316 - Hunting Emerald 1 64
|
||||||
|
317 - Hunting Emerald 2 3002
|
||||||
|
318 - Hunting Emerald 3 3001
|
||||||
|
|
||||||
|
400 - 499 : Boxes
|
||||||
|
400 - Super Ring Box 2011
|
||||||
|
401 - Grey Ring Box 2012
|
||||||
|
402 - Ring Shield Box 48
|
||||||
|
403 - Fire Shield Box 2002
|
||||||
|
404 - Bomb Shield Box 2018
|
||||||
|
405 - Jump Shield Box 35
|
||||||
|
406 - Water Shield Box 2028
|
||||||
|
407 - Sneaker Box 25
|
||||||
|
408 - Invincibility Box 2022
|
||||||
|
409 - 1-Up Box 41
|
||||||
|
410 - Eggman Box 2005
|
||||||
|
411 - Mixup Box 78
|
||||||
|
412 - Question Box 3000
|
||||||
|
|
||||||
|
500 - 599 : Interactive Objects (friendly or otherwise - includes springs)
|
||||||
|
500 - Bubble Patch 33
|
||||||
|
501 - Level End Sign 86
|
||||||
|
502 - Starpost 3006
|
||||||
|
520 - Spike Ball -1
|
||||||
|
521 - Special Stage Spike Ball 23
|
||||||
|
522 - Ceiling Spike 67
|
||||||
|
523 - Floor Spike 68
|
||||||
|
540 - Fan 32
|
||||||
|
541 - Steam Riser 30
|
||||||
|
550 - Yellow Spring 28
|
||||||
|
551 - Red Spring 79
|
||||||
|
552 - Blue Spring 5004
|
||||||
|
553 - Yellow Spring Down 65
|
||||||
|
554 - Red Spring Down 66
|
||||||
|
555 - Yellow Diagonal Spring 2015
|
||||||
|
556 - Red Diagonal Spring 38
|
||||||
|
557 - Yellow Diag Spring Down 20
|
||||||
|
558 - Red Diag Spring Down 39
|
||||||
|
|
||||||
|
600 - 699 : Special placement patterns
|
||||||
|
600 - Vertical Rigns - Stack of 5 (suitable for Yellow Spring) 84
|
||||||
|
601 - Vertical Rings - Stack of 5 (suitable for Red Spring) 44
|
||||||
|
602 - Diagonal rings (5) 76
|
||||||
|
603 - Diagonal rings (10) 77
|
||||||
|
604 - A ring of rings 47
|
||||||
|
605 - A BIGGER ring of rings 2007
|
||||||
|
606 - A ring of wing items 2048
|
||||||
|
607 - A BIGGER ring of wing items 2010
|
||||||
|
608 - A ring of rings and wings (alternating) 2046
|
||||||
|
609 - A BIGGER ring of rings and wings (alternating) 2047
|
||||||
|
|
||||||
|
700 - 799 : Powerup indicators/environmental effects/miscellany
|
||||||
|
700 - Ambient Water 1a (S) 2026
|
||||||
|
701 - Ambient Water 1b (S) 2024
|
||||||
|
702 - Ambient Water 2a (M) 2023
|
||||||
|
703 - Ambient Water 2b (M) 2045
|
||||||
|
704 - Ambient Water 3a (L) 83
|
||||||
|
705 - Ambient Water 3b (L) 2019
|
||||||
|
706 - Ambient Water 4a (XL) 2025
|
||||||
|
707 - Ambient Water 4b (XL) 27
|
||||||
|
708 - Random Ambient 1 14
|
||||||
|
709 - Random Ambient 2 43
|
||||||
|
750 - Chaos Spawner 8
|
||||||
|
751 - Teleport Point 5003
|
||||||
|
752 - Alternate View Point 5007
|
||||||
|
753 - Zoom Tube Waypoint 18
|
||||||
|
754 - Pusher 5001
|
||||||
|
755 - Puller 5002
|
||||||
|
756 - Street Light 2003
|
||||||
|
|
||||||
|
800 - 899 : Greenflower Scenery
|
||||||
|
800 - Flower 1 36
|
||||||
|
801 - Flower 2 70
|
||||||
|
802 - Flower 3 73
|
||||||
|
804 - Berry Bush 74
|
||||||
|
805 - Bush 75
|
||||||
|
|
||||||
|
900 - 999 : Techno Hill Scenery
|
||||||
|
900 - THZ Plant 2035
|
||||||
|
901 - Alarm 2006
|
||||||
|
|
||||||
|
1000 - 1099 : Deep Sea Scenery
|
||||||
|
1000 - Gargoyle 81
|
||||||
|
|
||||||
|
1100 - 1199 : Castle Eggman Scenery
|
||||||
|
1100 - Ceiling Chain 49
|
||||||
|
1101 - Torch Flame 24
|
||||||
|
1102 - Eggman Statue 52
|
||||||
|
1103 - CEZ Flower 2001
|
||||||
|
|
||||||
|
1200 - 1299 : Arid Canyon Scenery
|
||||||
|
1300 - 1399 : Red Volcano Scenery
|
||||||
|
1400 - 1499 : Dark City Scenery
|
||||||
|
1500 - 1599 : Doom Ship Scenery
|
||||||
|
1600 - 1699 : Egg Rock/Final Fight Scenery
|
||||||
|
1700 - 1799 : NiGHTS Items
|
||||||
|
1700 - Axis 72
|
||||||
|
1701 - Axis Transfer (Normal) 61
|
||||||
|
1702 - Axis Transfer (Line) 46
|
||||||
|
1703 - Nights Drone 60
|
||||||
|
1704 - Nights Bumper 82
|
||||||
|
1705 - Hoop 57
|
||||||
|
1706 - Nights Wing 37
|
||||||
|
1707 - Super Loop Powerup 3007
|
||||||
|
1708 - Drill Refill Powerup 3008
|
||||||
|
1709 - Helper Powerup 3009
|
||||||
|
1710 - Egg Capsule 40
|
||||||
|
|
||||||
|
1800 - 1849 : Mario Items
|
||||||
|
1800 - Coin 10005
|
||||||
|
1801 - Goomba 10000
|
||||||
|
1802 - Blue Goomba 10001
|
||||||
|
1803 - FireFlower 50
|
||||||
|
1804 - Shell 10
|
||||||
|
1805 - Puma 29
|
||||||
|
1806 - Koopa 19
|
||||||
|
1807 - Axe 12
|
||||||
|
1808 - Mario Bush 1 10002
|
||||||
|
1809 - Mario Bush 2 10003
|
||||||
|
1810 - Toad 10004
|
||||||
|
|
||||||
|
1850 - 1899 : Christmas Items
|
||||||
|
1850 - Xmas Pole 5
|
||||||
|
1851 - Candy Cane 13
|
||||||
|
1852 - Snowman 6
|
||||||
|
|
||||||
|
1900 - 1999 : Misc Scenery
|
||||||
|
1900 - Stalagmite 0
|
||||||
|
1901 - Stalagmite 1
|
||||||
|
1902 - Stalagmite 2
|
||||||
|
1903 - Stalagmite 3
|
||||||
|
1904 - Stalagmite 4
|
||||||
|
1905 - Stalagmite 5
|
||||||
|
1906 - Stalagmite 6
|
||||||
|
1907 - Stalagmite 7
|
||||||
|
1908 - Stalagmite 8
|
||||||
|
1909 - Stalagmite 9
|
||||||
@@ -0,0 +1,223 @@
|
|||||||
|
Description OldNum NewNum Description
|
||||||
|
Old Water 14 Removed
|
||||||
|
|
||||||
|
Level Parameters/Misc:
|
||||||
|
Per-Sector Gravity 64 1
|
||||||
|
Custom Exit 71 2
|
||||||
|
Zoom Tube Parameters 18 3
|
||||||
|
Speed Pad 65 4
|
||||||
|
Camera Scanner 63 5
|
||||||
|
Disable Linedef 73 6
|
||||||
|
Flat Alignment 66 7
|
||||||
|
Sector Special Parameters New 8
|
||||||
|
Mace Parameters New 9
|
||||||
|
Sprite Cull Height New 10
|
||||||
|
Rope Hang Parameters New 11
|
||||||
|
Rock Spawner Parameters New 12
|
||||||
|
|
||||||
|
PolyObjects
|
||||||
|
Marks first line in PolyObject New 20
|
||||||
|
Explicitly includes a PolyObject line New 21
|
||||||
|
PolyObject: Parameters New 22
|
||||||
|
PolyObject: Waving Flag New 31
|
||||||
|
|
||||||
|
Level-Load Effects:
|
||||||
|
Instant Floor Lower 26 50
|
||||||
|
Instant Ceiling Raise 24 51
|
||||||
|
Continuously Falling Sector 88 52
|
||||||
|
Continuous Floor/Ceiling Mover 2 53
|
||||||
|
Continuous Floor Mover 3 54
|
||||||
|
Continuous Ceiling Mover 4 55
|
||||||
|
Continuous Two-Speed Floor/Ceiling Mover 6 56
|
||||||
|
Continuous Two-Speed Floor Mover 7 57
|
||||||
|
Continuous Two-Speed Ceiling Mover 8 58
|
||||||
|
Activate Floating Platform 232 59
|
||||||
|
Activate Floating Platform (Adjustable Speed) 233 60
|
||||||
|
Crusher 1 (Ceiling to Floor) 43 61
|
||||||
|
Crusher 2 (Floor to Ceiling) 50 62
|
||||||
|
Fake Floor/Ceiling 242 63
|
||||||
|
Appearing/Disappearing FOF New 64
|
||||||
|
Bridge Thinker New 65
|
||||||
|
|
||||||
|
Floor Over Floors:
|
||||||
|
"Floor Over Floor: Solid, Opaque, Shadowcasting " 25 100
|
||||||
|
"Floor Over Floor: Solid, Opaque, Non-Shadowcasting " 33 101
|
||||||
|
"Floor Over Floor: Solid, Translucent " 44 102
|
||||||
|
"Floor Over Floor: Solid, Sides Only " 69 103
|
||||||
|
"Floor Over Floor: Solid, No Sides " 51 104
|
||||||
|
"Floor Over Floor: Solid, Invisible " 57 105
|
||||||
|
|
||||||
|
"Floor Over Floor: Water, Opaque " 48 120
|
||||||
|
"Floor Over Floor: Water, Translucent " 45 121
|
||||||
|
"Floor Over Floor: Water, Opaque, No Sides " 75 122
|
||||||
|
"Floor Over Floor: Water, Translucent, No Sides " 74 123
|
||||||
|
|
||||||
|
"Floor Over Floor: Platform, Opaque " 59 140
|
||||||
|
"Floor Over Floor: Platform, Translucent " 81 141
|
||||||
|
"Floor Over Floor: Platform, Translucent, No Sides " 77 142
|
||||||
|
|
||||||
|
Floor Over Floor: Bobbing (Air) 38 150
|
||||||
|
Floor Over Floor: Adjustable Bobbing (Air) 68 151
|
||||||
|
Floor Over Floor: Reverse Adjustable Bobbing (Air) 72 152
|
||||||
|
|
||||||
|
"Floor Over Floor: Floating, Bobbing " 34 160
|
||||||
|
|
||||||
|
Floor Over Floor: Crumbling (Respawn) 36 170
|
||||||
|
Floor Over Floor: Crumbling (No Respawn) 35 171
|
||||||
|
"Floor Over Floor: Crumbling (Respawn), Platform " 79 172
|
||||||
|
"Floor Over Floor: Crumbling (No Respawn), Platform " 80 173
|
||||||
|
"Floor Over Floor: Crumbling (Respawn), Platform, Translucent " 82 174
|
||||||
|
"Floor Over Floor: Crumbling (No Respawn), Platform, Translucent " 83 175
|
||||||
|
"Floor Over Floor: Crumbling (Respawn), Floating, Bobbing " 39 176
|
||||||
|
"Floor Over Floor: Crumbling (No Respawn), Floating, Bobbing " 1 177
|
||||||
|
"Floor Over Floor: Crumbling (Respawn), Floating " 37 178
|
||||||
|
"Floor Over Floor: Crumbling (No Respawn), Floating " 42 179
|
||||||
|
"Floor Over Floor: Crumbling (Respawn), Bobbing (Air) " 40 180
|
||||||
|
|
||||||
|
"Floor Over Floor: Rising Platform, Solid, Opaque, Shadowcasting " 89 190
|
||||||
|
"Floor Over Floor: Rising Platform, Solid, Opaque, Non-Shadowcasting " 90 191
|
||||||
|
"Floor Over Floor: Rising Platform, Solid, Translucent " 91 192
|
||||||
|
"Floor Over Floor: Rising Platform, Solid, Invisible " 94 193
|
||||||
|
"Floor Over Floor: Rising Platform, Platform, Opaque " 92 194
|
||||||
|
"Floor Over Floor: Rising Platform, Platform, Translucent " 93 195
|
||||||
|
|
||||||
|
Floor Over Floor: Light Block 49 200
|
||||||
|
Floor Over Floor: Half Light Block 47 201
|
||||||
|
Floor Over Floor: Fog Block 46 202
|
||||||
|
|
||||||
|
"Floor Over Floor: Intangible, Opaque " 62 220
|
||||||
|
"Floor Over Floor: Intangible, Translucent " 52 221
|
||||||
|
"Floor Over Floor: Intangible, Sides Only " 67 222
|
||||||
|
"Floor Over Floor: Intangible, Invisible " 58 223
|
||||||
|
|
||||||
|
Floor Over Floor: Mario Block 41 250
|
||||||
|
Floor Over Floor: Thwomp Block 54 251
|
||||||
|
Floor Over Floor: Shatter Block 76 252
|
||||||
|
"Floor Over Floor: Shatter Block, Translucent " 86 253
|
||||||
|
Floor Over Floor: Bustable Block 55 254
|
||||||
|
Floor Over Floor: Spin Bust Block 78 255
|
||||||
|
"Floor Over Floor: Spin Bust Block, Translucent " 84 256
|
||||||
|
Floor Over Floor: Quicksand Block 56 257
|
||||||
|
Floor Over Floor: Laser Block 53 258
|
||||||
|
Floor Over Floor: Custom 87 259
|
||||||
|
|
||||||
|
Linedef Executor Triggers:
|
||||||
|
Trigger Linedef Executor (Continuous) 96 300
|
||||||
|
Trigger Linedef Executor (Each Time) 97 301
|
||||||
|
Trigger Linedef Executor (Once) 98 302
|
||||||
|
Trigger Linedef Executor (Ring Count - Continuous) 95 303
|
||||||
|
Trigger Linedef Executor (Ring Count - Once) 99 304
|
||||||
|
Trigger Linedef Executor (Character Ability - Continuous) 19 305
|
||||||
|
Trigger Linedef Executor (Character Ability - Each Time) 20 306
|
||||||
|
Trigger Linedef Executor (Character Ability - Once) 21 307
|
||||||
|
"Trigger Linedef Executor (Race Only, Once) " 9 308
|
||||||
|
Trigger Linedef Executor (CTF Red Team - Continuous) 10 309
|
||||||
|
Trigger Linedef Executor (CTF Red Team - Each Time) 11 310
|
||||||
|
Trigger Linedef Executor (CTF Blue Team - Continuous) 12 311
|
||||||
|
Trigger Linedef Executor (CTF Blue Team - Each Time) 13 312
|
||||||
|
Trigger Linedef Executor (No More Enemies - Once) 15 313
|
||||||
|
Trigger Linedef Executor (# of Pushables - Continuous) New 314
|
||||||
|
Trigger Linedef Executor (# of Pushables - Once) New 315
|
||||||
|
Trigger Linedef Executors (PolyObject - Land On) New 316
|
||||||
|
Trigger Linedef Executor (Level Load) New 399
|
||||||
|
|
||||||
|
Linedef Executor Options:
|
||||||
|
Linedef Executor: Set Tagged Sector's Floor Height/Pic 101 400
|
||||||
|
Linedef Executor: Set Tagged Sector's Ceiling Height/Pic 102 401
|
||||||
|
Linedef Executor: Set Tagged Sector's Light Level 103 402
|
||||||
|
Linedef Executor: Move Tagged Sector's Floor 106 403
|
||||||
|
Linedef Executor: Move Tagged Sector's Ceiling 107 404
|
||||||
|
Linedef Executor: Lower Floor by Line 108 405
|
||||||
|
Linedef Executor: Raise Floor by Line 109 406
|
||||||
|
Linedef Executor: Lower Ceiling by Line 110 407
|
||||||
|
Linedef Executor: Raise Ceiling by Line 111 408
|
||||||
|
Linedef Executor: Change Calling Sector's Tag 112 409
|
||||||
|
Linedef Executor: Change Front Sector's Tag 114 410
|
||||||
|
Linedef Executor: Stop Plane Movement 116 411
|
||||||
|
Linedef Executor: Teleport Player to Tagged Sector 104 412
|
||||||
|
Linedef Executor: Change Music 105 413
|
||||||
|
Linedef Executor: Play SFX 115 414
|
||||||
|
Linedef Executor: Run Script 113 415
|
||||||
|
Linedef Executor: Start Adjustable Fire Flicker 119 416
|
||||||
|
Linedef Executor: Start Adjustable Glowing Light 120 417
|
||||||
|
Linedef Executor: Start Adjustable Strobe Flash (unsynchronized) New 418
|
||||||
|
Linedef Executor: Start Adjustable Strobe Flash (synchronized) New 419
|
||||||
|
Linedef Executor: Fade Light Level 117 420
|
||||||
|
Linedef Executor: Stop Lighting Effect 118 421
|
||||||
|
Linedef Executor: Cut-Away View 121 422
|
||||||
|
Linedef Executor: Change Sky 123 423
|
||||||
|
Linedef Executor: Change Weather 124 424
|
||||||
|
Linedef Executor: Change Object State 125 425
|
||||||
|
Linedef Executor: Stop Object 122 426
|
||||||
|
Linedef Executor: Award Score 126 427
|
||||||
|
Linedef Executor: Start Platform Movement 127 428
|
||||||
|
Linedef Executor: Crush Ceiling Once New 429
|
||||||
|
Linedef Executor: Crush Floor Once New 430
|
||||||
|
Linedef Executor: Crush Floor & Ceiling Once New 431
|
||||||
|
Linedef Executor: Enable 2D Mode New 432
|
||||||
|
Linedef Executor: Disable 2D Mode New 433
|
||||||
|
Linedef Executor: Award Custom Power New 434
|
||||||
|
Linedef Executor: Stop Conveyor New 435
|
||||||
|
Linedef Executor: Start Conveyor New 436
|
||||||
|
Linedef Executor: Disable Player Movement New 437
|
||||||
|
|
||||||
|
Linedef Executor: Execute Linedef Executor New 450
|
||||||
|
|
||||||
|
Linedef Executor: PolyObject: Door Slide New 480
|
||||||
|
Linedef Executor: PolyObject: Door Swing New 481
|
||||||
|
Linedef Executor: PolyObject: Move XY New 482
|
||||||
|
Linedef Executor: PolyObject: Move XY w/ override New 483
|
||||||
|
Linedef Executor: PolyObject: Rotate Right New 484
|
||||||
|
Linedef Executor: PolyObject: Rotate Right w/ override New 485
|
||||||
|
Linedef Executor: PolyObject: Rotate Left New 486
|
||||||
|
Linedef Executor: PolyObject: Rotate Left w/ override New 487
|
||||||
|
Linedef Executor: PolyObject: Start waypoint movement New 488
|
||||||
|
Linedef Executor: PolyObject: Make Invisible New 489
|
||||||
|
Linedef Executor: PolyObject: Make Visible New 490
|
||||||
|
|
||||||
|
Scrollers/Pushers:
|
||||||
|
Scroll Wall First Side Left 100 500
|
||||||
|
Scroll Wall First Side Opposite Direction 85 501
|
||||||
|
Scroll Wall According to Linedef 254 502
|
||||||
|
Acc Scroll Wall According to Linedef 218 503
|
||||||
|
Disp Scroll Wall According to Linedef 249 504
|
||||||
|
Scroll Texture by Offsets 255 505
|
||||||
|
|
||||||
|
Scroll Floor Texture 251 510
|
||||||
|
Acc Scroll Floor Texture 215 511
|
||||||
|
Disp Scroll Floor Texture 246 512
|
||||||
|
Scroll Ceiling Texture 250 513
|
||||||
|
Acc Scroll Ceiling Texture 214 514
|
||||||
|
Disp Scroll Ceiling Texture 245 515
|
||||||
|
|
||||||
|
Carry Objects on Floor (no scroll) 252 520
|
||||||
|
Acc Carry Objects on Floor 216 521
|
||||||
|
Disp Carry Objects on Floor 247 522
|
||||||
|
Carry Objects on Ceiling 203 523
|
||||||
|
Acc Carry Objects on Ceiling 205 524
|
||||||
|
Disp Carry Objects on Ceiling 201 525
|
||||||
|
|
||||||
|
Scroll Floor Texture and Carry Objects 253 530
|
||||||
|
Acc Scroll Floor Texture and Carry Objects 217 531
|
||||||
|
Disp Scroll Floor Texture and Carry Objects 248 532
|
||||||
|
Scroll Ceiling Texture and Carry Objects 202 533
|
||||||
|
Acc Scroll Ceiling Texture and Carry Objects 204 534
|
||||||
|
Disp Scroll Ceiling Texture and Carry Objects 200 535
|
||||||
|
|
||||||
|
Friction 223 540
|
||||||
|
Horizontal Wind 224 541
|
||||||
|
Upwards Wind 229 542
|
||||||
|
Downwards Wind 230 543
|
||||||
|
Horizontal Current 225 544
|
||||||
|
Upwards Current 227 545
|
||||||
|
Downwards Current 228 546
|
||||||
|
Boom Push/Pull Thing 226 547
|
||||||
|
|
||||||
|
Lighting:
|
||||||
|
Floor Lighting 213 600
|
||||||
|
Ceiling Lighting 5 601
|
||||||
|
Adjustable Pulsating Light 60 602
|
||||||
|
Adjustable Flickering Light 61 603
|
||||||
|
Adjustable Blinking Light (unsynchronized) New 604
|
||||||
|
Adjustable Blinking Light (synchronized) New 605
|
||||||
|
Colormap 16 606
|
||||||
Binary file not shown.
@@ -0,0 +1,78 @@
|
|||||||
|
Removed:
|
||||||
|
- Buttons 1-20 690-709
|
||||||
|
- Button 21 (THZ2 A/740 B/741 D/742 E/745 710
|
||||||
|
- Close Door Blazing (Tag 743) 711
|
||||||
|
- Raise Ceiling to Highest (Tag 744) 981
|
||||||
|
- THZ2 Slime Raise (B/712 W713 P714 D715 S716) 986
|
||||||
|
|
||||||
|
Stuff to Remove/Change:
|
||||||
|
- Light Blinks On Every 0.5 Seconds 2 Add Linedef Combine
|
||||||
|
- Light Blinks On Every 1 Second 3 Add Linedef Combine
|
||||||
|
- Light Pulses Smoothly 8 Remove
|
||||||
|
- Light Blinks On Every 0.5 Seconds (Sync) 12 Add Linedef Combine
|
||||||
|
- Lights Blinks On Every 1 Second (Sync) 13 Add Linedef Combine
|
||||||
|
- Light Flickers Like Fire 17 Remove
|
||||||
|
? - Damage (Fire) and Current 519 Remove (convert to combination)
|
||||||
|
? - Damage (Water) and Current 984 Remove (convert to combination)
|
||||||
|
|
||||||
|
Section 1:
|
||||||
|
1 - Damage (Generic) 11
|
||||||
|
2 - Damage (Water) 983
|
||||||
|
3 - Damage (Fire) 7
|
||||||
|
4 - Damage (Electrical) 18
|
||||||
|
5 - Spikes 4
|
||||||
|
6 - Death Pit (Camera Mod) 16
|
||||||
|
7 - Death Pit (No Camera Mod) 5
|
||||||
|
8 - Instant Kill 10
|
||||||
|
9 - Ring Drainer (Floor Touch) 978
|
||||||
|
10 - Ring Drainer (No Floor Touch) 980
|
||||||
|
11 - Special Stage Damage 9
|
||||||
|
12 - Space Countdown 6
|
||||||
|
13 - Ramp Sector (Increase step-up) 992
|
||||||
|
14 - Non-Ramp Sector (Don't step-down) 996
|
||||||
|
15 - Bouncy Sector (FOF Control Only) 14
|
||||||
|
|
||||||
|
Section 2: << 4
|
||||||
|
1 - Trigger Linedef Exec (Pushable Objects) 971
|
||||||
|
2 - Trigger LD Exec (Anywhere in Sec/All Pls) 972
|
||||||
|
3 - Trigger Linedef Exec (Floor Touch/All Pls) 973
|
||||||
|
4 - Trigger Linedef Exec (Anywhere in Sec) 974
|
||||||
|
5 - Trigger Linedef Exec (Floor Touch) 975
|
||||||
|
6 - Trigger Linedef Exec (Emerald Check) 967
|
||||||
|
7 - Trigger Linedef Exec (NiGHTS Mare) 968
|
||||||
|
8 - Check for linedef executor on FOFs (ANY) 970
|
||||||
|
9 - Egg Trap Capsule 666
|
||||||
|
10 - Special Stage Time/Rings, Par 990
|
||||||
|
11 - Custom Global Gravity 991
|
||||||
|
|
||||||
|
Section 3: << 8
|
||||||
|
1 - Ice/Sludge (required?!) 256
|
||||||
|
2 - Wind/Current (required?!) 512
|
||||||
|
3 - Ice/Sludge and Wind/Current 768
|
||||||
|
4 - Conveyor Belt 985
|
||||||
|
5 - Speed Pad (No Spin) 976
|
||||||
|
6 - Speed Pad (Spin) 977
|
||||||
|
7 - Bustable Block Sprite Parameter 1500-1515
|
||||||
|
8 - "
|
||||||
|
9 - "
|
||||||
|
10 - "
|
||||||
|
11 - "
|
||||||
|
12 - "
|
||||||
|
13 - "
|
||||||
|
14 - "
|
||||||
|
15 - "
|
||||||
|
|
||||||
|
Section 4: << 12
|
||||||
|
1 - Starpost Activator 993
|
||||||
|
2 - Special Stage Goal Combine 33
|
||||||
|
2 - Exit Sector Combine 982
|
||||||
|
2 - No Tag Zone Combine 987
|
||||||
|
2 - CTF: Flag Return Combine 995
|
||||||
|
3 - CTF: Red Team Base 988
|
||||||
|
4 - CTF: Blue Team Base 989
|
||||||
|
5 - Fan Sector 997
|
||||||
|
6 - Super Sonic Transform 969
|
||||||
|
7 - Spinner 979
|
||||||
|
8 - Zoom Tube Start 998
|
||||||
|
9 - Zoom Tube End 999
|
||||||
|
10 - Finish Line 994
|
||||||
+307
@@ -0,0 +1,307 @@
|
|||||||
|
SRB2
|
||||||
|
Release v1.09, ? 2005.
|
||||||
|
|
||||||
|
Last Updated: June 2005
|
||||||
|
|
||||||
|
Original game & sources by: Id Software.
|
||||||
|
Additions: (c)1998 by: Fabrice Denis & Boris Pereira
|
||||||
|
(c)1999 by: Fabrice Denis, Boris Pereira & Thierry Van Elsuwe
|
||||||
|
(c)2000 by: Boris Pereira & Thierry Van Elsuwe
|
||||||
|
(c)2004 By: AJ, Graue, Alam Arias, Logan Arias & Andrew Clunis
|
||||||
|
|
||||||
|
Special thanks to Steven McGranahan, Lee Killough, Robert Bäuml and Bell Kin for
|
||||||
|
their large contribution and to other DooM LEGACY & SRB2 Team members.
|
||||||
|
|
||||||
|
Web site: http://www.SRB2.org/
|
||||||
|
e-mail: none@none.com
|
||||||
|
|
||||||
|
OpenGL specific:
|
||||||
|
Web site: http://legacy.newdoom.com/gl
|
||||||
|
|
||||||
|
|
||||||
|
-----------------------------------------------------------------------
|
||||||
|
F.A.Q.
|
||||||
|
-----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
If you have any trouble with SRB2, you might find a solution
|
||||||
|
here.
|
||||||
|
|
||||||
|
If you find a solution to a problem that was not listed here,
|
||||||
|
please tell us so that we can update the FAQ and help other people!
|
||||||
|
|
||||||
|
Mail your hardware/software problems to:
|
||||||
|
|
||||||
|
None@none.com subject: FAQ
|
||||||
|
|
||||||
|
|
||||||
|
--------
|
||||||
|
CONTENTS
|
||||||
|
--------
|
||||||
|
|
||||||
|
[0] Miscellaneous
|
||||||
|
[1] Mouse/Joystick/Keyboard
|
||||||
|
[2] Video
|
||||||
|
[3] Sound
|
||||||
|
[4] Network
|
||||||
|
[5] Troubleshooting
|
||||||
|
|
||||||
|
|
||||||
|
-----------------
|
||||||
|
[0] MISCELLANEOUS
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
* under win95 or OS/2, I don't have enough memory. How can i handle with ?
|
||||||
|
|
||||||
|
Tell win95 to put more dpmi memory for your dos box.
|
||||||
|
Or use the -mb option.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------
|
||||||
|
[1] MOUSE/JOYSTICK/KEYBOARD
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
* My mouse/joystick does not work in SRB2.
|
||||||
|
|
||||||
|
First, check that the mouse/joystick is activated : go at the
|
||||||
|
console and type either 'use_mouse' (or use the respective
|
||||||
|
menuitem) or 'use_joystick'.
|
||||||
|
|
||||||
|
If it tells '0' or off than the mouse/joystick is not used,
|
||||||
|
set the variable to 1. eg: 'use_mouse 1'.
|
||||||
|
|
||||||
|
For the joystick, different values will support different
|
||||||
|
types of joystick, check the console documentation for the
|
||||||
|
command 'use_joystick' for more.
|
||||||
|
|
||||||
|
Even if the mouse or joystick is activated, you have to
|
||||||
|
set up the contols into the Setup Controls menu. That is:
|
||||||
|
tell what use you will make of the mouse/joystick buttons.
|
||||||
|
|
||||||
|
|
||||||
|
---------
|
||||||
|
[2] VIDEO
|
||||||
|
---------
|
||||||
|
|
||||||
|
|
||||||
|
* Where are the other video modes ? I have only '320x200' in the
|
||||||
|
Video Modes menu.
|
||||||
|
|
||||||
|
DOS
|
||||||
|
---
|
||||||
|
|
||||||
|
SRB2 adds new video modes only if a VESA2 (or better) driver
|
||||||
|
is present. The VESA2 driver is a standard of 'talking' between a
|
||||||
|
program and the huge amount of different graphics cards
|
||||||
|
available today.
|
||||||
|
|
||||||
|
If you don't have a VESA2 driver, you can download UNIVBE, or
|
||||||
|
SMART DISPLAY DOCTOR from
|
||||||
|
|
||||||
|
http://www.scitechsoft.com/products/ent/free_titles.html
|
||||||
|
|
||||||
|
or if you have an S3 based card, you can download the free
|
||||||
|
software called 'S3VBE'.
|
||||||
|
|
||||||
|
ftp://ftp.externet.hu/pub/mirror/sac/graph/s3vbe318.zip
|
||||||
|
ftp://ftp.digsys.bg/pub/simtelnet/msdos/graphics/s3vbe318.zip
|
||||||
|
http://www.filesearching.com/cgi-bin/s?q=s3vbe318.zip
|
||||||
|
http://www.google.com/search?q=s3vbe318.zip
|
||||||
|
|
||||||
|
* The game doesn't restore the video mode I have chosen the last time
|
||||||
|
I played SRB2.
|
||||||
|
|
||||||
|
The current video mode has to be made the 'default' so that it is
|
||||||
|
saved to the config : press the key 'D' on the Video Options menu
|
||||||
|
to set the current video mode the default.
|
||||||
|
|
||||||
|
* I have some problems with OpenGL mode
|
||||||
|
|
||||||
|
Have a look at the FAQ for OpenGL on the glLegacy web site:
|
||||||
|
|
||||||
|
http://www.doomnation.com/gllegacy/faqe.htm
|
||||||
|
|
||||||
|
# Linux: I only have a 1024x768 (or 800x600, 1280x1024, ...) resolution
|
||||||
|
in fullscreen mode under X and SRB2 is really really slow. Can I
|
||||||
|
have lower resolutions like 320x200 in fullscreen mode as well?
|
||||||
|
|
||||||
|
Probably yes. SRB2 can only use the resolutions offered by the
|
||||||
|
X-Server. So if all fullscreen modes have a very high resolution you
|
||||||
|
have to modify /etc/XF86Config (or /etc/X11/XF86Config). Use XF86Setup
|
||||||
|
(or the appropriate tool coming with your distribution - sax,
|
||||||
|
xf86config, ...) to do this.
|
||||||
|
If you do not succeed there, you can enter them manually into your
|
||||||
|
XF86Config file. ONLY RECOMMENDED FOR USERS WHO KNOW WHAT THEY DO!
|
||||||
|
For a short guide on how to do this, have a look at the file
|
||||||
|
"Doublescan.txt".
|
||||||
|
In case of doubt consult the XFree86-HOWTO (or ask your system
|
||||||
|
administrator :).
|
||||||
|
|
||||||
|
# Linux: I cannot have any fullscreen modes at all!
|
||||||
|
|
||||||
|
You have only modes above 1024x768 in your XF86Config. Proceed as
|
||||||
|
described above.
|
||||||
|
|
||||||
|
# Linux: After a certain idle time my screensaver jams the display of
|
||||||
|
SRB2. I can still operate SRB2, but I do not see what's happening
|
||||||
|
and the screensaver won't go away.
|
||||||
|
|
||||||
|
You probably have KDE. The KDE screensaver does not obey the screensaver
|
||||||
|
rules (at least mine, version 1.1). The solution is to deactivate the
|
||||||
|
KDE screensaver and use another screensaver (like the xscreensaver,
|
||||||
|
e.g.). But the hell, when you started SRB2 you should have played it
|
||||||
|
as well and not left it alone!!!
|
||||||
|
|
||||||
|
---------
|
||||||
|
[3] SOUND
|
||||||
|
---------
|
||||||
|
|
||||||
|
+ DOS:I can't have CD audio music, why ?
|
||||||
|
|
||||||
|
Make sure that the MSCDEX driver version 2.0 or later is loaded.
|
||||||
|
If it says 'MSCDEX version xxx' at game startup, and you still
|
||||||
|
don't hear the cd music, then probably your card doesn't respond
|
||||||
|
when SRB2 tries to set the cd volume. If so, make sure your sound
|
||||||
|
card's mixer have the cd volume set up so that you can hear something.
|
||||||
|
|
||||||
|
+ When the CD plays, the game is very 'jerky'. It doesn't do that when
|
||||||
|
I type 'cd off' in the console.
|
||||||
|
|
||||||
|
You have an old/bad cd driver, that can take up to a second to
|
||||||
|
respond to cd driver commands. Either get the latest version of
|
||||||
|
your driver, or turn cd update off. Check 'cd_udpate' in the
|
||||||
|
console documentation for more.
|
||||||
|
|
||||||
|
* DOS:How can I *ALWAYS* disable the sounds or music of the game ?
|
||||||
|
|
||||||
|
Edit the allegro.cfg file and set digicard/midicard to 0 (none)
|
||||||
|
|
||||||
|
* DOS:My sterero sound is reversed, how can I set it the right way ?
|
||||||
|
|
||||||
|
Change the console variable 'stereoreverse' to either 1 or 0.
|
||||||
|
Or, you can edit the allegro.cfg file, and set the 'flip_pan' variable.
|
||||||
|
|
||||||
|
|
||||||
|
* DOS:The sounds are too 'slow', or 'low-pitched'
|
||||||
|
|
||||||
|
It seems to be a problem of the auto-detection of some 8bit sound
|
||||||
|
cards. You will have to set manually the 'sb_freq' value in the
|
||||||
|
allegro.cfg file to a lower value : 11906, 16129.
|
||||||
|
|
||||||
|
* DOS:SRB2 doesn't play any sound/music, but I have a sound
|
||||||
|
blaster genuine/compatible card.
|
||||||
|
|
||||||
|
If you have a genuine or compatible SoundBlaster card, it is very
|
||||||
|
important that you set the BLASTER environment variable.
|
||||||
|
|
||||||
|
If you are playing under DOS, and never installed your sound card
|
||||||
|
under DOS, run the setup of your sound card for DOS.
|
||||||
|
|
||||||
|
Check if the BLASTER variable was set: type 'SET' under dos
|
||||||
|
(or DOSbox)
|
||||||
|
|
||||||
|
Do you see something like 'BLASTER=A220 I5 D1 ...' ?
|
||||||
|
|
||||||
|
Yes? If you don't hear sounds/music, then tweak the settings in the
|
||||||
|
allegro.cfg file until you get something, first try changing the
|
||||||
|
type of the sound card, it is not always properly detected.
|
||||||
|
|
||||||
|
No? You have to set this variable in order that your sound card is
|
||||||
|
detected. Run the setup that was shipped with your sound card, and
|
||||||
|
make sure you run the setup for DOS too, it will usually add a
|
||||||
|
line of the type 'SET BLASTER=... ...' in the autoexec.bat file.
|
||||||
|
|
||||||
|
|
||||||
|
* DOS:How can I have better midi music on my 8bit sound card ?
|
||||||
|
|
||||||
|
Use the DIGMID driver, it is supported in SRB2.
|
||||||
|
|
||||||
|
What the hell is this? Well, the Gravis Ultrasound uses digital
|
||||||
|
samples to play midi music. On a simple 8bit card, you can use digital
|
||||||
|
samples too, which will sound usually better than what is output
|
||||||
|
by the poor fm synthesis chip of 8bit cards.
|
||||||
|
|
||||||
|
You will need to get a Gravis Ultrasound patch set, you can find
|
||||||
|
several ones for free on internet, it consists of a bunch of '.pat'
|
||||||
|
files which are the digital samples to play the midi instruments
|
||||||
|
(eg: piano, conga, guitar, ect.).
|
||||||
|
|
||||||
|
Check the Allegro homepage for some links to GUS patches:
|
||||||
|
http://alleg.sourceforge.net/digmid.html
|
||||||
|
http://alleg.sourceforge.net/
|
||||||
|
http://www.talula.demon.co.uk/allegro/digmid.html
|
||||||
|
http://www.talula.demon.co.uk/allegro/
|
||||||
|
|
||||||
|
Now to activate the DIGMID driver:
|
||||||
|
|
||||||
|
Set the 'midi_card' value to 8 (DIGMID) in the allegro.cfg file.
|
||||||
|
Make sure you leave the 'digi_voices' blank, or set it to a low
|
||||||
|
value, because the midi music will use digital voices.
|
||||||
|
At the end of the allegro.cfg file, set the 'patches' value
|
||||||
|
to the path, where you have installed a Gravis Ultrasound midi
|
||||||
|
patch set. eg: patches = d:\music\midipat\
|
||||||
|
|
||||||
|
# Linux: CD music does not work or only works when run as root.
|
||||||
|
|
||||||
|
We do not encourage you to run SRB2 as root (you never know
|
||||||
|
what SRB2 can do to your system - it's a mighty piece of code :).
|
||||||
|
There is a common problem with ATAPI CD-rom drives, which are
|
||||||
|
treated as harddisks. Usually there is a link /dev/cdrom pointing to
|
||||||
|
device hd[b,c,d]. As harddisks are not supposed to be read directly
|
||||||
|
via this device (especially not by a common user), there are no read
|
||||||
|
permissions for "all". For CD-roms you can savely set read permissions
|
||||||
|
unless you are very paranoid. Assuming your CD-rom drive is /dev/hdc,
|
||||||
|
set permissions with "chmod +r /dev/hdc" (as root). SCSI CD-rom drives
|
||||||
|
should not have this problem. But if they do, proceed as described
|
||||||
|
with ATAPI drives.
|
||||||
|
|
||||||
|
# Linux: The CD music volume is not set properly.
|
||||||
|
|
||||||
|
Go to the console and type "jigglecdvolume 1".
|
||||||
|
|
||||||
|
-----------
|
||||||
|
[4] NETWORK
|
||||||
|
-----------
|
||||||
|
|
||||||
|
* Where can I find Internet servers ?
|
||||||
|
|
||||||
|
For the moment there is one public server.
|
||||||
|
http://srb2.servegame.org/ Master server web page
|
||||||
|
srb2.servegame.org:28910 current Master Server
|
||||||
|
|
||||||
|
* When I start SRB2 with -server or -connect it say :
|
||||||
|
"BinToPort: Address already in use (EADDRINUSE)"
|
||||||
|
|
||||||
|
It appears only when SRB2 crashes or when you leave with ctrl-break.
|
||||||
|
use -udpport 12345 (or any other free slot) on both sides (client and
|
||||||
|
server).
|
||||||
|
|
||||||
|
This can also happens when there is already a SRB2 running on your
|
||||||
|
computer if you whant to try two SRB2 running on the same computer
|
||||||
|
use -clientport 12345 (or any other free slot). Then the second will
|
||||||
|
connect to the first one.
|
||||||
|
|
||||||
|
* Do you use the tcp protocol ?
|
||||||
|
|
||||||
|
No, we use the udp protocol which is faster, but don't worry udp is a
|
||||||
|
part of the internet protocol.
|
||||||
|
|
||||||
|
|
||||||
|
-------------------
|
||||||
|
[5] Troubleshooting
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
# Linux: SRB2 is hung in fullscreen mode and won´t let me leave.
|
||||||
|
What shall I do?
|
||||||
|
|
||||||
|
Some people press the reset button, but hey, we are not in the
|
||||||
|
stoneage of operating systems! There are two "proper" ways to
|
||||||
|
get out: kill your X-Server. You can usually do this by pressing
|
||||||
|
"CTRL-ALT-BACKSPACE". But if you have other open applications with
|
||||||
|
important data (probably hacked away on your diploma thesis for 3
|
||||||
|
weeks without saving once) you can also kill SRB2 directly. Press
|
||||||
|
"CTRL-ALT-F2" and you will get to a console. Log in, type
|
||||||
|
"killall llxSRB2" and switch back to the X-Server with "CTRL-ALT-F7".
|
||||||
|
Some X-Server crash on this procedure - blame the X-Server for the
|
||||||
|
loss of 3 weeks work on your diploma thesis :)
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>
|
||||||
|
Sonic Robo Blast 2 Manual
|
||||||
|
</title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="srb2manstyle.css">
|
||||||
|
<!-- Borrowed some javascript code so the height of the iframe is equal to the size of the document - Sonict -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* free code from dyn-web.com */
|
||||||
|
|
||||||
|
function getDocHeight(doc) {
|
||||||
|
doc = doc || document;
|
||||||
|
// from http://stackoverflow.com/questions/1145850/get-height-of-entire-document-with-javascript
|
||||||
|
var body = doc.body, html = doc.documentElement;
|
||||||
|
var height = Math.max( body.scrollHeight, body.offsetHeight,
|
||||||
|
html.clientHeight, html.scrollHeight, html.offsetHeight );
|
||||||
|
return height;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setIframeHeight(id) {
|
||||||
|
var ifrm = document.getElementById(id);
|
||||||
|
var doc = ifrm.contentDocument? ifrm.contentDocument: ifrm.contentWindow.document;
|
||||||
|
ifrm.style.visibility = 'hidden';
|
||||||
|
ifrm.style.height = "10px"; // reset to minimal height in case going from longer to shorter doc
|
||||||
|
ifrm.style.height = getDocHeight( doc ) + "px";
|
||||||
|
ifrm.style.visibility = 'visible';
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<meta http-equiv="Content-type" content="text/html; charset=UTF-8">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p class="c1">
|
||||||
|
<img src="manual_img/sonicname2.png" alt="SONIC" width="136" height="36">
|
||||||
|
<br>
|
||||||
|
<img src="manual_img/srb2banner.png" alt="ROBO BLAST 2" width="224" height="43">
|
||||||
|
</p>
|
||||||
|
<p class="c1">
|
||||||
|
<big><big><strong>Manual</strong></big></big>
|
||||||
|
</p>
|
||||||
|
<table class="cf" align="center">
|
||||||
|
<tr><td class="c">
|
||||||
|
<ul class="hmenu">
|
||||||
|
<li class="hmenu"><a class="hmenu" href="intro.htm" target="ifrm">Main</a></li>
|
||||||
|
<li class="hmenu"><a class="hmenu" href="items.htm" target="ifrm">Items</a></li>
|
||||||
|
<li class="hmenu"><a class="hmenu" href="playerabilities.htm" target="ifrm">Player Abilities</a></li>
|
||||||
|
<li class="hmenu"><a class="hmenu" href="basicplay.htm" target="ifrm">Gameplay</a></li>
|
||||||
|
<li class="hmenu"><a class="hmenu" href="surroundings.htm" target="ifrm">Surroundings</a></li>
|
||||||
|
</ul>
|
||||||
|
</td></tr>
|
||||||
|
<tr><td class="c">
|
||||||
|
<ul class="hmenu">
|
||||||
|
<li class="hmenu"><a class="hmenu" href="multiplayer.htm" target="ifrm">Multiplayer</a></li>
|
||||||
|
<li class="hmenu"><a class="hmenu" href="zones.htm" target="ifrm">Zones</a></li>
|
||||||
|
<li class="hmenu"><a class="hmenu" href="controls.htm" target="ifrm">Controls</a></li>
|
||||||
|
<li class="hmenu"><a class="hmenu" href="consolecommands.htm" target="ifrm">Console Commands</a></li>
|
||||||
|
<li class="hmenu"><a class="hmenu" href="misc.htm" target="ifrm">Misc</a></li>
|
||||||
|
</ul>
|
||||||
|
</td></tr>
|
||||||
|
</table>
|
||||||
|
<hr>
|
||||||
|
<p class="c1">
|
||||||
|
<!-- The "onload" property of the iframe makes an error when validated through the W3C validation checker. -->
|
||||||
|
<!-- This will not be fixed as it isn't worth the time to fix it up properly. - Sonict -->
|
||||||
|
<iframe id="ifrm" name="ifrm" src="intro.htm" onload="setIframeHeight(this.id)"> </iframe>
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
SVN-RULES
|
||||||
|
|
||||||
|
- As you can see, there is sub-directory in the repository, one for eatch
|
||||||
|
platform (djgpp (dos),win32,SDL) the root directory is for all platform,
|
||||||
|
so take care of the order we have put in.
|
||||||
|
- do not commit/upload tests of bugged code, try to fix a maximum of know
|
||||||
|
bugs and update know bugs list in source.txt. If you must commit your source
|
||||||
|
make your code in #ifdef so we can disable it
|
||||||
|
- SRB2 is a modification of doom/Doom Legacy source. We allow additionnal feature
|
||||||
|
and visual addition.
|
||||||
|
- Maximize communications between members, do not impose your changes, if your
|
||||||
|
are not sure about a feature/change, talk about it in irc://irc.esper.net/srb2 chat room.
|
||||||
|
|
||||||
|
CODE-RULES
|
||||||
|
|
||||||
|
- We use no tab, 4 space indent, and tab size 8 (in case some tab have filtred
|
||||||
|
and for makefile)
|
||||||
|
- Self documented code, variable and function must have a name that help
|
||||||
|
understand the code, so do not call variable and function a,b, a2, ...
|
||||||
|
- the usage of extern in a c file is prohibited, except for declaration of a
|
||||||
|
function with body (so it is like public keyword in c++)
|
||||||
|
Also function protos haren't allowed for external function, put it un the
|
||||||
|
corresponding h file.
|
||||||
|
- Try to minimize #ifdef usage for :
|
||||||
|
- code readability
|
||||||
|
- the main code is for all port so if something is good for a platform all
|
||||||
|
platform can benefit by this feature
|
||||||
|
- Take care of platform dependent code, we would like to have code that work
|
||||||
|
on Dos, Win32, SDL, ... little and big endian, software/Glide/OpenGl.
|
||||||
|
|
||||||
|
GOOD PRACTICE
|
||||||
|
|
||||||
|
- Try to put as mush static variable and function on module so it help to
|
||||||
|
understand the role of the varaible/function in the module also this
|
||||||
|
help the compiler to optimize
|
||||||
|
- minimise global variable
|
||||||
|
- make a log of your work, so you don't need to put a lot of comment in
|
||||||
|
the code, this will also help us to update the what's new section of doc
|
||||||
|
when doing final release
|
||||||
+240
@@ -0,0 +1,240 @@
|
|||||||
|
|
||||||
|
1. Compile SRB2
|
||||||
|
2. Explanation of the code
|
||||||
|
2.1 The memory model
|
||||||
|
2.2 Hardware Texture model
|
||||||
|
|
||||||
|
1. Compile SRB2
|
||||||
|
=================
|
||||||
|
|
||||||
|
DOS
|
||||||
|
---
|
||||||
|
|
||||||
|
need:
|
||||||
|
- djgpp 2.03 (http://www.delorie.com/djgpp/)
|
||||||
|
- allegro 3.12 (http://alleg.sourceforge.net/index.html)
|
||||||
|
(
|
||||||
|
- libsocket 0.7.4 (beta 4) or better
|
||||||
|
for use with Winsock 1.1 (example Windows 3.1)
|
||||||
|
(http://www.phekda.freeserve.co.uk/richdawe/lsck/lsck.htm)
|
||||||
|
OR
|
||||||
|
- Wattcp-32 v2.2 dev.rel 6 or better
|
||||||
|
For use with a packet driver
|
||||||
|
(http://www.bgnett.no/~giva/)
|
||||||
|
(http://groups.yahoo.com/group/watt-32/)
|
||||||
|
(http://groups.yahoo.com/group/watt-32/files/v2.2/)
|
||||||
|
)
|
||||||
|
- bcd 1.03 (inlcude in this package)
|
||||||
|
- gcc 2.95.2 is recommended
|
||||||
|
- nasm 0.98 (or better) (http://nasm.sourceforge.net/)
|
||||||
|
|
||||||
|
compile:
|
||||||
|
make
|
||||||
|
make WATTCP=1 (to make a Wattcp-32 version)
|
||||||
|
|
||||||
|
debug:
|
||||||
|
when craching SRB2 will return eip
|
||||||
|
type make asm, then you will have a 8 megs srb2.s (a assembler file)
|
||||||
|
the you can find the faulting instruction and function
|
||||||
|
|
||||||
|
------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Linux/SDL
|
||||||
|
-----
|
||||||
|
|
||||||
|
need:
|
||||||
|
- tested with gcc 2.95 and 3.X.
|
||||||
|
- SDL 1.2
|
||||||
|
- SDL_mixer 1.2
|
||||||
|
- ibogg and libvorbis (http://Xiph.org/)
|
||||||
|
- nasm 0.98 (or better)(http://nasm.sourceforge.net/) only with 2.95, else add CC30=1
|
||||||
|
|
||||||
|
compile
|
||||||
|
make LINUX=1
|
||||||
|
|
||||||
|
debug:
|
||||||
|
gdb ?
|
||||||
|
|
||||||
|
------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Win32
|
||||||
|
-----
|
||||||
|
|
||||||
|
need :
|
||||||
|
- glide 3.x sdk (optional) (http://www.3dfx.com)
|
||||||
|
- directx6 sdk (or higher) (http://www.micosoft.com/directx)
|
||||||
|
- nasm 0.98 (or better) (http://nasm.sourceforge.net/)
|
||||||
|
- use src\win32\wLegacy.dsp
|
||||||
|
- VC6 should also work with VC5, and VS.NET 200X
|
||||||
|
|
||||||
|
debug:
|
||||||
|
press on "step over" with the release version (there is some debug info
|
||||||
|
on it). Then change the eip in the regster window when you will type
|
||||||
|
enter the edi will go to the faulting instruction. don't forget that
|
||||||
|
you can follow the stack for calls.
|
||||||
|
You can also use trace with the debug version but add -win and -nomouse.
|
||||||
|
|
||||||
|
------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Win32/minGW/SDL
|
||||||
|
-----
|
||||||
|
|
||||||
|
need:
|
||||||
|
- tested with gcc 2.95 and 3.X.
|
||||||
|
- can also use Dev-C++ 5.0 beta 9 (4.9.9.0) from http://www.bloodshed.net/dev/devcpp.html
|
||||||
|
- SDL 1.2
|
||||||
|
- SDL_mixer 1.2
|
||||||
|
|
||||||
|
compile
|
||||||
|
make minGW=1 SDL=1
|
||||||
|
or use src\SDL\Win32SDL.dev with Dev-C++ 4.9.9.0 or later
|
||||||
|
|
||||||
|
debug:
|
||||||
|
gdb ?
|
||||||
|
|
||||||
|
------------------------------------------------------------------------
|
||||||
|
|
||||||
|
WinCE/SDL WIP
|
||||||
|
-----
|
||||||
|
|
||||||
|
need:
|
||||||
|
- ActiveSync 3.8
|
||||||
|
http://www.microsoft.com/windowsmobile/downloads/activesync38.mspx
|
||||||
|
|
||||||
|
- ActiveSync 3.7.1, if 3.8 isn't available for your language
|
||||||
|
http://www.microsoft.com/windowsmobile/downloads/activesync37.mspx
|
||||||
|
|
||||||
|
- eMbedded Visual Tools 3.0 - 2002 Edition
|
||||||
|
http://www.microsoft.com/downloads/details.aspx?FamilyID=f663bf48-31ee-4cbe-aac5-0affd5fb27dd
|
||||||
|
|
||||||
|
- Pocket PC 2000 SDK
|
||||||
|
http://www.microsoft.com/downloads/details.aspx?FamilyID=bb3f4d7b-de2a-4e1a-a175-26a68c301ac4
|
||||||
|
|
||||||
|
- Pocket PC 2002 SDK (eMVT 3.0 2002 Ed. comes with this)
|
||||||
|
http://www.microsoft.com/downloads/details.aspx?FamilyID=2dbee84a-bd94-4167-b817-2b2e548b2e92
|
||||||
|
|
||||||
|
- Pocket PC 2002 SDK Emulator Images (eMVT 3.0 2002 Ed. comes with this)
|
||||||
|
http://www.microsoft.com/downloads/details.aspx?FamilyID=25f4de97-ae80-477a-9df1-496b85b3d3e3
|
||||||
|
|
||||||
|
- eMbedded Visual C++ 4.0
|
||||||
|
http://www.microsoft.com/downloads/details.aspx?familyid=1DACDB3D-50D1-41B2-A107-FA75AE960856
|
||||||
|
|
||||||
|
- eMbedded Visual C++ 4.0 SP3 (Win CE 4.0-4.2)
|
||||||
|
http://www.microsoft.com/downloads/details.aspx?FamilyID=5bb36f3e-5b3d-419a-9610-2fe53815ae3b
|
||||||
|
|
||||||
|
OR
|
||||||
|
|
||||||
|
- eMbedded Visual C++ 4.0 SP4 (No SH3 support,Win CE 4.0-5.0 support)
|
||||||
|
http://www.microsoft.com/downloads/details.aspx?FamilyID=4a4ed1f4-91d3-4dbe-986e-a812984318e5
|
||||||
|
|
||||||
|
- eMbedded Visual C++ 4.0 Update 5625 (SP4 only)
|
||||||
|
http://www.microsoft.com/downloads/details.aspx?FamilyID=aa282a6d-6f57-436d-8c10-0ec02d94f5b1
|
||||||
|
|
||||||
|
- Windows CE: Standard Software Development Kit
|
||||||
|
http://www.microsoft.com/downloads/details.aspx?familyid=a08f6991-16b0-4019-a174-0c40e6d25fe7
|
||||||
|
|
||||||
|
- SDK for Windows Mobile 2003-based Pocket PCs
|
||||||
|
http://www.microsoft.com/downloads/details.aspx?FamilyId=9996B314-0364-4623-9EDE-0B5FBB133652
|
||||||
|
|
||||||
|
- Emulator Images for Windows Mobile 2003 Second Edition software for Pocket PC
|
||||||
|
http://www.microsoft.com/downloads/details.aspx?familyid=5C53E3B5-F2A2-47D7-A41D-825FD68EBB6C
|
||||||
|
|
||||||
|
- Microsoft Device Emulator 1.0 Community Preview
|
||||||
|
http://beta.microsoft.com Use Guest ID "MSDEVICE" to access the Community Preview website
|
||||||
|
|
||||||
|
- Windows CE Utilities for Visual Studio .NET 2003 Add-on Pack 1.1
|
||||||
|
(if you also have VS 2003 installed, you need this to install Win CE 5.0 SDK, else no need)
|
||||||
|
http://www.microsoft.com/downloads/details.aspx?FamilyId=7EC99CA6-2095-4086-B0CC-7C6C39B28762
|
||||||
|
|
||||||
|
- Windows CE 5.0: Standard Software Development Kit (eMC++ 4 SP4 only)
|
||||||
|
http://www.microsoft.com/downloads/details.aspx?FamilyID=fa1a3d66-3f61-4ddc-9510-ae450e2318c3
|
||||||
|
|
||||||
|
- SDL 1.27 (use patch and zip in tools\SDL1.2.7_CE)
|
||||||
|
|
||||||
|
compile
|
||||||
|
use src\SDL\WinCE\SRB2CE.vcw
|
||||||
|
|
||||||
|
debug:
|
||||||
|
?
|
||||||
|
|
||||||
|
|
||||||
|
2. Explanation of the code
|
||||||
|
==========================
|
||||||
|
|
||||||
|
2.1 The memory model (original) (z_zone.c) (by BP)
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
SRB2 allocate a heap of 6/32/48 megs at begining and provide a Z_Malloc function
|
||||||
|
to allocate in this heap.
|
||||||
|
|
||||||
|
Z_Malloc( int size,int tag,void* user )
|
||||||
|
|
||||||
|
size is the size in byte
|
||||||
|
tag can be : PU_STATIC allocated static (like malloc do)
|
||||||
|
call Z_Free to free it
|
||||||
|
PU_LEVEL same as static but the zone is "tagged" with the
|
||||||
|
tag PU_LEVEL, when calling
|
||||||
|
Z_FreeTag (PU_LEVEL, PU_LEVEL) all zone tagged
|
||||||
|
with PU_LEVEL are freed (at the end of the level)
|
||||||
|
PU_CACHE this one _can_ be freed automatiquely by one other
|
||||||
|
call to Z_Malloc. the *user point to a pointer
|
||||||
|
to this zone so when freed automatiquely the
|
||||||
|
pointer is set to NULL so eatch time you use it
|
||||||
|
you must check if the pointer is not NULL and
|
||||||
|
reload it.
|
||||||
|
|
||||||
|
(...)
|
||||||
|
|
||||||
|
2.2 Hardware Texture model (by BP)
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
Eatch texture/patch/flats/pic in SRB2 are converted to hardware texture at
|
||||||
|
runtime (the GlideMipmap_s structure (hw_data.h)). I will call hardware
|
||||||
|
texture a gr_texture so there is no confusion.
|
||||||
|
|
||||||
|
To remind you :
|
||||||
|
- Texture are set of patch and are associate to linedefs (walls) can be
|
||||||
|
upper, lower or middle texture. It can have hole on it.
|
||||||
|
- patch are sprites (the doom patch are run of vertical lines)
|
||||||
|
- flats are used for floors and ceiling of sectors and have size of 64x64
|
||||||
|
it can't have hole on it
|
||||||
|
- pic are new legacy format for picture, it can only handle plain texture
|
||||||
|
like flats it is now used for hud in full screen for the main picture
|
||||||
|
of legacy and for coronas (the format was extended to handle 32 bit color
|
||||||
|
or intensity + alpha, not all are implemented at this time)
|
||||||
|
|
||||||
|
Since patch, flat and pic are basic structure represented by only one lump in
|
||||||
|
the wad, the wad loader allocate for eatch lump a GlideMipmap_s (cache3Dfx)
|
||||||
|
and init data field to NULL. Since the data structure is allocated in
|
||||||
|
PU_3DFXCACHE (like PU_CACHE) the data will be initilised when needed
|
||||||
|
(hw_cache.c).
|
||||||
|
|
||||||
|
The GlideMipmap_s structures for textures are initialized on
|
||||||
|
HWR_PrepLevelCache (hw_cache.c) it is called in P_SetupLevel (load level)
|
||||||
|
the number of textures is computed with TEXTURE1, TEXTURE2 lumps since this
|
||||||
|
can be changed in runtime in SRB2 (load a wad while runing) it must be
|
||||||
|
reallocated. Well, at this time it is realloceted at eatch level start. We
|
||||||
|
can do better, since numtextures change only when a wad is loaded.
|
||||||
|
|
||||||
|
The 3dfx driver use glide3, it load gr_texture in gr_texture memory of the
|
||||||
|
card in fifo order when there is no more place it remove the first gr_texture,
|
||||||
|
the downloaded field of GlideMipmap_s go to false and when needed it is
|
||||||
|
reloaded in gr_texture memory. In OpenGl, since OpenGl keep texture in there
|
||||||
|
own memory and handle gr_texture memory of the card we no more need to
|
||||||
|
redownload it but if we not free time to time gr_texture memory in opengl,
|
||||||
|
it will get alot of memory, so the gr_texture memory is cleared at eatch
|
||||||
|
new level (same time of texture reallocation). Opengl and 3dfx link the
|
||||||
|
loaded gr_texture with the nextmipmap field of GlideMipmap_s so before clear
|
||||||
|
textures of the heap we MUST free gr_texture memory of OpenGl or 3dfx !
|
||||||
|
|
||||||
|
SRB2 can also draw patch with a differant colormap (thanks to Hurdler).
|
||||||
|
When needed it create the same gr_texture but just with a differant colormap.
|
||||||
|
This one is linked with the original in the GlideMipmap_s with the
|
||||||
|
nextcolormap field.
|
||||||
|
|
||||||
|
So when a polygone with a gr_texture must be drawn, first we check if the
|
||||||
|
gr_textures is not allready loaded in hadware memory (downloaded field) if
|
||||||
|
not then we check if gr_texture data is there (not grabbed by z_malloc
|
||||||
|
function) if not we must recompute it eatch type of gr_texture (texture,
|
||||||
|
patch, flat, pic have there own methode) the we can send the gr_texture
|
||||||
|
to 3dfx or OpenGl.
|
||||||
+1992
File diff suppressed because it is too large.
Load diff
@@ -5,13 +5,13 @@
|
|||||||
# met:
|
# met:
|
||||||
|
|
||||||
# (1) Redistributions of source code must retain the above copyright
|
# (1) Redistributions of source code must retain the above copyright
|
||||||
# notice, this list of conditions and the following disclaimer.
|
# notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
# (2) Redistributions in binary form must reproduce the above copyright
|
# (2) Redistributions in binary form must reproduce the above copyright
|
||||||
# notice, this list of conditions and the following disclaimer in
|
# notice, this list of conditions and the following disclaimer in
|
||||||
# the documentation and/or other materials provided with the
|
# the documentation and/or other materials provided with the
|
||||||
# distribution.
|
# distribution.
|
||||||
|
|
||||||
# (3) The name of the author may not be used to
|
# (3) The name of the author may not be used to
|
||||||
# endorse or promote products derived from this software without
|
# endorse or promote products derived from this software without
|
||||||
# specific prior written permission.
|
# specific prior written permission.
|
||||||
@@ -26,4 +26,4 @@
|
|||||||
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||||
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
@@ -10,18 +10,8 @@ The libbacktrace library may be linked into a program or library and
|
|||||||
used to produce symbolic backtraces.
|
used to produce symbolic backtraces.
|
||||||
Sample uses would be to print a detailed backtrace when an error
|
Sample uses would be to print a detailed backtrace when an error
|
||||||
occurs or to gather detailed profiling information.
|
occurs or to gather detailed profiling information.
|
||||||
|
|
||||||
In general the functions provided by this library are async-signal-safe,
|
In general the functions provided by this library are async-signal-safe,
|
||||||
meaning that they may be safely called from a signal handler.
|
meaning that they may be safely called from a signal handler.
|
||||||
That said, on systems that use `dl_iterate_phdr`, such as GNU/Linux,
|
|
||||||
the first call to a libbacktrace function will call `dl_iterate_phdr`,
|
|
||||||
which is not in general async-signal-safe. Therefore, programs
|
|
||||||
that call libbacktrace from a signal handler should ensure that they
|
|
||||||
make an initial call from outside of a signal handler.
|
|
||||||
Similar considerations apply when arranging to call libbacktrace
|
|
||||||
from within malloc; `dl_iterate_phdr` can also call malloc,
|
|
||||||
so make an initial call to a libbacktrace function outside of
|
|
||||||
malloc before trying to call libbacktrace functions within malloc.
|
|
||||||
|
|
||||||
The libbacktrace library is provided under a BSD license.
|
The libbacktrace library is provided under a BSD license.
|
||||||
See the source files for the exact license text.
|
See the source files for the exact license text.
|
||||||
@@ -35,7 +25,7 @@ will work.
|
|||||||
See the source file backtrace-supported.h.in for the macros that it
|
See the source file backtrace-supported.h.in for the macros that it
|
||||||
defines.
|
defines.
|
||||||
|
|
||||||
As of July 2024, libbacktrace supports ELF, PE/COFF, Mach-O, and
|
As of October 2020, libbacktrace supports ELF, PE/COFF, Mach-O, and
|
||||||
XCOFF executables with DWARF debugging information.
|
XCOFF executables with DWARF debugging information.
|
||||||
In other words, it supports GNU/Linux, *BSD, macOS, Windows, and AIX.
|
In other words, it supports GNU/Linux, *BSD, macOS, Windows, and AIX.
|
||||||
The library is written to make it straightforward to add support for
|
The library is written to make it straightforward to add support for
|
||||||
|
|||||||
Binary file not shown.
@@ -1,41 +0,0 @@
|
|||||||
# libbacktrace.la - a libtool library file
|
|
||||||
# Generated by libtool (GNU libtool 1.3134 2009-11-29) 2.2.7a
|
|
||||||
#
|
|
||||||
# Please DO NOT delete this file!
|
|
||||||
# It is necessary for linking the library.
|
|
||||||
|
|
||||||
# The name that we can dlopen(3).
|
|
||||||
dlname=''
|
|
||||||
|
|
||||||
# Names of this library.
|
|
||||||
library_names=''
|
|
||||||
|
|
||||||
# The name of the static archive.
|
|
||||||
old_library='libbacktrace.a'
|
|
||||||
|
|
||||||
# Linker flags that can not go in dependency_libs.
|
|
||||||
inherited_linker_flags=''
|
|
||||||
|
|
||||||
# Libraries that this one depends upon.
|
|
||||||
dependency_libs=''
|
|
||||||
|
|
||||||
# Names of additional weak libraries provided by this library
|
|
||||||
weak_library_names=''
|
|
||||||
|
|
||||||
# Version information for libbacktrace.
|
|
||||||
current=0
|
|
||||||
age=0
|
|
||||||
revision=0
|
|
||||||
|
|
||||||
# Is this an already installed library?
|
|
||||||
installed=no
|
|
||||||
|
|
||||||
# Should we warn about portability when linking against -modules?
|
|
||||||
shouldnotlink=no
|
|
||||||
|
|
||||||
# Files to dlopen/dlpreopen
|
|
||||||
dlopen=''
|
|
||||||
dlpreopen=''
|
|
||||||
|
|
||||||
# Directory that this library needs to be installed in:
|
|
||||||
libdir='/mingw64/lib'
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
# libbacktrace.la - a libtool library file
|
|
||||||
# Generated by libtool (GNU libtool 1.3134 2009-11-29) 2.2.7a
|
|
||||||
#
|
|
||||||
# Please DO NOT delete this file!
|
|
||||||
# It is necessary for linking the library.
|
|
||||||
|
|
||||||
# The name that we can dlopen(3).
|
|
||||||
dlname=''
|
|
||||||
|
|
||||||
# Names of this library.
|
|
||||||
library_names=''
|
|
||||||
|
|
||||||
# The name of the static archive.
|
|
||||||
old_library='libbacktrace.a'
|
|
||||||
|
|
||||||
# Linker flags that can not go in dependency_libs.
|
|
||||||
inherited_linker_flags=''
|
|
||||||
|
|
||||||
# Libraries that this one depends upon.
|
|
||||||
dependency_libs=''
|
|
||||||
|
|
||||||
# Names of additional weak libraries provided by this library
|
|
||||||
weak_library_names=''
|
|
||||||
|
|
||||||
# Version information for libbacktrace.
|
|
||||||
current=0
|
|
||||||
age=0
|
|
||||||
revision=0
|
|
||||||
|
|
||||||
# Is this an already installed library?
|
|
||||||
installed=yes
|
|
||||||
|
|
||||||
# Should we warn about portability when linking against -modules?
|
|
||||||
shouldnotlink=no
|
|
||||||
|
|
||||||
# Files to dlopen/dlpreopen
|
|
||||||
dlopen=''
|
|
||||||
dlpreopen=''
|
|
||||||
|
|
||||||
# Directory that this library needs to be installed in:
|
|
||||||
libdir='/mingw64/lib'
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 153 KiB |
+6
-1
@@ -442,7 +442,12 @@ if(${SRB2_CONFIG_HAVE_PNG} AND ${SRB2_CONFIG_HAVE_ZLIB})
|
|||||||
set(SRB2_HAVE_PNG ON)
|
set(SRB2_HAVE_PNG ON)
|
||||||
add_definitions(-DHAVE_PNG)
|
add_definitions(-DHAVE_PNG)
|
||||||
add_definitions(-D_LARGEFILE64_SOURCE)
|
add_definitions(-D_LARGEFILE64_SOURCE)
|
||||||
source_group("Main" FILES ${SRB2_CORE_SOURCES} ${SRB2_CORE_HEADERS})
|
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})
|
||||||
else()
|
else()
|
||||||
message(WARNING "You have specified that PNG is available but it was not found. SRB2Kart may not compile correctly.")
|
message(WARNING "You have specified that PNG is available but it was not found. SRB2Kart may not compile correctly.")
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
+13
-21
@@ -69,7 +69,6 @@
|
|||||||
# VALGRIND=1 - Enable Valgrind memory debugging support.
|
# VALGRIND=1 - Enable Valgrind memory debugging support.
|
||||||
# PROFILEMODE=1 - Enable performance profiling (gprof).
|
# PROFILEMODE=1 - Enable performance profiling (gprof).
|
||||||
# USEASAN=1 - Enable building with Address Sanitizer.
|
# USEASAN=1 - Enable building with Address Sanitizer.
|
||||||
# USEUBSAN=1 - Enable building with Undefined Behavior Sanitizer.
|
|
||||||
# NOLIBBACKTRACE=1 - Disable using Libbacktrace for crashlog traces.
|
# NOLIBBACKTRACE=1 - Disable using Libbacktrace for crashlog traces.
|
||||||
#
|
#
|
||||||
# General flags for building:
|
# General flags for building:
|
||||||
@@ -244,14 +243,10 @@ ifdef STATIC
|
|||||||
libs+=-static
|
libs+=-static
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq (,$(filter $(CC) $(CXX),gcc g++))
|
|
||||||
opts+=-mno-ms-bitfields
|
|
||||||
endif
|
|
||||||
|
|
||||||
# build with profiling information
|
# build with profiling information
|
||||||
ifdef PROFILEMODE
|
ifdef PROFILEMODE
|
||||||
opts+=-pg
|
opts+=-pg
|
||||||
libs+=-pg
|
LDFLAGS+=-pg
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef DEBUGMODE
|
ifdef DEBUGMODE
|
||||||
@@ -261,32 +256,29 @@ debug_opts=-DNDEBUG
|
|||||||
opts+=-O3
|
opts+=-O3
|
||||||
ifdef USELTO
|
ifdef USELTO
|
||||||
# compile with LTO
|
# compile with LTO
|
||||||
|
ifdef MINGW
|
||||||
|
opts+=-flto=auto -g
|
||||||
|
LDFLAGS+=-flto=auto -g
|
||||||
|
else
|
||||||
opts+=-flto=auto
|
opts+=-flto=auto
|
||||||
libs+=-flto=auto
|
LDFLAGS+=-flto=auto
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef USEASAN
|
ifdef USEASAN
|
||||||
# compile with asan
|
# compile with asan
|
||||||
|
ifdef MINGW
|
||||||
|
opts+=-fsanitize=address -g
|
||||||
|
libs+=-fsanitize=address -g
|
||||||
|
else
|
||||||
opts+=-fsanitize=address
|
opts+=-fsanitize=address
|
||||||
libs+=-fsanitize=address
|
libs+=-fsanitize=address
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef USEUBSAN
|
|
||||||
# compile with asan
|
|
||||||
opts+=-fsanitize=undefined
|
|
||||||
libs+=-fsanitize=undefined
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq (,$(filter $(CC) $(CXX),clang clang++))
|
ifeq ($(CC),clang)
|
||||||
libs+=-fuse-ld=lld
|
LDFLAGS+= -fuse-ld=lld
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef MINGW
|
|
||||||
# mingw needs this passed AFTER lto and the likes were passed
|
|
||||||
# otherwise libbacktrace may break
|
|
||||||
opts+=-g
|
|
||||||
libs+=-g
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# debug_opts also get passed to windres
|
# debug_opts also get passed to windres
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
makedir:=$(makedir)/Dummy
|
|
||||||
|
|
||||||
sources+=$(call List,dummy/Sourcefile)
|
|
||||||
|
|
||||||
NOHW=1
|
|
||||||
@@ -18,10 +18,8 @@ ifndef NOHW
|
|||||||
opts+=-DHWRENDER
|
opts+=-DHWRENDER
|
||||||
|
|
||||||
ifndef NOSCREENFBO
|
ifndef NOSCREENFBO
|
||||||
ifndef STATIC_OPENGL
|
|
||||||
opts+=-DUSE_FBO_OGL
|
opts+=-DUSE_FBO_OGL
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
|
|
||||||
sources+=$(call List,hardware/Sourcefile)
|
sources+=$(call List,hardware/Sourcefile)
|
||||||
endif
|
endif
|
||||||
@@ -30,12 +28,14 @@ ifndef NOMD5
|
|||||||
sources+=md5.c
|
sources+=md5.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifndef NONET
|
||||||
ifndef NOSATURNJOIN
|
ifndef NOSATURNJOIN
|
||||||
opts+=-DDOSATURNJOIN
|
opts+=-DDOSATURNJOIN
|
||||||
endif
|
endif
|
||||||
ifndef NOSATURNPAK
|
ifndef NOSATURNPAK
|
||||||
opts+=-DDOSATURNPAK
|
opts+=-DDOSATURNPAK
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
ifndef NOZLIB
|
ifndef NOZLIB
|
||||||
ifndef NOPNG
|
ifndef NOPNG
|
||||||
@@ -50,6 +50,7 @@ ifdef LINUX
|
|||||||
opts+=-D_LARGEFILE64_SOURCE
|
opts+=-D_LARGEFILE64_SOURCE
|
||||||
endif
|
endif
|
||||||
opts+=-DHAVE_PNG
|
opts+=-DHAVE_PNG
|
||||||
|
sources+=apng.c
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,9 @@ else ifeq (${DEDICATED},1)
|
|||||||
EXENAME?=srb2haikud
|
EXENAME?=srb2haikud
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifndef NONET
|
||||||
libs+=-lnetwork
|
libs+=-lnetwork
|
||||||
|
endif
|
||||||
|
|
||||||
define _set =
|
define _set =
|
||||||
$(1)_CFLAGS?=$($(1)_opts)
|
$(1)_CFLAGS?=$($(1)_opts)
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
makedir:=$(makedir)/SDL
|
makedir:=$(makedir)/SDL
|
||||||
|
|
||||||
opts+=-DHAVE_SDL
|
opts+=-DDIRECTFULLSCREEN -DHAVE_SDL
|
||||||
sources+=$(call List,sdl/Sourcefile)
|
sources+=$(call List,sdl/Sourcefile)
|
||||||
|
|
||||||
NOUPNP=1
|
NOUPNP=1
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
# Mingw, if you don't know, that's Win32/Win64
|
# Mingw, if you don't know, that's Win32/Win64
|
||||||
#
|
#
|
||||||
|
|
||||||
sources+=$(call List,win32/Sourcefile)
|
|
||||||
|
|
||||||
ifndef MINGW64
|
ifndef MINGW64
|
||||||
EXENAME?=srb2kart-saturn_32bit.exe
|
EXENAME?=srb2kart-saturn_32bit.exe
|
||||||
else
|
else
|
||||||
@@ -97,7 +95,7 @@ LIBBACKTRACE_libs:=-L$(lib)/lib/x86_64 -lbacktrace
|
|||||||
$(eval $(call _set,LIBBACKTRACE))
|
$(eval $(call _set,LIBBACKTRACE))
|
||||||
else
|
else
|
||||||
lib:=../libs/drmingw
|
lib:=../libs/drmingw
|
||||||
opts+=-I$(lib)/include -DHAVE_DRMINGW
|
opts+=-I$(lib)/include
|
||||||
libs+=-L$(lib)/lib/win32 -lmgwhelp -lexchndl
|
libs+=-L$(lib)/lib/win32 -lmgwhelp -lexchndl
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -34,7 +34,6 @@ m_misc.c
|
|||||||
m_perfstats.c
|
m_perfstats.c
|
||||||
m_queue.c
|
m_queue.c
|
||||||
m_random.c
|
m_random.c
|
||||||
m_curl.c
|
|
||||||
mserv.c
|
mserv.c
|
||||||
http-mserv.c
|
http-mserv.c
|
||||||
qs22j.c
|
qs22j.c
|
||||||
@@ -53,7 +52,7 @@ r_data.c
|
|||||||
r_draw.c
|
r_draw.c
|
||||||
r_fps.cpp
|
r_fps.cpp
|
||||||
r_main.cpp
|
r_main.cpp
|
||||||
r_patch.cpp
|
r_patch.c
|
||||||
r_patchrotation.c
|
r_patchrotation.c
|
||||||
r_plane.cpp
|
r_plane.cpp
|
||||||
r_segs.cpp
|
r_segs.cpp
|
||||||
|
|||||||
+1
-8
@@ -265,11 +265,6 @@ static void AM_findMinMaxBoundaries(void)
|
|||||||
max_w = minimapinfo.map_w << MAPBITS;
|
max_w = minimapinfo.map_w << MAPBITS;
|
||||||
max_h = minimapinfo.map_h << MAPBITS;
|
max_h = minimapinfo.map_h << MAPBITS;
|
||||||
|
|
||||||
if (max_w == 0)
|
|
||||||
max_w = 1;
|
|
||||||
if (max_h == 0)
|
|
||||||
max_h = 1;
|
|
||||||
|
|
||||||
a = FixedDiv(f_w<<FRACBITS, max_w);
|
a = FixedDiv(f_w<<FRACBITS, max_w);
|
||||||
b = FixedDiv(f_h<<FRACBITS, max_h);
|
b = FixedDiv(f_h<<FRACBITS, max_h);
|
||||||
|
|
||||||
@@ -359,9 +354,7 @@ static void AM_LevelInit(void)
|
|||||||
AM_findMinMaxBoundaries();
|
AM_findMinMaxBoundaries();
|
||||||
scale_mtof = FixedDiv(min_scale_mtof*10, 7*FRACUNIT);
|
scale_mtof = FixedDiv(min_scale_mtof*10, 7*FRACUNIT);
|
||||||
if (scale_mtof > max_scale_mtof)
|
if (scale_mtof > max_scale_mtof)
|
||||||
scale_mtof = max_scale_mtof;
|
scale_mtof = min_scale_mtof;
|
||||||
if (scale_mtof == 0)
|
|
||||||
scale_mtof = 1;
|
|
||||||
scale_ftom = FixedDiv(FRACUNIT, scale_mtof);
|
scale_ftom = FixedDiv(FRACUNIT, scale_mtof);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ void I_Error(const char *error, ...)
|
|||||||
char logbuf[8192];
|
char logbuf[8192];
|
||||||
|
|
||||||
va_start(argptr, error);
|
va_start(argptr, error);
|
||||||
vsnprintf(logbuf, 8192, error, argptr);
|
vsprintf(logbuf, error, argptr);
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
|
|
||||||
LOGE(logbuf);
|
LOGE(logbuf);
|
||||||
@@ -166,7 +166,7 @@ void I_OutputMsg(const char *fmt, ...)
|
|||||||
char logbuf[8192];
|
char logbuf[8192];
|
||||||
|
|
||||||
va_start(argptr, fmt);
|
va_start(argptr, fmt);
|
||||||
vsnprintf(logbuf, 8192, fmt, argptr);
|
vsprintf(logbuf, fmt, argptr);
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
|
|
||||||
LOGD(logbuf);
|
LOGD(logbuf);
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ INT32 VID_SetMode(INT32 modenum)
|
|||||||
vid.modenum = 0;
|
vid.modenum = 0;
|
||||||
vid.width = 320;
|
vid.width = 320;
|
||||||
vid.height = 240;
|
vid.height = 240;
|
||||||
|
vid.buffer = android_surface;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,7 +65,7 @@ void I_WaitVBL(INT32 count)
|
|||||||
(void)count;
|
(void)count;
|
||||||
}
|
}
|
||||||
|
|
||||||
void I_ReadScreen(UINT8 * restrict scr, INT32 scale)
|
void I_ReadScreen(UINT8 *scr)
|
||||||
{
|
{
|
||||||
(void)scr;
|
(void)scr;
|
||||||
}
|
}
|
||||||
|
|||||||
+289
@@ -0,0 +1,289 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2019, James R.
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
1. Redistributions of source code must retain the above copyright notice, this
|
||||||
|
list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
|
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "apng.h"
|
||||||
|
|
||||||
|
#define APNG_INFO_acTL 0x20000U
|
||||||
|
|
||||||
|
#define APNG_WROTE_acTL 0x10000U
|
||||||
|
|
||||||
|
struct apng_info_def
|
||||||
|
{
|
||||||
|
png_uint_32 mode;
|
||||||
|
png_uint_32 valid;
|
||||||
|
|
||||||
|
png_uint_32 num_frames;
|
||||||
|
png_uint_32 num_plays;
|
||||||
|
|
||||||
|
long start_acTL;/* acTL is written here */
|
||||||
|
|
||||||
|
png_flush_ptr output_flush_fn;
|
||||||
|
apng_seek_ptr output_seek_fn;
|
||||||
|
apng_tell_ptr output_tell_fn;
|
||||||
|
|
||||||
|
apng_set_acTL_ptr set_acTL_fn;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* PROTOS (FUCK COMPILER) */
|
||||||
|
void apng_seek (png_structp, apng_const_infop, size_t);
|
||||||
|
size_t apng_tell (png_structp, apng_const_infop);
|
||||||
|
#ifdef PNG_WRITE_FLUSH_SUPPORTED
|
||||||
|
void apng_flush (png_structp, apng_infop);
|
||||||
|
#ifdef PNG_STDIO_SUPPORTED
|
||||||
|
void apng_default_flush (png_structp);
|
||||||
|
#endif/* PNG_STDIO_SUPPORTED */
|
||||||
|
#endif/* PNG_WRITE_FLUSH_SUPPORTED */
|
||||||
|
#ifdef PNG_STDIO_SUPPORTED
|
||||||
|
void apng_default_seek (png_structp, size_t);
|
||||||
|
size_t apng_default_tell (png_structp);
|
||||||
|
#endif/* PNG_STDIO_SUPPORTED */
|
||||||
|
void apng_write_IEND (png_structp);
|
||||||
|
void apng_write_acTL (png_structp, png_uint_32, png_uint_32);
|
||||||
|
#ifndef PNG_WRITE_APNG_SUPPORTED
|
||||||
|
png_uint_32 apng_set_acTL_dummy (png_structp, png_infop,
|
||||||
|
png_uint_32, png_uint_32);
|
||||||
|
#endif/* PNG_WRITE_APNG_SUPPORTED */
|
||||||
|
|
||||||
|
apng_infop
|
||||||
|
apng_create_info_struct (png_structp pngp)
|
||||||
|
{
|
||||||
|
apng_infop ainfop;
|
||||||
|
(void)pngp;
|
||||||
|
if (( ainfop = calloc(1, sizeof (apng_info)) ))
|
||||||
|
{
|
||||||
|
apng_set_write_fn(pngp, ainfop, 0, 0, 0, 0, 0);
|
||||||
|
apng_set_set_acTL_fn(pngp, ainfop, 0);
|
||||||
|
}
|
||||||
|
return ainfop;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
apng_destroy_info_struct (png_structp pngp, apng_infopp ainfopp)
|
||||||
|
{
|
||||||
|
(void)pngp;
|
||||||
|
if (!( pngp && ainfopp ))
|
||||||
|
return;
|
||||||
|
|
||||||
|
free((*ainfopp));
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
apng_seek (png_structp pngp, apng_const_infop ainfop, size_t l)
|
||||||
|
{
|
||||||
|
(*(ainfop->output_seek_fn))(pngp, l);
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t
|
||||||
|
apng_tell (png_structp pngp, apng_const_infop ainfop)
|
||||||
|
{
|
||||||
|
return (*(ainfop->output_tell_fn))(pngp);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef PNG_WRITE_FLUSH_SUPPORTED
|
||||||
|
void
|
||||||
|
apng_flush (png_structp pngp, apng_infop ainfop)
|
||||||
|
{
|
||||||
|
if (ainfop->output_flush_fn)
|
||||||
|
(*(ainfop->output_flush_fn))(pngp);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef PNG_STDIO_SUPPORTED
|
||||||
|
void
|
||||||
|
apng_default_flush (png_structp pngp)
|
||||||
|
{
|
||||||
|
if (!( pngp ))
|
||||||
|
return;
|
||||||
|
|
||||||
|
fflush((png_FILE_p)png_get_io_ptr);
|
||||||
|
}
|
||||||
|
#endif/* PNG_STDIO_SUPPORTED */
|
||||||
|
#endif/* PNG_WRITE_FLUSH_SUPPORTED */
|
||||||
|
|
||||||
|
#ifdef PNG_STDIO_SUPPORTED
|
||||||
|
void
|
||||||
|
apng_default_seek (png_structp pngp, size_t l)
|
||||||
|
{
|
||||||
|
if (!( pngp ))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (fseek((png_FILE_p)png_get_io_ptr(pngp), (long)l, SEEK_SET) == -1)
|
||||||
|
png_error(pngp, "Seek Error");
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t
|
||||||
|
apng_default_tell (png_structp pngp)
|
||||||
|
{
|
||||||
|
long l;
|
||||||
|
|
||||||
|
if (!( pngp ))
|
||||||
|
{
|
||||||
|
png_error(pngp, "Call to apng_default_tell with NULL pngp failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (( l = ftell((png_FILE_p)png_get_io_ptr(pngp)) ) == -1)
|
||||||
|
png_error(pngp, "Tell Error");
|
||||||
|
|
||||||
|
return (size_t)l;
|
||||||
|
}
|
||||||
|
#endif/* PNG_STDIO_SUPPORTED */
|
||||||
|
|
||||||
|
void
|
||||||
|
apng_set_write_fn (png_structp pngp, apng_infop ainfop, png_voidp iop,
|
||||||
|
png_rw_ptr write_f, png_flush_ptr flush_f,
|
||||||
|
apng_seek_ptr seek_f, apng_tell_ptr tell_f)
|
||||||
|
{
|
||||||
|
if (!( pngp && ainfop ))
|
||||||
|
return;
|
||||||
|
|
||||||
|
png_set_write_fn(pngp, iop, write_f, flush_f);
|
||||||
|
|
||||||
|
#ifdef PNG_WRITE_FLUSH_SUPPORTED
|
||||||
|
#ifdef PNG_STDIO_SUPPORTED
|
||||||
|
if (!flush_f)
|
||||||
|
ainfop->output_flush_fn = &apng_default_flush;
|
||||||
|
else
|
||||||
|
#endif/* PNG_STDIO_SUPPORTED */
|
||||||
|
ainfop->output_flush_fn = flush_f;
|
||||||
|
#endif/* PNG_WRITE_FLUSH_SUPPORTED */
|
||||||
|
#ifdef PNG_STDIO_SUPPORTED
|
||||||
|
if (!seek_f)
|
||||||
|
ainfop->output_seek_fn = &apng_default_seek;
|
||||||
|
else
|
||||||
|
#endif/* PNG_STDIO_SUPPORTED */
|
||||||
|
ainfop->output_seek_fn = seek_f;
|
||||||
|
#ifdef PNG_STDIO_SUPPORTED
|
||||||
|
if (!seek_f)
|
||||||
|
ainfop->output_tell_fn = apng_default_tell;
|
||||||
|
else
|
||||||
|
#endif/* PNG_STDIO_SUPPORTED */
|
||||||
|
ainfop->output_tell_fn = tell_f;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
apng_write_IEND (png_structp pngp)
|
||||||
|
{
|
||||||
|
png_byte chunkc[] = "IEND";
|
||||||
|
png_write_chunk(pngp, chunkc, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
apng_write_acTL (png_structp pngp, png_uint_32 frames, png_uint_32 plays)
|
||||||
|
{
|
||||||
|
png_byte chunkc[] = "acTL";
|
||||||
|
png_byte buf[8];
|
||||||
|
png_save_uint_32(buf, frames);
|
||||||
|
png_save_uint_32(buf + 4, plays);
|
||||||
|
png_write_chunk(pngp, chunkc, buf, 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
png_uint_32
|
||||||
|
apng_set_acTL (png_structp pngp, png_infop infop, apng_infop ainfop,
|
||||||
|
png_uint_32 frames, png_uint_32 plays)
|
||||||
|
{
|
||||||
|
(void)pngp;
|
||||||
|
(void)infop;
|
||||||
|
if (!( pngp && infop && ainfop ))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
ainfop->num_frames = frames;
|
||||||
|
ainfop->num_plays = plays;
|
||||||
|
|
||||||
|
ainfop->valid |= APNG_INFO_acTL;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
apng_write_info_before_PLTE (png_structp pngp, png_infop infop,
|
||||||
|
apng_infop ainfop)
|
||||||
|
{
|
||||||
|
if (!( pngp && infop && ainfop ))
|
||||||
|
return;
|
||||||
|
|
||||||
|
png_write_info_before_PLTE(pngp, infop);
|
||||||
|
|
||||||
|
if (( ainfop->valid & APNG_INFO_acTL )&&!( ainfop->mode & APNG_WROTE_acTL ))
|
||||||
|
{
|
||||||
|
ainfop->start_acTL = apng_tell(pngp, ainfop);
|
||||||
|
|
||||||
|
apng_write_acTL(pngp, 0, 0);
|
||||||
|
/* modified for runtime dynamic linking */
|
||||||
|
(*(ainfop->set_acTL_fn))(pngp, infop, PNG_UINT_31_MAX, 0);
|
||||||
|
|
||||||
|
ainfop->mode |= APNG_WROTE_acTL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
apng_write_info (png_structp pngp, png_infop infop,
|
||||||
|
apng_infop ainfop)
|
||||||
|
{
|
||||||
|
apng_write_info_before_PLTE(pngp, infop, ainfop);
|
||||||
|
png_write_info(pngp, infop);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
apng_write_end (png_structp pngp, png_infop infop, apng_infop ainfop)
|
||||||
|
{
|
||||||
|
(void)infop;
|
||||||
|
apng_write_IEND(pngp);
|
||||||
|
apng_seek(pngp, ainfop, ainfop->start_acTL);
|
||||||
|
apng_write_acTL(pngp, ainfop->num_frames, ainfop->num_plays);
|
||||||
|
|
||||||
|
#ifdef PNG_WRITE_FLUSH_SUPPORTED
|
||||||
|
#ifdef PNG_WRITE_FLUSH_AFTER_IEND_SUPPORTED
|
||||||
|
apng_flush(pngp, infop);
|
||||||
|
#endif/* PNG_WRITE_FLUSH_SUPPORTED */
|
||||||
|
#endif/* PNG_WRITE_FLUSH_AFTER_IEND_SUPPORTED */
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef PNG_WRITE_APNG_SUPPORTED
|
||||||
|
png_uint_32
|
||||||
|
apng_set_acTL_dummy (png_structp pngp, png_infop infop,
|
||||||
|
png_uint_32 frames, png_uint_32 plays)
|
||||||
|
{
|
||||||
|
(void)pngp;
|
||||||
|
(void)infop;
|
||||||
|
(void)frames;
|
||||||
|
(void)plays;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif/* PNG_WRITE_APNG_SUPPORTED */
|
||||||
|
|
||||||
|
/* Dynamic runtime linking capable! (Hopefully.) */
|
||||||
|
void
|
||||||
|
apng_set_set_acTL_fn (png_structp pngp, apng_infop ainfop,
|
||||||
|
apng_set_acTL_ptr set_acTL_f)
|
||||||
|
{
|
||||||
|
(void)pngp;
|
||||||
|
if (!ainfop->set_acTL_fn)
|
||||||
|
#ifndef PNG_WRITE_APNG_SUPPORTED
|
||||||
|
ainfop->set_acTL_fn = &apng_set_acTL_dummy;
|
||||||
|
#else
|
||||||
|
ainfop->set_acTL_fn = &png_set_acTL;
|
||||||
|
#endif/* PNG_WRITE_APNG_SUPPORTED */
|
||||||
|
else
|
||||||
|
ainfop->set_acTL_fn = set_acTL_f;
|
||||||
|
}
|
||||||
+80
@@ -0,0 +1,80 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2019, James R.
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
1. Redistributions of source code must retain the above copyright notice, this
|
||||||
|
list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
|
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef APNG_H
|
||||||
|
#define APNG_H
|
||||||
|
|
||||||
|
#ifndef _MSC_VER
|
||||||
|
#ifndef _LARGEFILE64_SOURCE
|
||||||
|
#define _LARGEFILE64_SOURCE
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _LFS64_LARGEFILE
|
||||||
|
#define _LFS64_LARGEFILE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _FILE_OFFSET_BITS
|
||||||
|
#define _FILE_OFFSET_BITS 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <png.h>
|
||||||
|
|
||||||
|
typedef struct apng_info_def apng_info;
|
||||||
|
typedef apng_info * apng_infop;
|
||||||
|
typedef const apng_info * apng_const_infop;
|
||||||
|
typedef apng_info * * apng_infopp;
|
||||||
|
|
||||||
|
typedef void (*apng_seek_ptr)(png_structp, size_t);
|
||||||
|
typedef size_t (*apng_tell_ptr)(png_structp);
|
||||||
|
|
||||||
|
typedef png_uint_32 (*apng_set_acTL_ptr)(png_structp, png_infop,
|
||||||
|
png_uint_32, png_uint_32);
|
||||||
|
|
||||||
|
apng_infop apng_create_info_struct (png_structp png_ptr);
|
||||||
|
|
||||||
|
void apng_destroy_info_struct (png_structp png_ptr,
|
||||||
|
apng_infopp info_ptr_ptr);
|
||||||
|
|
||||||
|
/* Call the following functions in place of the libpng counterparts. */
|
||||||
|
|
||||||
|
png_uint_32 apng_set_acTL (png_structp png_ptr, png_infop info_ptr,
|
||||||
|
apng_infop ainfo_ptr,
|
||||||
|
png_uint_32 num_frames, png_uint_32 num_plays);
|
||||||
|
|
||||||
|
void apng_write_info_before_PLTE (png_structp png_ptr, png_infop info_ptr,
|
||||||
|
apng_infop ainfo_ptr);
|
||||||
|
void apng_write_info (png_structp png_ptr, png_infop info_ptr,
|
||||||
|
apng_infop ainfo_ptr);
|
||||||
|
|
||||||
|
void apng_write_end (png_structp png_ptr, png_infop info_ptr,
|
||||||
|
apng_infop ainfo_ptr);
|
||||||
|
|
||||||
|
void apng_set_write_fn (png_structp png_ptr, apng_infop ainfo_ptr,
|
||||||
|
png_voidp io_ptr,
|
||||||
|
png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn,
|
||||||
|
apng_seek_ptr output_seek_fn, apng_tell_ptr output_tell_fn);
|
||||||
|
|
||||||
|
void apng_set_set_acTL_fn (png_structp png_ptr, apng_infop ainfo_ptr,
|
||||||
|
apng_set_acTL_ptr set_acTL_fn);
|
||||||
|
|
||||||
|
#endif/* APNG_H */
|
||||||
@@ -10,13 +10,8 @@
|
|||||||
/// \file b_bot.h
|
/// \file b_bot.h
|
||||||
/// \brief Basic bot handling
|
/// \brief Basic bot handling
|
||||||
|
|
||||||
#ifndef __B_BOT__
|
|
||||||
#define __B_BOT__
|
|
||||||
|
|
||||||
void B_BuildTiccmd(player_t *player, ticcmd_t *cmd);
|
void B_BuildTiccmd(player_t *player, ticcmd_t *cmd);
|
||||||
void B_KeysToTiccmd(mobj_t *mo, ticcmd_t *cmd, boolean forward, boolean backward, boolean left, boolean right, boolean strafeleft, boolean straferight, boolean jump, boolean spin);
|
void B_KeysToTiccmd(mobj_t *mo, ticcmd_t *cmd, boolean forward, boolean backward, boolean left, boolean right, boolean strafeleft, boolean straferight, boolean jump, boolean spin);
|
||||||
boolean B_CheckRespawn(player_t *player);
|
boolean B_CheckRespawn(player_t *player);
|
||||||
void B_MoveBlocked(player_t *player);
|
void B_MoveBlocked(player_t *player);
|
||||||
void B_RespawnBot(INT32 playernum);
|
void B_RespawnBot(INT32 playernum);
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -46,6 +46,10 @@
|
|||||||
** =======================================================
|
** =======================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(disable : 4324)
|
||||||
|
#endif
|
||||||
|
|
||||||
/* chain list of long jump buffers */
|
/* chain list of long jump buffers */
|
||||||
struct lua_longjmp {
|
struct lua_longjmp {
|
||||||
struct lua_longjmp *previous;
|
struct lua_longjmp *previous;
|
||||||
@@ -53,6 +57,10 @@ struct lua_longjmp {
|
|||||||
volatile int status; /* error code */
|
volatile int status; /* error code */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(default : 4324)
|
||||||
|
#endif
|
||||||
|
|
||||||
void luaD_seterrorobj (lua_State *L, int lerrcode, StkId oldtop) {
|
void luaD_seterrorobj (lua_State *L, int lerrcode, StkId oldtop) {
|
||||||
switch (lerrcode) {
|
switch (lerrcode) {
|
||||||
case LUA_ERRMEM: {
|
case LUA_ERRMEM: {
|
||||||
|
|||||||
@@ -48,6 +48,12 @@ LUAI_FUNC void luaD_reallocCI (lua_State *L, int newsize);
|
|||||||
LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize);
|
LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize);
|
||||||
LUAI_FUNC void luaD_growstack (lua_State *L, int n);
|
LUAI_FUNC void luaD_growstack (lua_State *L, int n);
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#ifndef ATTRNORETURN
|
||||||
|
#define ATTRNORETURN __declspec(noreturn)
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef ATTRNORETURN
|
#ifndef ATTRNORETURN
|
||||||
#define ATTRNORETURN
|
#define ATTRNORETURN
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -11,8 +11,12 @@
|
|||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#define INT32 __int32
|
||||||
|
#else
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#define INT32 int32_t
|
#define INT32 int32_t
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __cplusplus
|
#ifndef __cplusplus
|
||||||
#ifndef min // Double-Check with WATTCP-32's cdefs.h
|
#ifndef min // Double-Check with WATTCP-32's cdefs.h
|
||||||
@@ -566,6 +570,9 @@
|
|||||||
#define luai_numshl(a,b) ((unsigned)(a)<<(unsigned)(b))
|
#define luai_numshl(a,b) ((unsigned)(a)<<(unsigned)(b))
|
||||||
#define luai_numshr(a,b) ((unsigned)(a)>>(unsigned)(b))
|
#define luai_numshr(a,b) ((unsigned)(a)>>(unsigned)(b))
|
||||||
#define luai_numnot(a) (~((unsigned)(a)))
|
#define luai_numnot(a) (~((unsigned)(a)))
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(disable : 4244)
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -582,11 +589,24 @@
|
|||||||
#if defined(LUA_NUMBER_DOUBLE) && !defined(LUA_ANSI) && !defined(__SSE2__) && \
|
#if defined(LUA_NUMBER_DOUBLE) && !defined(LUA_ANSI) && !defined(__SSE2__) && \
|
||||||
(defined(__i386) || defined (_M_IX86) || defined(__i386__))
|
(defined(__i386) || defined (_M_IX86) || defined(__i386__))
|
||||||
|
|
||||||
|
/* On a Microsoft compiler, use assembler */
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
|
||||||
|
#define lua_number2int(i,d) __asm fld d __asm fistp i
|
||||||
|
#define lua_number2integer(i,n) lua_number2int(i, n)
|
||||||
|
|
||||||
|
/* the next trick should work on any Pentium, but sometimes clashes
|
||||||
|
with a DirectX idiosyncrasy */
|
||||||
|
#else
|
||||||
|
|
||||||
union luai_Cast { double l_d; long l_l; };
|
union luai_Cast { double l_d; long l_l; };
|
||||||
#define lua_number2int(i,d) \
|
#define lua_number2int(i,d) \
|
||||||
{ volatile union luai_Cast u; u.l_d = (d) + 6755399441055744.0; (i) = u.l_l; }
|
{ volatile union luai_Cast u; u.l_d = (d) + 6755399441055744.0; (i) = u.l_l; }
|
||||||
#define lua_number2integer(i,n) lua_number2int(i, n)
|
#define lua_number2integer(i,n) lua_number2int(i, n)
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* this option always works, but may be slow */
|
/* this option always works, but may be slow */
|
||||||
#else
|
#else
|
||||||
#define lua_number2int(i,d) ((i)=(int)(d))
|
#define lua_number2int(i,d) ((i)=(int)(d))
|
||||||
|
|||||||
+22
-20
@@ -712,10 +712,12 @@ static void COM_CEcho_f(void)
|
|||||||
|
|
||||||
for (i = 1; i < COM_Argc(); i++)
|
for (i = 1; i < COM_Argc(); i++)
|
||||||
{
|
{
|
||||||
strlcpy(cechotext, COM_Argv(i), sizeof(cechotext)-1);
|
strncat(cechotext, COM_Argv(i), sizeof(cechotext)-1);
|
||||||
strlcat(cechotext, " ", sizeof(cechotext)-1);
|
strncat(cechotext, " ", sizeof(cechotext)-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cechotext[sizeof(cechotext) - 1] = '\0';
|
||||||
|
|
||||||
HU_DoCEcho(cechotext);
|
HU_DoCEcho(cechotext);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1650,13 +1652,13 @@ static void CV_SetCVar(consvar_t *var, const char *value, boolean stealth)
|
|||||||
UINT8 *p = buf;
|
UINT8 *p = buf;
|
||||||
if (!(server || (IsPlayerAdmin(consoleplayer))))
|
if (!(server || (IsPlayerAdmin(consoleplayer))))
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_NOTICE, "Only the server or admin can change: %s %s\n", var->name, var->string);
|
CONS_Printf(M_GetText("Only the server or admin can change: %s %s\n"), var->name, var->string);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (var == &cv_kartencore && !M_SecretUnlocked(SECRET_ENCORE))
|
if (var == &cv_kartencore && !M_SecretUnlocked(SECRET_ENCORE))
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_NOTICE, "You haven't unlocked Encore Mode yet!\n");
|
CONS_Printf(M_GetText("You haven't unlocked Encore Mode yet!\n"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1664,7 +1666,7 @@ static void CV_SetCVar(consvar_t *var, const char *value, boolean stealth)
|
|||||||
{
|
{
|
||||||
if (!stricmp(value, "Hard") || atoi(value) == 2)
|
if (!stricmp(value, "Hard") || atoi(value) == 2)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_NOTICE, "You haven't unlocked this yet!\n");
|
CONS_Printf(M_GetText("You haven't unlocked this yet!\n"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1681,13 +1683,14 @@ static void CV_SetCVar(consvar_t *var, const char *value, boolean stealth)
|
|||||||
else
|
else
|
||||||
Setvalue(var, value, stealth);
|
Setvalue(var, value, stealth);
|
||||||
}
|
}
|
||||||
else if ((var->flags & CV_NOTINNET) && netgame)
|
|
||||||
{
|
|
||||||
CONS_Alert(CONS_NOTICE, "This variable can't be changed while in netgame: %s %s\n", var->name, var->string);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
Setvalue(var, value, stealth);
|
if ((var->flags & CV_NOTINNET) && netgame)
|
||||||
|
{
|
||||||
|
CONS_Printf(M_GetText("This variable can't be changed while in netgame: %s %s\n"), var->name, var->string);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Setvalue(var, value, stealth);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets a value to a variable without calling its callback function.
|
/** Sets a value to a variable without calling its callback function.
|
||||||
@@ -1770,7 +1773,7 @@ void CV_AddValue(consvar_t *var, INT32 increment)
|
|||||||
newvalue = var->value - 1;
|
newvalue = var->value - 1;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (increment > 0) // Going up!
|
if(increment > 0) // Going up!
|
||||||
{
|
{
|
||||||
if (++newvalue == NUMMAPS)
|
if (++newvalue == NUMMAPS)
|
||||||
newvalue = -1;
|
newvalue = -1;
|
||||||
@@ -1784,7 +1787,7 @@ void CV_AddValue(consvar_t *var, INT32 increment)
|
|||||||
if (newvalue == oldvalue)
|
if (newvalue == oldvalue)
|
||||||
break; // don't loop forever if there's none of a certain gametype
|
break; // don't loop forever if there's none of a certain gametype
|
||||||
|
|
||||||
if (newvalue >= 0 && !mapheaderinfo[newvalue])
|
if(!mapheaderinfo[newvalue])
|
||||||
continue; // Don't allocate the header. That just makes memory usage skyrocket.
|
continue; // Don't allocate the header. That just makes memory usage skyrocket.
|
||||||
|
|
||||||
} while (!M_CanShowLevelInList(newvalue, gt));
|
} while (!M_CanShowLevelInList(newvalue, gt));
|
||||||
@@ -1913,14 +1916,13 @@ void CV_AddValue(consvar_t *var, INT32 increment)
|
|||||||
max = (M_SecretUnlocked(SECRET_HARDSPEED) ? 3 : 2);
|
max = (M_SecretUnlocked(SECRET_HARDSPEED) ? 3 : 2);
|
||||||
}
|
}
|
||||||
#ifdef PARANOIA
|
#ifdef PARANOIA
|
||||||
if (currentindice == -1 || max == 0)
|
if (currentindice == -1)
|
||||||
I_Error("CV_AddValue: current value %d not found in possible value\n", var->value);
|
I_Error("CV_AddValue: current value %d not found in possible value\n",
|
||||||
|
var->value);
|
||||||
#endif
|
#endif
|
||||||
if (max > 0)
|
|
||||||
{
|
newindice = (currentindice + increment + max) % max;
|
||||||
newindice = (currentindice + increment + max) % max;
|
CV_Set(var, var->PossibleValue[newindice].strvalue);
|
||||||
CV_Set(var, var->PossibleValue[newindice].strvalue);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
+46
-25
@@ -69,9 +69,14 @@ static boolean consoleready; // console prompt is ready
|
|||||||
INT32 con_destlines; // vid lines used by console at final position
|
INT32 con_destlines; // vid lines used by console at final position
|
||||||
static INT32 con_curlines; // vid lines currently used by console
|
static INT32 con_curlines; // vid lines currently used by console
|
||||||
|
|
||||||
|
INT32 con_clipviewtop; // (useless)
|
||||||
|
|
||||||
static UINT8 con_hudlines; // number of console heads up message lines
|
static UINT8 con_hudlines; // number of console heads up message lines
|
||||||
static UINT32 con_hudtime[MAXHUDLINES]; // remaining time of display for hud msg lines
|
static UINT32 con_hudtime[MAXHUDLINES]; // remaining time of display for hud msg lines
|
||||||
|
|
||||||
|
INT32 con_clearlines; // top screen lines to refresh when view reduced
|
||||||
|
boolean con_hudupdate; // when messages scroll, we need a backgrnd refresh
|
||||||
|
|
||||||
// console text output
|
// console text output
|
||||||
static char *con_line; // console text output current line
|
static char *con_line; // console text output current line
|
||||||
static size_t con_cx; // cursor position in current line
|
static size_t con_cx; // cursor position in current line
|
||||||
@@ -388,6 +393,9 @@ void CON_Init(void)
|
|||||||
|
|
||||||
Lock_state();
|
Lock_state();
|
||||||
|
|
||||||
|
//note: CON_Ticker should always execute at least once before D_Display()
|
||||||
|
con_clipviewtop = -1; // -1 does not clip
|
||||||
|
|
||||||
con_hudlines = atoi(cons_hudlines.defaultvalue);
|
con_hudlines = atoi(cons_hudlines.defaultvalue);
|
||||||
|
|
||||||
Unlock_state();
|
Unlock_state();
|
||||||
@@ -471,18 +479,18 @@ static void CON_RecalcSize(void)
|
|||||||
|
|
||||||
switch (cv_constextsize.value)
|
switch (cv_constextsize.value)
|
||||||
{
|
{
|
||||||
case V_NOSCALEPATCH:
|
case V_NOSCALEPATCH:
|
||||||
con_scalefactor = 1;
|
con_scalefactor = 1;
|
||||||
break;
|
break;
|
||||||
case V_SMALLSCALEPATCH:
|
case V_SMALLSCALEPATCH:
|
||||||
con_scalefactor = vid.smalldup;
|
con_scalefactor = vid.smalldupx;
|
||||||
break;
|
break;
|
||||||
case V_MEDSCALEPATCH:
|
case V_MEDSCALEPATCH:
|
||||||
con_scalefactor = vid.meddup;
|
con_scalefactor = vid.meddupx;
|
||||||
break;
|
break;
|
||||||
default: // Full scaling
|
default: // Full scaling
|
||||||
con_scalefactor = vid.dup;
|
con_scalefactor = vid.dupx;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
con_recalc = false;
|
con_recalc = false;
|
||||||
@@ -599,7 +607,7 @@ static void CON_MoveConsole(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Not instant - Increment fracmovement fractionally
|
// Not instant - Increment fracmovement fractionally
|
||||||
fracmovement += FixedMul(cons_speed.value*vid.fdup, (cv_uncappedhud.value ? renderdeltatics : FRACUNIT));
|
fracmovement += FixedMul(cons_speed.value*vid.fdupy, (cv_uncappedhud.value ? renderdeltatics : FRACUNIT));
|
||||||
|
|
||||||
if (con_curlines < con_destlines) // Move the console downwards
|
if (con_curlines < con_destlines) // Move the console downwards
|
||||||
{
|
{
|
||||||
@@ -719,8 +727,7 @@ void CON_ToggleOff(void)
|
|||||||
con_curlines = 0;
|
con_curlines = 0;
|
||||||
CON_ClearHUD();
|
CON_ClearHUD();
|
||||||
con_forcepic = 0;
|
con_forcepic = 0;
|
||||||
|
con_clipviewtop = -1; // remove console clipping of view
|
||||||
I_SetTextInput(false);
|
|
||||||
|
|
||||||
Unlock_state();
|
Unlock_state();
|
||||||
}
|
}
|
||||||
@@ -761,24 +768,28 @@ void CON_Ticker(void)
|
|||||||
{
|
{
|
||||||
con_destlines = 0;
|
con_destlines = 0;
|
||||||
CON_ClearHUD();
|
CON_ClearHUD();
|
||||||
I_SetTextInput(false);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
CON_ChangeHeight();
|
CON_ChangeHeight();
|
||||||
I_SetTextInput(true);
|
}
|
||||||
}
|
|
||||||
|
// clip the view, so that the part under the console is not drawn
|
||||||
|
con_clipviewtop = -1;
|
||||||
|
if (cons_backpic.value) // clip only when using an opaque background
|
||||||
|
{
|
||||||
|
if (con_curlines > 0)
|
||||||
|
con_clipviewtop = con_curlines - viewwindowy - 1 - 10;
|
||||||
|
// NOTE: BIG HACK::SUBTRACT 10, SO THAT WATER DON'T COPY LINES OF THE CONSOLE
|
||||||
|
// WINDOW!!! (draw some more lines behind the bottom of the console)
|
||||||
|
if (con_clipviewtop < 0)
|
||||||
|
con_clipviewtop = -1; // maybe not necessary, provided it's < 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if console ready for prompt
|
// check if console ready for prompt
|
||||||
if (con_destlines >= minheight)
|
if (con_destlines >= minheight)
|
||||||
{
|
|
||||||
consoleready = true;
|
consoleready = true;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
consoleready = false;
|
consoleready = false;
|
||||||
}
|
|
||||||
|
|
||||||
// make overlay messages disappear after a while
|
// make overlay messages disappear after a while
|
||||||
for (i = 0; i < con_hudlines; i++)
|
for (i = 0; i < con_hudlines; i++)
|
||||||
@@ -1079,6 +1090,9 @@ static void CON_Linefeed(void)
|
|||||||
|
|
||||||
con_line = &con_buffer[(con_cy%con_totallines)*con_width];
|
con_line = &con_buffer[(con_cy%con_totallines)*con_width];
|
||||||
memset(con_line, ' ', con_width);
|
memset(con_line, ' ', con_width);
|
||||||
|
|
||||||
|
// make sure the view borders are refreshed if hud messages scroll
|
||||||
|
con_hudupdate = true; // see HU_Erase()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Outputs text into the console text buffer
|
// Outputs text into the console text buffer
|
||||||
@@ -1258,7 +1272,7 @@ void CONS_Alert(alerttype_t level, const char *fmt, ...)
|
|||||||
txt = malloc(8192);
|
txt = malloc(8192);
|
||||||
|
|
||||||
va_start(argptr, fmt);
|
va_start(argptr, fmt);
|
||||||
vsnprintf(txt, 8192, fmt, argptr);
|
vsprintf(txt, fmt, argptr);
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
|
|
||||||
switch (level)
|
switch (level)
|
||||||
@@ -1294,7 +1308,7 @@ void CONS_Debug(INT32 debugflags, const char *fmt, ...)
|
|||||||
txt = malloc(8192);
|
txt = malloc(8192);
|
||||||
|
|
||||||
va_start(argptr, fmt);
|
va_start(argptr, fmt);
|
||||||
vsnprintf(txt, 8192, fmt, argptr);
|
vsprintf(txt, fmt, argptr);
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
|
|
||||||
// Again I am lazy, oh well
|
// Again I am lazy, oh well
|
||||||
@@ -1465,6 +1479,9 @@ static void CON_DrawHudlines(void)
|
|||||||
//V_DrawCharacter(x, y, (p[c]&0xff) | cv_constextsize.value | V_NOSCALESTART, !cv_allcaps.value);
|
//V_DrawCharacter(x, y, (p[c]&0xff) | cv_constextsize.value | V_NOSCALESTART, !cv_allcaps.value);
|
||||||
y += charheight;
|
y += charheight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// top screen lines that might need clearing when view is reduced
|
||||||
|
con_clearlines = y; // this is handled by HU_Erase();
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw the console background, text, and prompt if enough place
|
// draw the console background, text, and prompt if enough place
|
||||||
@@ -1482,6 +1499,10 @@ static void CON_DrawConsole(void)
|
|||||||
if (con_curlines <= 0)
|
if (con_curlines <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
//FIXME: refresh borders only when console bg is translucent
|
||||||
|
con_clearlines = con_curlines; // clear console draw from view borders
|
||||||
|
con_hudupdate = true; // always refresh while console is on
|
||||||
|
|
||||||
// draw console background
|
// draw console background
|
||||||
if (cons_backpic.value || con_forcepic)
|
if (cons_backpic.value || con_forcepic)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -30,9 +30,14 @@ extern boolean con_recalc;
|
|||||||
|
|
||||||
extern boolean con_startup;
|
extern boolean con_startup;
|
||||||
|
|
||||||
|
// top clip value for view render: do not draw part of view hidden by console
|
||||||
|
extern INT32 con_clipviewtop;
|
||||||
|
|
||||||
// 0 means console if off, or moving out
|
// 0 means console if off, or moving out
|
||||||
extern INT32 con_destlines;
|
extern INT32 con_destlines;
|
||||||
|
|
||||||
|
extern INT32 con_clearlines; // lines of top of screen to refresh
|
||||||
|
extern boolean con_hudupdate; // hud messages have changed, need refresh
|
||||||
extern UINT32 con_scalefactor; // console text scale factor
|
extern UINT32 con_scalefactor; // console text scale factor
|
||||||
|
|
||||||
extern consvar_t cons_backcolor, cons_menuhighlight;
|
extern consvar_t cons_backcolor, cons_menuhighlight;
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// SONIC ROBO BLAST 2 KART
|
// BLANKART
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Copyright (C) 2024 by Ronald "Eidolon" Kinard
|
// Copyright (C) 2024 by Ronald "Eidolon" Kinard
|
||||||
// Copyright (C) 2024 by Kart Krew
|
// Copyright (C) 2024 by Kart Krew
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// SONIC ROBO BLAST 2 KART
|
// BLANKART
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Copyright (C) 2024 by Ronald "Eidolon" Kinard
|
// Copyright (C) 2024 by Ronald "Eidolon" Kinard
|
||||||
// Copyright (C) 2024 by Kart Krew
|
// Copyright (C) 2024 by Kart Krew
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// SONIC ROBO BLAST 2 KART
|
// BLANKART
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Copyright (C) 2024 by Ronald "Eidolon" Kinard
|
// Copyright (C) 2024 by Ronald "Eidolon" Kinard
|
||||||
// Copyright (C) 2024 by Kart Krew
|
// Copyright (C) 2024 by Kart Krew
|
||||||
|
|||||||
+137
-47
@@ -54,9 +54,11 @@
|
|||||||
#include "d_main.h"
|
#include "d_main.h"
|
||||||
#include "r_fps.h"
|
#include "r_fps.h"
|
||||||
|
|
||||||
|
#ifdef CLIENT_LOADINGSCREEN
|
||||||
// cl loading screen
|
// cl loading screen
|
||||||
#include "v_video.h"
|
#include "v_video.h"
|
||||||
#include "f_finale.h"
|
#include "f_finale.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_DISCORDRPC
|
#ifdef HAVE_DISCORDRPC
|
||||||
#include "discord.h"
|
#include "discord.h"
|
||||||
@@ -338,7 +340,7 @@ static void WriteNetXCmd(UINT8 *cmd, netxcmd_t id, const void *param, size_t npa
|
|||||||
|
|
||||||
void SendNetXCmdForPlayer(UINT8 playerid, netxcmd_t id, const void *param, size_t nparam)
|
void SendNetXCmdForPlayer(UINT8 playerid, netxcmd_t id, const void *param, size_t nparam)
|
||||||
{
|
{
|
||||||
if (textcmdbuf[playerid] != NULL || localtextcmd[playerid][0]+2+nparam > MAXTEXTCMD)
|
if (localtextcmd[playerid][0]+2+nparam > MAXTEXTCMD)
|
||||||
{
|
{
|
||||||
textcmdbuf_t *buf = textcmdbuf[playerid];
|
textcmdbuf_t *buf = textcmdbuf[playerid];
|
||||||
|
|
||||||
@@ -373,13 +375,17 @@ void SendNetXCmdForPlayer(UINT8 playerid, netxcmd_t id, const void *param, size_
|
|||||||
{
|
{
|
||||||
WriteNetXCmd(buf->cmd, id, param, nparam);
|
WriteNetXCmd(buf->cmd, id, param, nparam);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteNetXCmd(localtextcmd[playerid], id, param, nparam);
|
WriteNetXCmd(localtextcmd[playerid], id, param, nparam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*UINT8 GetFreeXCmdSize(UINT8 playerid)
|
||||||
|
{
|
||||||
|
// -1 for the size and another -1 for the ID.
|
||||||
|
return (UINT8)(localtextcmd[playerid][0] - 2);
|
||||||
|
}*/
|
||||||
|
|
||||||
// Frees all textcmd memory for the specified tic
|
// Frees all textcmd memory for the specified tic
|
||||||
static void D_FreeTextcmd(tic_t tic)
|
static void D_FreeTextcmd(tic_t tic)
|
||||||
{
|
{
|
||||||
@@ -418,8 +424,7 @@ static UINT8* D_GetExistingTextcmd(tic_t tic, INT32 playernum)
|
|||||||
if (textcmdtic)
|
if (textcmdtic)
|
||||||
{
|
{
|
||||||
UINT8 *cmd = textcmdtic->playercmds[playernum];
|
UINT8 *cmd = textcmdtic->playercmds[playernum];
|
||||||
if (cmd)
|
if (cmd) return cmd;
|
||||||
return cmd;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -457,7 +462,6 @@ static void ExtraDataTicker(void)
|
|||||||
INT32 i;
|
INT32 i;
|
||||||
|
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
{
|
|
||||||
if (playeringame[i] || i == 0)
|
if (playeringame[i] || i == 0)
|
||||||
{
|
{
|
||||||
UINT8 *bufferstart = D_GetExistingTextcmd(gametic, i);
|
UINT8 *bufferstart = D_GetExistingTextcmd(gametic, i);
|
||||||
@@ -472,7 +476,8 @@ static void ExtraDataTicker(void)
|
|||||||
{
|
{
|
||||||
if (*curpos < MAXNETXCMD && listnetxcmd[*curpos])
|
if (*curpos < MAXNETXCMD && listnetxcmd[*curpos])
|
||||||
{
|
{
|
||||||
const UINT8 id = *curpos++;
|
const UINT8 id = *curpos;
|
||||||
|
curpos++;
|
||||||
DEBFILE(va("executing x_cmd %s ply %u ", netxcmdnames[id - 1], i));
|
DEBFILE(va("executing x_cmd %s ply %u ", netxcmdnames[id - 1], i));
|
||||||
(listnetxcmd[id])(&curpos, i);
|
(listnetxcmd[id])(&curpos, i);
|
||||||
DEBFILE("done\n");
|
DEBFILE("done\n");
|
||||||
@@ -484,14 +489,12 @@ static void ExtraDataTicker(void)
|
|||||||
SendKick(i, KICK_MSG_CON_FAIL);
|
SendKick(i, KICK_MSG_CON_FAIL);
|
||||||
DEBFILE(va("player %d kicked [gametic=%u] reason as follows:\n", i, gametic));
|
DEBFILE(va("player %d kicked [gametic=%u] reason as follows:\n", i, gametic));
|
||||||
}
|
}
|
||||||
|
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Got unknown net command [%s]=%d (max %d)\n"), sizeu1(curpos - bufferstart), *curpos, bufferstart[0]);
|
CONS_Alert(CONS_WARNING, M_GetText("Got unknown net command [%s]=%d (max %d)\n"), sizeu1(curpos - bufferstart), *curpos, bufferstart[0]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// If you are a client, you can safely forget the net commands for this tic
|
// If you are a client, you can safely forget the net commands for this tic
|
||||||
// If you are the server, you need to remember them until every client has been aknowledged,
|
// If you are the server, you need to remember them until every client has been aknowledged,
|
||||||
@@ -1101,6 +1104,10 @@ static void SV_AcknowledgeResynchAck(INT32 node, UINT8 rsg)
|
|||||||
|
|
||||||
static INT16 Consistancy(void);
|
static INT16 Consistancy(void);
|
||||||
|
|
||||||
|
#ifndef NONET
|
||||||
|
#define JOININGAME
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
CL_SEARCHING,
|
CL_SEARCHING,
|
||||||
@@ -1110,7 +1117,9 @@ typedef enum
|
|||||||
CL_LOADFILES,
|
CL_LOADFILES,
|
||||||
CL_SETUPFILES,
|
CL_SETUPFILES,
|
||||||
CL_WAITJOINRESPONSE,
|
CL_WAITJOINRESPONSE,
|
||||||
|
#ifdef JOININGAME
|
||||||
CL_DOWNLOADSAVEGAME,
|
CL_DOWNLOADSAVEGAME,
|
||||||
|
#endif
|
||||||
CL_CONNECTED,
|
CL_CONNECTED,
|
||||||
CL_ABORTED,
|
CL_ABORTED,
|
||||||
CL_VIEWSERVER,
|
CL_VIEWSERVER,
|
||||||
@@ -1162,6 +1171,8 @@ static void CV_LoadPlayerNames(UINT8 **p)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CLIENT_LOADINGSCREEN
|
||||||
|
|
||||||
//
|
//
|
||||||
// CL_DrawConnectionStatus
|
// CL_DrawConnectionStatus
|
||||||
//
|
//
|
||||||
@@ -1199,6 +1210,7 @@ static inline void CL_DrawConnectionStatus(void)
|
|||||||
|
|
||||||
switch (cl_mode)
|
switch (cl_mode)
|
||||||
{
|
{
|
||||||
|
#ifdef JOININGAME
|
||||||
case CL_DOWNLOADSAVEGAME:
|
case CL_DOWNLOADSAVEGAME:
|
||||||
if (filedownload.current != -1)
|
if (filedownload.current != -1)
|
||||||
{
|
{
|
||||||
@@ -1224,6 +1236,7 @@ static inline void CL_DrawConnectionStatus(void)
|
|||||||
else
|
else
|
||||||
cltext = M_GetText("Waiting to download game state...");
|
cltext = M_GetText("Waiting to download game state...");
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
case CL_ASKFULLFILELIST:
|
case CL_ASKFULLFILELIST:
|
||||||
case CL_CONFIRMCONNECT:
|
case CL_CONFIRMCONNECT:
|
||||||
case CL_LEGACYREQUESTFAILED:
|
case CL_LEGACYREQUESTFAILED:
|
||||||
@@ -1496,6 +1509,7 @@ static inline void CL_DrawConnectionStatus(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static boolean CL_AskFileList(INT32 firstfile)
|
static boolean CL_AskFileList(INT32 firstfile)
|
||||||
{
|
{
|
||||||
@@ -1503,7 +1517,7 @@ static boolean CL_AskFileList(INT32 firstfile)
|
|||||||
netbuffer->packettype = PT_TELLFILESNEEDED;
|
netbuffer->packettype = PT_TELLFILESNEEDED;
|
||||||
netbuffer->u.filesneedednum = firstfile;
|
netbuffer->u.filesneedednum = firstfile;
|
||||||
|
|
||||||
return HSendPacket(servernode, false, 0, sizeof(INT32));
|
return HSendPacket(servernode, false, 0, sizeof (INT32));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sends a special packet to declare how many players in local
|
/** Sends a special packet to declare how many players in local
|
||||||
@@ -1863,6 +1877,7 @@ static boolean SV_SendServerConfig(INT32 node)
|
|||||||
return waspacketsent;
|
return waspacketsent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef JOININGAME
|
||||||
#define SAVEGAMESIZE (768*1024)
|
#define SAVEGAMESIZE (768*1024)
|
||||||
|
|
||||||
#ifdef SATURNPAK
|
#ifdef SATURNPAK
|
||||||
@@ -1885,7 +1900,7 @@ static void SV_SendSaveGame(INT32 node, boolean resending)
|
|||||||
UINT8 *buffertosend;
|
UINT8 *buffertosend;
|
||||||
|
|
||||||
// first save it in a malloced buffer
|
// first save it in a malloced buffer
|
||||||
save.buffer = (UINT8 *)Z_Malloc(SAVEGAMESIZE, PU_STATIC, NULL);
|
save.buffer = (UINT8 *)malloc(SAVEGAMESIZE);
|
||||||
if (!save.buffer)
|
if (!save.buffer)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_ERROR, M_GetText("No more free memory for savegame\n"));
|
CONS_Alert(CONS_ERROR, M_GetText("No more free memory for savegame\n"));
|
||||||
@@ -1900,7 +1915,7 @@ static void SV_SendSaveGame(INT32 node, boolean resending)
|
|||||||
length = save.p - save.buffer;
|
length = save.p - save.buffer;
|
||||||
if (length > SAVEGAMESIZE)
|
if (length > SAVEGAMESIZE)
|
||||||
{
|
{
|
||||||
Z_Free(save.buffer);
|
free(save.buffer);
|
||||||
save.p = NULL;
|
save.p = NULL;
|
||||||
I_Error("Savegame buffer overrun");
|
I_Error("Savegame buffer overrun");
|
||||||
}
|
}
|
||||||
@@ -1918,7 +1933,8 @@ static void SV_SendSaveGame(INT32 node, boolean resending)
|
|||||||
if ((compressedlen = lzf_compress(save.buffer + sizeof(UINT32), length - sizeof(UINT32), compressedsave + sizeof(UINT32), length - sizeof(UINT32) - 1)))
|
if ((compressedlen = lzf_compress(save.buffer + sizeof(UINT32), length - sizeof(UINT32), compressedsave + sizeof(UINT32), length - sizeof(UINT32) - 1)))
|
||||||
{
|
{
|
||||||
// Compressing succeeded; send compressed data
|
// Compressing succeeded; send compressed data
|
||||||
Z_Free(save.buffer);
|
|
||||||
|
free(save.buffer);
|
||||||
|
|
||||||
// State that we're compressed.
|
// State that we're compressed.
|
||||||
buffertosend = compressedsave;
|
buffertosend = compressedsave;
|
||||||
@@ -1959,7 +1975,7 @@ static void SV_SavedGame(void)
|
|||||||
sprintf(tmpsave, "%s" PATHSEP TMPSAVENAME, srb2home);
|
sprintf(tmpsave, "%s" PATHSEP TMPSAVENAME, srb2home);
|
||||||
|
|
||||||
// first save it in a malloced buffer
|
// first save it in a malloced buffer
|
||||||
save.p = save.buffer = (UINT8 *)Z_Malloc(SAVEGAMESIZE, PU_STATIC, NULL);
|
save.p = save.buffer = (UINT8 *)malloc(SAVEGAMESIZE);
|
||||||
if (!save.p)
|
if (!save.p)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_ERROR, M_GetText("No more free memory for savegame\n"));
|
CONS_Alert(CONS_ERROR, M_GetText("No more free memory for savegame\n"));
|
||||||
@@ -1971,7 +1987,7 @@ static void SV_SavedGame(void)
|
|||||||
length = save.p - save.buffer;
|
length = save.p - save.buffer;
|
||||||
if (length > SAVEGAMESIZE)
|
if (length > SAVEGAMESIZE)
|
||||||
{
|
{
|
||||||
Z_Free(save.buffer);
|
free(save.buffer);
|
||||||
save.p = NULL;
|
save.p = NULL;
|
||||||
I_Error("Savegame buffer overrun");
|
I_Error("Savegame buffer overrun");
|
||||||
}
|
}
|
||||||
@@ -1980,7 +1996,7 @@ static void SV_SavedGame(void)
|
|||||||
if (!FIL_WriteFile(tmpsave, save.buffer, length))
|
if (!FIL_WriteFile(tmpsave, save.buffer, length))
|
||||||
CONS_Printf(M_GetText("Didn't save %s for netgame"), tmpsave);
|
CONS_Printf(M_GetText("Didn't save %s for netgame"), tmpsave);
|
||||||
|
|
||||||
Z_Free(save.buffer);
|
free(save.buffer);
|
||||||
save.p = NULL;
|
save.p = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2095,7 +2111,9 @@ static void CL_ReloadReceivedSavegame(void)
|
|||||||
CONS_Printf(M_GetText("Game state reloaded\n"));
|
CONS_Printf(M_GetText("Game state reloaded\n"));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef NONET
|
||||||
static void SendAskInfo(INT32 node)
|
static void SendAskInfo(INT32 node)
|
||||||
{
|
{
|
||||||
tic_t asktime;
|
tic_t asktime;
|
||||||
@@ -2269,6 +2287,7 @@ void CL_TimeoutServerList(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // ifndef NONET
|
||||||
|
|
||||||
static void CL_ConfirmConnect(void)
|
static void CL_ConfirmConnect(void)
|
||||||
{
|
{
|
||||||
@@ -2299,6 +2318,7 @@ static void CL_ConfirmConnect(void)
|
|||||||
|
|
||||||
static void M_ConfirmConnect(event_t *ev)
|
static void M_ConfirmConnect(event_t *ev)
|
||||||
{
|
{
|
||||||
|
#ifndef NONET
|
||||||
if (ev->type == ev_keydown)
|
if (ev->type == ev_keydown)
|
||||||
{
|
{
|
||||||
if (ev->data1 == ' ' || ev->data1 == 'y' || ev->data1 == KEY_ENTER || ev->data1 == gamecontrol[0][gc_accelerate][0] || ev->data1 == gamecontrol[0][gc_accelerate][1])
|
if (ev->data1 == ' ' || ev->data1 == 'y' || ev->data1 == KEY_ENTER || ev->data1 == gamecontrol[0][gc_accelerate][0] || ev->data1 == gamecontrol[0][gc_accelerate][1])
|
||||||
@@ -2313,6 +2333,9 @@ static void M_ConfirmConnect(event_t *ev)
|
|||||||
M_ClearMenus(true);
|
M_ClearMenus(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
(void)ev;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void CL_AbortConnection(void)
|
void CL_AbortConnection(void)
|
||||||
@@ -2407,25 +2430,29 @@ static boolean CL_FinishedFileList(void)
|
|||||||
if (!filedownload.http_failed)
|
if (!filedownload.http_failed)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
#ifndef NONET
|
||||||
filedownload.completednum = 0;
|
filedownload.completednum = 0;
|
||||||
filedownload.completedsize = 0;
|
filedownload.completedsize = 0;
|
||||||
|
|
||||||
filedownload.totalnum = 0;
|
filedownload.totalnum = 0;
|
||||||
filedownload.totalsize = 0;
|
filedownload.totalsize = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
for (i = 0; i < fileneedednum; i++)
|
for (i = 0; i < fileneedednum; i++)
|
||||||
{
|
|
||||||
if (fileneeded[i].status == FS_NOTFOUND || fileneeded[i].status == FS_MD5SUMBAD)
|
if (fileneeded[i].status == FS_NOTFOUND || fileneeded[i].status == FS_MD5SUMBAD)
|
||||||
{
|
{
|
||||||
|
#ifndef NONET
|
||||||
filedownload.totalnum++;
|
filedownload.totalnum++;
|
||||||
filedownload.totalsize += fileneeded[i].totalsize;
|
filedownload.totalsize += fileneeded[i].totalsize;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
#ifndef NONET
|
||||||
if (filedownload.totalsize>>20 >= 10)
|
if (filedownload.totalsize>>20 >= 10)
|
||||||
downloadsize = Z_StrDup(va("%uM",filedownload.totalsize>>20));
|
downloadsize = Z_StrDup(va("%uM",filedownload.totalsize>>20));
|
||||||
else
|
else
|
||||||
downloadsize = Z_StrDup(va("%uK",filedownload.totalsize>>10));
|
downloadsize = Z_StrDup(va("%uK",filedownload.totalsize>>10));
|
||||||
|
#endif
|
||||||
|
|
||||||
if (cv_showdownloadprompt.value)
|
if (cv_showdownloadprompt.value)
|
||||||
{
|
{
|
||||||
@@ -2479,6 +2506,7 @@ static boolean CL_FinishedFileList(void)
|
|||||||
*/
|
*/
|
||||||
static boolean CL_ServerConnectionSearchTicker(tic_t *asksent)
|
static boolean CL_ServerConnectionSearchTicker(tic_t *asksent)
|
||||||
{
|
{
|
||||||
|
#ifndef NONET
|
||||||
INT32 i;
|
INT32 i;
|
||||||
|
|
||||||
// serverlist is updated by GetPacket function
|
// serverlist is updated by GetPacket function
|
||||||
@@ -2497,7 +2525,6 @@ static boolean CL_ServerConnectionSearchTicker(tic_t *asksent)
|
|||||||
if (i < 0)
|
if (i < 0)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
joinnode = i;
|
joinnode = i;
|
||||||
|
|
||||||
// Quit here rather than downloading files and being refused later.
|
// Quit here rather than downloading files and being refused later.
|
||||||
@@ -2518,7 +2545,6 @@ static boolean CL_ServerConnectionSearchTicker(tic_t *asksent)
|
|||||||
CONS_Printf("We received a http url from the server, however it will not be used as this build lacks curl support (%s)\n", serverlist[i].info.httpsource);
|
CONS_Printf("We received a http url from the server, however it will not be used as this build lacks curl support (%s)\n", serverlist[i].info.httpsource);
|
||||||
#endif
|
#endif
|
||||||
D_ParseFileneeded(serverlist[i].info.fileneedednum, serverlist[i].info.fileneeded, 0);
|
D_ParseFileneeded(serverlist[i].info.fileneedednum, serverlist[i].info.fileneeded, 0);
|
||||||
|
|
||||||
if (serverlist[i].info.kartvars & SV_LOTSOFADDONS)
|
if (serverlist[i].info.kartvars & SV_LOTSOFADDONS)
|
||||||
{
|
{
|
||||||
cl_mode = CL_ASKFULLFILELIST;
|
cl_mode = CL_ASKFULLFILELIST;
|
||||||
@@ -2543,6 +2569,11 @@ static boolean CL_ServerConnectionSearchTicker(tic_t *asksent)
|
|||||||
SendAskInfo(servernode);
|
SendAskInfo(servernode);
|
||||||
*asksent = I_GetTime() + NEWTICRATE;
|
*asksent = I_GetTime() + NEWTICRATE;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
(void)asksent;
|
||||||
|
// No netgames, so we skip this state.
|
||||||
|
cl_mode = CL_ASKJOIN;
|
||||||
|
#endif // ifndef NONET/else
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -2562,6 +2593,10 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
|
|||||||
boolean waitmore;
|
boolean waitmore;
|
||||||
INT32 i;
|
INT32 i;
|
||||||
|
|
||||||
|
#ifdef NONET
|
||||||
|
(void)tmpsave;
|
||||||
|
#endif
|
||||||
|
|
||||||
switch (cl_mode)
|
switch (cl_mode)
|
||||||
{
|
{
|
||||||
case CL_SEARCHING:
|
case CL_SEARCHING:
|
||||||
@@ -2680,12 +2715,12 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
|
|||||||
), NULL, MM_NOTHING);
|
), NULL, MM_NOTHING);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#ifdef JOININGAME
|
||||||
// prepare structures to save the file
|
// prepare structures to save the file
|
||||||
// WARNING: this can be useless in case of server not in GS_LEVEL
|
// WARNING: this can be useless in case of server not in GS_LEVEL
|
||||||
// but since the network layer doesn't provide ordered packets...
|
// but since the network layer doesn't provide ordered packets...
|
||||||
CL_PrepareDownloadSaveGame(tmpsave);
|
CL_PrepareDownloadSaveGame(tmpsave);
|
||||||
|
#endif
|
||||||
if (I_GetTime() >= *asksent && CL_SendJoin())
|
if (I_GetTime() >= *asksent && CL_SendJoin())
|
||||||
{
|
{
|
||||||
*asksent = I_GetTime() + NEWTICRATE*3;
|
*asksent = I_GetTime() + NEWTICRATE*3;
|
||||||
@@ -2698,6 +2733,7 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
|
|||||||
cl_mode = CL_ASKJOIN;
|
cl_mode = CL_ASKJOIN;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#ifdef JOININGAME
|
||||||
case CL_DOWNLOADSAVEGAME:
|
case CL_DOWNLOADSAVEGAME:
|
||||||
// At this state, the first (and only) needed file is the gamestate
|
// At this state, the first (and only) needed file is the gamestate
|
||||||
if (fileneeded[0].status == FS_FOUND)
|
if (fileneeded[0].status == FS_FOUND)
|
||||||
@@ -2709,6 +2745,7 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
|
|||||||
} // don't break case continue to CL_CONNECTED
|
} // don't break case continue to CL_CONNECTED
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
case CL_CONNECTED:
|
case CL_CONNECTED:
|
||||||
case CL_CONFIRMCONNECT: //logic is handled by M_ConfirmConnect
|
case CL_CONFIRMCONNECT: //logic is handled by M_ConfirmConnect
|
||||||
default:
|
default:
|
||||||
@@ -2771,6 +2808,7 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
|
|||||||
}
|
}
|
||||||
*oldtic = I_GetTime();
|
*oldtic = I_GetTime();
|
||||||
|
|
||||||
|
#ifdef CLIENT_LOADINGSCREEN
|
||||||
if (client && cl_mode != CL_CONNECTED && cl_mode != CL_ABORTED)
|
if (client && cl_mode != CL_CONNECTED && cl_mode != CL_ABORTED)
|
||||||
{
|
{
|
||||||
F_TitleScreenTicker(true);
|
F_TitleScreenTicker(true);
|
||||||
@@ -2787,6 +2825,10 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
|
|||||||
if (moviemode)
|
if (moviemode)
|
||||||
M_SaveFrame();
|
M_SaveFrame();
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
CON_Drawer();
|
||||||
|
I_UpdateNoVsync();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -2806,17 +2848,26 @@ static void CL_ConnectToServer(void)
|
|||||||
{
|
{
|
||||||
INT32 pnumnodes, nodewaited = doomcom->numnodes, i;
|
INT32 pnumnodes, nodewaited = doomcom->numnodes, i;
|
||||||
tic_t oldtic;
|
tic_t oldtic;
|
||||||
|
#ifndef NONET
|
||||||
tic_t asksent;
|
tic_t asksent;
|
||||||
|
#endif
|
||||||
|
#ifdef JOININGAME
|
||||||
char tmpsave[264];
|
char tmpsave[264];
|
||||||
|
|
||||||
sprintf(tmpsave, "%s" PATHSEP TMPSAVENAME, srb2home);
|
sprintf(tmpsave, "%s" PATHSEP TMPSAVENAME, srb2home);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CLIENT_LOADINGSCREEN
|
||||||
filedownload.current = -1;
|
filedownload.current = -1;
|
||||||
|
#endif
|
||||||
|
|
||||||
cl_mode = CL_SEARCHING;
|
cl_mode = CL_SEARCHING;
|
||||||
|
|
||||||
|
#ifdef JOININGAME
|
||||||
// Don't get a corrupt savegame error because tmpsave already exists
|
// Don't get a corrupt savegame error because tmpsave already exists
|
||||||
if (FIL_FileExists(tmpsave) && unlink(tmpsave) == -1)
|
if (FIL_FileExists(tmpsave) && unlink(tmpsave) == -1)
|
||||||
I_Error("Can't delete %s\n", tmpsave);
|
I_Error("Can't delete %s\n", tmpsave);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (netgame)
|
if (netgame)
|
||||||
{
|
{
|
||||||
@@ -2838,6 +2889,7 @@ static void CL_ConnectToServer(void)
|
|||||||
ClearAdminPlayers();
|
ClearAdminPlayers();
|
||||||
pnumnodes = 1;
|
pnumnodes = 1;
|
||||||
oldtic = 0;
|
oldtic = 0;
|
||||||
|
#ifndef NONET
|
||||||
asksent = 0;
|
asksent = 0;
|
||||||
firstconnectattempttime = I_GetTime();
|
firstconnectattempttime = I_GetTime();
|
||||||
|
|
||||||
@@ -2870,11 +2922,16 @@ static void CL_ConnectToServer(void)
|
|||||||
map_icon_read = 0;
|
map_icon_read = 0;
|
||||||
map_icon_missing = 0xffffffff;
|
map_icon_missing = 0xffffffff;
|
||||||
map_icon_last_request = I_GetTime();
|
map_icon_last_request = I_GetTime();
|
||||||
|
#endif
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
// If the connection was aborted for some reason, leave
|
// If the connection was aborted for some reason, leave
|
||||||
|
#ifndef NONET
|
||||||
if (!CL_ServerConnectionTicker(tmpsave, &oldtic, &asksent))
|
if (!CL_ServerConnectionTicker(tmpsave, &oldtic, &asksent))
|
||||||
|
#else
|
||||||
|
if (!CL_ServerConnectionTicker((char*)NULL, &oldtic, (tic_t *)NULL))
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
if (P_PartialAddGetStage() >= 0)
|
if (P_PartialAddGetStage() >= 0)
|
||||||
P_MultiSetupWadFiles(true); // in case any partial adds were done
|
P_MultiSetupWadFiles(true); // in case any partial adds were done
|
||||||
@@ -2891,14 +2948,16 @@ static void CL_ConnectToServer(void)
|
|||||||
}
|
}
|
||||||
while (!(cl_mode == CL_CONNECTED && (client || (server && nodewaited <= pnumnodes))));
|
while (!(cl_mode == CL_CONNECTED && (client || (server && nodewaited <= pnumnodes))));
|
||||||
|
|
||||||
|
#ifndef NONET
|
||||||
if (netgame)
|
if (netgame)
|
||||||
F_StartWaitingPlayers();
|
F_StartWaitingPlayers();
|
||||||
|
#endif
|
||||||
DEBFILE(va("Synchronisation Finished\n"));
|
DEBFILE(va("Synchronisation Finished\n"));
|
||||||
|
|
||||||
displayplayers[0] = consoleplayer;
|
displayplayers[0] = consoleplayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NONET
|
||||||
static void Command_ShowBan(void) //Print out ban list
|
static void Command_ShowBan(void) //Print out ban list
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
@@ -3284,6 +3343,8 @@ static void Command_Packetstat(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
static void ResetNode(INT32 node);
|
static void ResetNode(INT32 node);
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -3415,8 +3476,10 @@ void CL_Reset(void)
|
|||||||
memset(fileneeded, 0, sizeof(fileneeded));
|
memset(fileneeded, 0, sizeof(fileneeded));
|
||||||
memset(packetstat, 0, sizeof(packetstat));
|
memset(packetstat, 0, sizeof(packetstat));
|
||||||
|
|
||||||
|
#ifndef NONET
|
||||||
filedownload.totalnum = 0;
|
filedownload.totalnum = 0;
|
||||||
filedownload.totalsize = 0;
|
filedownload.totalsize = 0;
|
||||||
|
#endif
|
||||||
firstconnectattempttime = 0;
|
firstconnectattempttime = 0;
|
||||||
serverisfull = false;
|
serverisfull = false;
|
||||||
connectiontimeout = (tic_t)cv_nettimeout.value; //reset this temporary hack
|
connectiontimeout = (tic_t)cv_nettimeout.value; //reset this temporary hack
|
||||||
@@ -3434,6 +3497,7 @@ void CL_Reset(void)
|
|||||||
// D_StartTitle should get done now, but the calling function will handle it
|
// D_StartTitle should get done now, but the calling function will handle it
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NONET
|
||||||
static void Command_GetPlayerNum(void)
|
static void Command_GetPlayerNum(void)
|
||||||
{
|
{
|
||||||
INT32 i;
|
INT32 i;
|
||||||
@@ -3760,6 +3824,7 @@ static void Command_Kick(void)
|
|||||||
else
|
else
|
||||||
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
|
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void Got_KickCmd(UINT8 **p, INT32 playernum)
|
static void Got_KickCmd(UINT8 **p, INT32 playernum)
|
||||||
{
|
{
|
||||||
@@ -4117,6 +4182,10 @@ consvar_t cv_allownewplayer = {"allowjoin", "On", CV_SAVE|CV_CALL, CV_OnOff, Joi
|
|||||||
consvar_t cv_allownewsaturnplayer = {"allowsaturnjoin", "On", CV_HIDEN, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_allownewsaturnplayer = {"allowsaturnjoin", "On", CV_HIDEN, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef VANILLAJOINNEXTROUND
|
||||||
|
consvar_t cv_joinnextround = {"joinnextround", "Off", CV_SAVE|CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; /// \todo not done
|
||||||
|
#endif
|
||||||
|
|
||||||
static CV_PossibleValue_t maxplayers_cons_t[] = {{2, "MIN"}, {MAXPLAYERS, "MAX"}, {0, NULL}};
|
static CV_PossibleValue_t maxplayers_cons_t[] = {{2, "MIN"}, {MAXPLAYERS, "MAX"}, {0, NULL}};
|
||||||
consvar_t cv_maxplayers = {"maxplayers", "8", CV_SAVE|CV_CALL, maxplayers_cons_t, Joinable_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_maxplayers = {"maxplayers", "8", CV_SAVE|CV_CALL, maxplayers_cons_t, Joinable_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
@@ -4161,10 +4230,7 @@ static void Joinable_OnChange(void)
|
|||||||
UINT8 maxplayer;
|
UINT8 maxplayer;
|
||||||
|
|
||||||
if (!server)
|
if (!server)
|
||||||
{
|
|
||||||
CONS_Alert(CONS_NOTICE, ("Only the server can change: %s %s\n"), cv_allownewplayer.name, cv_allownewplayer.string);
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef SATURNJOIN
|
#ifdef SATURNJOIN
|
||||||
// disabling joins should also disable saturn joins unless its called with CV_StealthSet and vice versa to make life a bit easier
|
// disabling joins should also disable saturn joins unless its called with CV_StealthSet and vice versa to make life a bit easier
|
||||||
@@ -4186,6 +4252,7 @@ void D_ClientServerInit(void)
|
|||||||
DEBFILE(va("- - -== SRB2Kart v%d.%d "VERSIONSTRING" debugfile ==- - -\n",
|
DEBFILE(va("- - -== SRB2Kart v%d.%d "VERSIONSTRING" debugfile ==- - -\n",
|
||||||
VERSION, SUBVERSION));
|
VERSION, SUBVERSION));
|
||||||
|
|
||||||
|
#ifndef NONET
|
||||||
COM_AddCommand("getplayernum", Command_GetPlayerNum);
|
COM_AddCommand("getplayernum", Command_GetPlayerNum);
|
||||||
COM_AddCommand("kick", Command_Kick);
|
COM_AddCommand("kick", Command_Kick);
|
||||||
COM_AddCommand("ban", Command_Ban);
|
COM_AddCommand("ban", Command_Ban);
|
||||||
@@ -4211,13 +4278,17 @@ void D_ClientServerInit(void)
|
|||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
COM_AddCommand("numnodes", Command_Numnodes);
|
COM_AddCommand("numnodes", Command_Numnodes);
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
RegisterNetXCmd(XD_KICK, Got_KickCmd);
|
RegisterNetXCmd(XD_KICK, Got_KickCmd);
|
||||||
RegisterNetXCmd(XD_ADDPLAYER, Got_AddPlayer);
|
RegisterNetXCmd(XD_ADDPLAYER, Got_AddPlayer);
|
||||||
RegisterNetXCmd(XD_REMOVEPLAYER, Got_RemovePlayer);
|
RegisterNetXCmd(XD_REMOVEPLAYER, Got_RemovePlayer);
|
||||||
|
#ifndef NONET
|
||||||
#ifdef DUMPCONSISTENCY
|
#ifdef DUMPCONSISTENCY
|
||||||
CV_RegisterVar(&cv_dumpconsistency);
|
CV_RegisterVar(&cv_dumpconsistency);
|
||||||
#endif
|
#endif
|
||||||
D_LoadBan(false);
|
D_LoadBan(false);
|
||||||
|
#endif
|
||||||
|
|
||||||
gametic = 0;
|
gametic = 0;
|
||||||
localgametic = 0;
|
localgametic = 0;
|
||||||
@@ -4812,17 +4883,18 @@ static void HandleConnect(SINT8 node)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#ifndef NONET
|
||||||
boolean newnode = false;
|
boolean newnode = false;
|
||||||
|
#endif
|
||||||
// client authorised to join
|
// client authorised to join
|
||||||
nodewaiting[node] = (UINT8)(netbuffer->u.clientcfg.localplayers - playerpernode[node]);
|
nodewaiting[node] = (UINT8)(netbuffer->u.clientcfg.localplayers - playerpernode[node]);
|
||||||
|
|
||||||
if (!nodeingame[node])
|
if (!nodeingame[node])
|
||||||
{
|
{
|
||||||
gamestate_t backupstate = gamestate;
|
gamestate_t backupstate = gamestate;
|
||||||
|
#ifndef NONET
|
||||||
newnode = true;
|
newnode = true;
|
||||||
|
#endif
|
||||||
SV_AddNode(node);
|
SV_AddNode(node);
|
||||||
|
|
||||||
/// \note Wait what???
|
/// \note Wait what???
|
||||||
@@ -4831,6 +4903,10 @@ static void HandleConnect(SINT8 node)
|
|||||||
// you get a free second before desynch checks. use it wisely.
|
// you get a free second before desynch checks. use it wisely.
|
||||||
SV_InitResynchVars(node);
|
SV_InitResynchVars(node);
|
||||||
|
|
||||||
|
#ifdef VANILLAJOINNEXTROUND
|
||||||
|
if (cv_joinnextround.value && gameaction == ga_nothing)
|
||||||
|
G_SetGamestate(GS_WAITINGPLAYERS);
|
||||||
|
#endif
|
||||||
if (!SV_SendServerConfig(node))
|
if (!SV_SendServerConfig(node))
|
||||||
{
|
{
|
||||||
G_SetGamestate(backupstate);
|
G_SetGamestate(backupstate);
|
||||||
@@ -4848,6 +4924,7 @@ static void HandleConnect(SINT8 node)
|
|||||||
DEBFILE("new node joined\n");
|
DEBFILE("new node joined\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef JOININGAME
|
||||||
if (nodewaiting[node])
|
if (nodewaiting[node])
|
||||||
{
|
{
|
||||||
if (node && newnode)
|
if (node && newnode)
|
||||||
@@ -4858,6 +4935,12 @@ static void HandleConnect(SINT8 node)
|
|||||||
|
|
||||||
SV_AddWaitingPlayers();
|
SV_AddWaitingPlayers();
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#ifndef NONET
|
||||||
|
// I guess we have no use for this if we aren't doing mid-level joins?
|
||||||
|
(void)newnode;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4889,6 +4972,7 @@ static void HandleTimeout(SINT8 node)
|
|||||||
M_StartMessage(M_GetText("Server Timeout\n\nPress Esc\n"), NULL, MM_NOTHING);
|
M_StartMessage(M_GetText("Server Timeout\n\nPress Esc\n"), NULL, MM_NOTHING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NONET
|
||||||
/** Called when a PT_SERVERINFO packet is received
|
/** Called when a PT_SERVERINFO packet is received
|
||||||
*
|
*
|
||||||
* \param node The packet sender
|
* \param node The packet sender
|
||||||
@@ -5197,8 +5281,11 @@ static void PT_ServerCFG(SINT8 node)
|
|||||||
playernode[(UINT8)serverplayer] = servernode;
|
playernode[(UINT8)serverplayer] = servernode;
|
||||||
|
|
||||||
if (netgame)
|
if (netgame)
|
||||||
|
#ifdef JOININGAME
|
||||||
CONS_Printf(M_GetText("Join accepted, waiting for complete game state...\n"));
|
CONS_Printf(M_GetText("Join accepted, waiting for complete game state...\n"));
|
||||||
|
#else
|
||||||
|
CONS_Printf(M_GetText("Join accepted, waiting for next level change...\n"));
|
||||||
|
#endif
|
||||||
DEBFILE(va("Server accept join gametic=%u mynode=%d\n", gametic, mynode));
|
DEBFILE(va("Server accept join gametic=%u mynode=%d\n", gametic, mynode));
|
||||||
|
|
||||||
#ifdef SATURNPAK
|
#ifdef SATURNPAK
|
||||||
@@ -5221,13 +5308,16 @@ static void PT_ServerCFG(SINT8 node)
|
|||||||
scp = netbuffer->u.servercfg.varlengthinputs;
|
scp = netbuffer->u.servercfg.varlengthinputs;
|
||||||
CV_LoadPlayerNames(&scp);
|
CV_LoadPlayerNames(&scp);
|
||||||
CV_LoadNetVars(&scp);
|
CV_LoadNetVars(&scp);
|
||||||
|
#ifdef JOININGAME
|
||||||
/// \note Wait. What if a Lua script uses some global custom variables synched with the NetVars hook?
|
/// \note Wait. What if a Lua script uses some global custom variables synched with the NetVars hook?
|
||||||
/// Shouldn't them be downloaded even at intermission time?
|
/// Shouldn't them be downloaded even at intermission time?
|
||||||
/// Also, according to HandleConnect, the server will send the savegame even during intermission...
|
/// Also, according to HandleConnect, the server will send the savegame even during intermission...
|
||||||
/// Sryder 2018-07-05: If we don't want to send the player config another way we need to send the gamestate
|
/// Sryder 2018-07-05: If we don't want to send the player config another way we need to send the gamestate
|
||||||
/// At almost any gamestate there could be joiners... So just always send gamestate?
|
/// At almost any gamestate there could be joiners... So just always send gamestate?
|
||||||
cl_mode = ((server) ? CL_CONNECTED : CL_DOWNLOADSAVEGAME);
|
cl_mode = ((server) ? CL_CONNECTED : CL_DOWNLOADSAVEGAME);
|
||||||
|
#else
|
||||||
|
cl_mode = CL_CONNECTED;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PT_FileFragmentFromAwayNode(SINT8 node)
|
static void PT_FileFragmentFromAwayNode(SINT8 node)
|
||||||
@@ -5255,6 +5345,8 @@ static void PT_RequestFile(SINT8 node)
|
|||||||
Net_CloseConnection(node); // nope
|
Net_CloseConnection(node); // nope
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef SATURNPAK
|
#ifdef SATURNPAK
|
||||||
static void PT_WillResendGamestate(void)
|
static void PT_WillResendGamestate(void)
|
||||||
{
|
{
|
||||||
@@ -5392,8 +5484,11 @@ static void PT_ClientCmd(INT32 netconsole, SINT8 node)
|
|||||||
{
|
{
|
||||||
tic_t realend, realstart;
|
tic_t realend, realstart;
|
||||||
|
|
||||||
|
if (client)
|
||||||
|
return;
|
||||||
|
|
||||||
// Ignore tics from those not synched
|
// Ignore tics from those not synched
|
||||||
if (client || resynch_inprogress[node])
|
if (resynch_inprogress[node])
|
||||||
return;
|
return;
|
||||||
|
|
||||||
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
|
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
|
||||||
@@ -5549,8 +5644,7 @@ static void PT_ClientCmd(INT32 netconsole, SINT8 node)
|
|||||||
--resynch_score[node];
|
--resynch_score[node];
|
||||||
#else
|
#else
|
||||||
// Check player consistancy during the level
|
// Check player consistancy during the level
|
||||||
if (gamestate == GS_LEVEL
|
if (realstart <= gametic && realstart > gametic - BACKUPTICS+1 && gamestate == GS_LEVEL
|
||||||
&& (realstart <= gametic && realstart + BACKUPTICS - 1 > gametic)
|
|
||||||
&& consistancy[realstart%BACKUPTICS] != SHORT(netbuffer->u.clientpak.consistancy))
|
&& consistancy[realstart%BACKUPTICS] != SHORT(netbuffer->u.clientpak.consistancy))
|
||||||
{
|
{
|
||||||
SV_RequireResynch(node);
|
SV_RequireResynch(node);
|
||||||
@@ -5558,13 +5652,10 @@ static void PT_ClientCmd(INT32 netconsole, SINT8 node)
|
|||||||
if (cv_resynchattempts.value && resynch_score[node] <= (unsigned)cv_resynchattempts.value*250)
|
if (cv_resynchattempts.value && resynch_score[node] <= (unsigned)cv_resynchattempts.value*250)
|
||||||
{
|
{
|
||||||
if (cv_blamecfail.value)
|
if (cv_blamecfail.value)
|
||||||
{
|
|
||||||
CONS_Printf(M_GetText("Synch failure for player %d (%s); expected %hd, got %hd\n"),
|
CONS_Printf(M_GetText("Synch failure for player %d (%s); expected %hd, got %hd\n"),
|
||||||
netconsole+1, player_names[netconsole],
|
netconsole+1, player_names[netconsole],
|
||||||
consistancy[realstart%BACKUPTICS],
|
consistancy[realstart%BACKUPTICS],
|
||||||
SHORT(netbuffer->u.clientpak.consistancy));
|
SHORT(netbuffer->u.clientpak.consistancy));
|
||||||
}
|
|
||||||
|
|
||||||
DEBFILE(va("Restoring player %d (synch failure) [%update] %d!=%d\n",
|
DEBFILE(va("Restoring player %d (synch failure) [%update] %d!=%d\n",
|
||||||
netconsole, realstart, consistancy[realstart%BACKUPTICS],
|
netconsole, realstart, consistancy[realstart%BACKUPTICS],
|
||||||
SHORT(netbuffer->u.clientpak.consistancy)));
|
SHORT(netbuffer->u.clientpak.consistancy)));
|
||||||
@@ -5961,17 +6052,16 @@ static void GetPackets(void)
|
|||||||
{
|
{
|
||||||
node = (SINT8)doomcom->remotenode;
|
node = (SINT8)doomcom->remotenode;
|
||||||
|
|
||||||
if (server && netbuffer->packettype == PT_CLIENTJOIN)
|
if (netbuffer->packettype == PT_CLIENTJOIN && server)
|
||||||
{
|
{
|
||||||
if (!levelloading) // Otherwise just ignore
|
if (!levelloading) // Otherwise just ignore
|
||||||
{
|
{
|
||||||
HandleConnect(node);
|
HandleConnect(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (client && node == servernode && cl_mode != CL_SEARCHING)
|
if (node == servernode && client && cl_mode != CL_SEARCHING)
|
||||||
{
|
{
|
||||||
if (netbuffer->packettype == PT_SERVERSHUTDOWN)
|
if (netbuffer->packettype == PT_SERVERSHUTDOWN)
|
||||||
{
|
{
|
||||||
@@ -5985,11 +6075,13 @@ static void GetPackets(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NONET
|
||||||
if (netbuffer->packettype == PT_SERVERINFO)
|
if (netbuffer->packettype == PT_SERVERINFO)
|
||||||
{
|
{
|
||||||
HandleServerInfo(node);
|
HandleServerInfo(node);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*if (netbuffer->packettype == PT_PLAYERINFO)
|
/*if (netbuffer->packettype == PT_PLAYERINFO)
|
||||||
continue; // We do nothing with PLAYERINFO, that's for the MS browser. Not quite true anymore :p*/
|
continue; // We do nothing with PLAYERINFO, that's for the MS browser. Not quite true anymore :p*/
|
||||||
@@ -6030,8 +6122,7 @@ static INT16 Consistancy(void)
|
|||||||
{
|
{
|
||||||
if (!playeringame[i])
|
if (!playeringame[i])
|
||||||
ret ^= 0xCCCC;
|
ret ^= 0xCCCC;
|
||||||
else if (!players[i].mo || gamestate != GS_LEVEL)
|
else if (!players[i].mo || gamestate != GS_LEVEL);
|
||||||
;
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ret += players[i].mo->x;
|
ret += players[i].mo->x;
|
||||||
@@ -6040,7 +6131,6 @@ static INT16 Consistancy(void)
|
|||||||
ret *= i+1;
|
ret *= i+1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// I give up
|
// I give up
|
||||||
// Coop desynching enemies is painful
|
// Coop desynching enemies is painful
|
||||||
if (gamestate == GS_LEVEL)
|
if (gamestate == GS_LEVEL)
|
||||||
@@ -6881,7 +6971,7 @@ void NetKeepAlive(void)
|
|||||||
|
|
||||||
UpdatePingTable();
|
UpdatePingTable();
|
||||||
|
|
||||||
// Sryder: What is FILESTAMP??? << lmao
|
// Sryder: What is FILESTAMP??? << lmao
|
||||||
|
|
||||||
GetPackets();
|
GetPackets();
|
||||||
|
|
||||||
@@ -7151,7 +7241,7 @@ void CL_ClearRewinds(void)
|
|||||||
while ((head = rewindhead))
|
while ((head = rewindhead))
|
||||||
{
|
{
|
||||||
rewindhead = rewindhead->next;
|
rewindhead = rewindhead->next;
|
||||||
Z_Free(head);
|
free(head);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7163,7 +7253,7 @@ rewind_t *CL_SaveRewindPoint(size_t demopos)
|
|||||||
if (rewindhead && rewindhead->leveltime + REWIND_POINT_INTERVAL > leveltime)
|
if (rewindhead && rewindhead->leveltime + REWIND_POINT_INTERVAL > leveltime)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
rewind = (rewind_t *)Z_Malloc(sizeof(rewind_t), PU_STATIC, NULL);
|
rewind = (rewind_t *)malloc(sizeof (rewind_t));
|
||||||
if (!rewind)
|
if (!rewind)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@@ -7186,7 +7276,7 @@ rewind_t *CL_RewindToTime(tic_t time)
|
|||||||
while (rewindhead && rewindhead->leveltime > time)
|
while (rewindhead && rewindhead->leveltime > time)
|
||||||
{
|
{
|
||||||
rewind = rewindhead->next;
|
rewind = rewindhead->next;
|
||||||
Z_Free(rewindhead);
|
free(rewindhead);
|
||||||
rewindhead = rewind;
|
rewindhead = rewind;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+28
-2
@@ -133,6 +133,10 @@ void Command_Droprate(void);
|
|||||||
void Command_Numnodes(void);
|
void Command_Numnodes(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
#pragma pack(1)
|
||||||
|
#endif
|
||||||
|
|
||||||
// Client to server packet
|
// Client to server packet
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@@ -172,6 +176,10 @@ typedef struct
|
|||||||
ticcmd_t cmd, cmd2, cmd3, cmd4;
|
ticcmd_t cmd, cmd2, cmd3, cmd4;
|
||||||
} ATTRPACK client4cmd_pak;
|
} ATTRPACK client4cmd_pak;
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(disable : 4200)
|
||||||
|
#endif
|
||||||
|
|
||||||
// Server to client packet
|
// Server to client packet
|
||||||
// this packet is too large
|
// this packet is too large
|
||||||
typedef struct
|
typedef struct
|
||||||
@@ -364,6 +372,10 @@ typedef struct {
|
|||||||
UINT8 data[0]; // Size is variable using hardware_MAXPACKETLENGTH
|
UINT8 data[0]; // Size is variable using hardware_MAXPACKETLENGTH
|
||||||
} ATTRPACK filetx_pak;
|
} ATTRPACK filetx_pak;
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(default : 4200)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define MAXAPPLICATION 16
|
#define MAXAPPLICATION 16
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
@@ -507,6 +519,10 @@ typedef struct
|
|||||||
} u; // This is needed to pack diff packet types data together
|
} u; // This is needed to pack diff packet types data together
|
||||||
} ATTRPACK doomdata_t;
|
} ATTRPACK doomdata_t;
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
#pragma pack()
|
||||||
|
#endif
|
||||||
|
|
||||||
#define MAXSERVERLIST (MAXNETNODES-1)
|
#define MAXSERVERLIST (MAXNETNODES-1)
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@@ -583,6 +599,9 @@ extern tic_t lowest_lag;
|
|||||||
extern consvar_t cv_mindelay, cv_gentlemens;
|
extern consvar_t cv_mindelay, cv_gentlemens;
|
||||||
|
|
||||||
extern consvar_t
|
extern consvar_t
|
||||||
|
#ifdef VANILLAJOINNEXTROUND
|
||||||
|
cv_joinnextround,
|
||||||
|
#endif
|
||||||
cv_netticbuffer, cv_allownewplayer,
|
cv_netticbuffer, cv_allownewplayer,
|
||||||
#ifdef SATURNJOIN
|
#ifdef SATURNJOIN
|
||||||
cv_allownewsaturnplayer,
|
cv_allownewsaturnplayer,
|
||||||
@@ -639,9 +658,16 @@ void D_QuitNetGame(void);
|
|||||||
//? How many ticks to run?
|
//? How many ticks to run?
|
||||||
boolean TryRunTics(tic_t realtic);
|
boolean TryRunTics(tic_t realtic);
|
||||||
|
|
||||||
|
// extra data for lmps
|
||||||
|
// these functions scare me. they contain magic.
|
||||||
|
/*boolean AddLmpExtradata(UINT8 **demo_p, INT32 playernum);
|
||||||
|
void ReadLmpExtraData(UINT8 **demo_pointer, INT32 playernum);*/
|
||||||
|
|
||||||
|
#ifndef NONET
|
||||||
// translate a playername in a player number return -1 if not found and
|
// translate a playername in a player number return -1 if not found and
|
||||||
// print a error message in the console
|
// print a error message in the console
|
||||||
SINT8 nametonum(const char *name);
|
SINT8 nametonum(const char *name);
|
||||||
|
#endif
|
||||||
|
|
||||||
extern char motd[254], server_context[8];
|
extern char motd[254], server_context[8];
|
||||||
extern UINT8 playernode[MAXPLAYERS];
|
extern UINT8 playernode[MAXPLAYERS];
|
||||||
@@ -653,6 +679,7 @@ INT32 D_NumPlayers(void);
|
|||||||
void D_ResetTiccmds(void);
|
void D_ResetTiccmds(void);
|
||||||
|
|
||||||
tic_t GetLag(INT32 node);
|
tic_t GetLag(INT32 node);
|
||||||
|
//UINT8 GetFreeXCmdSize(UINT8 playerid);
|
||||||
|
|
||||||
extern UINT8 hu_resynching;
|
extern UINT8 hu_resynching;
|
||||||
#ifdef SATURNPAK
|
#ifdef SATURNPAK
|
||||||
@@ -660,8 +687,7 @@ extern UINT8 hu_redownloadinggamestate;
|
|||||||
#endif
|
#endif
|
||||||
extern boolean hu_stopped; // kart, true when the game is stopped for players due to a disconnecting or connecting player
|
extern boolean hu_stopped; // kart, true when the game is stopped for players due to a disconnecting or connecting player
|
||||||
|
|
||||||
typedef struct rewind_s
|
typedef struct rewind_s {
|
||||||
{
|
|
||||||
UINT8 savebuffer[(768*1024)];
|
UINT8 savebuffer[(768*1024)];
|
||||||
tic_t leveltime;
|
tic_t leveltime;
|
||||||
size_t demopos;
|
size_t demopos;
|
||||||
|
|||||||
+92
-81
@@ -347,66 +347,13 @@ static void D_Renderview(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i <= splitscreen; i++)
|
|
||||||
{
|
|
||||||
if (!P_MobjWasRemoved(players[displayplayers[i]].mo) || players[displayplayers[i]].playerstate == PST_DEAD)
|
|
||||||
{
|
|
||||||
viewssnum = i;
|
|
||||||
|
|
||||||
switch (i)
|
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
if (splitscreen > 1)
|
|
||||||
{
|
|
||||||
viewwindowx = viewwidth;
|
|
||||||
viewwindowy = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
viewwindowx = 0;
|
|
||||||
viewwindowy = viewheight;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
viewwindowx = 0;
|
|
||||||
viewwindowy = viewheight;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
viewwindowx = viewwidth;
|
|
||||||
viewwindowy = viewheight;
|
|
||||||
break;
|
|
||||||
default: // Initialize for P1
|
|
||||||
viewwindowy = viewwindowx = 0;
|
|
||||||
objectsdrawn = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef HWRENDER
|
|
||||||
if (rendermode == render_opengl)
|
|
||||||
{
|
|
||||||
HWR_RenderPlayerView();
|
|
||||||
}
|
|
||||||
else if (rendermode == render_soft)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
R_RenderPlayerView(&players[displayplayers[i]]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rendermode == render_soft)
|
|
||||||
{
|
|
||||||
if (i == 0)
|
|
||||||
R_ApplyViewMorph();
|
|
||||||
|
|
||||||
V_DoPostProcessor(i, postimgparam[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Draw over the fourth screen so you don't have to stare at a HOM :V
|
// Draw over the fourth screen so you don't have to stare at a HOM :V
|
||||||
if (splitscreen == 2)
|
if (splitscreen == 2)
|
||||||
{
|
{
|
||||||
// V_DrawPatchFill, but for the fourth screen only
|
// V_DrawPatchFill, but for the fourth screen only
|
||||||
patch_t *pat = W_CachePatchName("SRB2BACK", PU_PATCH);
|
patch_t *pat = W_CachePatchName("SRB2BACK", PU_CACHE);
|
||||||
INT32 x, y, pw = SHORT(pat->width) * vid.dup, ph = SHORT(pat->height) * vid.dup;
|
INT32 dupz = (vid.dupx < vid.dupy ? vid.dupx : vid.dupy);
|
||||||
|
INT32 x, y, pw = SHORT(pat->width) * dupz, ph = SHORT(pat->height) * dupz;
|
||||||
|
|
||||||
for (x = vid.width>>1; x < vid.width; x += pw)
|
for (x = vid.width>>1; x < vid.width; x += pw)
|
||||||
{
|
{
|
||||||
@@ -415,6 +362,65 @@ static void D_Renderview(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i = 0; i <= splitscreen; i++)
|
||||||
|
{
|
||||||
|
const boolean issplitscreen = (i > 0);
|
||||||
|
|
||||||
|
if (!P_MobjWasRemoved(players[displayplayers[i]].mo) || players[displayplayers[i]].playerstate == PST_DEAD)
|
||||||
|
{
|
||||||
|
viewssnum = i;
|
||||||
|
|
||||||
|
if (!issplitscreen) // Initialize for P1
|
||||||
|
{
|
||||||
|
viewwindowy = viewwindowx = 0;
|
||||||
|
objectsdrawn = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef HWRENDER
|
||||||
|
if (rendermode == render_opengl)
|
||||||
|
{
|
||||||
|
HWR_RenderPlayerView();
|
||||||
|
R_RestoreLevelInterpolators();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (issplitscreen) // Splitscreen-specific
|
||||||
|
{
|
||||||
|
switch (i)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
if (splitscreen > 1)
|
||||||
|
{
|
||||||
|
viewwindowx = viewwidth;
|
||||||
|
viewwindowy = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
viewwindowx = 0;
|
||||||
|
viewwindowy = viewheight;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
viewwindowx = 0;
|
||||||
|
viewwindowy = viewheight;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
viewwindowx = viewwidth;
|
||||||
|
viewwindowy = viewheight;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
R_RenderPlayerView(&players[displayplayers[i]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!issplitscreen)
|
||||||
|
R_ApplyViewMorph();
|
||||||
|
|
||||||
|
V_DoPostProcessor(i, postimgparam[i]);
|
||||||
|
}
|
||||||
|
|
||||||
R_RestoreLevelInterpolators();
|
R_RestoreLevelInterpolators();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -517,16 +523,19 @@ static boolean D_Display(void)
|
|||||||
case GS_LEVEL:
|
case GS_LEVEL:
|
||||||
if (!gametic)
|
if (!gametic)
|
||||||
break;
|
break;
|
||||||
|
HU_Erase();
|
||||||
AM_Drawer();
|
AM_Drawer();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GS_INTERMISSION:
|
case GS_INTERMISSION:
|
||||||
Y_IntermissionDrawer();
|
Y_IntermissionDrawer();
|
||||||
|
HU_Erase();
|
||||||
HU_Drawer();
|
HU_Drawer();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GS_VOTING:
|
case GS_VOTING:
|
||||||
Y_VoteDrawer();
|
Y_VoteDrawer();
|
||||||
|
HU_Erase();
|
||||||
HU_Drawer();
|
HU_Drawer();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -541,6 +550,7 @@ static boolean D_Display(void)
|
|||||||
|
|
||||||
case GS_CUTSCENE:
|
case GS_CUTSCENE:
|
||||||
F_CutsceneDrawer();
|
F_CutsceneDrawer();
|
||||||
|
HU_Erase();
|
||||||
HU_Drawer();
|
HU_Drawer();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -550,6 +560,7 @@ static boolean D_Display(void)
|
|||||||
|
|
||||||
case GS_EVALUATION:
|
case GS_EVALUATION:
|
||||||
F_GameEvaluationDrawer();
|
F_GameEvaluationDrawer();
|
||||||
|
HU_Erase();
|
||||||
HU_Drawer();
|
HU_Drawer();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -559,6 +570,7 @@ static boolean D_Display(void)
|
|||||||
|
|
||||||
case GS_CREDITS:
|
case GS_CREDITS:
|
||||||
F_CreditDrawer();
|
F_CreditDrawer();
|
||||||
|
HU_Erase();
|
||||||
HU_Drawer();
|
HU_Drawer();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -575,6 +587,7 @@ static boolean D_Display(void)
|
|||||||
{
|
{
|
||||||
// I don't think HOM from nothing drawing is independent...
|
// I don't think HOM from nothing drawing is independent...
|
||||||
F_WaitingPlayersDrawer();
|
F_WaitingPlayersDrawer();
|
||||||
|
HU_Erase();
|
||||||
HU_Drawer();
|
HU_Drawer();
|
||||||
}
|
}
|
||||||
case GS_TIMEATTACK:
|
case GS_TIMEATTACK:
|
||||||
@@ -597,7 +610,7 @@ static boolean D_Display(void)
|
|||||||
{
|
{
|
||||||
if (rendermode == render_soft)
|
if (rendermode == render_soft)
|
||||||
{
|
{
|
||||||
VID_BlitLinearScreen(vid.screens[0], vid.screens[1], vid.width, vid.height, vid.width, vid.width);
|
VID_BlitLinearScreen(vid.screens[0], vid.screens[1], vid.width, vid.height, vid.width, vid.rowbytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
lastdraw = false;
|
lastdraw = false;
|
||||||
@@ -761,8 +774,8 @@ void D_SRB2Loop(void)
|
|||||||
// capbudget is the minimum precise_t duration of a single loop iteration
|
// capbudget is the minimum precise_t duration of a single loop iteration
|
||||||
precise_t capbudget;
|
precise_t capbudget;
|
||||||
precise_t enterprecise = I_GetPreciseTime();
|
precise_t enterprecise = I_GetPreciseTime();
|
||||||
|
precise_t finishprecise = enterprecise;
|
||||||
|
|
||||||
memset(&g_dc, 0, sizeof(g_dc));
|
|
||||||
Z_Frame_Reset();
|
Z_Frame_Reset();
|
||||||
|
|
||||||
// Casting the return value of a function is bad practice (apparently)
|
// Casting the return value of a function is bad practice (apparently)
|
||||||
@@ -878,6 +891,12 @@ void D_SRB2Loop(void)
|
|||||||
// always update console and hud
|
// always update console and hud
|
||||||
// otherwise it may take minutes to open it
|
// otherwise it may take minutes to open it
|
||||||
CON_Drawer();
|
CON_Drawer();
|
||||||
|
|
||||||
|
if (gamestate == GS_LEVEL)
|
||||||
|
{
|
||||||
|
ST_Drawer();
|
||||||
|
HU_Drawer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -899,7 +918,7 @@ void D_SRB2Loop(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
// Fully completed frame made.
|
// Fully completed frame made.
|
||||||
precise_t finishprecise = I_GetPreciseTime();
|
finishprecise = I_GetPreciseTime();
|
||||||
|
|
||||||
// Use the time before sleep for frameskip calculations:
|
// Use the time before sleep for frameskip calculations:
|
||||||
// post-sleep time is literally being intentionally wasted
|
// post-sleep time is literally being intentionally wasted
|
||||||
@@ -914,16 +933,9 @@ void D_SRB2Loop(void)
|
|||||||
//
|
//
|
||||||
// Wipes run an inner loop and artificially increase
|
// Wipes run an inner loop and artificially increase
|
||||||
// the measured time.
|
// the measured time.
|
||||||
if (cv_frameskip.value)
|
if (!ranwipe && (frameskip < 3) && (deltatics > 1.0))
|
||||||
{
|
{
|
||||||
if (!ranwipe && (frameskip < 3) && (deltatics > 1.0))
|
frameskip++;
|
||||||
{
|
|
||||||
frameskip++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
frameskip = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1009,7 +1021,7 @@ void D_ClearState(void)
|
|||||||
S_StopSounds();
|
S_StopSounds();
|
||||||
S_ResetKeepAndSpecialMus(); // just in case
|
S_ResetKeepAndSpecialMus(); // just in case
|
||||||
|
|
||||||
//P_FreeLevelState();
|
P_FreeLevelState();
|
||||||
|
|
||||||
G_SetGamestate(GS_NULL);
|
G_SetGamestate(GS_NULL);
|
||||||
wipegamestate = GS_NULL;
|
wipegamestate = GS_NULL;
|
||||||
@@ -1093,28 +1105,25 @@ static void D_AutoloadFile(const char *file, char **filearray)
|
|||||||
char *newfile;
|
char *newfile;
|
||||||
INT32 fileType = D_DetectFileType(file);
|
INT32 fileType = D_DetectFileType(file);
|
||||||
|
|
||||||
|
for (pnumwadfiles = 0; filearray[pnumwadfiles]; pnumwadfiles++)
|
||||||
|
;
|
||||||
|
|
||||||
|
newfile = malloc(strlen(file) + 1);
|
||||||
|
if (!newfile)
|
||||||
|
I_Error("No more free memory to AutoloadFile %s",file);
|
||||||
|
|
||||||
if (!fileType)
|
if (!fileType)
|
||||||
{
|
{
|
||||||
CONS_Printf("D_AutoloadFile: File %s is unknown or invalid\n", file);
|
CONS_Printf("D_AutoloadFile: File %s is unknown or invalid\n", file);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (pnumwadfiles = 0; filearray[pnumwadfiles]; pnumwadfiles++)
|
strcpy(newfile, file);
|
||||||
;
|
|
||||||
|
|
||||||
if (fileType <= 6)
|
if (fileType <= 6)
|
||||||
{
|
|
||||||
newfile = malloc(strlen(file) + 1);
|
|
||||||
if (!newfile)
|
|
||||||
I_Error("No more free memory to AutoloadFile %s",file);
|
|
||||||
|
|
||||||
strcpy(newfile, file);
|
|
||||||
filearray[pnumwadfiles] = newfile;
|
filearray[pnumwadfiles] = newfile;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
COM_BufAddText(va("exec %s\n", newfile));
|
||||||
COM_BufAddText(va("exec %s\n", file));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *strremove(char *str, const char *sub)
|
static char *strremove(char *str, const char *sub)
|
||||||
@@ -1913,7 +1922,9 @@ void D_SRB2Main(void)
|
|||||||
|
|
||||||
G_LoadGameData();
|
G_LoadGameData();
|
||||||
|
|
||||||
|
#if defined (__unix__) || defined (UNIXCOMMON) || defined (HAVE_SDL)
|
||||||
VID_PrepareModeList(); // Regenerate Modelist according to cv_fullscreen
|
VID_PrepareModeList(); // Regenerate Modelist according to cv_fullscreen
|
||||||
|
#endif
|
||||||
|
|
||||||
// set user default mode or mode set at cmdline
|
// set user default mode or mode set at cmdline
|
||||||
SCR_CheckDefaultMode();
|
SCR_CheckDefaultMode();
|
||||||
|
|||||||
+50
-1
@@ -145,6 +145,7 @@ boolean Net_GetNetStat(void)
|
|||||||
#define URGENTFREESLOTNUM 10
|
#define URGENTFREESLOTNUM 10
|
||||||
#define ACKTOSENDTIMEOUT (TICRATE/11)
|
#define ACKTOSENDTIMEOUT (TICRATE/11)
|
||||||
|
|
||||||
|
#ifndef NONET
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
UINT8 acknum;
|
UINT8 acknum;
|
||||||
@@ -158,6 +159,7 @@ typedef struct
|
|||||||
doomdata_t data;
|
doomdata_t data;
|
||||||
} pak;
|
} pak;
|
||||||
} ackpak_t;
|
} ackpak_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
@@ -165,8 +167,10 @@ typedef enum
|
|||||||
NF_TIMEOUT = 2, // Flag is set when the node got a timeout
|
NF_TIMEOUT = 2, // Flag is set when the node got a timeout
|
||||||
} node_flags_t;
|
} node_flags_t;
|
||||||
|
|
||||||
|
#ifndef NONET
|
||||||
// Table of packets that were not acknowleged can be resent (the sender window)
|
// Table of packets that were not acknowleged can be resent (the sender window)
|
||||||
static ackpak_t ackpak[MAXACKPACKETS];
|
static ackpak_t ackpak[MAXACKPACKETS];
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@@ -194,6 +198,7 @@ typedef struct
|
|||||||
static node_t nodes[MAXNETNODES];
|
static node_t nodes[MAXNETNODES];
|
||||||
#define NODETIMEOUT 14
|
#define NODETIMEOUT 14
|
||||||
|
|
||||||
|
#ifndef NONET
|
||||||
// return <0 if a < b (mod 256)
|
// return <0 if a < b (mod 256)
|
||||||
// 0 if a = n (mod 256)
|
// 0 if a = n (mod 256)
|
||||||
// >0 if a > b (mod 256)
|
// >0 if a > b (mod 256)
|
||||||
@@ -406,16 +411,22 @@ static boolean Processackpak(void)
|
|||||||
}
|
}
|
||||||
return goodpacket;
|
return goodpacket;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// send special packet with only ack on it
|
// send special packet with only ack on it
|
||||||
void Net_SendAcks(INT32 node)
|
void Net_SendAcks(INT32 node)
|
||||||
{
|
{
|
||||||
|
#ifdef NONET
|
||||||
|
(void)node;
|
||||||
|
#else
|
||||||
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
|
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
|
||||||
netbuffer->packettype = PT_NOTHING;
|
netbuffer->packettype = PT_NOTHING;
|
||||||
M_Memcpy(netbuffer->u.textcmd, nodes[node].acktosend, MAXACKTOSEND);
|
M_Memcpy(netbuffer->u.textcmd, nodes[node].acktosend, MAXACKTOSEND);
|
||||||
HSendPacket(node, false, 0, MAXACKTOSEND);
|
HSendPacket(node, false, 0, MAXACKTOSEND);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NONET
|
||||||
static void GotAcks(void)
|
static void GotAcks(void)
|
||||||
{
|
{
|
||||||
INT32 i, j;
|
INT32 i, j;
|
||||||
@@ -446,6 +457,7 @@ static void GotAcks(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void Net_ConnectionTimeout(INT32 node)
|
void Net_ConnectionTimeout(INT32 node)
|
||||||
{
|
{
|
||||||
@@ -472,6 +484,7 @@ void Net_ConnectionTimeout(INT32 node)
|
|||||||
// Resend the data if needed
|
// Resend the data if needed
|
||||||
void Net_AckTicker(void)
|
void Net_AckTicker(void)
|
||||||
{
|
{
|
||||||
|
#ifndef NONET
|
||||||
INT32 i;
|
INT32 i;
|
||||||
|
|
||||||
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
|
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
|
||||||
@@ -521,12 +534,16 @@ void Net_AckTicker(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove last packet received ack before resending the ackreturn
|
// Remove last packet received ack before resending the ackreturn
|
||||||
// (the higher layer doesn't have room, or something else ....)
|
// (the higher layer doesn't have room, or something else ....)
|
||||||
void Net_UnAcknowledgePacket(INT32 node)
|
void Net_UnAcknowledgePacket(INT32 node)
|
||||||
{
|
{
|
||||||
|
#ifdef NONET
|
||||||
|
(void)node;
|
||||||
|
#else
|
||||||
INT32 hm1 = (nodes[node].acktosend_head-1+MAXACKTOSEND) % MAXACKTOSEND;
|
INT32 hm1 = (nodes[node].acktosend_head-1+MAXACKTOSEND) % MAXACKTOSEND;
|
||||||
DEBFILE(va("UnAcknowledge node %d\n", node));
|
DEBFILE(va("UnAcknowledge node %d\n", node));
|
||||||
|
|
||||||
@@ -563,8 +580,10 @@ void Net_UnAcknowledgePacket(INT32 node)
|
|||||||
if (!nodes[node].firstacktosend)
|
if (!nodes[node].firstacktosend)
|
||||||
nodes[node].firstacktosend = 1;
|
nodes[node].firstacktosend = 1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NONET
|
||||||
/** Checks if all acks have been received
|
/** Checks if all acks have been received
|
||||||
*
|
*
|
||||||
* \return True if all acks have been received
|
* \return True if all acks have been received
|
||||||
@@ -582,6 +601,7 @@ static boolean Net_AllAcksReceived(void)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/** Waits for all ackreturns
|
/** Waits for all ackreturns
|
||||||
*
|
*
|
||||||
@@ -590,6 +610,9 @@ static boolean Net_AllAcksReceived(void)
|
|||||||
*/
|
*/
|
||||||
void Net_WaitAllAckReceived(UINT32 timeout)
|
void Net_WaitAllAckReceived(UINT32 timeout)
|
||||||
{
|
{
|
||||||
|
#ifdef NONET
|
||||||
|
(void)timeout;
|
||||||
|
#else
|
||||||
tic_t tictac = I_GetTime();
|
tic_t tictac = I_GetTime();
|
||||||
timeout = tictac + timeout*NEWTICRATE;
|
timeout = tictac + timeout*NEWTICRATE;
|
||||||
|
|
||||||
@@ -607,6 +630,7 @@ void Net_WaitAllAckReceived(UINT32 timeout)
|
|||||||
HGetPacket();
|
HGetPacket();
|
||||||
Net_AckTicker();
|
Net_AckTicker();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void InitNode(node_t *node)
|
static void InitNode(node_t *node)
|
||||||
@@ -623,8 +647,10 @@ static void InitAck(void)
|
|||||||
{
|
{
|
||||||
INT32 i;
|
INT32 i;
|
||||||
|
|
||||||
|
#ifndef NONET
|
||||||
for (i = 0; i < MAXACKPACKETS; i++)
|
for (i = 0; i < MAXACKPACKETS; i++)
|
||||||
ackpak[i].acknum = 0;
|
ackpak[i].acknum = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
for (i = 0; i < MAXNETNODES; i++)
|
for (i = 0; i < MAXNETNODES; i++)
|
||||||
InitNode(&nodes[i]);
|
InitNode(&nodes[i]);
|
||||||
@@ -637,6 +663,9 @@ static void InitAck(void)
|
|||||||
*/
|
*/
|
||||||
void Net_AbortPacketType(UINT8 packettype)
|
void Net_AbortPacketType(UINT8 packettype)
|
||||||
{
|
{
|
||||||
|
#ifdef NONET
|
||||||
|
(void)packettype;
|
||||||
|
#else
|
||||||
for (INT32 i = 0; i < MAXACKPACKETS; i++)
|
for (INT32 i = 0; i < MAXACKPACKETS; i++)
|
||||||
{
|
{
|
||||||
if (ackpak[i].acknum && (ackpak[i].pak.data.packettype == packettype
|
if (ackpak[i].acknum && (ackpak[i].pak.data.packettype == packettype
|
||||||
@@ -645,6 +674,7 @@ void Net_AbortPacketType(UINT8 packettype)
|
|||||||
ackpak[i].acknum = 0;
|
ackpak[i].acknum = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------
|
// -----------------------------------------------------------------
|
||||||
@@ -654,6 +684,9 @@ void Net_AbortPacketType(UINT8 packettype)
|
|||||||
// remove a node, clear all ack from this node and reset askret
|
// remove a node, clear all ack from this node and reset askret
|
||||||
void Net_CloseConnection(INT32 node)
|
void Net_CloseConnection(INT32 node)
|
||||||
{
|
{
|
||||||
|
#ifdef NONET
|
||||||
|
(void)node;
|
||||||
|
#else
|
||||||
INT32 i;
|
INT32 i;
|
||||||
|
|
||||||
if (node == -1)
|
if (node == -1)
|
||||||
@@ -705,8 +738,10 @@ void Net_CloseConnection(INT32 node)
|
|||||||
InitNode(&nodes[node]);
|
InitNode(&nodes[node]);
|
||||||
SV_AbortSendFiles(node);
|
SV_AbortSendFiles(node);
|
||||||
I_NetFreeNodenum(node);
|
I_NetFreeNodenum(node);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NONET
|
||||||
//
|
//
|
||||||
// Checksum
|
// Checksum
|
||||||
//
|
//
|
||||||
@@ -722,8 +757,10 @@ static UINT32 NetbufferChecksum(void)
|
|||||||
|
|
||||||
return LONG(c);
|
return LONG(c);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUGFILE
|
#ifdef DEBUGFILE
|
||||||
|
|
||||||
static void fprintfstring(char *s, size_t len)
|
static void fprintfstring(char *s, size_t len)
|
||||||
{
|
{
|
||||||
INT32 mode = 0;
|
INT32 mode = 0;
|
||||||
@@ -995,6 +1032,7 @@ void Command_Droprate(void)
|
|||||||
packetdroprate = droprate;
|
packetdroprate = droprate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NONET
|
||||||
static boolean ShouldDropPacket(void)
|
static boolean ShouldDropPacket(void)
|
||||||
{
|
{
|
||||||
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
|
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
|
||||||
@@ -1002,6 +1040,7 @@ static boolean ShouldDropPacket(void)
|
|||||||
|| (packetdroprate != 0 && rand() < (((double)RAND_MAX) * (packetdroprate / 100.f))) || packetdroprate == 100;
|
|| (packetdroprate != 0 && rand() < (((double)RAND_MAX) * (packetdroprate / 100.f))) || packetdroprate == 100;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// HSendPacket
|
// HSendPacket
|
||||||
@@ -1038,6 +1077,11 @@ boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum, size_t packetlen
|
|||||||
if (!netgame)
|
if (!netgame)
|
||||||
I_Error("Tried to transmit to another node");
|
I_Error("Tried to transmit to another node");
|
||||||
|
|
||||||
|
#ifdef NONET
|
||||||
|
(void)node;
|
||||||
|
(void)reliable;
|
||||||
|
(void)acknum;
|
||||||
|
#else
|
||||||
// do this before GetFreeAcknum because this function backups
|
// do this before GetFreeAcknum because this function backups
|
||||||
// the current packet
|
// the current packet
|
||||||
doomcom->remotenode = (INT16)node;
|
doomcom->remotenode = (INT16)node;
|
||||||
@@ -1092,6 +1136,8 @@ boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum, size_t packetlen
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif // ndef NONET
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1125,7 +1171,9 @@ boolean HGetPacket(void)
|
|||||||
if (!netgame)
|
if (!netgame)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
while (true)
|
#ifndef NONET
|
||||||
|
|
||||||
|
while(true)
|
||||||
{
|
{
|
||||||
I_NetGet();
|
I_NetGet();
|
||||||
|
|
||||||
@@ -1168,6 +1216,7 @@ boolean HGetPacket(void)
|
|||||||
doomcom->datalength -= BASEPACKETSIZE;
|
doomcom->datalength -= BASEPACKETSIZE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#endif // ifndef NONET
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,8 +53,10 @@ void Net_AckTicker(void);
|
|||||||
boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum, size_t packetlength);
|
boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum, size_t packetlength);
|
||||||
boolean HGetPacket(void);
|
boolean HGetPacket(void);
|
||||||
void D_SetDoomcom(void);
|
void D_SetDoomcom(void);
|
||||||
|
#ifndef NONET
|
||||||
void D_SaveBan(void);
|
void D_SaveBan(void);
|
||||||
void D_LoadBan(boolean warning);
|
void D_LoadBan(boolean warning);
|
||||||
|
#endif
|
||||||
boolean D_CheckNetGame(void);
|
boolean D_CheckNetGame(void);
|
||||||
void D_CloseConnection(void);
|
void D_CloseConnection(void);
|
||||||
void Net_UnAcknowledgePacket(INT32 node);
|
void Net_UnAcknowledgePacket(INT32 node);
|
||||||
|
|||||||
+53
-31
@@ -721,8 +721,10 @@ void D_RegisterServerCommands(void)
|
|||||||
CV_RegisterVar(&cv_killingdead);
|
CV_RegisterVar(&cv_killingdead);
|
||||||
|
|
||||||
// d_clisrv
|
// d_clisrv
|
||||||
|
#ifndef NONET
|
||||||
#ifdef SATURNJOIN
|
#ifdef SATURNJOIN
|
||||||
CV_RegisterVar(&cv_allownewsaturnplayer); // need to register it before cv_maxplayers && cv_allownewplayer
|
CV_RegisterVar(&cv_allownewsaturnplayer); // need to register it before cv_maxplayers && cv_allownewplayer
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
CV_RegisterVar(&cv_maxplayers);
|
CV_RegisterVar(&cv_maxplayers);
|
||||||
CV_RegisterVar(&cv_resynchattempts);
|
CV_RegisterVar(&cv_resynchattempts);
|
||||||
@@ -735,15 +737,18 @@ void D_RegisterServerCommands(void)
|
|||||||
CV_RegisterVar(&cv_downloadspeed);
|
CV_RegisterVar(&cv_downloadspeed);
|
||||||
CV_RegisterVar(&cv_connectawaittime);
|
CV_RegisterVar(&cv_connectawaittime);
|
||||||
CV_RegisterVar(&cv_httpsource);
|
CV_RegisterVar(&cv_httpsource);
|
||||||
|
#ifndef NONET
|
||||||
CV_RegisterVar(&cv_allownewplayer);
|
CV_RegisterVar(&cv_allownewplayer);
|
||||||
|
|
||||||
CV_RegisterVar(&cv_joinrefusemessage);
|
CV_RegisterVar(&cv_joinrefusemessage);
|
||||||
|
|
||||||
CV_RegisterVar(&cv_chatlogsize);
|
CV_RegisterVar(&cv_chatlogsize);
|
||||||
|
#ifdef VANILLAJOINNEXTROUND
|
||||||
|
CV_RegisterVar(&cv_joinnextround);
|
||||||
|
#endif
|
||||||
CV_RegisterVar(&cv_showjoinaddress);
|
CV_RegisterVar(&cv_showjoinaddress);
|
||||||
CV_RegisterVar(&cv_shownodeip);
|
CV_RegisterVar(&cv_shownodeip);
|
||||||
CV_RegisterVar(&cv_blamecfail);
|
CV_RegisterVar(&cv_blamecfail);
|
||||||
|
#endif
|
||||||
|
|
||||||
COM_AddCommand("ping", Command_Ping_f);
|
COM_AddCommand("ping", Command_Ping_f);
|
||||||
CV_RegisterVar(&cv_nettimeout);
|
CV_RegisterVar(&cv_nettimeout);
|
||||||
@@ -845,6 +850,12 @@ void D_RegisterClientCommands(void)
|
|||||||
CV_RegisterVar(&cv_zlib_memory);
|
CV_RegisterVar(&cv_zlib_memory);
|
||||||
CV_RegisterVar(&cv_zlib_strategy);
|
CV_RegisterVar(&cv_zlib_strategy);
|
||||||
CV_RegisterVar(&cv_zlib_window_bits);
|
CV_RegisterVar(&cv_zlib_window_bits);
|
||||||
|
// APNG variables
|
||||||
|
CV_RegisterVar(&cv_zlib_levela);
|
||||||
|
CV_RegisterVar(&cv_zlib_memorya);
|
||||||
|
CV_RegisterVar(&cv_zlib_strategya);
|
||||||
|
CV_RegisterVar(&cv_zlib_window_bitsa);
|
||||||
|
CV_RegisterVar(&cv_apng_delay);
|
||||||
// GIF variables
|
// GIF variables
|
||||||
CV_RegisterVar(&cv_gif_optimize);
|
CV_RegisterVar(&cv_gif_optimize);
|
||||||
CV_RegisterVar(&cv_gif_downscale);
|
CV_RegisterVar(&cv_gif_downscale);
|
||||||
@@ -964,11 +975,10 @@ void D_RegisterClientCommands(void)
|
|||||||
|
|
||||||
// g_input.c
|
// g_input.c
|
||||||
CV_RegisterVar(&cv_controlperkey);
|
CV_RegisterVar(&cv_controlperkey);
|
||||||
|
CV_RegisterVar(&cv_turnsmooth);
|
||||||
|
|
||||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||||
{
|
{
|
||||||
CV_RegisterVar(&cv_turnsmooth[i]);
|
|
||||||
|
|
||||||
CV_RegisterVar(&cv_turnaxis[i]);
|
CV_RegisterVar(&cv_turnaxis[i]);
|
||||||
CV_RegisterVar(&cv_moveaxis[i]);
|
CV_RegisterVar(&cv_moveaxis[i]);
|
||||||
CV_RegisterVar(&cv_camturnaxis[i]);
|
CV_RegisterVar(&cv_camturnaxis[i]);
|
||||||
@@ -985,8 +995,6 @@ void D_RegisterClientCommands(void)
|
|||||||
CV_RegisterVar(&cv_xdeadzone[i]);
|
CV_RegisterVar(&cv_xdeadzone[i]);
|
||||||
CV_RegisterVar(&cv_ydeadzone[i]);
|
CV_RegisterVar(&cv_ydeadzone[i]);
|
||||||
|
|
||||||
CV_RegisterVar(&cv_litesteer[i]);
|
|
||||||
|
|
||||||
CV_RegisterVar(&cv_usejoystick[i]);
|
CV_RegisterVar(&cv_usejoystick[i]);
|
||||||
CV_RegisterVar(&cv_joyscale[i]);
|
CV_RegisterVar(&cv_joyscale[i]);
|
||||||
CV_RegisterVar(&cv_rumble[i]);
|
CV_RegisterVar(&cv_rumble[i]);
|
||||||
@@ -1019,7 +1027,6 @@ void D_RegisterClientCommands(void)
|
|||||||
// screen.c
|
// screen.c
|
||||||
CV_RegisterVar(&cv_fullscreen);
|
CV_RegisterVar(&cv_fullscreen);
|
||||||
CV_RegisterVar(&cv_renderview);
|
CV_RegisterVar(&cv_renderview);
|
||||||
CV_RegisterVar(&cv_frameskip);
|
|
||||||
CV_RegisterVar(&cv_vhseffect);
|
CV_RegisterVar(&cv_vhseffect);
|
||||||
CV_RegisterVar(&cv_shittyscreen);
|
CV_RegisterVar(&cv_shittyscreen);
|
||||||
CV_RegisterVar(&cv_scr_width);
|
CV_RegisterVar(&cv_scr_width);
|
||||||
@@ -1994,6 +2001,11 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
SetPlayerSkinByNum(playernum, skin);
|
SetPlayerSkinByNum(playernum, skin);
|
||||||
|
|
||||||
|
#ifdef HAVE_DISCORDRPC
|
||||||
|
if (playernum == consoleplayer)
|
||||||
|
DRPC_UpdatePresence();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendWeaponPref(void)
|
void SendWeaponPref(void)
|
||||||
@@ -4374,14 +4386,6 @@ static void Command_Addfilelocal(void)
|
|||||||
P_AddWadFile(fn, true);
|
P_AddWadFile(fn, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CloseFileHandle(FILE **fhandle)
|
|
||||||
{
|
|
||||||
if (*fhandle)
|
|
||||||
{
|
|
||||||
fclose(*fhandle);
|
|
||||||
*fhandle = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Adds a pwad at runtime.
|
/** Adds a pwad at runtime.
|
||||||
* Searches for sounds, maps, music, new images.
|
* Searches for sounds, maps, music, new images.
|
||||||
@@ -4394,7 +4398,7 @@ static void Command_Addfile(void)
|
|||||||
INT32 i;
|
INT32 i;
|
||||||
int musiconly = -1; // W_VerifyNMUSlumps isn't boolean
|
int musiconly = -1; // W_VerifyNMUSlumps isn't boolean
|
||||||
|
|
||||||
CLEANUP(CloseFileHandle) FILE *fhandle = NULL;
|
FILE *fhandle = NULL;
|
||||||
|
|
||||||
if (COM_Argc() != 2)
|
if (COM_Argc() != 2)
|
||||||
{
|
{
|
||||||
@@ -4409,15 +4413,18 @@ static void Command_Addfile(void)
|
|||||||
if (!isprint(fn[i]) || fn[i] == ';')
|
if (!isprint(fn[i]) || fn[i] == ';')
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (fhandle)
|
||||||
|
{
|
||||||
|
fclose(fhandle);
|
||||||
|
fhandle = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if ((fhandle = W_OpenWadFile(&fn, true)) != NULL)
|
if ((fhandle = W_OpenWadFile(&fn, true)) != NULL)
|
||||||
{
|
{
|
||||||
musiconly = W_VerifyNMUSlumps(fn, fhandle, false);
|
musiconly = W_VerifyNMUSlumps(fn, fhandle, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fhandle == NULL || musiconly == -1)
|
if (musiconly == -1)
|
||||||
return; // file not found
|
|
||||||
|
|
||||||
if (!musiconly)
|
|
||||||
{
|
{
|
||||||
// ... But only so long as they contain nothing more then music and sprites.
|
// ... But only so long as they contain nothing more then music and sprites.
|
||||||
if (netgame && !(server || IsPlayerAdmin(consoleplayer)))
|
if (netgame && !(server || IsPlayerAdmin(consoleplayer)))
|
||||||
@@ -4445,7 +4452,7 @@ static void Command_Addfile(void)
|
|||||||
{
|
{
|
||||||
UINT8 md5sum[16];
|
UINT8 md5sum[16];
|
||||||
#ifdef NOMD5
|
#ifdef NOMD5
|
||||||
memset(md5sum, 0, 16);
|
memset(md5sum,0,16);
|
||||||
#else
|
#else
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -4457,22 +4464,26 @@ static void Command_Addfile(void)
|
|||||||
|
|
||||||
for (i = 0; i < numwadfiles; i++)
|
for (i = 0; i < numwadfiles; i++)
|
||||||
{
|
{
|
||||||
if (!memcmp(wadfiles[i]->md5sum, md5sum, 16))
|
if (memcmp(wadfiles[i]->md5sum, md5sum, 16))
|
||||||
{
|
continue;
|
||||||
CONS_Alert(CONS_ERROR, M_GetText("%s is already loaded\n"), fn);
|
|
||||||
return;
|
CONS_Alert(CONS_ERROR, M_GetText("%s is already loaded\n"), fn);
|
||||||
}
|
goto addfile_finally;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
// Finally okay to write this important data
|
// Finally okay to write this important data
|
||||||
WRITESTRINGN(buf_p, p, 240);
|
WRITESTRINGN(buf_p,p,240);
|
||||||
WRITEMEM(buf_p, md5sum, 16);
|
WRITEMEM(buf_p, md5sum, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsPlayerAdmin(consoleplayer) && (!server)) // Request to add file
|
if (IsPlayerAdmin(consoleplayer) && (!server)) // Request to add file
|
||||||
SendNetXCmd(XD_REQADDFILE, buf, buf_p - buf);
|
SendNetXCmd(XD_REQADDFILE, buf, buf_p - buf);
|
||||||
else
|
else
|
||||||
SendNetXCmd(XD_ADDFILE, buf, buf_p - buf);;
|
SendNetXCmd(XD_ADDFILE, buf, buf_p - buf);
|
||||||
|
|
||||||
|
addfile_finally:
|
||||||
|
if (fhandle)
|
||||||
|
fclose(fhandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Adds something at runtime.
|
/** Adds something at runtime.
|
||||||
@@ -4663,7 +4674,7 @@ static void Got_Addfilecmd(UINT8 **cp, INT32 playernum)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ncs = findfile(filename, md5sum, true);
|
ncs = findfile(filename,md5sum,true);
|
||||||
|
|
||||||
if (ncs != FS_FOUND || !P_AddWadFile(filename, false))
|
if (ncs != FS_FOUND || !P_AddWadFile(filename, false))
|
||||||
{
|
{
|
||||||
@@ -4876,7 +4887,18 @@ static void Command_Version_f(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// OS
|
// OS
|
||||||
CONS_Printf("%s ", I_GetSysName());
|
// Would be nice to use SDL_GetPlatform for this
|
||||||
|
#if defined (_WIN32) || defined (_WIN64)
|
||||||
|
CONS_Printf("Windows ");
|
||||||
|
#elif defined(__linux__)
|
||||||
|
CONS_Printf("Linux ");
|
||||||
|
#elif defined(MACOSX)
|
||||||
|
CONS_Printf("macOS ");
|
||||||
|
#elif defined(UNIXCOMMON)
|
||||||
|
CONS_Printf("Unix (Common) ");
|
||||||
|
#else
|
||||||
|
CONS_Printf("Other OS ");
|
||||||
|
#endif
|
||||||
|
|
||||||
// Bitness
|
// Bitness
|
||||||
if (sizeof(void*) == 4)
|
if (sizeof(void*) == 4)
|
||||||
@@ -5264,7 +5286,7 @@ retryscramble:
|
|||||||
memset(&scrambleplayers, 0, sizeof(scrambleplayers));
|
memset(&scrambleplayers, 0, sizeof(scrambleplayers));
|
||||||
memset(&scrambleteams, 0, sizeof(scrambleplayers));
|
memset(&scrambleteams, 0, sizeof(scrambleplayers));
|
||||||
scrambletotal = scramblecount = 0;
|
scrambletotal = scramblecount = 0;
|
||||||
blue = red = newteam = playercount = 0;
|
blue = red = maxcomposition = newteam = playercount = 0;
|
||||||
repick = true;
|
repick = true;
|
||||||
|
|
||||||
// Put each player's node in the array.
|
// Put each player's node in the array.
|
||||||
|
|||||||
@@ -266,6 +266,14 @@ typedef enum
|
|||||||
|
|
||||||
extern const char *netxcmdnames[MAXNETXCMD - 1];
|
extern const char *netxcmdnames[MAXNETXCMD - 1];
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
#pragma pack(1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(disable : 4214)
|
||||||
|
#endif
|
||||||
|
|
||||||
//Packet composition for Command_TeamChange_f() ServerTeamChange, etc.
|
//Packet composition for Command_TeamChange_f() ServerTeamChange, etc.
|
||||||
//bitwise structs make packing bits a little easier, but byte alignment harder?
|
//bitwise structs make packing bits a little easier, but byte alignment harder?
|
||||||
//todo: decide whether to make the other netcommands conform, or just get rid of this experiment.
|
//todo: decide whether to make the other netcommands conform, or just get rid of this experiment.
|
||||||
@@ -277,6 +285,10 @@ typedef struct {
|
|||||||
UINT32 scrambled : 1; // value 0 to 1
|
UINT32 scrambled : 1; // value 0 to 1
|
||||||
} ATTRPACK changeteam_packet_t;
|
} ATTRPACK changeteam_packet_t;
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(default : 4214)
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
UINT16 l; // liitle endian
|
UINT16 l; // liitle endian
|
||||||
UINT16 b; // big enian
|
UINT16 b; // big enian
|
||||||
@@ -290,6 +302,10 @@ typedef union {
|
|||||||
changeteam_value_t value;
|
changeteam_value_t value;
|
||||||
} ATTRPACK changeteam_union;
|
} ATTRPACK changeteam_union;
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
#pragma pack()
|
||||||
|
#endif
|
||||||
|
|
||||||
// add game commands, needs cleanup
|
// add game commands, needs cleanup
|
||||||
void D_RegisterServerCommands(void);
|
void D_RegisterServerCommands(void);
|
||||||
void D_RegisterClientCommands(void);
|
void D_RegisterClientCommands(void);
|
||||||
|
|||||||
+52
-77
@@ -35,8 +35,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_CURL
|
#ifdef HAVE_CURL
|
||||||
#include <curl/curl.h>
|
#include "curl/curl.h"
|
||||||
#include "m_curl.h"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "doomdef.h"
|
#include "doomdef.h"
|
||||||
@@ -121,7 +120,6 @@ file_download_t filedownload;
|
|||||||
|
|
||||||
#ifdef HAVE_CURL
|
#ifdef HAVE_CURL
|
||||||
static CURL *http_handle;
|
static CURL *http_handle;
|
||||||
static char curl_errbuf[CURL_ERROR_SIZE];
|
|
||||||
static CURLM *multi_handle;
|
static CURLM *multi_handle;
|
||||||
static UINT32 curl_dlnow;
|
static UINT32 curl_dlnow;
|
||||||
static UINT32 curl_dltotal;
|
static UINT32 curl_dltotal;
|
||||||
@@ -231,7 +229,9 @@ void D_ParseFileneeded(INT32 fileneedednum_parm, UINT8 *fileneededstr, UINT16 fi
|
|||||||
|
|
||||||
void CL_PrepareDownloadSaveGame(const char *tmpsave)
|
void CL_PrepareDownloadSaveGame(const char *tmpsave)
|
||||||
{
|
{
|
||||||
|
#ifdef CLIENT_LOADINGSCREEN
|
||||||
filedownload.current = -1;
|
filedownload.current = -1;
|
||||||
|
#endif
|
||||||
fileneedednum = 1;
|
fileneedednum = 1;
|
||||||
fileneeded[0].status = FS_REQUESTED;
|
fileneeded[0].status = FS_REQUESTED;
|
||||||
fileneeded[0].justdownloaded = false;
|
fileneeded[0].justdownloaded = false;
|
||||||
@@ -493,6 +493,9 @@ INT32 CL_CheckFiles(void)
|
|||||||
size_t filestoload = 0;
|
size_t filestoload = 0;
|
||||||
boolean downloadrequired = false;
|
boolean downloadrequired = false;
|
||||||
|
|
||||||
|
// if (M_CheckParm("-nofiles"))
|
||||||
|
// return 1;
|
||||||
|
|
||||||
// the first is the iwad (the main wad file)
|
// the first is the iwad (the main wad file)
|
||||||
// we don't care if it's called srb2.srb or srb2.wad.
|
// we don't care if it's called srb2.srb or srb2.wad.
|
||||||
// Never download the IWAD, just assume it's there and identical
|
// Never download the IWAD, just assume it's there and identical
|
||||||
@@ -506,9 +509,11 @@ INT32 CL_CheckFiles(void)
|
|||||||
{
|
{
|
||||||
CONS_Debug(DBG_NETPLAY, "game is modified; only doing basic checks\n");
|
CONS_Debug(DBG_NETPLAY, "game is modified; only doing basic checks\n");
|
||||||
|
|
||||||
|
boolean have_important = false;
|
||||||
|
|
||||||
for (i = 0, j = mainwads+1; i < fileneedednum || j < numwadfiles;)
|
for (i = 0, j = mainwads+1; i < fileneedednum || j < numwadfiles;)
|
||||||
{
|
{
|
||||||
if (j < numwadfiles && !wadfiles[j]->important) // TODO: add checks for localfiles that dont contain anything "allowed" (maps and stuff like that)
|
if (j < numwadfiles && (!wadfiles[j]->important || wadfiles[j]->localfile))
|
||||||
{
|
{
|
||||||
// Unimportant on our side. still don't care.
|
// Unimportant on our side. still don't care.
|
||||||
++j;
|
++j;
|
||||||
@@ -517,7 +522,15 @@ INT32 CL_CheckFiles(void)
|
|||||||
|
|
||||||
// If this test is true, we've reached the end of one file list.
|
// If this test is true, we've reached the end of one file list.
|
||||||
if (i >= fileneedednum || j >= numwadfiles)
|
if (i >= fileneedednum || j >= numwadfiles)
|
||||||
return 2;
|
{
|
||||||
|
// We are missing some of important files, or have too much
|
||||||
|
// important files.
|
||||||
|
if (have_important)
|
||||||
|
return 2;
|
||||||
|
|
||||||
|
// All checked files weren't important, don't care about them.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// For the sake of speed, only bother with a md5 check
|
// For the sake of speed, only bother with a md5 check
|
||||||
if (memcmp(wadfiles[j]->md5sum, fileneeded[i].md5sum, 16))
|
if (memcmp(wadfiles[j]->md5sum, fileneeded[i].md5sum, 16))
|
||||||
@@ -525,12 +538,14 @@ INT32 CL_CheckFiles(void)
|
|||||||
|
|
||||||
// It's accounted for! let's keep going.
|
// It's accounted for! let's keep going.
|
||||||
CONS_Debug(DBG_NETPLAY, "'%s' accounted for\n", fileneeded[i].filename);
|
CONS_Debug(DBG_NETPLAY, "'%s' accounted for\n", fileneeded[i].filename);
|
||||||
|
have_important = true;
|
||||||
fileneeded[i].status = FS_OPEN;
|
fileneeded[i].status = FS_OPEN;
|
||||||
++i;
|
++i;
|
||||||
++j;
|
++j;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
if (have_important)
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < fileneedednum; i++)
|
for (i = 0; i < fileneedednum; i++)
|
||||||
@@ -578,6 +593,9 @@ boolean CL_LoadServerFiles(void)
|
|||||||
{
|
{
|
||||||
INT32 i;
|
INT32 i;
|
||||||
|
|
||||||
|
// if (M_CheckParm("-nofiles"))
|
||||||
|
// return;
|
||||||
|
|
||||||
for (i = 0; i < fileneedednum; i++)
|
for (i = 0; i < fileneedednum; i++)
|
||||||
{
|
{
|
||||||
if (fileneeded[i].status == FS_OPEN)
|
if (fileneeded[i].status == FS_OPEN)
|
||||||
@@ -613,7 +631,6 @@ boolean CL_LoadServerFiles(void)
|
|||||||
fileneeded[i].status, s);
|
fileneeded[i].status, s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1005,16 +1022,17 @@ void Got_Filetxpak(void)
|
|||||||
file->file = NULL;
|
file->file = NULL;
|
||||||
file->status = FS_FOUND;
|
file->status = FS_FOUND;
|
||||||
file->justdownloaded = true;
|
file->justdownloaded = true;
|
||||||
CONS_Printf(M_GetText("Downloading %s...(done)\n"), filename);
|
CONS_Printf(M_GetText("Downloading %s...(done)\n"),
|
||||||
|
filename);
|
||||||
|
#ifndef NONET
|
||||||
filedownload.completednum++;
|
filedownload.completednum++;
|
||||||
filedownload.completedsize += file->totalsize;
|
filedownload.completedsize += file->totalsize;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!file->justdownloaded)
|
else if (!file->justdownloaded)
|
||||||
{
|
{
|
||||||
const char *s;
|
const char *s;
|
||||||
|
|
||||||
switch(file->status)
|
switch(file->status)
|
||||||
{
|
{
|
||||||
case FS_NOTFOUND:
|
case FS_NOTFOUND:
|
||||||
@@ -1033,7 +1051,6 @@ void Got_Filetxpak(void)
|
|||||||
s = "unknown";
|
s = "unknown";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
I_Error("Received a file not requested (file id: %d, file status: %s)\n", filenum, s);
|
I_Error("Received a file not requested (file id: %d, file status: %s)\n", filenum, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1044,7 +1061,9 @@ void Got_Filetxpak(void)
|
|||||||
filetime = 0;
|
filetime = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CLIENT_LOADINGSCREEN
|
||||||
filedownload.current = filenum;
|
filedownload.current = filenum;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \brief Checks if a node is downloading a file
|
/** \brief Checks if a node is downloading a file
|
||||||
@@ -1290,7 +1309,6 @@ static int curlprogress_callback(void *clientp, double dltotal, double dlnow, do
|
|||||||
void CURLPrepareFile(const char* url, int dfilenum)
|
void CURLPrepareFile(const char* url, int dfilenum)
|
||||||
{
|
{
|
||||||
HTTP_login *login;
|
HTTP_login *login;
|
||||||
CURLcode cc;
|
|
||||||
|
|
||||||
#ifdef PARANOIA
|
#ifdef PARANOIA
|
||||||
if (M_CheckParm("-nodownload"))
|
if (M_CheckParm("-nodownload"))
|
||||||
@@ -1299,33 +1317,14 @@ void CURLPrepareFile(const char* url, int dfilenum)
|
|||||||
|
|
||||||
if (!multi_handle)
|
if (!multi_handle)
|
||||||
{
|
{
|
||||||
cc = curl_global_init(CURL_GLOBAL_ALL);
|
curl_global_init(CURL_GLOBAL_ALL);
|
||||||
if (cc < 0)
|
multi_handle = curl_multi_init();
|
||||||
{
|
|
||||||
I_OutputMsg("libcurl: curl_global_init() returned %d\n", cc);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
multi_handle = curl_multi_init();
|
|
||||||
}
|
|
||||||
if (!multi_handle)
|
|
||||||
{
|
|
||||||
I_OutputMsg("libcurl: curl_multi_init() failed\n");
|
|
||||||
curl_global_cleanup();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
http_handle = curl_easy_init();
|
http_handle = curl_easy_init();
|
||||||
|
|
||||||
if (http_handle)
|
if (http_handle && multi_handle)
|
||||||
{
|
{
|
||||||
CURLMcode mc;
|
|
||||||
|
|
||||||
cc = curl_easy_setopt(http_handle, CURLOPT_ERRORBUFFER, curl_errbuf);
|
|
||||||
if (cc != CURLE_OK) I_OutputMsg("libcurl: CURLOPT_ERRORBUFFER failed\n");
|
|
||||||
curl_errbuf[0] = 0x00;
|
|
||||||
|
|
||||||
I_mkdir(downloaddir, 0755);
|
I_mkdir(downloaddir, 0755);
|
||||||
|
|
||||||
curl_curfile = &fileneeded[dfilenum];
|
curl_curfile = &fileneeded[dfilenum];
|
||||||
@@ -1335,38 +1334,31 @@ void CURLPrepareFile(const char* url, int dfilenum)
|
|||||||
curl_origfilesize = curl_curfile->currentsize;
|
curl_origfilesize = curl_curfile->currentsize;
|
||||||
curl_origtotalfilesize = curl_curfile->totalsize;
|
curl_origtotalfilesize = curl_curfile->totalsize;
|
||||||
|
|
||||||
cc = curl_easy_setopt(http_handle, CURLOPT_URL, va("%s/%s", url, curl_realname));
|
curl_easy_setopt(http_handle, CURLOPT_URL, va("%s/%s", url, curl_realname));
|
||||||
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", curl_errbuf);
|
|
||||||
|
|
||||||
// Only allow HTTP and HTTPS
|
// Only allow HTTP and HTTPS
|
||||||
#if (LIBCURL_VERSION_MAJOR <= 7) && (LIBCURL_VERSION_MINOR < 85)
|
#if (LIBCURL_VERSION_MAJOR <= 7) && (LIBCURL_VERSION_MINOR < 85)
|
||||||
cc = curl_easy_setopt(http_handle, CURLOPT_PROTOCOLS, CURLPROTO_HTTP|CURLPROTO_HTTPS);
|
curl_easy_setopt(http_handle, CURLOPT_PROTOCOLS, CURLPROTO_HTTP|CURLPROTO_HTTPS);
|
||||||
#else
|
#else
|
||||||
cc = curl_easy_setopt(http_handle, CURLOPT_PROTOCOLS_STR, "http,https");
|
curl_easy_setopt(http_handle, CURLOPT_PROTOCOLS_STR, "http,https");
|
||||||
#endif
|
#endif
|
||||||
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", curl_errbuf);
|
|
||||||
|
|
||||||
// Set user agent, as some servers won't accept invalid user agents.
|
curl_easy_setopt(http_handle, CURLOPT_USERAGENT, va("SRB2Kart/v%d.%d", VERSION, SUBVERSION)); // Set user agent as some servers won't accept invalid user agents.
|
||||||
cc = curl_easy_setopt(http_handle, CURLOPT_USERAGENT, va("SRB2Kart/v%d.%d", VERSION, SUBVERSION));
|
|
||||||
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", curl_errbuf);
|
|
||||||
|
|
||||||
// Authenticate if the user so wishes
|
// Authenticate if the user so wishes
|
||||||
login = CURLGetLogin(url, NULL);
|
login = CURLGetLogin(url, NULL);
|
||||||
|
|
||||||
if (login)
|
if (login)
|
||||||
{
|
{
|
||||||
cc = curl_easy_setopt(http_handle, CURLOPT_USERPWD, login->auth);
|
curl_easy_setopt(http_handle, CURLOPT_USERPWD, login->auth);
|
||||||
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", curl_errbuf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Follow a redirect request, if sent by the server.
|
// Follow a redirect request, if sent by the server.
|
||||||
cc = curl_easy_setopt(http_handle, CURLOPT_FOLLOWLOCATION, 1L);
|
curl_easy_setopt(http_handle, CURLOPT_FOLLOWLOCATION, 1L);
|
||||||
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", curl_errbuf);
|
|
||||||
|
|
||||||
cc = curl_easy_setopt(http_handle, CURLOPT_FAILONERROR, 1L);
|
curl_easy_setopt(http_handle, CURLOPT_FAILONERROR, 1L);
|
||||||
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", curl_errbuf);
|
|
||||||
|
|
||||||
CONS_Printf("Downloading addon \"%s\" from %s\n", curl_realname, url);
|
CONS_Printf("Downloading %s from %s\n", curl_realname, url);
|
||||||
|
|
||||||
strcatbf(curl_curfile->filename, downloaddir, "/");
|
strcatbf(curl_curfile->filename, downloaddir, "/");
|
||||||
curl_curfile->file = fopen(curl_curfile->filename, "wb");
|
curl_curfile->file = fopen(curl_curfile->filename, "wb");
|
||||||
@@ -1385,33 +1377,19 @@ void CURLPrepareFile(const char* url, int dfilenum)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
cc = curl_easy_setopt(http_handle, CURLOPT_WRITEDATA, curl_curfile->file);
|
curl_easy_setopt(http_handle, CURLOPT_WRITEDATA, curl_curfile->file);
|
||||||
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", curl_errbuf);
|
curl_easy_setopt(http_handle, CURLOPT_WRITEFUNCTION, curlwrite_data);
|
||||||
|
curl_easy_setopt(http_handle, CURLOPT_NOPROGRESS, 0L);
|
||||||
cc = curl_easy_setopt(http_handle, CURLOPT_WRITEFUNCTION, curlwrite_data);
|
|
||||||
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", curl_errbuf);
|
|
||||||
|
|
||||||
cc = curl_easy_setopt(http_handle, CURLOPT_NOPROGRESS, 0L);
|
|
||||||
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", curl_errbuf);
|
|
||||||
|
|
||||||
#ifdef XFERINFOFUNCTION
|
#ifdef XFERINFOFUNCTION
|
||||||
cc = curl_easy_setopt(http_handle, CURLOPT_XFERINFOFUNCTION, curlprogress_callbackx);
|
curl_easy_setopt(http_handle, CURLOPT_XFERINFOFUNCTION, curlprogress_callbackx);
|
||||||
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", curl_errbuf);
|
|
||||||
#else
|
#else
|
||||||
cc = curl_easy_setopt(http_handle, CURLOPT_PROGRESSFUNCTION, curlprogress_callback);
|
curl_easy_setopt(http_handle, CURLOPT_PROGRESSFUNCTION, curlprogress_callback);
|
||||||
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", curl_errbuf);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
M_SetCURLArgs(http_handle, curl_errbuf);
|
|
||||||
|
|
||||||
curl_curfile->status = FS_DOWNLOADING;
|
curl_curfile->status = FS_DOWNLOADING;
|
||||||
|
curl_multi_add_handle(multi_handle, http_handle);
|
||||||
|
|
||||||
mc = curl_multi_add_handle(multi_handle, http_handle);
|
curl_multi_perform(multi_handle, &curl_runninghandles);
|
||||||
if (mc != CURLM_OK) I_OutputMsg("libcurl: %s\n", curl_multi_strerror(mc));
|
|
||||||
|
|
||||||
mc = curl_multi_perform(multi_handle, &curl_runninghandles);
|
|
||||||
if (mc != CURLM_OK) I_OutputMsg("libcurl: %s\n", curl_multi_strerror(mc));
|
|
||||||
|
|
||||||
curl_starttime = time(NULL);
|
curl_starttime = time(NULL);
|
||||||
|
|
||||||
filedownload.current = dfilenum;
|
filedownload.current = dfilenum;
|
||||||
@@ -1453,15 +1431,14 @@ void CURLGetFile(void)
|
|||||||
{
|
{
|
||||||
if (curl_runninghandles)
|
if (curl_runninghandles)
|
||||||
{
|
{
|
||||||
mc = curl_multi_perform(multi_handle, &curl_runninghandles);
|
curl_multi_perform(multi_handle, &curl_runninghandles);
|
||||||
if (mc != CURLM_OK) I_OutputMsg("libcurl: %s\n", curl_multi_strerror(mc));
|
|
||||||
|
|
||||||
/* wait for activity, timeout or "nothing" */
|
/* wait for activity, timeout or "nothing" */
|
||||||
mc = curl_multi_wait(multi_handle, NULL, 0, 1000, NULL);
|
mc = curl_multi_wait(multi_handle, NULL, 0, 1000, NULL);
|
||||||
|
|
||||||
if (mc != CURLM_OK)
|
if (mc != CURLM_OK)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_WARNING, "curl_multi_wait() failed: %s.\n", curl_multi_strerror(mc));
|
CONS_Alert(CONS_WARNING, "curl_multi_wait() failed, code %d.\n", mc);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1519,8 +1496,7 @@ void CURLGetFile(void)
|
|||||||
Z_Free(filename);
|
Z_Free(filename);
|
||||||
curl_curfile->file = NULL;
|
curl_curfile->file = NULL;
|
||||||
filedownload.remaining--;
|
filedownload.remaining--;
|
||||||
mc = curl_multi_remove_handle(multi_handle, e);
|
curl_multi_remove_handle(multi_handle, e);
|
||||||
if (mc != CURLM_OK) I_OutputMsg("libcurl: %s\n", curl_multi_strerror(mc));
|
|
||||||
curl_easy_cleanup(e);
|
curl_easy_cleanup(e);
|
||||||
|
|
||||||
if (!filedownload.remaining)
|
if (!filedownload.remaining)
|
||||||
@@ -1531,8 +1507,7 @@ void CURLGetFile(void)
|
|||||||
|
|
||||||
if (!filedownload.remaining || !filedownload.http_running)
|
if (!filedownload.remaining || !filedownload.http_running)
|
||||||
{
|
{
|
||||||
mc = curl_multi_cleanup(multi_handle);
|
curl_multi_cleanup(multi_handle);
|
||||||
if (mc != CURLM_OK) I_OutputMsg("libcurl: %s\n", curl_multi_strerror(mc));
|
|
||||||
curl_global_cleanup();
|
curl_global_cleanup();
|
||||||
multi_handle = NULL;
|
multi_handle = NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,15 +59,19 @@ extern char downloaddir[512];
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
#ifdef CLIENT_LOADINGSCREEN
|
||||||
INT32 current;
|
INT32 current;
|
||||||
INT32 completednum;
|
INT32 completednum;
|
||||||
UINT32 completedsize;
|
UINT32 completedsize;
|
||||||
INT32 totalnum;
|
INT32 totalnum;
|
||||||
UINT32 totalsize;
|
UINT32 totalsize;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_CURL
|
#ifdef HAVE_CURL
|
||||||
INT32 remaining;
|
INT32 remaining;
|
||||||
boolean http_failed;
|
boolean http_failed;
|
||||||
boolean http_running;
|
boolean http_running;
|
||||||
|
|
||||||
char http_source[MAX_MIRROR_LENGTH+1];
|
char http_source[MAX_MIRROR_LENGTH+1];
|
||||||
#endif
|
#endif
|
||||||
} file_download_t;
|
} file_download_t;
|
||||||
@@ -75,6 +79,7 @@ typedef struct
|
|||||||
extern file_download_t filedownload;
|
extern file_download_t filedownload;
|
||||||
|
|
||||||
#ifdef HAVE_CURL
|
#ifdef HAVE_CURL
|
||||||
|
|
||||||
typedef struct HTTP_login HTTP_login;
|
typedef struct HTTP_login HTTP_login;
|
||||||
|
|
||||||
extern struct HTTP_login
|
extern struct HTTP_login
|
||||||
|
|||||||
+11
-28
@@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
#ifdef HAVE_CURL
|
#ifdef HAVE_CURL
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
#include "m_curl.h"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "doomdef.h"
|
#include "doomdef.h"
|
||||||
@@ -208,14 +207,13 @@ void D_SetupProtocol(void)
|
|||||||
|
|
||||||
fp = fopen(protocolfile, "a+");
|
fp = fopen(protocolfile, "a+");
|
||||||
result = fgets(buffer, PATH_MAX, fp);
|
result = fgets(buffer, PATH_MAX, fp);
|
||||||
|
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
if (strcmp(buffer, "no") == 0)
|
if (strcmp(buffer, "no") == 0)
|
||||||
{
|
{
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (strcmp(buffer, exe_path) != 0)
|
else if (strcmp(buffer, exe_path) != 0)
|
||||||
{
|
{
|
||||||
// overwrite
|
// overwrite
|
||||||
@@ -234,7 +232,6 @@ void D_SetupProtocol(void)
|
|||||||
else
|
else
|
||||||
fprintf(fp, "no");
|
fprintf(fp, "no");
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -258,10 +255,8 @@ void D_CreateProtocol(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_CURL
|
#ifdef HAVE_CURL
|
||||||
static char curl_errbuf[CURL_ERROR_SIZE];
|
|
||||||
void D_DownloadReplay(const char *url, const char *path)
|
void D_DownloadReplay(const char *url, const char *path)
|
||||||
{
|
{
|
||||||
|
|
||||||
FILE *fp = NULL;
|
FILE *fp = NULL;
|
||||||
CURL *curl;
|
CURL *curl;
|
||||||
CURLcode cc;
|
CURLcode cc;
|
||||||
@@ -269,29 +264,17 @@ void D_DownloadReplay(const char *url, const char *path)
|
|||||||
if (!curl)
|
if (!curl)
|
||||||
I_Error("Unable to download replay. Error initializing CURL.");
|
I_Error("Unable to download replay. Error initializing CURL.");
|
||||||
|
|
||||||
cc = curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, curl_errbuf);
|
|
||||||
if (cc != CURLE_OK) I_OutputMsg("libcurl: CURLOPT_ERRORBUFFER failed\n");
|
|
||||||
curl_errbuf[0] = 0x00;
|
|
||||||
|
|
||||||
fp = fopen(path, "wb");
|
fp = fopen(path, "wb");
|
||||||
CONS_Printf("REPLAY: URL: %s\n", url);
|
CONS_Printf("REPLAY: URL: %s\n", url);
|
||||||
|
curl_easy_setopt(curl, CURLOPT_URL, url);
|
||||||
|
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curlwrite_data);
|
||||||
|
curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);
|
||||||
|
|
||||||
cc = curl_easy_setopt(curl, CURLOPT_URL, url);
|
cc = curl_easy_perform(curl);
|
||||||
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", curl_errbuf);
|
|
||||||
|
|
||||||
cc = curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curlwrite_data);
|
|
||||||
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", curl_errbuf);
|
|
||||||
|
|
||||||
cc = curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);
|
|
||||||
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", curl_errbuf);
|
|
||||||
|
|
||||||
M_SetCURLArgs(curl, curl_errbuf);
|
|
||||||
|
|
||||||
cc = curl_easy_perform(curl);
|
|
||||||
if (cc != CURLE_OK)
|
if (cc != CURLE_OK)
|
||||||
I_Error("Unable to download replay. libcurl: %s.", curl_errbuf);
|
I_Error("Unable to download replay. URL gave response code %u.", cc);
|
||||||
|
|
||||||
curl_easy_cleanup(curl);
|
curl_easy_cleanup(curl);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -9,9 +9,6 @@
|
|||||||
/// \file d_protocol.h
|
/// \file d_protocol.h
|
||||||
/// \brief srb2kart:// protocol stuff
|
/// \brief srb2kart:// protocol stuff
|
||||||
|
|
||||||
#ifndef __D_PROTOCOL__
|
|
||||||
#define __D_PROTOCOL__
|
|
||||||
|
|
||||||
void D_SetupProtocol(void);
|
void D_SetupProtocol(void);
|
||||||
|
|
||||||
void D_CreateProtocol(void);
|
void D_CreateProtocol(void);
|
||||||
@@ -19,5 +16,3 @@ void D_DeleteProtocol(void);
|
|||||||
#ifdef HAVE_CURL
|
#ifdef HAVE_CURL
|
||||||
void D_DownloadReplay(const char *url, const char *path);
|
void D_DownloadReplay(const char *url, const char *path);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif //__D_PROTOCOL__
|
|
||||||
@@ -50,6 +50,10 @@ typedef enum
|
|||||||
#define TICCMD_RECEIVED 1
|
#define TICCMD_RECEIVED 1
|
||||||
#define TICCMD_XY 2
|
#define TICCMD_XY 2
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
#pragma pack(1)
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
SINT8 forwardmove; // -MAXPLMOVE to MAXPLMOVE (50)
|
SINT8 forwardmove; // -MAXPLMOVE to MAXPLMOVE (50)
|
||||||
@@ -61,4 +65,8 @@ typedef struct
|
|||||||
UINT8 latency; // Netgames: how many tics ago was this ticcmd generated from this player's end?
|
UINT8 latency; // Netgames: how many tics ago was this ticcmd generated from this player's end?
|
||||||
} ATTRPACK ticcmd_t;
|
} ATTRPACK ticcmd_t;
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
#pragma pack()
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
+18
-6
@@ -138,7 +138,8 @@ static void InitLogging(void)
|
|||||||
|
|
||||||
if (M_IsPathAbsolute(reldir))
|
if (M_IsPathAbsolute(reldir))
|
||||||
{
|
{
|
||||||
left = snprintf(logfilename, sizeof logfilename, "%s"PATHSEP, reldir);
|
left = snprintf(logfilename, sizeof logfilename,
|
||||||
|
"%s"PATHSEP, reldir);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#ifdef DEFAULTDIR
|
#ifdef DEFAULTDIR
|
||||||
@@ -154,10 +155,13 @@ static void InitLogging(void)
|
|||||||
"."PATHSEP"%s"PATHSEP, reldir);
|
"."PATHSEP"%s"PATHSEP, reldir);
|
||||||
}
|
}
|
||||||
|
|
||||||
strftime(&logfilename[left], sizeof logfilename - left, format, timeinfo);
|
strftime(&logfilename[left], sizeof logfilename - left,
|
||||||
|
format, timeinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
M_MkdirEachUntil(logfilename, M_PathParts(logdir) - 1, M_PathParts(logfilename) - 1, 0755);
|
M_MkdirEachUntil(logfilename,
|
||||||
|
M_PathParts(logdir) - 1,
|
||||||
|
M_PathParts(logfilename) - 1, 0755);
|
||||||
|
|
||||||
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||||
logstream = fopen(logfilename, "w");
|
logstream = fopen(logfilename, "w");
|
||||||
@@ -209,9 +213,12 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
//I_OutputMsg("I_StartupSystem() ...\n");
|
//I_OutputMsg("I_StartupSystem() ...\n");
|
||||||
I_StartupSystem();
|
I_StartupSystem();
|
||||||
|
#if defined (_WIN32)
|
||||||
#ifdef HAVE_DRMINGW
|
{
|
||||||
InitDrMingw();
|
#ifdef DRMINGW
|
||||||
|
ExcHndlInit();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// startup SRB2
|
// startup SRB2
|
||||||
@@ -221,6 +228,11 @@ int main(int argc, char **argv)
|
|||||||
// never return
|
// never return
|
||||||
D_SRB2Loop();
|
D_SRB2Loop();
|
||||||
|
|
||||||
|
#ifdef BUGTRAP
|
||||||
|
// This is safe even if BT didn't start.
|
||||||
|
ShutdownBugTrap();
|
||||||
|
#endif
|
||||||
|
|
||||||
// return to OS
|
// return to OS
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
+360
-360
@@ -54,6 +54,8 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#elif defined (_MSC_VER)
|
||||||
|
#include <direct.h>
|
||||||
#endif
|
#endif
|
||||||
#if defined (__unix__) || defined (UNIXCOMMON)
|
#if defined (__unix__) || defined (UNIXCOMMON)
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
@@ -64,6 +66,10 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
|
|||||||
#include <conio.h>
|
#include <conio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(disable : 4214 4244)
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined (__unix__) || defined(__APPLE__) || (defined (UNIXCOMMON) && !defined (__HAIKU__))
|
#if defined (__unix__) || defined(__APPLE__) || (defined (UNIXCOMMON) && !defined (__HAIKU__))
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#if defined (__linux__)
|
#if defined (__linux__)
|
||||||
@@ -174,10 +180,293 @@ static char returnWadPath[256];
|
|||||||
#include "../byteptr.h"
|
#include "../byteptr.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBBACKTRACE
|
||||||
|
#include <backtrace.h>
|
||||||
|
// TODO - move this to some header file instead
|
||||||
|
extern struct backtrace_state *bt_state;
|
||||||
|
|
||||||
|
typedef struct bt_crash_reason_s {
|
||||||
|
enum {
|
||||||
|
BTCRASH_SIGNAL,
|
||||||
|
BTCRASH_ERRORMSG,
|
||||||
|
} type;
|
||||||
|
|
||||||
|
union {
|
||||||
|
INT32 signal;
|
||||||
|
const char *errormsg;
|
||||||
|
} value;
|
||||||
|
} bt_crash_reason_t;
|
||||||
|
|
||||||
|
#define BT_CRASH_REASON_SIGNAL(num) (bt_crash_reason_t){ .type = BTCRASH_SIGNAL, .value = { .signal = num } }
|
||||||
|
#define BT_CRASH_REASON_ERRORMSG(msg) (bt_crash_reason_t){ .type = BTCRASH_ERRORMSG, .value = { .errormsg = msg } }
|
||||||
|
|
||||||
|
static void printsignal(FILE *fp, INT32 num)
|
||||||
|
{
|
||||||
|
switch (num)
|
||||||
|
{
|
||||||
|
case SIGILL:
|
||||||
|
fprintf(fp, "SIGILL - illegal instruction - invalid function image");
|
||||||
|
break;
|
||||||
|
case SIGFPE:
|
||||||
|
fprintf(fp, "SIGFPE - mathematical exception");
|
||||||
|
break;
|
||||||
|
case SIGSEGV:
|
||||||
|
fprintf(fp, "SIGSEGV - segment violation");
|
||||||
|
break;
|
||||||
|
case SIGABRT:
|
||||||
|
fprintf(fp, "SIGABRT - abnormal termination triggered by abort call");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
fprintf(fp, "Signal number %d", num);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
typedef struct bt_out_buf_s {
|
||||||
|
boolean error;
|
||||||
|
char *pos;
|
||||||
|
size_t size;
|
||||||
|
} bt_out_buf_t;
|
||||||
|
|
||||||
|
static void bt_syminfo_cb(void *data, uintptr_t pc, const char *symname, uintptr_t symval, uintptr_t symsize)
|
||||||
|
{
|
||||||
|
(void)symval;
|
||||||
|
(void)symsize;
|
||||||
|
|
||||||
|
bt_out_buf_t *buf = (bt_out_buf_t*)data;
|
||||||
|
|
||||||
|
if (!symname)
|
||||||
|
symname = "???";
|
||||||
|
|
||||||
|
int n = snprintf(buf->pos, buf->size, "%p %s\n", (void*)pc, symname);
|
||||||
|
|
||||||
|
if (n <= 0)
|
||||||
|
{
|
||||||
|
buf->size = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
buf->pos += n;
|
||||||
|
buf->size -= n;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int bt_simple_cb(void *data, uintptr_t pc)
|
||||||
|
{
|
||||||
|
bt_out_buf_t *buf = (bt_out_buf_t*)data;
|
||||||
|
|
||||||
|
backtrace_syminfo(bt_state, pc, bt_syminfo_cb, NULL, data);
|
||||||
|
|
||||||
|
if (!buf->size) return 1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int bt_full_cb(void *data, uintptr_t pc, const char *filename, int lineno, const char *function)
|
||||||
|
{
|
||||||
|
bt_out_buf_t *buf = (bt_out_buf_t*)data;
|
||||||
|
|
||||||
|
if (!filename) filename = "???";
|
||||||
|
if (!function) function = "???";
|
||||||
|
|
||||||
|
int n = snprintf(buf->pos, buf->size, "%p %s\n\t%s:%d\n", (void*)pc, function, filename, lineno);
|
||||||
|
|
||||||
|
if (n <= 0) return 1;
|
||||||
|
|
||||||
|
buf->pos += n;
|
||||||
|
buf->size -= n;
|
||||||
|
|
||||||
|
if (!buf->size) return 1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void bt_error_cb(void *data, const char *msg, int errnum)
|
||||||
|
{
|
||||||
|
(void)msg; // We don't need this
|
||||||
|
|
||||||
|
bt_out_buf_t *buf = (bt_out_buf_t*)data;
|
||||||
|
|
||||||
|
// No debug info
|
||||||
|
if (errnum == -1)
|
||||||
|
buf->error = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void write_backtrace(bt_crash_reason_t reason)
|
||||||
|
{
|
||||||
|
FILE *out = fopen(va("%s" PATHSEP "%s", srb2home, "srb2kart-crash-log.txt"), "a");
|
||||||
|
|
||||||
|
time_t rawtime;
|
||||||
|
struct tm *timeinfo;
|
||||||
|
|
||||||
|
const size_t BUFSIZE = 8192;
|
||||||
|
char backtrace[BUFSIZE];
|
||||||
|
|
||||||
|
bt_out_buf_t buf;
|
||||||
|
buf.error = false;
|
||||||
|
buf.pos = backtrace;
|
||||||
|
buf.size = BUFSIZE;
|
||||||
|
|
||||||
|
|
||||||
|
if (!out)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "\nWARNING: Couldn't open crash log for writing! Make sure your permissions are correct. Please save the below report!\n");
|
||||||
|
out = stderr;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the current time as a string.
|
||||||
|
time(&rawtime);
|
||||||
|
timeinfo = localtime(&rawtime);
|
||||||
|
|
||||||
|
fprintf(out, "------------------------\n\n");
|
||||||
|
|
||||||
|
fprintf(out, "Program name: %s %s\n", SRB2APPLICATION, VERSIONSTRING);
|
||||||
|
|
||||||
|
if (compdate && comptime && comprevision && compbranch)
|
||||||
|
fprintf(out, "Compiled: %s %s, commit %s, branch %s\n", compdate, comptime, comprevision, compbranch);
|
||||||
|
|
||||||
|
if (gamestate == GS_LEVEL)
|
||||||
|
{
|
||||||
|
char *title = G_BuildMapTitle(gamemap);
|
||||||
|
|
||||||
|
if (title)
|
||||||
|
{
|
||||||
|
fprintf(out, "Game map: %s (%s)\n", title, G_BuildMapName(gamemap));
|
||||||
|
Z_Free(title);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
fprintf(out, "Game map: %s\n", G_BuildMapName(gamemap));
|
||||||
|
}
|
||||||
|
|
||||||
|
fprintf(out, "Time of crash: %s\n", asctime(timeinfo));
|
||||||
|
|
||||||
|
fprintf(out, "Caused by: ");
|
||||||
|
|
||||||
|
switch (reason.type)
|
||||||
|
{
|
||||||
|
case BTCRASH_SIGNAL:
|
||||||
|
printsignal(out, reason.value.signal);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case BTCRASH_ERRORMSG:
|
||||||
|
fprintf(out, "%s", reason.value.errormsg);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
fprintf(out, "\nBacktrace:\n");
|
||||||
|
|
||||||
|
// Try to get full backtrace, it will print files and line numbers
|
||||||
|
backtrace_full(bt_state, 2, bt_full_cb, bt_error_cb, (void*)&buf);
|
||||||
|
|
||||||
|
if (buf.error)
|
||||||
|
{
|
||||||
|
// Fall back to simple backtrace, only prints function names
|
||||||
|
backtrace_simple(bt_state, 2, bt_simple_cb, NULL, (void*)&buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
fputs(backtrace, out);
|
||||||
|
|
||||||
|
if (out != stderr)
|
||||||
|
{
|
||||||
|
fclose(out);
|
||||||
|
fprintf(stderr, "Crash report created, find srb2kart-crash-log.txt in your SRB2Kart directory\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
boolean consolevent = false;
|
boolean consolevent = false;
|
||||||
boolean framebuffer = false;
|
boolean framebuffer = false;
|
||||||
|
|
||||||
|
boolean g_in_exiting_signal_handler = false;
|
||||||
|
|
||||||
UINT8 keyboard_started = false;
|
UINT8 keyboard_started = false;
|
||||||
|
|
||||||
|
static void I_ReportSignal(int num, int coredumped)
|
||||||
|
{
|
||||||
|
//static char msg[] = "oh no! back to reality!\r\n";
|
||||||
|
const char * sigmsg;
|
||||||
|
char msg[256];
|
||||||
|
|
||||||
|
switch (num)
|
||||||
|
{
|
||||||
|
// case SIGINT:
|
||||||
|
// sigmsg = "SIGINT - interrupted";
|
||||||
|
// break;
|
||||||
|
case SIGILL:
|
||||||
|
sigmsg = "SIGILL - illegal instruction - invalid function image";
|
||||||
|
break;
|
||||||
|
case SIGFPE:
|
||||||
|
sigmsg = "SIGFPE - mathematical exception";
|
||||||
|
break;
|
||||||
|
case SIGSEGV:
|
||||||
|
sigmsg = "SIGSEGV - segment violation";
|
||||||
|
break;
|
||||||
|
// case SIGTERM:
|
||||||
|
// sigmsg = "SIGTERM - Software termination signal from kill";
|
||||||
|
// break;
|
||||||
|
// case SIGBREAK:
|
||||||
|
// sigmsg = "SIGBREAK - Ctrl-Break sequence";
|
||||||
|
// break;
|
||||||
|
case SIGABRT:
|
||||||
|
sigmsg = "SIGABRT - abnormal termination triggered by abort call";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
sprintf(msg,"signal number %d", num);
|
||||||
|
if (coredumped)
|
||||||
|
sigmsg = 0;
|
||||||
|
else
|
||||||
|
sigmsg = msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (coredumped)
|
||||||
|
{
|
||||||
|
if (sigmsg)
|
||||||
|
sprintf(msg, "%s (core dumped)", sigmsg);
|
||||||
|
else
|
||||||
|
strcat(msg, " (core dumped)");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sprintf(msg, "%s", sigmsg);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBBACKTRACE
|
||||||
|
strncat(msg, "\n\nCrash report has been saved into srb2kart-crash-log.txt", 255);
|
||||||
|
#elif defined(_WIN32) && !defined(__MINGW64__)
|
||||||
|
strncat(msg, "\n\nCrash report has been saved into srb2kart.rpt", 255);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
I_OutputMsg("\nProcess killed by signal: %s\n\n", sigmsg);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef NEWSIGNALHANDLER
|
||||||
|
FUNCNORETURN static ATTRNORETURN void signal_handler(INT32 num)
|
||||||
|
{
|
||||||
|
g_in_exiting_signal_handler = true;
|
||||||
|
|
||||||
|
D_QuitNetGame(); // Fix server freezes
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBBACKTRACE
|
||||||
|
write_backtrace(BT_CRASH_REASON_SIGNAL(num));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (demo.recording)
|
||||||
|
G_SaveDemo();
|
||||||
|
|
||||||
|
I_ReportSignal(num, 0);
|
||||||
|
I_ShutdownSystem();
|
||||||
|
signal(num, SIG_DFL); //default signal action
|
||||||
|
raise(num);
|
||||||
|
I_Quit();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
FUNCNORETURN static ATTRNORETURN void quit_handler(int num)
|
||||||
|
{
|
||||||
|
signal(num, SIG_DFL); //default signal action
|
||||||
|
raise(num);
|
||||||
|
I_Quit();
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef HAVE_TERMIOS
|
#ifdef HAVE_TERMIOS
|
||||||
// TERMIOS console code from Quake3: thank you!
|
// TERMIOS console code from Quake3: thank you!
|
||||||
boolean stdin_active = true;
|
boolean stdin_active = true;
|
||||||
@@ -206,6 +495,16 @@ static struct termios tty_tc;
|
|||||||
// so we provide tty_Clear and tty_Show to be called before and after a stdout or stderr output
|
// so we provide tty_Clear and tty_Show to be called before and after a stdout or stderr output
|
||||||
// =============================================================
|
// =============================================================
|
||||||
|
|
||||||
|
// flush stdin, I suspect some terminals are sending a LOT of garbage
|
||||||
|
// FIXME TTimo relevant?
|
||||||
|
#if 0
|
||||||
|
static inline void tty_FlushIn(void)
|
||||||
|
{
|
||||||
|
char key;
|
||||||
|
while (read(STDIN_FILENO, &key, 1)!=-1);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// do a backspace
|
// do a backspace
|
||||||
// TTimo NOTE: it seems on some terminals just sending '\b' is not enough
|
// TTimo NOTE: it seems on some terminals just sending '\b' is not enough
|
||||||
// so for now, in any case we send "\b \b" .. yeah well ..
|
// so for now, in any case we send "\b \b" .. yeah well ..
|
||||||
@@ -500,6 +799,55 @@ static inline void I_StartupConsole(void)
|
|||||||
static inline void I_ShutdownConsole(void){}
|
static inline void I_ShutdownConsole(void){}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//
|
||||||
|
// StartupKeyboard
|
||||||
|
//
|
||||||
|
static void I_RegisterSignals (void)
|
||||||
|
{
|
||||||
|
#ifdef SIGINT
|
||||||
|
signal(SIGINT , quit_handler);
|
||||||
|
#endif
|
||||||
|
#ifdef SIGBREAK
|
||||||
|
signal(SIGBREAK , quit_handler);
|
||||||
|
#endif
|
||||||
|
#ifdef SIGTERM
|
||||||
|
signal(SIGTERM , quit_handler);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// If these defines don't exist,
|
||||||
|
// then compilation would have failed above us...
|
||||||
|
#ifndef NEWSIGNALHANDLER
|
||||||
|
signal(SIGILL , signal_handler);
|
||||||
|
signal(SIGSEGV , signal_handler);
|
||||||
|
signal(SIGABRT , signal_handler);
|
||||||
|
signal(SIGFPE , signal_handler);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef NEWSIGNALHANDLER
|
||||||
|
static void signal_handler_child(INT32 num)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_LIBBACKTRACE
|
||||||
|
write_backtrace(BT_CRASH_REASON_SIGNAL(num));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (demo.recording)
|
||||||
|
G_SaveDemo();
|
||||||
|
|
||||||
|
signal(num, SIG_DFL); //default signal action
|
||||||
|
raise(num);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void I_RegisterChildSignals(void)
|
||||||
|
{
|
||||||
|
// If these defines don't exist,
|
||||||
|
// then compilation would have failed above us...
|
||||||
|
signal(SIGILL , signal_handler_child);
|
||||||
|
signal(SIGSEGV , signal_handler_child);
|
||||||
|
signal(SIGABRT , signal_handler_child);
|
||||||
|
signal(SIGFPE , signal_handler_child);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
//I_OutputMsg
|
//I_OutputMsg
|
||||||
@@ -526,6 +874,10 @@ void I_OutputMsg(const char *fmt, ...)
|
|||||||
DEFAULTFONTBGR, DEFAULTFONTBGG, DEFAULTFONTBGB, DEFAULTFONTBGA, txt);
|
DEFAULTFONTBGR, DEFAULTFONTBGG, DEFAULTFONTBGB, DEFAULTFONTBGA, txt);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined (_WIN32) && defined (_MSC_VER)
|
||||||
|
OutputDebugStringA(txt);
|
||||||
|
#endif
|
||||||
|
|
||||||
len = strlen(txt);
|
len = strlen(txt);
|
||||||
|
|
||||||
#ifdef LOGMESSAGES
|
#ifdef LOGMESSAGES
|
||||||
@@ -970,317 +1322,6 @@ void I_SleepDuration(precise_t duration)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean g_in_exiting_signal_handler = false;
|
|
||||||
|
|
||||||
static void I_PrintSignal(INT32 signal_num, boolean core_dumped, char *signal_msg)
|
|
||||||
{
|
|
||||||
const char *sigmsg;
|
|
||||||
|
|
||||||
switch (signal_num)
|
|
||||||
{
|
|
||||||
#ifdef SIGINT
|
|
||||||
case SIGINT:
|
|
||||||
sigmsg = ("SIGINT - SRB2Kart-Saturn was interrupted prematurely by the user.");
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
case SIGILL: // illegal instruction - invalid function image
|
|
||||||
sigmsg = ("SIGILL - SRB2Kart-Saturn has attempted to execute an illegal instruction and needs to close.");
|
|
||||||
break;
|
|
||||||
case SIGFPE: // mathematical exception
|
|
||||||
sigmsg = ("SIGFPE - SRB2Kart-Saturn has encountered a mathematical exception and needs to close.");
|
|
||||||
break;
|
|
||||||
case SIGSEGV: // segment violation
|
|
||||||
sigmsg = ("SIGSEGV - SRB2Kart-Saturn has attempted to access a memory location that it shouldn't and needs to close.");
|
|
||||||
break;
|
|
||||||
#ifdef SIGTERM
|
|
||||||
case SIGTERM: // Software termination signal from kill
|
|
||||||
sigmsg = ("SIGTERM - SRB2Kart-Saturn was terminated by a kill signal.");
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
#ifdef SIGBREAK
|
|
||||||
case SIGBREAK: // Ctrl-Break sequence
|
|
||||||
sigmsg =("SIGBREAK - SRB2Kart-Saturn was terminated by a Ctrl-Break sequence.")
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
case SIGABRT: // abnormal termination triggered by abort call
|
|
||||||
sigmsg = ("SIGABRT - SRB2Kart-Saturn was terminated by an abort signal.");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
sprintf(signal_msg, "Signal number %d", signal_num);
|
|
||||||
sigmsg = (core_dumped ? "Unknown signal" : signal_msg);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (core_dumped)
|
|
||||||
{
|
|
||||||
if (sigmsg)
|
|
||||||
sprintf(signal_msg, "%s (core dumped)", sigmsg);
|
|
||||||
else
|
|
||||||
strcat(signal_msg, " (core dumped)");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sprintf(signal_msg, "%s", sigmsg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void I_ReportSignal(int num, int coredumped)
|
|
||||||
{
|
|
||||||
char sigmsg[512];
|
|
||||||
|
|
||||||
I_PrintSignal(num, coredumped, sigmsg);
|
|
||||||
size_t len = strlen(sigmsg);
|
|
||||||
snprintf(sigmsg + len, sizeof(sigmsg) - len, "\n\nCrash report has been saved into %s", CRASH_LOGFILE_NAME);
|
|
||||||
I_OutputMsg("\nProcess killed by signal: %s\n\n", sigmsg);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef NEWSIGNALHANDLER
|
|
||||||
FUNCNORETURN static ATTRNORETURN void signal_handler(INT32 num)
|
|
||||||
{
|
|
||||||
g_in_exiting_signal_handler = true;
|
|
||||||
|
|
||||||
D_QuitNetGame(); // Fix server freezes
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBBACKTRACE
|
|
||||||
write_backtrace(BT_CRASH_REASON_SIGNAL(num));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
I_ReportSignal(num, 0);
|
|
||||||
I_ShutdownSystem();
|
|
||||||
signal(num, SIG_DFL); //default signal action
|
|
||||||
raise(num);
|
|
||||||
I_Quit();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
FUNCNORETURN static ATTRNORETURN void quit_handler(int num)
|
|
||||||
{
|
|
||||||
signal(num, SIG_DFL); //default signal action
|
|
||||||
raise(num);
|
|
||||||
I_Quit();
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBBACKTRACE
|
|
||||||
#include <backtrace.h>
|
|
||||||
// TODO - move this to some header file instead
|
|
||||||
extern struct backtrace_state *bt_state;
|
|
||||||
|
|
||||||
typedef struct bt_crash_reason_s {
|
|
||||||
enum {
|
|
||||||
BTCRASH_SIGNAL,
|
|
||||||
BTCRASH_ERRORMSG,
|
|
||||||
} type;
|
|
||||||
|
|
||||||
union {
|
|
||||||
INT32 signal;
|
|
||||||
const char *errormsg;
|
|
||||||
} value;
|
|
||||||
} bt_crash_reason_t;
|
|
||||||
|
|
||||||
#define BT_CRASH_REASON_SIGNAL(num) (bt_crash_reason_t){ .type = BTCRASH_SIGNAL, .value = { .signal = num } }
|
|
||||||
#define BT_CRASH_REASON_ERRORMSG(msg) (bt_crash_reason_t){ .type = BTCRASH_ERRORMSG, .value = { .errormsg = msg } }
|
|
||||||
|
|
||||||
typedef struct bt_out_buf_s {
|
|
||||||
boolean error;
|
|
||||||
char *pos;
|
|
||||||
size_t size;
|
|
||||||
} bt_out_buf_t;
|
|
||||||
|
|
||||||
static void bt_syminfo_cb(void *data, uintptr_t pc, const char *symname, uintptr_t symval, uintptr_t symsize)
|
|
||||||
{
|
|
||||||
(void)symval;
|
|
||||||
(void)symsize;
|
|
||||||
|
|
||||||
bt_out_buf_t *buf = (bt_out_buf_t*)data;
|
|
||||||
|
|
||||||
if (!symname)
|
|
||||||
symname = "???";
|
|
||||||
|
|
||||||
int n = snprintf(buf->pos, buf->size, "%p %s\n", (void*)pc, symname);
|
|
||||||
|
|
||||||
if (n <= 0)
|
|
||||||
{
|
|
||||||
buf->size = 0;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
buf->pos += n;
|
|
||||||
buf->size -= n;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int bt_simple_cb(void *data, uintptr_t pc)
|
|
||||||
{
|
|
||||||
bt_out_buf_t *buf = (bt_out_buf_t*)data;
|
|
||||||
|
|
||||||
backtrace_syminfo(bt_state, pc, bt_syminfo_cb, NULL, data);
|
|
||||||
|
|
||||||
if (!buf->size) return 1;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int bt_full_cb(void *data, uintptr_t pc, const char *filename, int lineno, const char *function)
|
|
||||||
{
|
|
||||||
bt_out_buf_t *buf = (bt_out_buf_t*)data;
|
|
||||||
|
|
||||||
if (!filename) filename = "???";
|
|
||||||
if (!function) function = "???";
|
|
||||||
|
|
||||||
int n = snprintf(buf->pos, buf->size, "%p %s\n\t%s:%d\n", (void*)pc, function, filename, lineno);
|
|
||||||
|
|
||||||
if (n <= 0) return 1;
|
|
||||||
|
|
||||||
buf->pos += n;
|
|
||||||
buf->size -= n;
|
|
||||||
|
|
||||||
if (!buf->size) return 1;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void bt_error_cb(void *data, const char *msg, int errnum)
|
|
||||||
{
|
|
||||||
(void)msg; // We don't need this
|
|
||||||
|
|
||||||
bt_out_buf_t *buf = (bt_out_buf_t*)data;
|
|
||||||
|
|
||||||
// No debug info
|
|
||||||
if (errnum == -1)
|
|
||||||
buf->error = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void write_backtrace(bt_crash_reason_t reason)
|
|
||||||
{
|
|
||||||
char sig_msg[512];
|
|
||||||
const char *filename = va("%s" PATHSEP CRASH_LOGFILE_NAME, srb2home);
|
|
||||||
FILE *out = fopen(filename, "a+");
|
|
||||||
|
|
||||||
time_t rawtime;
|
|
||||||
struct tm *timeinfo;
|
|
||||||
|
|
||||||
const size_t BUFSIZE = 8192;
|
|
||||||
char backtrace[BUFSIZE];
|
|
||||||
|
|
||||||
bt_out_buf_t buf;
|
|
||||||
buf.error = false;
|
|
||||||
buf.pos = backtrace;
|
|
||||||
buf.size = BUFSIZE;
|
|
||||||
|
|
||||||
if (!out)
|
|
||||||
{
|
|
||||||
fprintf(stderr, "\nWARNING: Couldn't open crash log for writing! Make sure your permissions are correct. Please save the below report!\n");
|
|
||||||
out = stderr;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the current time as a string.
|
|
||||||
time(&rawtime);
|
|
||||||
timeinfo = localtime(&rawtime);
|
|
||||||
|
|
||||||
fprintf(out, "------------------------\n\n");
|
|
||||||
|
|
||||||
fprintf(out, "Program name: %s %s\n", SRB2APPLICATION, VERSIONSTRING);
|
|
||||||
|
|
||||||
fprintf(out, "Dedicated build\n");
|
|
||||||
fprintf(out, "Platform: %s\n", I_GetSysName());
|
|
||||||
|
|
||||||
if (compdate && comptime && comprevision && compbranch)
|
|
||||||
fprintf(out, "Compiled: %s %s, commit %s, branch %s\n", compdate, comptime, comprevision, compbranch);
|
|
||||||
|
|
||||||
if (gamestate == GS_LEVEL && gamemap)
|
|
||||||
{
|
|
||||||
char *title = G_BuildMapTitle(gamemap);
|
|
||||||
|
|
||||||
if (title)
|
|
||||||
{
|
|
||||||
fprintf(out, "Game map: %s (%s)\n", title, G_BuildMapName(gamemap));
|
|
||||||
Z_Free(title);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
fprintf(out, "Game map: %s\n", G_BuildMapName(gamemap));
|
|
||||||
}
|
|
||||||
|
|
||||||
fprintf(out, "Time of crash: %s\n", asctime(timeinfo));
|
|
||||||
|
|
||||||
fprintf(out, "Caused by: ");
|
|
||||||
|
|
||||||
switch (reason.type)
|
|
||||||
{
|
|
||||||
case BTCRASH_SIGNAL:
|
|
||||||
I_PrintSignal(reason.value.signal, false, sig_msg);
|
|
||||||
fprintf(out, "%s", sig_msg);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BTCRASH_ERRORMSG:
|
|
||||||
fprintf(out, "%s", reason.value.errormsg);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
fprintf(out, "\nBacktrace:\n");
|
|
||||||
|
|
||||||
// Try to get full backtrace, it will print files and line numbers
|
|
||||||
backtrace_full(bt_state, 2, bt_full_cb, bt_error_cb, (void*)&buf);
|
|
||||||
|
|
||||||
if (buf.error)
|
|
||||||
{
|
|
||||||
// Fall back to simple backtrace, only prints function names
|
|
||||||
backtrace_simple(bt_state, 2, bt_simple_cb, NULL, (void*)&buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
fputs(backtrace, out);
|
|
||||||
|
|
||||||
if (out != stderr)
|
|
||||||
{
|
|
||||||
fclose(out);
|
|
||||||
fprintf(stderr, "Crash report created, find %s in your SRB2Kart directory\n", CRASH_LOGFILE_NAME);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void I_RegisterSignals(void)
|
|
||||||
{
|
|
||||||
#ifdef SIGINT
|
|
||||||
signal(SIGINT, quit_handler);
|
|
||||||
#endif
|
|
||||||
#ifdef SIGBREAK
|
|
||||||
signal(SIGBREAK, quit_handler);
|
|
||||||
#endif
|
|
||||||
#ifdef SIGTERM
|
|
||||||
signal(SIGTERM, quit_handler);
|
|
||||||
#endif
|
|
||||||
#ifndef NEWSIGNALHANDLER
|
|
||||||
// If these defines don't exist,
|
|
||||||
// then compilation would have failed above us...
|
|
||||||
signal(SIGILL, signal_handler);
|
|
||||||
signal(SIGSEGV, signal_handler);
|
|
||||||
signal(SIGABRT, signal_handler);
|
|
||||||
signal(SIGFPE, signal_handler);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef NEWSIGNALHANDLER
|
|
||||||
static void signal_handler_child(INT32 num)
|
|
||||||
{
|
|
||||||
g_in_exiting_signal_handler = true;
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBBACKTRACE
|
|
||||||
write_backtrace(BT_CRASH_REASON_SIGNAL(num));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
signal(num, SIG_DFL); // default signal action
|
|
||||||
raise(num);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void I_RegisterChildSignals(void)
|
|
||||||
{
|
|
||||||
// If these defines don't exist,
|
|
||||||
// then compilation would have failed above us...
|
|
||||||
signal(SIGILL, signal_handler_child);
|
|
||||||
signal(SIGSEGV, signal_handler_child);
|
|
||||||
signal(SIGABRT, signal_handler_child);
|
|
||||||
signal(SIGFPE, signal_handler_child);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NEWSIGNALHANDLER
|
#ifdef NEWSIGNALHANDLER
|
||||||
FUNCNORETURN static ATTRNORETURN void newsignalhandler_Warn(const char *pr)
|
FUNCNORETURN static ATTRNORETURN void newsignalhandler_Warn(const char *pr)
|
||||||
{
|
{
|
||||||
@@ -1385,12 +1426,13 @@ void I_Quit(void)
|
|||||||
static boolean quiting = false;
|
static boolean quiting = false;
|
||||||
|
|
||||||
/* prevent recursive I_Quit() */
|
/* prevent recursive I_Quit() */
|
||||||
if (quiting)
|
if (quiting) goto death;
|
||||||
goto death;
|
|
||||||
quiting = false;
|
quiting = false;
|
||||||
I_ShutdownConsole();
|
I_ShutdownConsole();
|
||||||
M_SaveConfig(NULL); //save game config, cvars..
|
M_SaveConfig(NULL); //save game config, cvars..
|
||||||
|
#ifndef NONET
|
||||||
D_SaveBan(); // save the ban list
|
D_SaveBan(); // save the ban list
|
||||||
|
#endif
|
||||||
G_SaveGameData(false); // Tails 12-08-2002
|
G_SaveGameData(false); // Tails 12-08-2002
|
||||||
//added:16-02-98: when recording a demo, should exit using 'q' key,
|
//added:16-02-98: when recording a demo, should exit using 'q' key,
|
||||||
// but sometimes we forget and use 'F10'.. so save here too.
|
// but sometimes we forget and use 'F10'.. so save here too.
|
||||||
@@ -1468,7 +1510,7 @@ void I_Error(const char *error, ...)
|
|||||||
if (errorcount > 20)
|
if (errorcount > 20)
|
||||||
{
|
{
|
||||||
va_start(argptr, error);
|
va_start(argptr, error);
|
||||||
vsnprintf(buffer, 8192, error, argptr);
|
vsprintf(buffer, error, argptr);
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
|
|
||||||
I_OutputMsg("SRB2Kart %s Recursive Error", buffer);
|
I_OutputMsg("SRB2Kart %s Recursive Error", buffer);
|
||||||
@@ -1482,7 +1524,7 @@ void I_Error(const char *error, ...)
|
|||||||
|
|
||||||
// Display error message in the console before we start shutting it down
|
// Display error message in the console before we start shutting it down
|
||||||
va_start(argptr, error);
|
va_start(argptr, error);
|
||||||
vsnprintf(buffer, 8192, error, argptr);
|
vsprintf(buffer, error, argptr);
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
I_OutputMsg("\nI_Error(): %s\n", buffer);
|
I_OutputMsg("\nI_Error(): %s\n", buffer);
|
||||||
|
|
||||||
@@ -1494,7 +1536,9 @@ void I_Error(const char *error, ...)
|
|||||||
I_ShutdownConsole();
|
I_ShutdownConsole();
|
||||||
|
|
||||||
M_SaveConfig(NULL); // save game config, cvars..
|
M_SaveConfig(NULL); // save game config, cvars..
|
||||||
|
#ifndef NONET
|
||||||
D_SaveBan(); // save the ban list
|
D_SaveBan(); // save the ban list
|
||||||
|
#endif
|
||||||
G_SaveGameData(false); // Tails 12-08-2002
|
G_SaveGameData(false); // Tails 12-08-2002
|
||||||
|
|
||||||
// Shutdown. Here might be other errors.
|
// Shutdown. Here might be other errors.
|
||||||
@@ -1983,7 +2027,7 @@ const char *I_LocateWad(void)
|
|||||||
#if defined (_WIN32)
|
#if defined (_WIN32)
|
||||||
SetCurrentDirectoryA(waddir);
|
SetCurrentDirectoryA(waddir);
|
||||||
#else
|
#else
|
||||||
if (waddir == NULL || chdir(waddir) == -1)
|
if (chdir(waddir) == -1)
|
||||||
I_OutputMsg("Couldn't change working directory\n");
|
I_OutputMsg("Couldn't change working directory\n");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -2131,50 +2175,6 @@ size_t I_GetFreeMem(size_t *total)
|
|||||||
// note CPUAFFINITY code used to reside here
|
// note CPUAFFINITY code used to reside here
|
||||||
void I_RegisterSysCommands(void) {}
|
void I_RegisterSysCommands(void) {}
|
||||||
|
|
||||||
const char *I_GetSysName(void)
|
|
||||||
{
|
|
||||||
// reference: https://sourceforge.net/p/predef/wiki/OperatingSystems/
|
|
||||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
|
||||||
return "Windows";
|
|
||||||
#elif defined(__APPLE__)
|
|
||||||
return "Mac OS";
|
|
||||||
#elif defined(__linux__)
|
|
||||||
return "Linux";
|
|
||||||
#elif defined(__FreeBSD__)
|
|
||||||
return "FreeBSD";
|
|
||||||
#elif defined(__OpenBSD__)
|
|
||||||
return "OpenBSD";
|
|
||||||
#elif defined(__NetBSD__)
|
|
||||||
return "NetBSD";
|
|
||||||
#elif defined(__DragonFly__)
|
|
||||||
return "DragonFly BSD";
|
|
||||||
#elif defined(__gnu_hurd__)
|
|
||||||
return "GNU Hurd"; // for anyone mental enough to set up an SRB2 server on GNU Hurd
|
|
||||||
#elif defined(__hpux)
|
|
||||||
return "HP-UX";
|
|
||||||
#elif defined(EPLAN9)
|
|
||||||
return "Plan 9";
|
|
||||||
#elif defined(__HAIKU__)
|
|
||||||
return "Haiku";
|
|
||||||
#elif defined(__BEOS__)
|
|
||||||
return "BeOS";
|
|
||||||
#elif defined(__minix)
|
|
||||||
return "Minix";
|
|
||||||
#elif defined(__sun)
|
|
||||||
#if defined(__SVR4) || defined(__srv4__)
|
|
||||||
return "Solaris"; // this would be so cursed...
|
|
||||||
#else
|
|
||||||
return "SunOS";
|
|
||||||
#endif
|
|
||||||
#elif defined(_AIX)
|
|
||||||
return "AIX";
|
|
||||||
#elif defined(__SYLLABLE__)
|
|
||||||
return "SyllableOS"; // RIP SyllableOS, i still miss you ;-;
|
|
||||||
#else
|
|
||||||
return "Unknown";
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean I_InitNetwork(void)
|
boolean I_InitNetwork(void)
|
||||||
{
|
{
|
||||||
// this must exist, but this is actually handled in i_tcp.c
|
// this must exist, but this is actually handled in i_tcp.c
|
||||||
|
|||||||
@@ -89,10 +89,9 @@ void I_UpdateNoVsync(void)
|
|||||||
//
|
//
|
||||||
// I_ReadScreen
|
// I_ReadScreen
|
||||||
//
|
//
|
||||||
void I_ReadScreen(UINT8 * restrict scr, INT32 scale)
|
void I_ReadScreen(UINT8 *scr)
|
||||||
{
|
{
|
||||||
(void)scr;
|
(void)scr;
|
||||||
(void)scale;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -145,9 +144,8 @@ UINT32 I_GetRefreshRate(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void I_SetTextInput(boolean enable)
|
void I_SetTextInput(void)
|
||||||
{
|
{
|
||||||
(void)enable;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean I_UseNativeKeyboard(void)
|
boolean I_UseNativeKeyboard(void)
|
||||||
|
|||||||
+9
-9
@@ -754,7 +754,7 @@ static void readlevelheader(MYFILE *f, INT32 num, INT32 wadnum)
|
|||||||
strupr(word);
|
strupr(word);
|
||||||
|
|
||||||
// Now get the part after
|
// Now get the part after
|
||||||
word2 = tmp + 2;
|
word2 = tmp += 2;
|
||||||
i = atoi(word2); // used for numerical settings
|
i = atoi(word2); // used for numerical settings
|
||||||
|
|
||||||
// CHEAP HACK: move this over here for lowercase subtitles
|
// CHEAP HACK: move this over here for lowercase subtitles
|
||||||
@@ -1393,7 +1393,7 @@ static void readhuditem(MYFILE *f, INT32 num)
|
|||||||
strupr(word);
|
strupr(word);
|
||||||
|
|
||||||
// Now get the part after
|
// Now get the part after
|
||||||
word2 = tmp + 2;
|
word2 = tmp += 2;
|
||||||
strupr(word2);
|
strupr(word2);
|
||||||
|
|
||||||
i = atoi(word2); // used for numerical settings
|
i = atoi(word2); // used for numerical settings
|
||||||
@@ -1862,7 +1862,7 @@ static void reademblemdata(MYFILE *f, INT32 num)
|
|||||||
strupr(word);
|
strupr(word);
|
||||||
|
|
||||||
// Now get the part after
|
// Now get the part after
|
||||||
word2 = tmp + 2;
|
word2 = tmp += 2;
|
||||||
value = atoi(word2); // used for numerical settings
|
value = atoi(word2); // used for numerical settings
|
||||||
|
|
||||||
// Up here to allow lowercase in hints
|
// Up here to allow lowercase in hints
|
||||||
@@ -1989,7 +1989,7 @@ static void readextraemblemdata(MYFILE *f, INT32 num)
|
|||||||
strupr(word);
|
strupr(word);
|
||||||
|
|
||||||
// Now get the part after
|
// Now get the part after
|
||||||
word2 = tmp + 2;
|
word2 = tmp += 2;
|
||||||
strupr(word2);
|
strupr(word2);
|
||||||
|
|
||||||
value = atoi(word2); // used for numerical settings
|
value = atoi(word2); // used for numerical settings
|
||||||
@@ -2067,7 +2067,7 @@ static void readunlockable(MYFILE *f, INT32 num)
|
|||||||
strupr(word);
|
strupr(word);
|
||||||
|
|
||||||
// Now get the part after
|
// Now get the part after
|
||||||
word2 = tmp + 2;
|
word2 = tmp += 2;
|
||||||
strupr(word2);
|
strupr(word2);
|
||||||
|
|
||||||
i = atoi(word2); // used for numerical settings
|
i = atoi(word2); // used for numerical settings
|
||||||
@@ -2336,7 +2336,7 @@ static void readconditionset(MYFILE *f, UINT8 setnum)
|
|||||||
strupr(word);
|
strupr(word);
|
||||||
|
|
||||||
// Now get the part after
|
// Now get the part after
|
||||||
word2 = tmp + 2;
|
word2 = tmp += 2;
|
||||||
strupr(word2);
|
strupr(word2);
|
||||||
|
|
||||||
if (fastncmp(word, "CONDITION", 9))
|
if (fastncmp(word, "CONDITION", 9))
|
||||||
@@ -2470,7 +2470,7 @@ static void readmaincfg(MYFILE *f)
|
|||||||
strupr(word);
|
strupr(word);
|
||||||
|
|
||||||
// Now get the part after
|
// Now get the part after
|
||||||
word2 = tmp + 2;
|
word2 = tmp += 2;
|
||||||
strupr(word2);
|
strupr(word2);
|
||||||
|
|
||||||
value = atoi(word2); // used for numerical settings
|
value = atoi(word2); // used for numerical settings
|
||||||
@@ -2649,7 +2649,7 @@ static void readwipes(MYFILE *f)
|
|||||||
{
|
{
|
||||||
char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
|
char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
|
||||||
char *word = s;
|
char *word = s;
|
||||||
char *pword;
|
char *pword = word;
|
||||||
char *word2;
|
char *word2;
|
||||||
char *tmp;
|
char *tmp;
|
||||||
INT32 value;
|
INT32 value;
|
||||||
@@ -2682,7 +2682,7 @@ static void readwipes(MYFILE *f)
|
|||||||
strupr(word);
|
strupr(word);
|
||||||
|
|
||||||
// Now get the part after
|
// Now get the part after
|
||||||
word2 = tmp + 2;
|
word2 = tmp += 2;
|
||||||
value = atoi(word2); // used for numerical settings
|
value = atoi(word2); // used for numerical settings
|
||||||
|
|
||||||
if (value < -1 || value > 99)
|
if (value < -1 || value > 99)
|
||||||
|
|||||||
+1
-27
@@ -49,27 +49,6 @@ discordRequest_t *discordRequestList = NULL;
|
|||||||
|
|
||||||
static char self_ip[IP_SIZE+1];
|
static char self_ip[IP_SIZE+1];
|
||||||
|
|
||||||
/*--------------------------------------------------
|
|
||||||
* const char *DRPC_HideUsername(const char *input)
|
|
||||||
*
|
|
||||||
* See header file for description.
|
|
||||||
* --------------------------------------------------*/
|
|
||||||
const char *DRPC_HideUsername(const char *input)
|
|
||||||
{
|
|
||||||
static char buffer[5];
|
|
||||||
int i;
|
|
||||||
|
|
||||||
buffer[0] = input[0];
|
|
||||||
|
|
||||||
for (i = 1; i < 4; ++i)
|
|
||||||
{
|
|
||||||
buffer[i] = '.';
|
|
||||||
}
|
|
||||||
|
|
||||||
buffer[4] = '\0';
|
|
||||||
return buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean drpc_init = false;
|
boolean drpc_init = false;
|
||||||
|
|
||||||
/*--------------------------------------------------
|
/*--------------------------------------------------
|
||||||
@@ -126,7 +105,7 @@ static void DRPC_HandleReady(const DiscordUser *user)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CONS_Printf("Discord: connected to %s (%s)\n", user->username, user->userId);
|
CONS_Printf("Discord: connected to %s#%s (%s)\n", user->username, user->discriminator, user->userId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -262,10 +241,8 @@ static void DRPC_HandleJoinRequest(const DiscordUser *requestUser)
|
|||||||
newRequest->username = Z_Calloc(344, PU_STATIC, NULL);
|
newRequest->username = Z_Calloc(344, PU_STATIC, NULL);
|
||||||
snprintf(newRequest->username, 344, "%s", requestUser->username);
|
snprintf(newRequest->username, 344, "%s", requestUser->username);
|
||||||
|
|
||||||
#if 0
|
|
||||||
newRequest->discriminator = Z_Calloc(8, PU_STATIC, NULL);
|
newRequest->discriminator = Z_Calloc(8, PU_STATIC, NULL);
|
||||||
snprintf(newRequest->discriminator, 8, "%s", requestUser->discriminator);
|
snprintf(newRequest->discriminator, 8, "%s", requestUser->discriminator);
|
||||||
#endif
|
|
||||||
|
|
||||||
newRequest->userID = Z_Calloc(32, PU_STATIC, NULL);
|
newRequest->userID = Z_Calloc(32, PU_STATIC, NULL);
|
||||||
snprintf(newRequest->userID, 32, "%s", requestUser->userId);
|
snprintf(newRequest->userID, 32, "%s", requestUser->userId);
|
||||||
@@ -331,9 +308,6 @@ void DRPC_RemoveRequest(discordRequest_t *removeRequest)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Z_Free(removeRequest->username);
|
Z_Free(removeRequest->username);
|
||||||
#if 0
|
|
||||||
Z_Free(removeRequest->discriminator);
|
|
||||||
#endif
|
|
||||||
Z_Free(removeRequest->userID);
|
Z_Free(removeRequest->userID);
|
||||||
Z_Free(removeRequest);
|
Z_Free(removeRequest);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,9 +29,7 @@ extern struct discordInfo_s {
|
|||||||
|
|
||||||
typedef struct discordRequest_s {
|
typedef struct discordRequest_s {
|
||||||
char *username; // Discord user name.
|
char *username; // Discord user name.
|
||||||
#if 0 // Good night, sweet prince...
|
|
||||||
char *discriminator; // Discord discriminator (The little hashtag thing after the username). Separated for a "hide discriminators" cvar.
|
char *discriminator; // Discord discriminator (The little hashtag thing after the username). Separated for a "hide discriminators" cvar.
|
||||||
#endif
|
|
||||||
char *userID; // The ID of the Discord user, gets used with Discord_Respond()
|
char *userID; // The ID of the Discord user, gets used with Discord_Respond()
|
||||||
|
|
||||||
// HAHAHA, no.
|
// HAHAHA, no.
|
||||||
@@ -46,15 +44,6 @@ typedef struct discordRequest_s {
|
|||||||
|
|
||||||
extern discordRequest_t *discordRequestList;
|
extern discordRequest_t *discordRequestList;
|
||||||
|
|
||||||
/*--------------------------------------------------
|
|
||||||
* const char *DRPC_HideUsername(const char *input);
|
|
||||||
*
|
|
||||||
* Handle usernames while cv_discordstreamer is activated.
|
|
||||||
* (The loss of discriminators is still a dumbass regression
|
|
||||||
* that I will never forgive the Discord developers for.)
|
|
||||||
* --------------------------------------------------*/
|
|
||||||
|
|
||||||
const char *DRPC_HideUsername(const char *input);
|
|
||||||
|
|
||||||
/*--------------------------------------------------
|
/*--------------------------------------------------
|
||||||
void DRPC_RemoveRequest(void);
|
void DRPC_RemoveRequest(void);
|
||||||
|
|||||||
@@ -57,6 +57,10 @@ enum
|
|||||||
|
|
||||||
// Do not use bit five or after, as they are used for object z-offsets.
|
// Do not use bit five or after, as they are used for object z-offsets.
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
#pragma pack(1)
|
||||||
|
#endif
|
||||||
|
|
||||||
// A single Vertex.
|
// A single Vertex.
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@@ -184,6 +188,10 @@ typedef struct
|
|||||||
UINT16 children[2];
|
UINT16 children[2];
|
||||||
} ATTRPACK mapnode_t;
|
} ATTRPACK mapnode_t;
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
#pragma pack()
|
||||||
|
#endif
|
||||||
|
|
||||||
// Thing definition, position, orientation and type,
|
// Thing definition, position, orientation and type,
|
||||||
// plus visibility flags and attributes.
|
// plus visibility flags and attributes.
|
||||||
typedef struct
|
typedef struct
|
||||||
|
|||||||
+22
-20
@@ -47,6 +47,17 @@
|
|||||||
#define ASMCALL
|
#define ASMCALL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(disable : 4127 4152 4213 4514)
|
||||||
|
#ifdef _WIN64
|
||||||
|
#pragma warning(disable : 4306)
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
// warning level 4
|
||||||
|
// warning C4127: conditional expression is constant
|
||||||
|
// warning C4152: nonstandard extension, function/data pointer conversion in expression
|
||||||
|
// warning C4213: nonstandard extension used : cast on l-value
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
@@ -90,14 +101,6 @@ extern FILE *logstream;
|
|||||||
extern char logfilename[1024];
|
extern char logfilename[1024];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined (HAVE_LIBBACKTRACE)
|
|
||||||
#define CRASH_LOGFILE_NAME "srb2kart-crash-log.txt"
|
|
||||||
#elif defined (HAVE_DRMINGW)
|
|
||||||
#define CRASH_LOGFILE_NAME "srb2kart-crash-log.RPT"
|
|
||||||
#else
|
|
||||||
#define CRASH_LOGFILE_NAME "(unknown crash log)"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* A mod name to further distinguish versions. */
|
/* A mod name to further distinguish versions. */
|
||||||
#define SRB2APPLICATION "SRB2Kart"
|
#define SRB2APPLICATION "SRB2Kart"
|
||||||
|
|
||||||
@@ -114,11 +117,9 @@ extern char logfilename[1024];
|
|||||||
#define SUBVERSION 6 // more precise version number
|
#define SUBVERSION 6 // more precise version number
|
||||||
#define VERSIONSTRING "Saturn v9"
|
#define VERSIONSTRING "Saturn v9"
|
||||||
#define VERSIONSTRINGW L"Saturn v9"
|
#define VERSIONSTRINGW L"Saturn v9"
|
||||||
|
|
||||||
#define SATURN_TESTING // comment out for saturn release builds!
|
|
||||||
|
|
||||||
// Hey! If you change this, add 1 to the MODVERSION below! Otherwise we can't force updates!
|
// Hey! If you change this, add 1 to the MODVERSION below! Otherwise we can't force updates!
|
||||||
// And change CMakeLists.txt (not src/, but in root), for CMake users!
|
// And change CMakeLists.txt (not src/, but in root), for CMake users!
|
||||||
|
// AND appveyor.yml, for the build bots!
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Maintain compatibility with 1.0.x record attack replays?
|
// Maintain compatibility with 1.0.x record attack replays?
|
||||||
@@ -415,7 +416,7 @@ enum {
|
|||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
FUNCIERROR void ATTRNORETURN I_Error(const char *error, ...);
|
void I_Error(const char *error, ...) FUNCIERROR;
|
||||||
|
|
||||||
/** \brief write a message to stderr (use before I_Quit) for when you need to quit with a msg, but need
|
/** \brief write a message to stderr (use before I_Quit) for when you need to quit with a msg, but need
|
||||||
the return code 0 of I_Quit();
|
the return code 0 of I_Quit();
|
||||||
@@ -559,19 +560,13 @@ UINT32 quickncasehash (const char *p, size_t n)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#if defined(__GNUC__) || defined(__clang__)
|
#if defined(__GNUC__) || defined(__clang__) || defined(_MSC_VER)
|
||||||
#define restrict __restrict
|
#define restrict __restrict
|
||||||
#else
|
#else
|
||||||
#define restrict
|
#define restrict
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// the GNU cleanup attribute: plugging memory leaks since 2003!
|
|
||||||
// on scope exit, the cleanup function is called with a pointer to the declared variable,
|
|
||||||
// essentially behaving like a C++ destructor
|
|
||||||
// NOTE: you WILL have nasal troubles if the variable is not initialized
|
|
||||||
#define CLEANUP(f) __attribute__((__cleanup__(f)))
|
|
||||||
|
|
||||||
// An assert-type mechanism.
|
// An assert-type mechanism.
|
||||||
#ifdef PARANOIA
|
#ifdef PARANOIA
|
||||||
#define I_Assert(e) ((e) ? (void)0 : I_Error("assert failed: %s, file %s, line %d", #e, __FILE__, __LINE__))
|
#define I_Assert(e) ((e) ? (void)0 : I_Error("assert failed: %s, file %s, line %d", #e, __FILE__, __LINE__))
|
||||||
@@ -594,6 +589,7 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
|
|||||||
// None of these that are disabled in the normal build are guaranteed to work perfectly
|
// None of these that are disabled in the normal build are guaranteed to work perfectly
|
||||||
// Compile them at your own risk!
|
// Compile them at your own risk!
|
||||||
|
|
||||||
|
#ifndef NONET
|
||||||
//-- SATURN __
|
//-- SATURN __
|
||||||
/// Detect if a client is on Saturn in the clientconfig.
|
/// Detect if a client is on Saturn in the clientconfig.
|
||||||
/// To seperately allow them to join or block joining from vanilla clients.
|
/// To seperately allow them to join or block joining from vanilla clients.
|
||||||
@@ -608,6 +604,7 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
|
|||||||
#define SATURNPAK
|
#define SATURNPAK
|
||||||
#endif
|
#endif
|
||||||
//-- <( ̄︶ ̄)> __
|
//-- <( ̄︶ ̄)> __
|
||||||
|
#endif
|
||||||
|
|
||||||
/// Undefine to use the new method of Gamma correction see colour cube in v_video.c
|
/// Undefine to use the new method of Gamma correction see colour cube in v_video.c
|
||||||
#define BACKWARDSCOMPATCORRECTION
|
#define BACKWARDSCOMPATCORRECTION
|
||||||
@@ -629,6 +626,11 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
|
|||||||
/// Most modifications should probably enable this.
|
/// Most modifications should probably enable this.
|
||||||
//#define SAVEGAME_OTHERVERSIONS
|
//#define SAVEGAME_OTHERVERSIONS
|
||||||
|
|
||||||
|
#ifndef NONET
|
||||||
|
/// Display a connection screen on join attempts.
|
||||||
|
#define CLIENT_LOADINGSCREEN
|
||||||
|
#endif
|
||||||
|
|
||||||
/// Backwards compatibility with musicslots.
|
/// Backwards compatibility with musicslots.
|
||||||
/// \note You should leave this enabled unless you're working with a future SRB2 version.
|
/// \note You should leave this enabled unless you're working with a future SRB2 version.
|
||||||
#define MUSICSLOT_COMPATIBILITY
|
#define MUSICSLOT_COMPATIBILITY
|
||||||
@@ -649,7 +651,7 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
|
|||||||
#define ROTANGLES 72 // Needs to be a divisor of 360 (45, 60, 90, 120...)
|
#define ROTANGLES 72 // Needs to be a divisor of 360 (45, 60, 90, 120...)
|
||||||
#define ROTANGDIFF (360 / ROTANGLES)
|
#define ROTANGDIFF (360 / ROTANGLES)
|
||||||
|
|
||||||
#if defined (HAVE_CURL)
|
#if defined (HAVE_CURL) && ! defined (NONET)
|
||||||
#define MASTERSERVER
|
#define MASTERSERVER
|
||||||
#define HOLEPUNCH
|
#define HOLEPUNCH
|
||||||
#else
|
#else
|
||||||
|
|||||||
+45
-2
@@ -28,6 +28,31 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* 7.18.1.1 Exact-width integer types */
|
/* 7.18.1.1 Exact-width integer types */
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#define UINT8 unsigned __int8
|
||||||
|
#define SINT8 signed __int8
|
||||||
|
|
||||||
|
#define UINT16 unsigned __int16
|
||||||
|
#define INT16 __int16
|
||||||
|
|
||||||
|
#define INT32 __int32
|
||||||
|
#define UINT32 unsigned __int32
|
||||||
|
|
||||||
|
#define INT64 __int64
|
||||||
|
#define UINT64 unsigned __int64
|
||||||
|
|
||||||
|
typedef long ssize_t;
|
||||||
|
|
||||||
|
/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
|
||||||
|
#if (_MSC_VER <= 1200)
|
||||||
|
#ifndef DWORD_PTR
|
||||||
|
#define DWORD_PTR DWORD
|
||||||
|
#endif
|
||||||
|
#ifndef PDWORD_PTR
|
||||||
|
#define PDWORD_PTR PDWORD
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
#define __STDC_LIMIT_MACROS
|
#define __STDC_LIMIT_MACROS
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
@@ -41,15 +66,26 @@ extern "C" {
|
|||||||
#define UINT32 uint32_t
|
#define UINT32 uint32_t
|
||||||
#define INT64 int64_t
|
#define INT64 int64_t
|
||||||
#define UINT64 uint64_t
|
#define UINT64 uint64_t
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE_CC__
|
#ifdef __APPLE_CC__
|
||||||
|
#define DIRECTFULLSCREEN 1
|
||||||
#define DEBUG_LOG
|
#define DEBUG_LOG
|
||||||
#define NOIPX
|
#define NOIPX
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Strings and some misc platform specific stuff */
|
/* Strings and some misc platform specific stuff */
|
||||||
|
|
||||||
#if defined (__OS2__)
|
#if defined (_MSC_VER) || defined (__OS2__)
|
||||||
|
// Microsoft VisualC++
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#if (_MSC_VER <= 1800) // MSVC 2013 and back
|
||||||
|
#define snprintf _snprintf
|
||||||
|
#if (_MSC_VER <= 1200) // MSVC 6.0 and back
|
||||||
|
#define vsnprintf _vsnprintf
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
#define strncasecmp strnicmp
|
#define strncasecmp strnicmp
|
||||||
#define strcasecmp stricmp
|
#define strcasecmp stricmp
|
||||||
#define inline __inline
|
#define inline __inline
|
||||||
@@ -234,6 +270,13 @@ typedef int32_t boolean;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ATTRUNUSED __attribute__((unused))
|
#define ATTRUNUSED __attribute__((unused))
|
||||||
|
|
||||||
|
#elif defined (_MSC_VER)
|
||||||
|
#define ATTRNORETURN __declspec(noreturn)
|
||||||
|
#define ATTRINLINE __forceinline
|
||||||
|
#if _MSC_VER > 1200 // >= MSVC 6.0
|
||||||
|
#define ATTRNOINLINE __declspec(noinline)
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef FUNCPRINTF
|
#ifndef FUNCPRINTF
|
||||||
@@ -325,7 +368,7 @@ typedef UINT8 bitarray_t;
|
|||||||
static inline int
|
static inline int
|
||||||
in_bit_array (const bitarray_t * const array, const int value)
|
in_bit_array (const bitarray_t * const array, const int value)
|
||||||
{
|
{
|
||||||
return(array[value >> 3] & (1<<(value & 7)));
|
return (array[value >> 3] & (1<<(value & 7)));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
|
|||||||
+12
-6
@@ -169,7 +169,7 @@ static void F_SkyScroll(INT32 scrollspeed)
|
|||||||
pat = W_CachePatchName("TITLEBG1", PU_PATCH_LOWPRIORITY);
|
pat = W_CachePatchName("TITLEBG1", PU_PATCH_LOWPRIORITY);
|
||||||
pat2 = W_CachePatchName("TITLEBG2", PU_PATCH_LOWPRIORITY);
|
pat2 = W_CachePatchName("TITLEBG2", PU_PATCH_LOWPRIORITY);
|
||||||
|
|
||||||
w = (vid.scaledwidth << FRACBITS);
|
w = (vid.width / vid.dupx)<<FRACBITS;
|
||||||
|
|
||||||
// The scroll offset MUST be clamped before shifting by FRACBITS, or else it'll overflow in about 3 minutes
|
// The scroll offset MUST be clamped before shifting by FRACBITS, or else it'll overflow in about 3 minutes
|
||||||
animtimer = ((((finalecount * scrollspeed) % (pat->width*16))<<FRACBITS) + (R_GetTimeFrac(RTF_MENU) * scrollspeed))/16;
|
animtimer = ((((finalecount * scrollspeed) % (pat->width*16))<<FRACBITS) + (R_GetTimeFrac(RTF_MENU) * scrollspeed))/16;
|
||||||
@@ -677,7 +677,7 @@ void F_CreditDrawer(void)
|
|||||||
y += 12<<FRACBITS;
|
y += 12<<FRACBITS;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (((y>>FRACBITS) * vid.dup) > vid.height)
|
if (((y>>FRACBITS) * vid.dupy) > vid.height)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -685,8 +685,8 @@ void F_CreditDrawer(void)
|
|||||||
if (finalecount)
|
if (finalecount)
|
||||||
{
|
{
|
||||||
const char *goodbyefornow = "See you in ""\x82""Dr. Robotnik's Ring Racers""\x80""!";
|
const char *goodbyefornow = "See you in ""\x82""Dr. Robotnik's Ring Racers""\x80""!";
|
||||||
fixed_t lpad = (vid.scaledwidth - BASEVIDWIDTH) << FRACBITS;
|
fixed_t lpad = ((vid.width/vid.dupx) - BASEVIDWIDTH)<<FRACBITS;
|
||||||
fixed_t w = V_StringWidth(goodbyefornow, V_ALLOWLOWERCASE) << FRACBITS;
|
fixed_t w = V_StringWidth(goodbyefornow, V_ALLOWLOWERCASE)<<FRACBITS;
|
||||||
fixed_t x = FixedMul(((BASEVIDWIDTH<<FRACBITS)+w+lpad), ((finalecount-1)<<FRACBITS)/(5*TICRATE)) - w - (lpad/2);
|
fixed_t x = FixedMul(((BASEVIDWIDTH<<FRACBITS)+w+lpad), ((finalecount-1)<<FRACBITS)/(5*TICRATE)) - w - (lpad/2);
|
||||||
V_DrawString(x>>FRACBITS, y>>FRACBITS, V_ALLOWLOWERCASE, goodbyefornow); // for some reason DrawStringAtFixed can't tolerate colour codes
|
V_DrawString(x>>FRACBITS, y>>FRACBITS, V_ALLOWLOWERCASE, goodbyefornow); // for some reason DrawStringAtFixed can't tolerate colour codes
|
||||||
}
|
}
|
||||||
@@ -707,8 +707,7 @@ void F_CreditTicker(void)
|
|||||||
case 1: y += 30<<FRACBITS; break;
|
case 1: y += 30<<FRACBITS; break;
|
||||||
default: y += 12<<FRACBITS; break;
|
default: y += 12<<FRACBITS; break;
|
||||||
}
|
}
|
||||||
|
if (FixedMul(y,vid.dupy) > vid.height)
|
||||||
if (FixedMul(y, vid.dup) > vid.height)
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1150,6 +1149,13 @@ void F_TitleScreenTicker(boolean run)
|
|||||||
// Setup demo name
|
// Setup demo name
|
||||||
snprintf(dname, 9, "%sS%02u", mapname, numstaff);
|
snprintf(dname, 9, "%sS%02u", mapname, numstaff);
|
||||||
|
|
||||||
|
/*if ((l = W_CheckNumForName(dname)) == LUMPERROR) -- we KNOW it exists now
|
||||||
|
{
|
||||||
|
CONS_Alert(CONS_ERROR, M_GetText("Demo lump \"%s\" doesn't exist\n"), dname);
|
||||||
|
F_StartIntro();
|
||||||
|
return;
|
||||||
|
}*/
|
||||||
|
|
||||||
loadreplay:
|
loadreplay:
|
||||||
demo.title = demo.fromtitle = true;
|
demo.title = demo.fromtitle = true;
|
||||||
demo.ignorefiles = true;
|
demo.ignorefiles = true;
|
||||||
|
|||||||
+2
-2
@@ -314,7 +314,7 @@ void F_WipeStartScreen(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
wipe_scr_start = vid.screens[3];
|
wipe_scr_start = vid.screens[3];
|
||||||
I_ReadScreen(wipe_scr_start, 1);
|
I_ReadScreen(wipe_scr_start);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -331,7 +331,7 @@ void F_WipeEndScreen(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
wipe_scr_end = vid.screens[4];
|
wipe_scr_end = vid.screens[4];
|
||||||
I_ReadScreen(wipe_scr_end, 1);
|
I_ReadScreen(wipe_scr_end);
|
||||||
V_DrawBlock(0, 0, 0, vid.width, vid.height, wipe_scr_start);
|
V_DrawBlock(0, 0, 0, vid.width, vid.height, wipe_scr_start);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
+312
-19
@@ -30,7 +30,286 @@
|
|||||||
#include "z_zone.h"
|
#include "z_zone.h"
|
||||||
#include "m_menu.h" // Addons_option_Onchange
|
#include "m_menu.h" // Addons_option_Onchange
|
||||||
|
|
||||||
static CV_PossibleValue_t addons_cons_t[] = {{0, "Default"}, {1, "HOME"}, {2, "SRB2"}, {3, "CUSTOM"}, {0, NULL}};
|
#if defined (_WIN32) && defined (_MSC_VER)
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#include <io.h>
|
||||||
|
#include <tchar.h>
|
||||||
|
|
||||||
|
#define SUFFIX "*"
|
||||||
|
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||||
|
|
||||||
|
#ifndef INVALID_FILE_ATTRIBUTES
|
||||||
|
#define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct dirent
|
||||||
|
{
|
||||||
|
long d_ino; /* Always zero. */
|
||||||
|
unsigned short d_reclen; /* Always zero. */
|
||||||
|
unsigned short d_namlen; /* Length of name in d_name. */
|
||||||
|
char d_name[FILENAME_MAX]; /* File name. */
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This is an internal data structure. Good programmers will not use it
|
||||||
|
* except as an argument to one of the functions below.
|
||||||
|
* dd_stat field is now int (was short in older versions).
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
/* disk transfer area for this dir */
|
||||||
|
struct _finddata_t dd_dta;
|
||||||
|
|
||||||
|
/* dirent struct to return from dir (NOTE: this makes this thread
|
||||||
|
* safe as long as only one thread uses a particular DIR struct at
|
||||||
|
* a time) */
|
||||||
|
struct dirent dd_dir;
|
||||||
|
|
||||||
|
/* _findnext handle */
|
||||||
|
#if _MSC_VER > 1200
|
||||||
|
intptr_t dd_handle;
|
||||||
|
#else
|
||||||
|
long dd_handle;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Status of search:
|
||||||
|
* 0 = not started yet (next entry to read is first entry)
|
||||||
|
* -1 = off the end
|
||||||
|
* positive = 0 based index of next entry
|
||||||
|
*/
|
||||||
|
int dd_stat;
|
||||||
|
|
||||||
|
/* given path for dir with search pattern (struct is extended) */
|
||||||
|
CHAR dd_name[1];
|
||||||
|
} DIR;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* opendir
|
||||||
|
*
|
||||||
|
* Returns a pointer to a DIR structure appropriately filled in to begin
|
||||||
|
* searching a directory.
|
||||||
|
*/
|
||||||
|
|
||||||
|
DIR *
|
||||||
|
opendir (const CHAR *szPath)
|
||||||
|
{
|
||||||
|
DIR *nd;
|
||||||
|
DWORD rc;
|
||||||
|
CHAR szFullPath[MAX_PATH];
|
||||||
|
|
||||||
|
errno = 0;
|
||||||
|
|
||||||
|
if (!szPath)
|
||||||
|
{
|
||||||
|
errno = EFAULT;
|
||||||
|
return (DIR *) 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (szPath[0] == '\0')
|
||||||
|
{
|
||||||
|
errno = ENOTDIR;
|
||||||
|
return (DIR *) 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Attempt to determine if the given path really is a directory. */
|
||||||
|
rc = GetFileAttributesA(szPath);
|
||||||
|
if (rc == INVALID_FILE_ATTRIBUTES)
|
||||||
|
{
|
||||||
|
/* call GetLastError for more error info */
|
||||||
|
errno = ENOENT;
|
||||||
|
return (DIR *) 0;
|
||||||
|
}
|
||||||
|
if (!(rc & FILE_ATTRIBUTE_DIRECTORY))
|
||||||
|
{
|
||||||
|
/* Error, entry exists but not a directory. */
|
||||||
|
errno = ENOTDIR;
|
||||||
|
return (DIR *) 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Make an absolute pathname. */
|
||||||
|
_fullpath (szFullPath, szPath, MAX_PATH);
|
||||||
|
|
||||||
|
/* Allocate enough space to store DIR structure and the complete
|
||||||
|
* directory path given. */
|
||||||
|
nd = (DIR *) malloc (sizeof (DIR) + (strlen(szFullPath) + strlen (SLASH) +
|
||||||
|
strlen(PATHSEP) + 1) * sizeof (CHAR));
|
||||||
|
|
||||||
|
if (!nd)
|
||||||
|
{
|
||||||
|
/* Error, out of memory. */
|
||||||
|
errno = ENOMEM;
|
||||||
|
return (DIR *) 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Create the search expression. */
|
||||||
|
strcpy (nd->dd_name, szFullPath);
|
||||||
|
|
||||||
|
/* Add on a slash if the path does not end with one. */
|
||||||
|
if (nd->dd_name[0] != '\0' &&
|
||||||
|
nd->dd_name[strlen (nd->dd_name) - 1] != PATHSEP[0])
|
||||||
|
{
|
||||||
|
strcat (nd->dd_name, PATHSEP);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Add on the search pattern */
|
||||||
|
strcat (nd->dd_name, SUFFIX);
|
||||||
|
|
||||||
|
/* Initialize handle to -1 so that a premature closedir doesn't try
|
||||||
|
* to call _findclose on it. */
|
||||||
|
nd->dd_handle = -1;
|
||||||
|
|
||||||
|
/* Initialize the status. */
|
||||||
|
nd->dd_stat = 0;
|
||||||
|
|
||||||
|
/* Initialize the dirent structure. ino and reclen are invalid under
|
||||||
|
* Win32, and name simply points at the appropriate part of the
|
||||||
|
* findfirst_t structure. */
|
||||||
|
nd->dd_dir.d_ino = 0;
|
||||||
|
nd->dd_dir.d_reclen = 0;
|
||||||
|
nd->dd_dir.d_namlen = 0;
|
||||||
|
ZeroMemory(nd->dd_dir.d_name, FILENAME_MAX);
|
||||||
|
|
||||||
|
return nd;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* readdir
|
||||||
|
*
|
||||||
|
* Return a pointer to a dirent structure filled with the information on the
|
||||||
|
* next entry in the directory.
|
||||||
|
*/
|
||||||
|
struct dirent *
|
||||||
|
readdir (DIR * dirp)
|
||||||
|
{
|
||||||
|
errno = 0;
|
||||||
|
|
||||||
|
/* Check for valid DIR struct. */
|
||||||
|
if (!dirp)
|
||||||
|
{
|
||||||
|
errno = EFAULT;
|
||||||
|
return (struct dirent *) 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dirp->dd_stat < 0)
|
||||||
|
{
|
||||||
|
/* We have already returned all files in the directory
|
||||||
|
* (or the structure has an invalid dd_stat). */
|
||||||
|
return (struct dirent *) 0;
|
||||||
|
}
|
||||||
|
else if (dirp->dd_stat == 0)
|
||||||
|
{
|
||||||
|
/* We haven't started the search yet. */
|
||||||
|
/* Start the search */
|
||||||
|
dirp->dd_handle = _findfirst (dirp->dd_name, &(dirp->dd_dta));
|
||||||
|
|
||||||
|
if (dirp->dd_handle == -1)
|
||||||
|
{
|
||||||
|
/* Whoops! Seems there are no files in that
|
||||||
|
* directory. */
|
||||||
|
dirp->dd_stat = -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dirp->dd_stat = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Get the next search entry. */
|
||||||
|
if (_findnext (dirp->dd_handle, &(dirp->dd_dta)))
|
||||||
|
{
|
||||||
|
/* We are off the end or otherwise error.
|
||||||
|
_findnext sets errno to ENOENT if no more file
|
||||||
|
Undo this. */
|
||||||
|
DWORD winerr = GetLastError();
|
||||||
|
if (winerr == ERROR_NO_MORE_FILES)
|
||||||
|
errno = 0;
|
||||||
|
_findclose (dirp->dd_handle);
|
||||||
|
dirp->dd_handle = -1;
|
||||||
|
dirp->dd_stat = -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Update the status to indicate the correct
|
||||||
|
* number. */
|
||||||
|
dirp->dd_stat++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dirp->dd_stat > 0)
|
||||||
|
{
|
||||||
|
/* Successfully got an entry. Everything about the file is
|
||||||
|
* already appropriately filled in except the length of the
|
||||||
|
* file name. */
|
||||||
|
dirp->dd_dir.d_namlen = (unsigned short)strlen (dirp->dd_dta.name);
|
||||||
|
strcpy (dirp->dd_dir.d_name, dirp->dd_dta.name);
|
||||||
|
return &dirp->dd_dir;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (struct dirent *) 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* rewinddir
|
||||||
|
*
|
||||||
|
* Makes the next readdir start from the beginning.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
rewinddir (DIR * dirp)
|
||||||
|
{
|
||||||
|
errno = 0;
|
||||||
|
|
||||||
|
/* Check for valid DIR struct. */
|
||||||
|
if (!dirp)
|
||||||
|
{
|
||||||
|
errno = EFAULT;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
dirp->dd_stat = 0;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* closedir
|
||||||
|
*
|
||||||
|
* Frees up resources allocated by opendir.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
closedir (DIR * dirp)
|
||||||
|
{
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
errno = 0;
|
||||||
|
rc = 0;
|
||||||
|
|
||||||
|
if (!dirp)
|
||||||
|
{
|
||||||
|
errno = EFAULT;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dirp->dd_handle != -1)
|
||||||
|
{
|
||||||
|
rc = _findclose (dirp->dd_handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Delete the dir structure. */
|
||||||
|
free (dirp);
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static CV_PossibleValue_t addons_cons_t[] = {{0, "Default"},
|
||||||
|
#if 1
|
||||||
|
{1, "HOME"}, {2, "SRB2"},
|
||||||
|
#endif
|
||||||
|
{3, "CUSTOM"}, {0, NULL}};
|
||||||
|
|
||||||
consvar_t cv_addons_option = {"addons_option", "Default", CV_SAVE|CV_CALL, addons_cons_t, Addons_option_Onchange, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_addons_option = {"addons_option", "Default", CV_SAVE|CV_CALL, addons_cons_t, Addons_option_Onchange, 0, NULL, NULL, 0, 0, NULL};
|
||||||
consvar_t cv_addons_folder = {"addons_folder", "", CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_addons_folder = {"addons_folder", "", CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
@@ -44,7 +323,7 @@ consvar_t cv_addons_search_case = {"addons_search_case", "No", CV_SAVE, CV_YesNo
|
|||||||
static CV_PossibleValue_t addons_search_type_cons_t[] = {{0, "Start"}, {1, "Anywhere"}, {0, NULL}};
|
static CV_PossibleValue_t addons_search_type_cons_t[] = {{0, "Start"}, {1, "Anywhere"}, {0, NULL}};
|
||||||
consvar_t cv_addons_search_type = {"addons_search_type", "Anywhere", CV_SAVE, addons_search_type_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_addons_search_type = {"addons_search_type", "Anywhere", CV_SAVE, addons_search_type_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
char menupath[MAXFILEPATH];
|
char menupath[1024];
|
||||||
size_t menupathindex[menudepth];
|
size_t menupathindex[menudepth];
|
||||||
size_t menudepthleft = menudepth;
|
size_t menudepthleft = menudepth;
|
||||||
|
|
||||||
@@ -111,7 +390,7 @@ filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *want
|
|||||||
int found = 0;
|
int found = 0;
|
||||||
char *searchname;
|
char *searchname;
|
||||||
int depthleft = maxsearchdepth;
|
int depthleft = maxsearchdepth;
|
||||||
char searchpath[MAXFILEPATH];
|
char searchpath[1024];
|
||||||
size_t *searchpathindex;
|
size_t *searchpathindex;
|
||||||
|
|
||||||
dirhandle = (DIR**)malloc(maxsearchdepth * sizeof(DIR*));
|
dirhandle = (DIR**)malloc(maxsearchdepth * sizeof(DIR*));
|
||||||
@@ -205,7 +484,6 @@ filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *want
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// This folder is excluded
|
|
||||||
if (skipfolder)
|
if (skipfolder)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@@ -421,6 +699,9 @@ boolean preparefilemenu(boolean samedepth, boolean replayhut)
|
|||||||
{
|
{
|
||||||
DIR *dirhandle;
|
DIR *dirhandle;
|
||||||
struct dirent *dent;
|
struct dirent *dent;
|
||||||
|
#ifndef _WIN32
|
||||||
|
struct stat fsstat;
|
||||||
|
#endif
|
||||||
size_t pos = 0, folderpos = 0, numfolders = 0;
|
size_t pos = 0, folderpos = 0, numfolders = 0;
|
||||||
char *tempname = NULL;
|
char *tempname = NULL;
|
||||||
|
|
||||||
@@ -442,13 +723,10 @@ boolean preparefilemenu(boolean samedepth, boolean replayhut)
|
|||||||
Z_Free(dirmenu);
|
Z_Free(dirmenu);
|
||||||
dirmenu = NULL;
|
dirmenu = NULL;
|
||||||
|
|
||||||
if (coredirmenu != NULL)
|
for (; sizecoredirmenu > 0; sizecoredirmenu--) // clear out existing items
|
||||||
{
|
{
|
||||||
for (; sizecoredirmenu > 0; sizecoredirmenu--) // clear out existing items
|
Z_Free(coredirmenu[sizecoredirmenu-1]);
|
||||||
{
|
coredirmenu[sizecoredirmenu-1] = NULL;
|
||||||
Z_Free(coredirmenu[sizecoredirmenu-1]);
|
|
||||||
coredirmenu[sizecoredirmenu-1] = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
@@ -466,16 +744,23 @@ boolean preparefilemenu(boolean samedepth, boolean replayhut)
|
|||||||
|
|
||||||
strcpy(&menupath[menupathindex[menudepthleft]],dent->d_name);
|
strcpy(&menupath[menupathindex[menudepthleft]],dent->d_name);
|
||||||
|
|
||||||
INT32 isdir = pathisdirectory(menupath);
|
#ifndef _WIN32
|
||||||
|
if (stat(menupath, &fsstat) < 0)
|
||||||
if (isdir == -1)
|
#else
|
||||||
|
// if we wanna follow symlinks we can check with FILE_ATTRIBUTE_REPARSE_POINT
|
||||||
|
DWORD fileattr = GetFileAttributes(menupath);
|
||||||
|
if (fileattr == INVALID_FILE_ATTRIBUTES)
|
||||||
|
#endif
|
||||||
; // was the file (re)moved? can't stat it
|
; // was the file (re)moved? can't stat it
|
||||||
else // is a file or directory
|
else // is a file or directory
|
||||||
{
|
{
|
||||||
if (isdir == 0) // file
|
#ifndef _WIN32
|
||||||
|
if (!S_ISDIR(fsstat.st_mode)) // file
|
||||||
|
#else
|
||||||
|
if (!(fileattr & FILE_ATTRIBUTE_DIRECTORY))
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
size_t len = strlen(dent->d_name)+1;
|
size_t len = strlen(dent->d_name)+1;
|
||||||
|
|
||||||
if (replayhut)
|
if (replayhut)
|
||||||
{
|
{
|
||||||
if (strcasecmp(".lmp", dent->d_name+len-5))
|
if (strcasecmp(".lmp", dent->d_name+len-5))
|
||||||
@@ -541,9 +826,13 @@ boolean preparefilemenu(boolean samedepth, boolean replayhut)
|
|||||||
|
|
||||||
strcpy(&menupath[menupathindex[menudepthleft]],dent->d_name);
|
strcpy(&menupath[menupathindex[menudepthleft]],dent->d_name);
|
||||||
|
|
||||||
INT32 isdir = pathisdirectory(menupath);
|
#ifndef _WIN32
|
||||||
|
if (stat(menupath, &fsstat) < 0)
|
||||||
if (isdir == -1)
|
#else
|
||||||
|
// if we wanna follow symlinks we can check with FILE_ATTRIBUTE_REPARSE_POINT
|
||||||
|
DWORD fileattr = GetFileAttributes(menupath);
|
||||||
|
if (fileattr == INVALID_FILE_ATTRIBUTES)
|
||||||
|
#endif
|
||||||
; // was the file (re)moved? can't stat it
|
; // was the file (re)moved? can't stat it
|
||||||
else // is a file or directory
|
else // is a file or directory
|
||||||
{
|
{
|
||||||
@@ -552,7 +841,11 @@ boolean preparefilemenu(boolean samedepth, boolean replayhut)
|
|||||||
UINT8 ext = EXT_FOLDER;
|
UINT8 ext = EXT_FOLDER;
|
||||||
UINT8 folder;
|
UINT8 folder;
|
||||||
|
|
||||||
if (isdir == 0) // file
|
#ifndef _WIN32
|
||||||
|
if (!S_ISDIR(fsstat.st_mode)) // file
|
||||||
|
#else
|
||||||
|
if (!(fileattr & FILE_ATTRIBUTE_DIRECTORY))
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
if (!((numfolders+pos) < sizecoredirmenu))
|
if (!((numfolders+pos) < sizecoredirmenu))
|
||||||
continue; // crash prevention
|
continue; // crash prevention
|
||||||
|
|||||||
+1
-2
@@ -34,8 +34,7 @@ filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *want
|
|||||||
|
|
||||||
#define menudepth 20
|
#define menudepth 20
|
||||||
|
|
||||||
#define MAXFILEPATH 1024
|
extern char menupath[1024];
|
||||||
extern char menupath[MAXFILEPATH];
|
|
||||||
extern size_t menupathindex[menudepth];
|
extern size_t menupathindex[menudepth];
|
||||||
extern size_t menudepthleft;
|
extern size_t menudepthleft;
|
||||||
|
|
||||||
|
|||||||
+7
-20
@@ -3569,8 +3569,7 @@ void G_SaveDemo(void)
|
|||||||
size_t i, strindex = 0;
|
size_t i, strindex = 0;
|
||||||
boolean dash = true;
|
boolean dash = true;
|
||||||
|
|
||||||
//for (i = 0; demo.titlename[i] && i < 127; i++) ?????
|
for (i = 0; demo.titlename[i] && i < 127; i++)
|
||||||
for (i = 0; i < 64 && demo.titlename[i]; i++)
|
|
||||||
{
|
{
|
||||||
if ((demo.titlename[i] >= 'a' && demo.titlename[i] <= 'z') ||
|
if ((demo.titlename[i] >= 'a' && demo.titlename[i] <= 'z') ||
|
||||||
(demo.titlename[i] >= '0' && demo.titlename[i] <= '9'))
|
(demo.titlename[i] >= '0' && demo.titlename[i] <= '9'))
|
||||||
@@ -3585,7 +3584,7 @@ void G_SaveDemo(void)
|
|||||||
strindex++;
|
strindex++;
|
||||||
dash = false;
|
dash = false;
|
||||||
}
|
}
|
||||||
else if (strindex && !dash)
|
else if (!dash)
|
||||||
{
|
{
|
||||||
demo_slug[strindex] = '-';
|
demo_slug[strindex] = '-';
|
||||||
strindex++;
|
strindex++;
|
||||||
@@ -3593,24 +3592,12 @@ void G_SaveDemo(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dash && strindex)
|
demo_slug[strindex] = 0;
|
||||||
{
|
if (dash) demo_slug[strindex-1] = 0;
|
||||||
strindex--;
|
|
||||||
}
|
|
||||||
demo_slug[strindex] = '\0';
|
|
||||||
|
|
||||||
if (demo_slug[0] != '\0')
|
writepoint = strstr(demoname, "-") + 1;
|
||||||
{
|
demo_slug[128 - (writepoint - demoname) - 4] = 0;
|
||||||
// Slug is valid, write the chosen filename.
|
sprintf(writepoint, "%s.lmp", demo_slug);
|
||||||
writepoint = strstr(demoname, "-");
|
|
||||||
if (!writepoint)
|
|
||||||
return;
|
|
||||||
|
|
||||||
writepoint++;
|
|
||||||
|
|
||||||
size_t flen = 128 - (writepoint - demoname) - 4;
|
|
||||||
snprintf(writepoint, flen, "%s.lmp", demo_slug);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
length = *(UINT32 *)demoinfo_p;
|
length = *(UINT32 *)demoinfo_p;
|
||||||
|
|||||||
+1
-1
@@ -67,7 +67,7 @@ typedef enum {
|
|||||||
} menudemotype_e;
|
} menudemotype_e;
|
||||||
|
|
||||||
typedef struct menudemo_s {
|
typedef struct menudemo_s {
|
||||||
char filepath[1023 + 256]; // see M_PrepReplayList and sizeof menupath
|
char filepath[256];
|
||||||
menudemotype_e type;
|
menudemotype_e type;
|
||||||
|
|
||||||
char title[65]; // Null-terminated for string prints
|
char title[65]; // Null-terminated for string prints
|
||||||
|
|||||||
+22
-30
@@ -452,13 +452,6 @@ consvar_t cv_ydeadzone[MAXSPLITSCREENPLAYERS] = {
|
|||||||
{"joy4_ydeadzone", "0.5", CV_FLOAT|CV_SAVE, deadzone_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}
|
{"joy4_ydeadzone", "0.5", CV_FLOAT|CV_SAVE, deadzone_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
consvar_t cv_litesteer[MAXSPLITSCREENPLAYERS] = {
|
|
||||||
{"litesteer", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
|
||||||
{"litesteer2", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
|
||||||
{"litesteer3", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
|
||||||
{"litesteer4", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}
|
|
||||||
};
|
|
||||||
|
|
||||||
static CV_PossibleValue_t driftsparkpulse_t[] = {{0, "MIN"}, {FRACUNIT*3, "MAX"}, {0, NULL}};
|
static CV_PossibleValue_t driftsparkpulse_t[] = {{0, "MIN"}, {FRACUNIT*3, "MAX"}, {0, NULL}};
|
||||||
consvar_t cv_driftsparkpulse = {"driftsparkpulse", "1.4", CV_FLOAT | CV_SAVE, driftsparkpulse_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_driftsparkpulse = {"driftsparkpulse", "1.4", CV_FLOAT | CV_SAVE, driftsparkpulse_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
@@ -1021,8 +1014,8 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||||||
else
|
else
|
||||||
th = 0;
|
th = 0;
|
||||||
|
|
||||||
if (th < (cv_turnsmooth[forplayer].value * 3))
|
if (th < SLOWTURNTICS)
|
||||||
tspeed = cv_turnsmooth[forplayer].value == 2 ? 2 : 0; // slow turn
|
tspeed = cv_turnsmooth.value == 2 ? 2 : 0; // slow turn
|
||||||
else
|
else
|
||||||
tspeed = 1;
|
tspeed = 1;
|
||||||
|
|
||||||
@@ -1031,32 +1024,30 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||||||
// let movement keys cancel each other out
|
// let movement keys cancel each other out
|
||||||
if (turnright && !(turnleft))
|
if (turnright && !(turnleft))
|
||||||
{
|
{
|
||||||
cmd->angleturn -= angleturn[tspeed];
|
cmd->angleturn = (INT16)(cmd->angleturn - (angleturn[tspeed]));
|
||||||
|
cmd->driftturn = (INT16)(cmd->driftturn - (angleturn[tspeed]));
|
||||||
side += sidemove[1];
|
side += sidemove[1];
|
||||||
}
|
}
|
||||||
else if (turnleft && !(turnright))
|
else if (turnleft && !(turnright))
|
||||||
{
|
{
|
||||||
cmd->angleturn += angleturn[tspeed];
|
cmd->angleturn = (INT16)(cmd->angleturn + (angleturn[tspeed]));
|
||||||
|
cmd->driftturn = (INT16)(cmd->driftturn + (angleturn[tspeed]));
|
||||||
side -= sidemove[1];
|
side -= sidemove[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (analogjoystickmove && axis != 0)
|
if (analogjoystickmove && axis != 0)
|
||||||
{
|
{
|
||||||
cmd->angleturn -= (axis * KART_FULLTURN) / JOYAXISRANGE;
|
// JOYAXISRANGE should be 1023 (divide by 1024)
|
||||||
side += (axis * sidemove[0]) / JOYAXISRANGE;
|
cmd->angleturn = (INT16)(cmd->angleturn - (((axis * angleturn[1]) >> 10))); // ANALOG!
|
||||||
|
cmd->driftturn = (INT16)(cmd->driftturn - (((axis * angleturn[1]) >> 10)));
|
||||||
|
side += ((axis * sidemove[0]) >> 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cv_mouseturn.value)
|
if (cv_mouseturn.value)
|
||||||
{
|
{
|
||||||
//THIS WORKS WTF????????
|
//THIS WORKS WTF????????
|
||||||
cmd->angleturn -= (mousex*(encoremode ? -1 : 1)*8);
|
cmd->angleturn = (INT16)(cmd->angleturn - ((mousex*(encoremode ? -1 : 1)*8)));
|
||||||
}
|
cmd->driftturn = (INT16)(cmd->driftturn - ((mousex*(encoremode ? -1 : 1)*8)));
|
||||||
|
|
||||||
// Digital users can input diagonal-back for shallow turns.
|
|
||||||
if (cv_litesteer[forplayer].value && InputDown(gc_aimbackward, ssplayer)
|
|
||||||
&& abs(cmd->angleturn) == KART_FULLTURN) // My keyboard hits 1024 but my keyboard only hits 1023, video games
|
|
||||||
{
|
|
||||||
cmd->angleturn /= 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (objectplacing) // SRB2Kart: spectators need special controls // not anymore huehuehue
|
if (objectplacing) // SRB2Kart: spectators need special controls // not anymore huehuehue
|
||||||
@@ -1169,8 +1160,10 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||||||
else if (cmd->angleturn < (-angleturn[1]))
|
else if (cmd->angleturn < (-angleturn[1]))
|
||||||
cmd->angleturn = (-angleturn[1]);
|
cmd->angleturn = (-angleturn[1]);
|
||||||
|
|
||||||
// until here both are the very same
|
if (cmd->driftturn > (angleturn[1]))
|
||||||
cmd->driftturn = cmd->angleturn;
|
cmd->driftturn = (angleturn[1]);
|
||||||
|
else if (cmd->driftturn < (-angleturn[1]))
|
||||||
|
cmd->driftturn = (-angleturn[1]);
|
||||||
|
|
||||||
if (player->mo)
|
if (player->mo)
|
||||||
cmd->angleturn = K_GetKartTurnValue(player, cmd->angleturn);
|
cmd->angleturn = K_GetKartTurnValue(player, cmd->angleturn);
|
||||||
@@ -3571,7 +3564,7 @@ void G_SaveGameData(boolean force)
|
|||||||
if (!gamedataloaded)
|
if (!gamedataloaded)
|
||||||
return; // If never loaded (-nodata), don't save
|
return; // If never loaded (-nodata), don't save
|
||||||
|
|
||||||
save.p = save.buffer = (UINT8 *)Z_Malloc(GAMEDATASIZE, PU_STATIC, NULL);
|
save.p = save.buffer = (UINT8 *)malloc(GAMEDATASIZE);
|
||||||
if (!save.p)
|
if (!save.p)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_ERROR, M_GetText("No more free memory for saving game data\n"));
|
CONS_Alert(CONS_ERROR, M_GetText("No more free memory for saving game data\n"));
|
||||||
@@ -3591,8 +3584,6 @@ void G_SaveGameData(boolean force)
|
|||||||
if (!FIL_CopyFile(gamedatafilename, backupfile))
|
if (!FIL_CopyFile(gamedatafilename, backupfile))
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_WARNING,"Failed to create a backup of save data. Will not attempt to write to save data\n");
|
CONS_Alert(CONS_WARNING,"Failed to create a backup of save data. Will not attempt to write to save data\n");
|
||||||
Z_Free(save.buffer);
|
|
||||||
save.p = save.buffer = NULL;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3664,7 +3655,7 @@ void G_SaveGameData(boolean force)
|
|||||||
length = save.p - save.buffer;
|
length = save.p - save.buffer;
|
||||||
|
|
||||||
FIL_WriteFile(va(pandf, srb2home, gamedatafilename), save.buffer, length);
|
FIL_WriteFile(va(pandf, srb2home, gamedatafilename), save.buffer, length);
|
||||||
Z_Free(save.buffer);
|
free(save.buffer);
|
||||||
save.p = save.buffer = NULL;
|
save.p = save.buffer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3834,7 +3825,7 @@ void G_SaveGame(UINT32 savegameslot)
|
|||||||
char name[VERSIONSIZE];
|
char name[VERSIONSIZE];
|
||||||
size_t length;
|
size_t length;
|
||||||
|
|
||||||
save.p = save.buffer = (UINT8 *)Z_Malloc(SAVEGAMESIZE, PU_STATIC, NULL);
|
save.p = save.buffer = (UINT8 *)malloc(SAVEGAMESIZE);
|
||||||
if (!save.p)
|
if (!save.p)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_ERROR, M_GetText("No more free memory for saving game data\n"));
|
CONS_Alert(CONS_ERROR, M_GetText("No more free memory for saving game data\n"));
|
||||||
@@ -3849,7 +3840,7 @@ void G_SaveGame(UINT32 savegameslot)
|
|||||||
|
|
||||||
length = save.p - save.buffer;
|
length = save.p - save.buffer;
|
||||||
saved = FIL_WriteFile(backup, save.buffer, length);
|
saved = FIL_WriteFile(backup, save.buffer, length);
|
||||||
Z_Free(save.buffer);
|
free(save.buffer);
|
||||||
save.p = save.buffer = NULL;
|
save.p = save.buffer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4150,6 +4141,8 @@ INT32 G_FindMap(const char *mapname, char **foundmapnamep,
|
|||||||
if (!( realmapname = G_BuildMapTitle(mapnum) ))
|
if (!( realmapname = G_BuildMapTitle(mapnum) ))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
aprop = realmapname;
|
||||||
|
|
||||||
/* Now that we found a perfect match no need to fucking guess. */
|
/* Now that we found a perfect match no need to fucking guess. */
|
||||||
if (strnicmp(realmapname, mapname, mapnamelen) == 0)
|
if (strnicmp(realmapname, mapname, mapnamelen) == 0)
|
||||||
{
|
{
|
||||||
@@ -4177,7 +4170,6 @@ INT32 G_FindMap(const char *mapname, char **foundmapnamep,
|
|||||||
writesimplefreq(freq, &freqc,
|
writesimplefreq(freq, &freqc,
|
||||||
mapnum, aprop - realmapname, mapnamelen);
|
mapnum, aprop - realmapname, mapnamelen);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (apromapnum == 0)
|
if (apromapnum == 0)
|
||||||
{
|
{
|
||||||
apromapnum = mapnum;
|
apromapnum = mapnum;
|
||||||
|
|||||||
+3
-2
@@ -72,8 +72,6 @@ extern consvar_t cv_custom3axis[MAXSPLITSCREENPLAYERS];
|
|||||||
extern consvar_t cv_xdeadzone[MAXSPLITSCREENPLAYERS];
|
extern consvar_t cv_xdeadzone[MAXSPLITSCREENPLAYERS];
|
||||||
extern consvar_t cv_ydeadzone[MAXSPLITSCREENPLAYERS];
|
extern consvar_t cv_ydeadzone[MAXSPLITSCREENPLAYERS];
|
||||||
|
|
||||||
extern consvar_t cv_litesteer[MAXSPLITSCREENPLAYERS];
|
|
||||||
|
|
||||||
extern consvar_t cv_ghost_besttime, cv_ghost_bestlap, cv_ghost_last, cv_ghost_guest, cv_ghost_staff;
|
extern consvar_t cv_ghost_besttime, cv_ghost_bestlap, cv_ghost_last, cv_ghost_guest, cv_ghost_staff;
|
||||||
|
|
||||||
// Hud offsets
|
// Hud offsets
|
||||||
@@ -131,7 +129,9 @@ extern consvar_t cv_playerblendeffects;
|
|||||||
|
|
||||||
extern consvar_t cv_cechotoggle;
|
extern consvar_t cv_cechotoggle;
|
||||||
|
|
||||||
|
#ifndef NONET
|
||||||
extern consvar_t cv_chatlogsize;
|
extern consvar_t cv_chatlogsize;
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
@@ -155,6 +155,7 @@ typedef enum
|
|||||||
// mouseaiming (looking up/down with the mouse or keyboard)
|
// mouseaiming (looking up/down with the mouse or keyboard)
|
||||||
#define KB_LOOKSPEED (1<<25)
|
#define KB_LOOKSPEED (1<<25)
|
||||||
#define MAXPLMOVE (50)
|
#define MAXPLMOVE (50)
|
||||||
|
#define SLOWTURNTICS (cv_turnsmooth.value * 3)
|
||||||
|
|
||||||
// build an internal map name MAPxx from map number
|
// build an internal map name MAPxx from map number
|
||||||
const char *G_BuildMapName(INT32 map);
|
const char *G_BuildMapName(INT32 map);
|
||||||
|
|||||||
+1
-7
@@ -37,13 +37,7 @@ static CV_PossibleValue_t turnsmooth_cons_t[] = {{2, "Slow"}, {1, "Fast"}, {0, "
|
|||||||
consvar_t cv_mousesens = {"mousesens", "20", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_mousesens = {"mousesens", "20", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
consvar_t cv_mouseysens = {"mouseysens", "20", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_mouseysens = {"mouseysens", "20", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
consvar_t cv_controlperkey = {"controlperkey", "One", CV_SAVE, onecontrolperkey_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_controlperkey = {"controlperkey", "One", CV_SAVE, onecontrolperkey_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
consvar_t cv_turnsmooth = {"turnsmoothing", "Slow", CV_SAVE, turnsmooth_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
consvar_t cv_turnsmooth[MAXSPLITSCREENPLAYERS] = {
|
|
||||||
{"turnsmoothing", "Slow", CV_SAVE, turnsmooth_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
|
||||||
{"turnsmoothing2", "Slow", CV_SAVE, turnsmooth_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
|
||||||
{"turnsmoothing3", "Slow", CV_SAVE, turnsmooth_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
|
||||||
{"turnsmoothing4", "Slow", CV_SAVE, turnsmooth_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}
|
|
||||||
};
|
|
||||||
|
|
||||||
static void G_ResetPlayerDeviceRumble(INT32 player);
|
static void G_ResetPlayerDeviceRumble(INT32 player);
|
||||||
static void rumble_off_handle(void);
|
static void rumble_off_handle(void);
|
||||||
|
|||||||
+1
-2
@@ -110,8 +110,7 @@ typedef enum
|
|||||||
|
|
||||||
// mouse values are used once
|
// mouse values are used once
|
||||||
extern consvar_t cv_mousesens, cv_mouseysens;
|
extern consvar_t cv_mousesens, cv_mouseysens;
|
||||||
extern consvar_t cv_controlperkey;
|
extern consvar_t cv_controlperkey, cv_turnsmooth;
|
||||||
extern consvar_t cv_turnsmooth[MAXSPLITSCREENPLAYERS];
|
|
||||||
extern consvar_t cv_rumble[MAXSPLITSCREENPLAYERS];
|
extern consvar_t cv_rumble[MAXSPLITSCREENPLAYERS];
|
||||||
extern consvar_t cv_gamepadled[MAXSPLITSCREENPLAYERS];
|
extern consvar_t cv_gamepadled[MAXSPLITSCREENPLAYERS];
|
||||||
|
|
||||||
|
|||||||
@@ -455,6 +455,7 @@ void HWR_RenderBatches(void)
|
|||||||
{
|
{
|
||||||
GL_SetShader(nextShader);
|
GL_SetShader(nextShader);
|
||||||
currentShader = nextShader;
|
currentShader = nextShader;
|
||||||
|
changeShader = false;
|
||||||
|
|
||||||
ps_hw_numshaders.value.i++;
|
ps_hw_numshaders.value.i++;
|
||||||
}
|
}
|
||||||
@@ -464,6 +465,7 @@ void HWR_RenderBatches(void)
|
|||||||
// texture should be already ready for use from calls to GL_SetTexture during batch collection
|
// texture should be already ready for use from calls to GL_SetTexture during batch collection
|
||||||
GL_SetTexture(nextTexture);
|
GL_SetTexture(nextTexture);
|
||||||
currentTexture = nextTexture;
|
currentTexture = nextTexture;
|
||||||
|
changeTexture = false;
|
||||||
|
|
||||||
ps_hw_numtextures.value.i++;
|
ps_hw_numtextures.value.i++;
|
||||||
}
|
}
|
||||||
@@ -471,6 +473,7 @@ void HWR_RenderBatches(void)
|
|||||||
if (changePolyFlags)
|
if (changePolyFlags)
|
||||||
{
|
{
|
||||||
currentPolyFlags = nextPolyFlags;
|
currentPolyFlags = nextPolyFlags;
|
||||||
|
changePolyFlags = false;
|
||||||
|
|
||||||
ps_hw_numpolyflags.value.i++;
|
ps_hw_numpolyflags.value.i++;
|
||||||
}
|
}
|
||||||
@@ -478,6 +481,7 @@ void HWR_RenderBatches(void)
|
|||||||
if (changeSurfaceInfo)
|
if (changeSurfaceInfo)
|
||||||
{
|
{
|
||||||
currentSurfaceInfo = nextSurfaceInfo;
|
currentSurfaceInfo = nextSurfaceInfo;
|
||||||
|
changeSurfaceInfo = false;
|
||||||
|
|
||||||
ps_hw_numcolors.value.i++;
|
ps_hw_numcolors.value.i++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -974,7 +974,7 @@ void HWR_CreatePlanePolygons(INT32 bspnum)
|
|||||||
CONS_Debug(DBG_RENDER, "Looking for boundaries of map...\n");
|
CONS_Debug(DBG_RENDER, "Looking for boundaries of map...\n");
|
||||||
#endif
|
#endif
|
||||||
M_ClearBox(rootbbox);
|
M_ClearBox(rootbbox);
|
||||||
for (i = 0; i < numvertexes; i++)
|
for (i = 0;i < numvertexes; i++)
|
||||||
M_AddToBox(rootbbox, vertexes[i].x, vertexes[i].y);
|
M_AddToBox(rootbbox, vertexes[i].x, vertexes[i].y);
|
||||||
|
|
||||||
#ifdef DEBUG_HWBSP
|
#ifdef DEBUG_HWBSP
|
||||||
@@ -985,8 +985,8 @@ void HWR_CreatePlanePolygons(INT32 bspnum)
|
|||||||
|
|
||||||
// allocate extra data for each subsector present in map
|
// allocate extra data for each subsector present in map
|
||||||
totsubsectors = numsubsectors + NEWSUBSECTORS;
|
totsubsectors = numsubsectors + NEWSUBSECTORS;
|
||||||
extrasubsectors = calloc(totsubsectors, sizeof(*extrasubsectors));
|
extrasubsectors = calloc(totsubsectors, sizeof (*extrasubsectors));
|
||||||
if (UNLIKELY(!extrasubsectors))
|
if (UNLIKELY(extrasubsectors == NULL))
|
||||||
I_Error("couldn't malloc extrasubsectors totsubsectors %s\n", sizeu1(totsubsectors));
|
I_Error("couldn't malloc extrasubsectors totsubsectors %s\n", sizeu1(totsubsectors));
|
||||||
|
|
||||||
// number of the first new subsector that might be added
|
// number of the first new subsector that might be added
|
||||||
@@ -1009,13 +1009,11 @@ void HWR_CreatePlanePolygons(INT32 bspnum)
|
|||||||
rootpv->y = FIXED_TO_FLOAT(rootbbox[BOXBOTTOM]); //ll
|
rootpv->y = FIXED_TO_FLOAT(rootbbox[BOXBOTTOM]); //ll
|
||||||
rootpv++;
|
rootpv++;
|
||||||
|
|
||||||
WalkBSPNode(bspnum, rootp, NULL, rootbbox);
|
WalkBSPNode(bspnum, rootp, NULL,rootbbox);
|
||||||
|
|
||||||
#ifdef DEBUG_HWBSP
|
|
||||||
i = SolveTProblem();
|
i = SolveTProblem();
|
||||||
|
#ifdef DEBUG_HWBSP
|
||||||
CONS_Debug(DBG_RENDER, "%d point divides a polygon line\n",i);
|
CONS_Debug(DBG_RENDER, "%d point divides a polygon line\n",i);
|
||||||
#else
|
|
||||||
SolveTProblem();
|
|
||||||
#endif
|
#endif
|
||||||
AdjustSegs();
|
AdjustSegs();
|
||||||
|
|
||||||
|
|||||||
@@ -804,7 +804,7 @@ static void HWR_PrecacheLevelSprites(void)
|
|||||||
|
|
||||||
void HWR_PrecacheLevel(void)
|
void HWR_PrecacheLevel(void)
|
||||||
{
|
{
|
||||||
if (gamestate != GS_LEVEL)
|
if (rendermode != render_opengl)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Precache flats.
|
// Precache flats.
|
||||||
@@ -1190,9 +1190,7 @@ static void HWR_CacheFadeMask(GLMipmap_t *glMipmap, lumpnum_t fademasklumpnum)
|
|||||||
break;
|
break;
|
||||||
default: // Bad lump
|
default: // Bad lump
|
||||||
CONS_Alert(CONS_WARNING, "Fade mask lump of incorrect size, ignored\n"); // I should avoid this by checking the lumpnum in HWR_RunWipe
|
CONS_Alert(CONS_WARNING, "Fade mask lump of incorrect size, ignored\n"); // I should avoid this by checking the lumpnum in HWR_RunWipe
|
||||||
glMipmap->width = 0;
|
break;
|
||||||
glMipmap->height = 0;
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Thankfully, this will still work for this scenario
|
// Thankfully, this will still work for this scenario
|
||||||
|
|||||||
@@ -99,6 +99,10 @@ typedef struct
|
|||||||
fixed_t x2, y2, z2;
|
fixed_t x2, y2, z2;
|
||||||
} polyvertex_t;
|
} polyvertex_t;
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(disable : 4200)
|
||||||
|
#endif
|
||||||
|
|
||||||
// a convex 'plane' polygon, clockwise order
|
// a convex 'plane' polygon, clockwise order
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@@ -106,6 +110,10 @@ typedef struct
|
|||||||
polyvertex_t pts[0];
|
polyvertex_t pts[0];
|
||||||
} poly_t;
|
} poly_t;
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(default : 4200)
|
||||||
|
#endif
|
||||||
|
|
||||||
// holds extra info for 3D render, for each subsector in subsectors[]
|
// holds extra info for 3D render, for each subsector in subsectors[]
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
|||||||
Loaded 100 of 216 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user