mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-04-20 09:11:01 +00:00
Merge branch SRB2:next into add-namechange-lua-hook
This commit is contained in:
commit
096a9f0c79
239 changed files with 9638 additions and 6104 deletions
|
@ -7,6 +7,7 @@ jobs:
|
|||
environment:
|
||||
CC: ccache gcc
|
||||
CCACHE_COMPRESS: true
|
||||
CFLAGS: -Wno-error=unused-result
|
||||
#- image: ubuntu:trusty
|
||||
# environment:
|
||||
# CC: ccache gcc -m32
|
||||
|
@ -49,12 +50,15 @@ jobs:
|
|||
paths:
|
||||
- /home/circleci/.cache/apt
|
||||
- checkout
|
||||
- run:
|
||||
name: Create deps folder as needed
|
||||
command: mkdir -p make/linux/64/SDL/deps/
|
||||
- run:
|
||||
name: make master depend file
|
||||
command: find make/linux64/SDL/deps/ -type f -print0 | sort -z | xargs -r0 cat > make/linux64/SDL.deps
|
||||
command: find make/linux/64/SDL/deps/ -type f -print0 | sort -z | xargs -r0 cat > make/linux/64/SDL.deps
|
||||
- restore_cache:
|
||||
keys:
|
||||
- v1-SRB2-{{ .Branch }}-{{ checksum "make/linux64/SDL.deps" }}
|
||||
- v1-SRB2-{{ .Branch }}-{{ checksum "make/linux/64/SDL.deps" }}
|
||||
- run:
|
||||
name: Compile
|
||||
command: make -C src LINUX64=1 ERRORMODE=1 -k -j4
|
||||
|
@ -62,6 +66,6 @@ jobs:
|
|||
path: /home/circleci/SRB2/bin/
|
||||
destination: bin
|
||||
- save_cache:
|
||||
key: v1-SRB2-{{ .Branch }}-{{ checksum "make/linux64/SDL.deps" }}
|
||||
key: v1-SRB2-{{ .Branch }}-{{ checksum "make/linux/64/SDL.deps" }}
|
||||
paths:
|
||||
- /home/circleci/.ccache
|
||||
|
|
853
.gitlab-ci.yml
853
.gitlab-ci.yml
|
@ -1,848 +1,19 @@
|
|||
include:
|
||||
- '.gitlab/ci/templates/*.yml'
|
||||
- '.gitlab/ci/jobs/*.yml'
|
||||
|
||||
workflow:
|
||||
auto_cancel:
|
||||
on_new_commit: interruptible
|
||||
|
||||
variables:
|
||||
GIT_STRATEGY: clone
|
||||
GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_CONCURRENT_ID/$CI_PROJECT_PATH
|
||||
|
||||
default:
|
||||
image: git.do.srb2.org:5050/stjr/srb2ci/srb2ci:stable
|
||||
|
||||
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
|
||||
|
||||
- key: apk-$CI_JOB_IMAGE
|
||||
paths:
|
||||
- apk-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 nasm cmake ca-certificates
|
||||
- |
|
||||
# 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"
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "bin/"
|
||||
- "src/comptime.h"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-$CI_JOB_NAME_SLUG"
|
||||
|
||||
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
|
||||
- ccache --show-log-stats || true
|
||||
- |
|
||||
# ccahe_stats
|
||||
echo -e "\e[0Ksection_end:`date +%s`:ccache_stats\r\e[0K"
|
||||
GIT_DEPTH: 20
|
||||
|
||||
stages:
|
||||
- build
|
||||
|
||||
Debian testing GCC:
|
||||
stage: build
|
||||
|
||||
when: manual
|
||||
|
||||
image: debian:testing-slim
|
||||
|
||||
allow_failure: true
|
||||
|
||||
default:
|
||||
interruptible: true
|
||||
artifacts:
|
||||
paths:
|
||||
- "bin/"
|
||||
- "src/comptime.h"
|
||||
expose_as: "testing-gcc"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-testing-gcc"
|
||||
|
||||
variables:
|
||||
CC: gcc
|
||||
LDFLAGS: -Wl,-fuse-ld=gold
|
||||
|
||||
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 libminiupnpc-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:
|
||||
stage: build
|
||||
|
||||
when: on_success
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "bin/"
|
||||
- "src/comptime.h"
|
||||
expose_as: "Win32"
|
||||
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:
|
||||
stage: build
|
||||
|
||||
when: on_success
|
||||
|
||||
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
|
||||
LDFLAGS: -Wl,-fuse-ld=gold
|
||||
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 libminiupnpc-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 oldstable:amd64:
|
||||
extends: Debian stable:amd64
|
||||
|
||||
when: manual
|
||||
|
||||
image: git.do.srb2.org:5050/stjr/srb2ci/srb2ci:oldstable
|
||||
|
||||
allow_failure: true
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "bin/"
|
||||
- "src/comptime.h"
|
||||
expose_as: "Debian old amd64"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-old-x86-64"
|
||||
|
||||
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 libopenmpt-dev:amd64 libminiupnpc-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 NOGME=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX64=1 NOGME=1
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
||||
|
||||
Debian stable:i386:
|
||||
stage: build
|
||||
|
||||
when: manual
|
||||
|
||||
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 libminiupnpc-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:
|
||||
stage: build
|
||||
|
||||
when: manual
|
||||
|
||||
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
|
||||
LDFLAGS: -Wl,-fuse-ld=gold
|
||||
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 libminiupnpc-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 ARM64=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX64=1 NONX86=1 ARM64=1
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
||||
|
||||
Debian oldstable:arm64:
|
||||
extends: Debian stable:arm64
|
||||
|
||||
when: manual
|
||||
|
||||
image: git.do.srb2.org:5050/stjr/srb2ci/srb2ci:oldstable
|
||||
|
||||
allow_failure: true
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "bin/"
|
||||
- "src/comptime.h"
|
||||
expose_as: "Debian old arm64"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-old-aarch64"
|
||||
|
||||
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 libopenmpt-dev:arm64 libminiupnpc-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 ARM64=1 NOGME=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX64=1 NONX86=1 ARM64=1 NOGME=1
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
||||
|
||||
batocera:arm64:
|
||||
extends: Debian stable:arm64
|
||||
|
||||
when: manual
|
||||
|
||||
allow_failure: true
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "bin/"
|
||||
- "src/comptime.h"
|
||||
expose_as: "Debian old arm64"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-batocera-aarch64"
|
||||
|
||||
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 libopenmpt-dev:arm64 libminiupnpc-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 ARM64=1 NOGME=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX64=1 NONX86=1 ARM64=1 NOGME=1
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
||||
|
||||
Windows x64:
|
||||
stage: build
|
||||
|
||||
when: manual
|
||||
|
||||
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:
|
||||
stage: build
|
||||
|
||||
when: on_success
|
||||
|
||||
allow_failure: false
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "build.clang/bin/"
|
||||
- "build.clang/src/config.h"
|
||||
expose_as: "clang"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-clang"
|
||||
|
||||
variables:
|
||||
CC: clang
|
||||
CXX: clang
|
||||
WFLAGS: -Wno-cast-align -Wno-implicit-const-int-float-conversion -Werror
|
||||
CFLAGS: -Wno-cast-align -Wno-implicit-const-int-float-conversion -Werror
|
||||
LDFLAGS: -Wl,-fuse-ld=gold
|
||||
|
||||
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 libminiupnpc-dev
|
||||
- |
|
||||
# apt_development
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
|
||||
|
||||
- - |
|
||||
# cmake
|
||||
echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles"
|
||||
- cmake -B build.clang -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_USE_LIBGME:BOOL=OFF -G "Unix Makefiles"
|
||||
- |
|
||||
# cmake
|
||||
echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K"
|
||||
|
||||
- - |
|
||||
# make
|
||||
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
|
||||
- make --directory=build.clang --keep-going || make --directory=build.clang --keep-going
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
||||
|
||||
Debian testing Clang:
|
||||
extends: Debian stable Clang
|
||||
|
||||
when: manual
|
||||
|
||||
allow_failure: true
|
||||
|
||||
image: debian:testing-slim
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "build.clang/bin/"
|
||||
- "build.clang/src/config.h"
|
||||
expose_as: "testing-clang"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-testing-clang"
|
||||
|
||||
variables:
|
||||
CC: clang
|
||||
CXX: clang
|
||||
WFLAGS: -Wno-cast-align -Wno-implicit-const-int-float-conversion -Werror -Wno-deprecated-non-prototype -Wno-single-bit-bitfield-constant-conversion
|
||||
CFLAGS: -Wno-cast-align -Wno-implicit-const-int-float-conversion -Werror -Wno-deprecated-non-prototype -Wno-single-bit-bitfield-constant-conversion
|
||||
LDFLAGS: -Wl,-fuse-ld=gold
|
||||
|
||||
Alpine 3 GCC:
|
||||
stage: build
|
||||
|
||||
when: on_success
|
||||
|
||||
image: alpine:3
|
||||
|
||||
allow_failure: true
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "bin/"
|
||||
- "src/comptime.h"
|
||||
expose_as: "Apline-3"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-Apline-3"
|
||||
|
||||
before_script:
|
||||
- - |
|
||||
# apk_cache
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apk_cache[collapsed=true]\r\e[0KUpdating APK listing"
|
||||
- export APK_CACHE_DIR=`pwd`/apk-cache
|
||||
- mkdir --parents --verbose $APK_CACHE_DIR/
|
||||
- ln -sf /etc/apk/cache $APK_CACHE_DIR
|
||||
- |
|
||||
# apk_cache
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apk_cache\r\e[0K"
|
||||
|
||||
- - |
|
||||
# apk_update
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apk_update[collapsed=true]\r\e[0KUpdating APK listing"
|
||||
- apk update
|
||||
- |
|
||||
# apk_update
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apk_update\r\e[0K"
|
||||
|
||||
- - |
|
||||
# apk_upgrade
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apk_upgrade[collapsed=true]\r\e[0KUpdating existing packages"
|
||||
- apk upgrade
|
||||
- |
|
||||
# apk_update
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apk_upgrade\r\e[0K"
|
||||
|
||||
- - |
|
||||
# apk_common
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apk_common[collapsed=true]\r\e[0KInstalling common packages"
|
||||
- apk add make git ccache nasm
|
||||
- |
|
||||
# apk_common
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apk_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 -a ~/.ccache/ccache.conf
|
||||
- |
|
||||
# cache_dir
|
||||
echo cache_dir = $PWD/ccache | tee -a ~/.ccache/ccache.conf
|
||||
- |
|
||||
# compiler_check
|
||||
echo compiler_check = content | tee -a ~/.ccache/ccache.conf
|
||||
- |
|
||||
# stats_log
|
||||
echo stats_log = $PWD/ccache_statslog | tee -a ~/.ccache/ccache.conf
|
||||
- |
|
||||
# max_size
|
||||
echo max_size = 50M | tee -a ~/.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"
|
||||
|
||||
script:
|
||||
- - |
|
||||
# apk_toolchain
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apk_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
|
||||
- apk add gcc
|
||||
- |
|
||||
# apk_toolchain
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apk_toolchain\r\e[0K"
|
||||
|
||||
- - |
|
||||
# apk_development
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apk_development[collapsed=true]\r\e[0KInstalling development packages"
|
||||
- apk add musl-dev sdl2_mixer-dev libpng-dev curl-dev libgme-dev libopenmpt-dev miniupnpc-dev
|
||||
- |
|
||||
# apk_development
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apk_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 NOEXECINFO=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 NONX86=1 NOEXECINFO=1
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
||||
|
||||
after_script:
|
||||
- - |
|
||||
# apk_clean
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apk_clean[collapsed=true]\r\e[0KCleaning of unneeded APK packages"
|
||||
- apk cache clean
|
||||
- |
|
||||
# apk_clean
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apk_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"
|
||||
|
||||
Alpine 3 GCC Dedicated:
|
||||
extends: Alpine 3 GCC
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "bin/"
|
||||
- "src/comptime.h"
|
||||
expose_as: "Apline-3-Dedicated"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-Apline-3-Dedicated"
|
||||
|
||||
script:
|
||||
- - |
|
||||
# apk_toolchain
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apk_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
|
||||
- apk add gcc
|
||||
- |
|
||||
# apk_toolchain
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apk_toolchain\r\e[0K"
|
||||
|
||||
- - |
|
||||
# apk_development
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apk_development[collapsed=true]\r\e[0KInstalling development packages"
|
||||
- apk add musl-dev libpng-dev curl-dev
|
||||
- |
|
||||
# apk_development
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apk_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 NOEXECINFO=1 DEDICATED=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 NONX86=1 NOEXECINFO=1 DEDICATED=1
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
||||
|
||||
osxcross x86_64:
|
||||
stage: build
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "build.osxcross/bin/"
|
||||
- "build.osxcross/src/config.h"
|
||||
expose_as: "Mac x86_64"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-clang"
|
||||
|
||||
variables:
|
||||
OSXCROSS_HOST: x86_64-apple-darwin21.4
|
||||
LD: x86_64-apple-darwin21.4-ld
|
||||
|
||||
script:
|
||||
- - |
|
||||
# apt_development
|
||||
echo -e "\e[0Ksection_start:`date +%s`:macports_development[collapsed=true]\r\e[0KInstalling development packages"
|
||||
- osxcross-macports install curl libopenmpt libsdl2_mixer
|
||||
- |
|
||||
# apt_development
|
||||
echo -e "\e[0Ksection_end:`date +%s`:macports_development\r\e[0K"
|
||||
|
||||
- - |
|
||||
# make
|
||||
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KBuilding Makefiles"
|
||||
- cmake -B build.osxcross --toolchain /osxcross/toolchain.cmake -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DOPENMPT_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/include" -DSDL2_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/lib" -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_CONFIG_USE_GME:BOOL=OFF -G "Unix Makefiles"
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
||||
|
||||
- - |
|
||||
# make
|
||||
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
|
||||
- make --directory=build.osxcross --keep-going || make --directory=build.osxcross --keep-going
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
||||
|
||||
osxcross arm64:
|
||||
stage: build
|
||||
|
||||
when: manual
|
||||
|
||||
allow_failure: true
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "build.osxcross/bin/"
|
||||
- "build.osxcross/src/config.h"
|
||||
expose_as: "Mac arm64"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-clang"
|
||||
|
||||
variables:
|
||||
OSXCROSS_HOST: arm64-apple-darwin21.4
|
||||
LD: arm64-apple-darwin21.4-ld
|
||||
|
||||
script:
|
||||
- - |
|
||||
# apt_development
|
||||
echo -e "\e[0Ksection_start:`date +%s`:macports_development[collapsed=true]\r\e[0KInstalling development packages"
|
||||
- osxcross-macports install --arm64 curl libopenmpt libsdl2_mixer
|
||||
- |
|
||||
# apt_development
|
||||
echo -e "\e[0Ksection_end:`date +%s`:macports_development\r\e[0K"
|
||||
|
||||
- - |
|
||||
# make
|
||||
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KBuilding Makefiles"
|
||||
- cmake -B build.osxcross --toolchain /osxcross/toolchain.cmake -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DOPENMPT_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/include" -DSDL2_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/lib" -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_CONFIG_USE_GME:BOOL=OFF -G "Unix Makefiles"
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
||||
|
||||
- - |
|
||||
# make
|
||||
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
|
||||
- make --directory=build.osxcross --keep-going || make --directory=build.osxcross --keep-going
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
||||
expire_in: 1 day
|
||||
|
|
34
.gitlab/ci/jobs/alpine-3-gcc-dedicated-makefile.yml
Normal file
34
.gitlab/ci/jobs/alpine-3-gcc-dedicated-makefile.yml
Normal file
|
@ -0,0 +1,34 @@
|
|||
Alpine 3 GCC Dedicated Makefile:
|
||||
extends: Alpine 3 GCC Makefile
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "bin/"
|
||||
- "src/comptime.h"
|
||||
expose_as: "Apline-3-Dedicated-makefile"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-Apline-3-Dedicated-makefile"
|
||||
|
||||
script:
|
||||
- - |
|
||||
# apk_toolchain
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apk_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
|
||||
- apk add gcc g++
|
||||
- |
|
||||
# apk_toolchain
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apk_toolchain\r\e[0K"
|
||||
|
||||
- - |
|
||||
# apk_development
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apk_development[collapsed=true]\r\e[0KInstalling development packages"
|
||||
- apk add musl-dev libpng-dev curl-dev
|
||||
- |
|
||||
# apk_development
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apk_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 NOEXECINFO=1 DEDICATED=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 NONX86=1 NOEXECINFO=1 DEDICATED=1
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
135
.gitlab/ci/jobs/alpine-3-gcc-makefile.yml
Normal file
135
.gitlab/ci/jobs/alpine-3-gcc-makefile.yml
Normal file
|
@ -0,0 +1,135 @@
|
|||
Alpine 3 GCC Makefile:
|
||||
stage: build
|
||||
|
||||
when: manual
|
||||
|
||||
image: alpine:3
|
||||
|
||||
allow_failure: true
|
||||
|
||||
cache:
|
||||
- key: apk-$CI_JOB_IMAGE-makefile
|
||||
paths:
|
||||
- apk-cache
|
||||
unprotect: true
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "bin/"
|
||||
- "src/comptime.h"
|
||||
expose_as: "Apline-3-makefile"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-Apline-3-makefile"
|
||||
|
||||
before_script:
|
||||
- - |
|
||||
# apk_cache
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apk_cache[collapsed=true]\r\e[0KUpdating APK listing"
|
||||
- export APK_CACHE_DIR=`pwd`/apk-cache
|
||||
- mkdir --parents --verbose $APK_CACHE_DIR/
|
||||
- ln -sf /etc/apk/cache $APK_CACHE_DIR
|
||||
- |
|
||||
# apk_cache
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apk_cache\r\e[0K"
|
||||
|
||||
- - |
|
||||
# apk_update
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apk_update[collapsed=true]\r\e[0KUpdating APK listing"
|
||||
- apk update
|
||||
- |
|
||||
# apk_update
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apk_update\r\e[0K"
|
||||
|
||||
- - |
|
||||
# apk_upgrade
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apk_upgrade[collapsed=true]\r\e[0KUpdating existing packages"
|
||||
- apk upgrade
|
||||
- |
|
||||
# apk_update
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apk_upgrade\r\e[0K"
|
||||
|
||||
- - |
|
||||
# apk_common
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apk_common[collapsed=true]\r\e[0KInstalling common packages"
|
||||
- apk add make git ccache nasm
|
||||
- |
|
||||
# apk_common
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apk_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 -a ~/.ccache/ccache.conf
|
||||
- |
|
||||
# cache_dir
|
||||
echo cache_dir = $PWD/ccache | tee -a ~/.ccache/ccache.conf
|
||||
- |
|
||||
# compiler_check
|
||||
echo compiler_check = content | tee -a ~/.ccache/ccache.conf
|
||||
- |
|
||||
# stats_log
|
||||
echo stats_log = $PWD/ccache_statslog | tee -a ~/.ccache/ccache.conf
|
||||
- |
|
||||
# max_size
|
||||
echo max_size = 50M | tee -a ~/.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"
|
||||
|
||||
script:
|
||||
- - |
|
||||
# apk_toolchain
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apk_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
|
||||
- apk add gcc g++
|
||||
- |
|
||||
# apk_toolchain
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apk_toolchain\r\e[0K"
|
||||
|
||||
- - |
|
||||
# apk_development
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apk_development[collapsed=true]\r\e[0KInstalling development packages"
|
||||
- apk add cmake musl-dev sdl2_mixer-dev libpng-dev curl-dev libgme-dev libopenmpt-dev miniupnpc-dev elfutils-dev
|
||||
- |
|
||||
# apk_development
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apk_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 NOEXECINFO=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 NONX86=1 NOEXECINFO=1
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
||||
|
||||
after_script:
|
||||
- - |
|
||||
# apk_clean
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apk_clean[collapsed=true]\r\e[0KCleaning of unneeded APK packages"
|
||||
- apk cache clean
|
||||
- |
|
||||
# apk_clean
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apk_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"
|
143
.gitlab/ci/jobs/alpine-3-gcc.yml
Normal file
143
.gitlab/ci/jobs/alpine-3-gcc.yml
Normal file
|
@ -0,0 +1,143 @@
|
|||
Alpine 3 GCC:
|
||||
stage: build
|
||||
|
||||
when: manual
|
||||
|
||||
image: alpine:3
|
||||
|
||||
allow_failure: true
|
||||
|
||||
cache:
|
||||
- key: apk-$CI_JOB_IMAGE
|
||||
paths:
|
||||
- apk-cache
|
||||
unprotect: true
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "build.alpine3/bin/"
|
||||
- "build.alpine3/src/config.h"
|
||||
expose_as: "Apline-3"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-Apline-3"
|
||||
|
||||
before_script:
|
||||
- - |
|
||||
# apk_cache
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apk_cache[collapsed=true]\r\e[0KUpdating APK listing"
|
||||
- export APK_CACHE_DIR=`pwd`/apk-cache
|
||||
- mkdir --parents --verbose $APK_CACHE_DIR/
|
||||
- ln -sf /etc/apk/cache $APK_CACHE_DIR
|
||||
- |
|
||||
# apk_cache
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apk_cache\r\e[0K"
|
||||
|
||||
- - |
|
||||
# apk_update
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apk_update[collapsed=true]\r\e[0KUpdating APK listing"
|
||||
- apk update
|
||||
- |
|
||||
# apk_update
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apk_update\r\e[0K"
|
||||
|
||||
- - |
|
||||
# apk_upgrade
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apk_upgrade[collapsed=true]\r\e[0KUpdating existing packages"
|
||||
- apk upgrade
|
||||
- |
|
||||
# apk_update
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apk_upgrade\r\e[0K"
|
||||
|
||||
- - |
|
||||
# apk_common
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apk_common[collapsed=true]\r\e[0KInstalling common packages"
|
||||
- apk add cmake make git ccache nasm
|
||||
- |
|
||||
# apk_common
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apk_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 -a ~/.ccache/ccache.conf
|
||||
- |
|
||||
# cache_dir
|
||||
echo cache_dir = $PWD/ccache | tee -a ~/.ccache/ccache.conf
|
||||
- |
|
||||
# compiler_check
|
||||
echo compiler_check = content | tee -a ~/.ccache/ccache.conf
|
||||
- |
|
||||
# stats_log
|
||||
echo stats_log = $PWD/ccache_statslog | tee -a ~/.ccache/ccache.conf
|
||||
- |
|
||||
# max_size
|
||||
echo max_size = 50M | tee -a ~/.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"
|
||||
|
||||
script:
|
||||
- - |
|
||||
# apk_toolchain
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apk_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
|
||||
- apk add gcc g++
|
||||
- |
|
||||
# apk_toolchain
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apk_toolchain\r\e[0K"
|
||||
|
||||
- - |
|
||||
# apk_development
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apk_development[collapsed=true]\r\e[0KInstalling development packages"
|
||||
- apk add cmake musl-dev sdl2_mixer-dev libpng-dev curl-dev libgme-dev libopenmpt-dev miniupnpc-dev elfutils-dev
|
||||
- |
|
||||
# apk_development
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apk_development\r\e[0K"
|
||||
|
||||
- - |
|
||||
# cmake
|
||||
echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles"
|
||||
- cmake -B build.alpine3 -DSRB2_USE_CCACHE=YES -DSRB2_CONFIG_ERRORMODE=ON -DSRB2_CONFIG_EXECINFO=NO -G "Unix Makefiles"
|
||||
- |
|
||||
# cmake
|
||||
echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K"
|
||||
|
||||
- - |
|
||||
# make
|
||||
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
|
||||
- make --directory=build.alpine3 --keep-going || make --directory=build.alpine3 --keep-going
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
||||
|
||||
after_script:
|
||||
- - |
|
||||
# apk_clean
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apk_clean[collapsed=true]\r\e[0KCleaning of unneeded APK packages"
|
||||
- apk cache clean
|
||||
- |
|
||||
# apk_clean
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apk_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"
|
38
.gitlab/ci/jobs/batocera-arm64-makefile.yml
Normal file
38
.gitlab/ci/jobs/batocera-arm64-makefile.yml
Normal file
|
@ -0,0 +1,38 @@
|
|||
batocera:arm64 Makefile:
|
||||
extends: Debian stable:arm64 Makefile
|
||||
|
||||
when: manual
|
||||
|
||||
allow_failure: true
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "bin/"
|
||||
- "src/comptime.h"
|
||||
expose_as: "Debian old arm64 makefile"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-batocera-aarch64-makefile"
|
||||
|
||||
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 libopenmpt-dev:arm64 libminiupnpc-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 ARM64=1 NOGME=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX64=1 NONX86=1 ARM64=1 NOGME=1
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
46
.gitlab/ci/jobs/batocera-arm64.yml
Normal file
46
.gitlab/ci/jobs/batocera-arm64.yml
Normal file
|
@ -0,0 +1,46 @@
|
|||
batocera:arm64:
|
||||
extends: Debian stable:arm64
|
||||
|
||||
when: manual
|
||||
|
||||
allow_failure: true
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "build.cmake/bin/"
|
||||
- "build.cmake/src/config.h"
|
||||
expose_as: "Debian old arm64"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-batocera-aarch64"
|
||||
|
||||
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 libopenmpt-dev:arm64 libminiupnpc-dev:arm64
|
||||
- |
|
||||
# apt_development
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
|
||||
|
||||
- - |
|
||||
# cmake
|
||||
echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles"
|
||||
- cmake -B build.cmake -DSRB2_USE_CCACHE=YES -DSRB2_CONFIG_ERRORMODE=ON -DSRB2_CONFIG_FORCE_NO_MS_BITFIELDS=ON -DSRB2_CONFIG_USE_GME=OFF -G "Unix Makefiles"
|
||||
- |
|
||||
# cmake
|
||||
echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K"
|
||||
|
||||
- - |
|
||||
# make
|
||||
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
|
||||
- make --directory=build.cmake --keep-going || make --directory=build.cmake --keep-going
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
40
.gitlab/ci/jobs/debian-oldstable-amd64-makefile.yml
Normal file
40
.gitlab/ci/jobs/debian-oldstable-amd64-makefile.yml
Normal file
|
@ -0,0 +1,40 @@
|
|||
Debian oldstable:amd64 Makefile:
|
||||
extends: Debian stable:amd64 Makefile
|
||||
|
||||
when: manual
|
||||
|
||||
image: git.do.srb2.org:5050/stjr/srb2ci/srb2ci:oldstable
|
||||
|
||||
allow_failure: true
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "bin/"
|
||||
- "src/comptime.h"
|
||||
expose_as: "Debian old amd64 makefile"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-old-x86-64-makefile"
|
||||
|
||||
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 libopenmpt-dev:amd64 libminiupnpc-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 NOGME=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX64=1 NOGME=1
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
48
.gitlab/ci/jobs/debian-oldstable-amd64.yml
Normal file
48
.gitlab/ci/jobs/debian-oldstable-amd64.yml
Normal file
|
@ -0,0 +1,48 @@
|
|||
Debian oldstable:amd64:
|
||||
extends: Debian stable:amd64
|
||||
|
||||
when: manual
|
||||
|
||||
image: git.do.srb2.org:5050/stjr/srb2ci/srb2ci:oldstable
|
||||
|
||||
allow_failure: true
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "build.cmake/bin/"
|
||||
- "build.cmake/src/config.h"
|
||||
expose_as: "Debian old amd64"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-old-x86-64"
|
||||
|
||||
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 libopenmpt-dev:amd64 libminiupnpc-dev:amd64
|
||||
- |
|
||||
# apt_development
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
|
||||
|
||||
- - |
|
||||
# cmake
|
||||
echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles"
|
||||
- cmake -B build.cmake -DSRB2_USE_CCACHE=YES -DSRB2_CONFIG_ERRORMODE=ON -DSRB2_CONFIG_USE_GME=OFF -G "Unix Makefiles"
|
||||
- |
|
||||
# cmake
|
||||
echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K"
|
||||
|
||||
- - |
|
||||
# make
|
||||
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
|
||||
- make --directory=build.cmake --keep-going || make --directory=build.cmake --keep-going
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
40
.gitlab/ci/jobs/debian-oldstable-arm64-makefile.yml
Normal file
40
.gitlab/ci/jobs/debian-oldstable-arm64-makefile.yml
Normal file
|
@ -0,0 +1,40 @@
|
|||
Debian oldstable:arm64 Makefile:
|
||||
extends: Debian stable:arm64 Makefile
|
||||
|
||||
when: manual
|
||||
|
||||
image: git.do.srb2.org:5050/stjr/srb2ci/srb2ci:oldstable
|
||||
|
||||
allow_failure: true
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "bin/"
|
||||
- "src/comptime.h"
|
||||
expose_as: "Debian old arm64 makefile"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-old-aarch64-makefile"
|
||||
|
||||
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 libopenmpt-dev:arm64 libminiupnpc-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 ARM64=1 NOGME=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX64=1 NONX86=1 ARM64=1 NOGME=1
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
48
.gitlab/ci/jobs/debian-oldstable-arm64.yml
Normal file
48
.gitlab/ci/jobs/debian-oldstable-arm64.yml
Normal file
|
@ -0,0 +1,48 @@
|
|||
Debian oldstable:arm64:
|
||||
extends: Debian stable:arm64
|
||||
|
||||
when: manual
|
||||
|
||||
image: git.do.srb2.org:5050/stjr/srb2ci/srb2ci:oldstable
|
||||
|
||||
allow_failure: true
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "build.cmake/bin/"
|
||||
- "build.cmake/src/config.h"
|
||||
expose_as: "Debian old arm64"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-old-aarch64"
|
||||
|
||||
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 libopenmpt-dev:arm64 libminiupnpc-dev:arm64
|
||||
- |
|
||||
# apt_development
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
|
||||
|
||||
- - |
|
||||
# cmake
|
||||
echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles"
|
||||
- cmake -B build.cmake -DSRB2_USE_CCACHE=YES -DSRB2_CONFIG_ERRORMODE=ON -DSRB2_CONFIG_FORCE_NO_MS_BITFIELDS=ON -DSRB2_CONFIG_USE_GME=OFF -G "Unix Makefiles"
|
||||
- |
|
||||
# cmake
|
||||
echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K"
|
||||
|
||||
- - |
|
||||
# make
|
||||
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
|
||||
- make --directory=build.cmake --keep-going || make --directory=build.cmake --keep-going
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
45
.gitlab/ci/jobs/debian-stable-amd64-makefile.yml
Normal file
45
.gitlab/ci/jobs/debian-stable-amd64-makefile.yml
Normal file
|
@ -0,0 +1,45 @@
|
|||
Debian stable:amd64 Makefile:
|
||||
extends: .srb2ci
|
||||
|
||||
stage: build
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "bin/"
|
||||
- "src/comptime.h"
|
||||
expose_as: "Debian amd64 makefile"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-x86-64-makefile"
|
||||
|
||||
variables:
|
||||
CC: x86_64-linux-gnu-gcc
|
||||
LDFLAGS: -Wl,-fuse-ld=gold
|
||||
OBJCOPY: x86_64-linux-gnu-objcopy
|
||||
OBJDUMP: x86_64-linux-gnu-objdump
|
||||
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig
|
||||
|
||||
when: on_success
|
||||
|
||||
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 libminiupnpc-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"
|
53
.gitlab/ci/jobs/debian-stable-amd64.yml
Normal file
53
.gitlab/ci/jobs/debian-stable-amd64.yml
Normal file
|
@ -0,0 +1,53 @@
|
|||
Debian stable:amd64:
|
||||
extends: .srb2ci
|
||||
|
||||
stage: build
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "build.cmake/bin/"
|
||||
- "build.cmake/src/config.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
|
||||
LDFLAGS: -Wl,-fuse-ld=gold
|
||||
OBJCOPY: x86_64-linux-gnu-objcopy
|
||||
OBJDUMP: x86_64-linux-gnu-objdump
|
||||
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig
|
||||
|
||||
when: on_success
|
||||
|
||||
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 libminiupnpc-dev:amd64
|
||||
- |
|
||||
# apt_development
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
|
||||
|
||||
- - |
|
||||
# cmake
|
||||
echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles"
|
||||
- cmake -B build.cmake -DSRB2_USE_CCACHE=YES -DSRB2_CONFIG_ERRORMODE=ON -G "Unix Makefiles"
|
||||
- |
|
||||
# cmake
|
||||
echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K"
|
||||
|
||||
- - |
|
||||
# make
|
||||
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
|
||||
- make --directory=build.cmake --keep-going || make --directory=build.cmake --keep-going
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
46
.gitlab/ci/jobs/debian-stable-arm64-makefile.yml
Normal file
46
.gitlab/ci/jobs/debian-stable-arm64-makefile.yml
Normal file
|
@ -0,0 +1,46 @@
|
|||
Debian stable:arm64 Makefile:
|
||||
extends: .srb2ci
|
||||
|
||||
stage: build
|
||||
|
||||
when: manual
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "bin/"
|
||||
- "src/comptime.h"
|
||||
expose_as: "Debian arm64 makefile"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-aarch64-makefile"
|
||||
|
||||
variables:
|
||||
CC: aarch64-linux-gnu-gcc
|
||||
LDFLAGS: -Wl,-fuse-ld=gold
|
||||
OBJCOPY: aarch64-linux-gnu-objcopy
|
||||
OBJDUMP: aarch64-linux-gnu-objdump
|
||||
LD: aarch64-linux-gnu-ld
|
||||
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 libminiupnpc-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 ARM64=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX64=1 NONX86=1 ARM64=1
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
54
.gitlab/ci/jobs/debian-stable-arm64.yml
Normal file
54
.gitlab/ci/jobs/debian-stable-arm64.yml
Normal file
|
@ -0,0 +1,54 @@
|
|||
Debian stable:arm64:
|
||||
extends: .srb2ci
|
||||
|
||||
stage: build
|
||||
|
||||
when: manual
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "build.cmake/bin/"
|
||||
- "build.cmake/src/config.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
|
||||
LDFLAGS: -Wl,-fuse-ld=gold
|
||||
OBJCOPY: aarch64-linux-gnu-objcopy
|
||||
OBJDUMP: aarch64-linux-gnu-objdump
|
||||
LD: aarch64-linux-gnu-ld
|
||||
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 libminiupnpc-dev:arm64
|
||||
- |
|
||||
# apt_development
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
|
||||
|
||||
- - |
|
||||
# cmake
|
||||
echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles"
|
||||
- cmake -B build.cmake -DSRB2_USE_CCACHE=YES -DSRB2_CONFIG_ERRORMODE=ON -DSRB2_CONFIG_FORCE_NO_MS_BITFIELDS=ON -G "Unix Makefiles"
|
||||
- |
|
||||
# cmake
|
||||
echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K"
|
||||
|
||||
- - |
|
||||
# make
|
||||
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
|
||||
- make --directory=build.cmake --keep-going || make --directory=build.cmake --keep-going
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
55
.gitlab/ci/jobs/debian-stable-clang-amd64.yml
Normal file
55
.gitlab/ci/jobs/debian-stable-clang-amd64.yml
Normal file
|
@ -0,0 +1,55 @@
|
|||
Debian stable Clang:
|
||||
extends: .srb2ci
|
||||
|
||||
stage: build
|
||||
|
||||
when: on_success
|
||||
|
||||
allow_failure: false
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "build.clang/bin/"
|
||||
- "build.clang/src/config.h"
|
||||
expose_as: "clang"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-clang"
|
||||
|
||||
variables:
|
||||
CC: clang
|
||||
CXX: clang
|
||||
WFLAGS: -Wno-cast-align -Wno-implicit-const-int-float-conversion -Werror
|
||||
CFLAGS: -Wno-cast-align -Wno-implicit-const-int-float-conversion -Werror
|
||||
LDFLAGS: -Wl,-fuse-ld=gold
|
||||
|
||||
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 libminiupnpc-dev
|
||||
- |
|
||||
# apt_development
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
|
||||
|
||||
- - |
|
||||
# cmake
|
||||
echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles"
|
||||
- cmake -B build.clang -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_USE_LIBGME:BOOL=OFF -G "Unix Makefiles"
|
||||
- |
|
||||
# cmake
|
||||
echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K"
|
||||
|
||||
- - |
|
||||
# make
|
||||
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
|
||||
- make --directory=build.clang --keep-going || make --directory=build.clang --keep-going
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
45
.gitlab/ci/jobs/debian-stable-i386-makefile.yml
Normal file
45
.gitlab/ci/jobs/debian-stable-i386-makefile.yml
Normal file
|
@ -0,0 +1,45 @@
|
|||
Debian stable:i386 Makefile:
|
||||
extends: .srb2ci
|
||||
|
||||
stage: build
|
||||
|
||||
when: manual
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "bin/"
|
||||
- "src/comptime.h"
|
||||
expose_as: "Debian i386 makefile"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-i686-makefile"
|
||||
|
||||
variables:
|
||||
CC: i686-linux-gnu-gcc
|
||||
OBJCOPY: i686-linux-gnu-objcopy
|
||||
OBJDUMP: i686-linux-gnu-objdump
|
||||
LD: i686-linux-gnu-ld
|
||||
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 libminiupnpc-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"
|
53
.gitlab/ci/jobs/debian-stable-i386.yml
Normal file
53
.gitlab/ci/jobs/debian-stable-i386.yml
Normal file
|
@ -0,0 +1,53 @@
|
|||
Debian stable:i386:
|
||||
extends: .srb2ci
|
||||
|
||||
stage: build
|
||||
|
||||
when: manual
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "build.cmake/bin/"
|
||||
- "build.cmake/src/config.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
|
||||
LD: i686-linux-gnu-ld
|
||||
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 libminiupnpc-dev:i386
|
||||
- |
|
||||
# apt_development
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
|
||||
|
||||
- - |
|
||||
# cmake
|
||||
echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles"
|
||||
- cmake -B build.cmake -DSRB2_USE_CCACHE=YES -DSRB2_CONFIG_ERRORMODE=ON -G "Unix Makefiles"
|
||||
- |
|
||||
# cmake
|
||||
echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K"
|
||||
|
||||
- - |
|
||||
# make
|
||||
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
|
||||
- make --directory=build.cmake --keep-going || make --directory=build.cmake --keep-going
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
22
.gitlab/ci/jobs/debian-testing-clang-amd64.yml
Normal file
22
.gitlab/ci/jobs/debian-testing-clang-amd64.yml
Normal file
|
@ -0,0 +1,22 @@
|
|||
Debian testing Clang:
|
||||
extends: Debian stable Clang
|
||||
|
||||
when: manual
|
||||
|
||||
allow_failure: true
|
||||
|
||||
image: debian:testing-slim
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "build.clang/bin/"
|
||||
- "build.clang/src/config.h"
|
||||
expose_as: "testing-clang"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-testing-clang"
|
||||
|
||||
variables:
|
||||
CC: clang
|
||||
CXX: clang
|
||||
WFLAGS: -Wno-cast-align -Wno-implicit-const-int-float-conversion -Werror -Wno-deprecated-non-prototype -Wno-single-bit-bitfield-constant-conversion
|
||||
CFLAGS: -Wno-cast-align -Wno-implicit-const-int-float-conversion -Werror -Wno-deprecated-non-prototype -Wno-single-bit-bitfield-constant-conversion
|
||||
LDFLAGS: -Wl,-fuse-ld=gold
|
46
.gitlab/ci/jobs/debian-testing-gcc-amd64-makefile.yml
Normal file
46
.gitlab/ci/jobs/debian-testing-gcc-amd64-makefile.yml
Normal file
|
@ -0,0 +1,46 @@
|
|||
Debian testing GCC Makefile:
|
||||
extends: .srb2ci
|
||||
|
||||
stage: build
|
||||
|
||||
when: manual
|
||||
|
||||
image: debian:testing-slim
|
||||
|
||||
allow_failure: true
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "bin/"
|
||||
- "src/comptime.h"
|
||||
expose_as: "testing-gcc-makefile"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-testing-gcc-makefile"
|
||||
|
||||
variables:
|
||||
CC: gcc
|
||||
LDFLAGS: -Wl,-fuse-ld=gold
|
||||
|
||||
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 libminiupnpc-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"
|
54
.gitlab/ci/jobs/debian-testing-gcc-amd64.yml
Normal file
54
.gitlab/ci/jobs/debian-testing-gcc-amd64.yml
Normal file
|
@ -0,0 +1,54 @@
|
|||
Debian testing GCC:
|
||||
extends: .srb2ci
|
||||
|
||||
stage: build
|
||||
|
||||
when: manual
|
||||
|
||||
image: debian:testing-slim
|
||||
|
||||
allow_failure: true
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "build.cmake/bin/"
|
||||
- "build.cmake/src/config.h"
|
||||
expose_as: "testing-gcc"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-testing-gcc"
|
||||
|
||||
variables:
|
||||
CC: gcc
|
||||
LDFLAGS: -Wl,-fuse-ld=gold
|
||||
|
||||
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 libminiupnpc-dev
|
||||
- |
|
||||
# apt_development
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
|
||||
|
||||
- - |
|
||||
# cmake
|
||||
echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles"
|
||||
- cmake -B build.cmake -DSRB2_USE_CCACHE=YES -DSRB2_CONFIG_ERRORMODE=ON -G "Unix Makefiles"
|
||||
- |
|
||||
# cmake
|
||||
echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K"
|
||||
|
||||
- - |
|
||||
# make
|
||||
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
|
||||
- make --directory=build.cmake --keep-going || make --directory=build.cmake --keep-going
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
44
.gitlab/ci/jobs/macos-arm64.yml
Normal file
44
.gitlab/ci/jobs/macos-arm64.yml
Normal file
|
@ -0,0 +1,44 @@
|
|||
osxcross arm64:
|
||||
extends: .srb2ci
|
||||
|
||||
stage: build
|
||||
|
||||
when: manual
|
||||
|
||||
allow_failure: true
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "build.osxcross/bin/"
|
||||
- "build.osxcross/src/config.h"
|
||||
expose_as: "Mac arm64"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-clang"
|
||||
|
||||
variables:
|
||||
OSXCROSS_HOST: arm64-apple-darwin21.4
|
||||
LD: arm64-apple-darwin21.4-ld
|
||||
|
||||
script:
|
||||
- - |
|
||||
# apt_development
|
||||
echo -e "\e[0Ksection_start:`date +%s`:macports_development[collapsed=true]\r\e[0KInstalling development packages"
|
||||
- osxcross-macports install --arm64 curl libopenmpt libsdl2_mixer
|
||||
- |
|
||||
# apt_development
|
||||
echo -e "\e[0Ksection_end:`date +%s`:macports_development\r\e[0K"
|
||||
|
||||
- - |
|
||||
# cmake
|
||||
echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles"
|
||||
- cmake -B build.osxcross --toolchain /osxcross/toolchain.cmake -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DOPENMPT_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/include" -DSDL2_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/lib" -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_CONFIG_FORCE_NO_MS_BITFIELDS:BOOL=ON -DSRB2_CONFIG_USE_GME:BOOL=OFF -G "Unix Makefiles"
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
||||
|
||||
- - |
|
||||
# make
|
||||
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
|
||||
- make --directory=build.osxcross --keep-going || make --directory=build.osxcross --keep-going
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
115
.gitlab/ci/jobs/macos-x86_64.yml
Normal file
115
.gitlab/ci/jobs/macos-x86_64.yml
Normal file
|
@ -0,0 +1,115 @@
|
|||
osxcross x86_64:
|
||||
extends: .srb2ci
|
||||
|
||||
stage: build
|
||||
|
||||
cache:
|
||||
- key: ccache-$CI_JOB_NAME_SLUG-$CI_COMMIT_REF_SLUG
|
||||
fallback_keys:
|
||||
- ccache-$CI_JOB_NAME_SLUG-$CI_DEFAULT_BRANCH
|
||||
- ccache-$CI_JOB_NAME_SLUG-master
|
||||
paths:
|
||||
- build/ccache
|
||||
- build/ccache_statslog
|
||||
|
||||
- key: apt-$CI_JOB_IMAGE
|
||||
paths:
|
||||
- build/apt-cache
|
||||
unprotect: true
|
||||
|
||||
- key: vcpkg-root
|
||||
paths:
|
||||
- build/vcpkg-root
|
||||
unprotect: true
|
||||
|
||||
- key: vcpkg-binary-cache-x64-osx
|
||||
paths:
|
||||
- build/vcpkg-binary-cache
|
||||
unprotect: true
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "build.osxcross/bin/"
|
||||
- "build.osxcross/src/config.h"
|
||||
expose_as: "Mac x86_64"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-clang"
|
||||
|
||||
variables:
|
||||
OSXCROSS_HOST: x86_64-apple-darwin21.4
|
||||
LD: x86_64-apple-darwin21.4-ld
|
||||
|
||||
script:
|
||||
- |
|
||||
# vcpkg
|
||||
echo -e "\e[0Ksection_start:`date +%s`:vcpkg-root[collapsed=true]\r\e[0KUpdating vcpkg"
|
||||
|
||||
if [ -d "build/vcpkg-root" ]; then
|
||||
pushd build/vcpkg-root
|
||||
git fetch https://github.com/Microsoft/vcpkg master
|
||||
git reset --hard FETCH_HEAD
|
||||
popd
|
||||
else
|
||||
mkdir -p build
|
||||
git clone https://github.com/Microsoft/vcpkg build/vcpkg-root
|
||||
fi
|
||||
|
||||
export VCPKG_ROOT=$(pwd)/build/vcpkg-root
|
||||
export VCPKG_BINARY_SOURCES="clear;files,$(pwd)/build/vcpkg-binary-cache,readwrite"
|
||||
|
||||
mkdir -p "build/vcpkg-binary-cache"
|
||||
|
||||
echo -e "\e[0Ksection_end:`date +%s`:vcpkg-root\r\e[0K"
|
||||
|
||||
- - |
|
||||
# apt_development
|
||||
echo -e "\e[0Ksection_start:`date +%s`:macports_development[collapsed=true]\r\e[0KInstalling development packages"
|
||||
- osxcross-macports install curl libopenmpt libsdl2_mixer
|
||||
- |
|
||||
# apt_development
|
||||
echo -e "\e[0Ksection_end:`date +%s`:macports_development\r\e[0K"
|
||||
|
||||
- - |
|
||||
# cmake
|
||||
echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles"
|
||||
- cmake -B build.osxcross --toolchain /osxcross/toolchain.cmake -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DOPENMPT_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/include" -DSDL2_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/lib" -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_CONFIG_USE_GME:BOOL=OFF -G "Unix Makefiles"
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
||||
|
||||
- - |
|
||||
# make
|
||||
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
|
||||
- make --directory=build.osxcross --keep-going || make --directory=build.osxcross --keep-going
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\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"
|
||||
|
||||
- - |
|
||||
# vcpkg_clean
|
||||
echo -e "\e[0Ksection_start:`date +%s`:vcpkg_clean[collapsed=true]\r\e[0KCleaning vcpkg-root"
|
||||
|
||||
if [ -d "build/vcpkg-root" ]; then
|
||||
pushd "build/vcpkg-root"
|
||||
git clean
|
||||
popd
|
||||
fi
|
||||
|
||||
echo -e "\e[0Ksection_end:`date +%s`:vcpkg_clean\r\e[0K"
|
||||
|
||||
- - |
|
||||
# ccache_stats
|
||||
echo -e "\e[0Ksection_start:`date +%s`:ccache_stats[collapsed=true]\r\e[0Kccache statistics:"
|
||||
- ccache --show-stats
|
||||
- ccache --show-log-stats || true
|
||||
- |
|
||||
# ccahe_stats
|
||||
echo -e "\e[0Ksection_end:`date +%s`:ccache_stats\r\e[0K"
|
35
.gitlab/ci/jobs/windows-x64-makefile.yml
Normal file
35
.gitlab/ci/jobs/windows-x64-makefile.yml
Normal file
|
@ -0,0 +1,35 @@
|
|||
Windows x64 Makefile:
|
||||
extends: .srb2ci
|
||||
|
||||
stage: build
|
||||
|
||||
when: manual
|
||||
|
||||
allow_failure: true
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "bin/"
|
||||
- "src/comptime.h"
|
||||
expose_as: "Win64-makefile"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-Win64-makefile"
|
||||
|
||||
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"
|
51
.gitlab/ci/jobs/windows-x64.yml
Normal file
51
.gitlab/ci/jobs/windows-x64.yml
Normal file
|
@ -0,0 +1,51 @@
|
|||
Windows x64:
|
||||
extends: .srb2ci
|
||||
|
||||
stage: build
|
||||
|
||||
when: manual
|
||||
|
||||
allow_failure: true
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "build.cmake/bin/"
|
||||
- "build.cmake/src/config.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"
|
||||
|
||||
- - |
|
||||
# apt_development
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages"
|
||||
- apt-get install ninja-build
|
||||
- |
|
||||
# apt_development
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
|
||||
|
||||
- - |
|
||||
# cmake
|
||||
echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles"
|
||||
- cmake -B build.cmake -DSRB2_USE_CCACHE=YES -DSRB2_CONFIG_ERRORMODE=ON -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-mingw-static -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/toolchains/mingw.cmake
|
||||
- |
|
||||
# cmake
|
||||
echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K"
|
||||
|
||||
- - |
|
||||
# make
|
||||
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
|
||||
- make --directory=build.cmake --keep-going || make --directory=build.cmake --keep-going
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
35
.gitlab/ci/jobs/windows-x86-makefile.yml
Normal file
35
.gitlab/ci/jobs/windows-x86-makefile.yml
Normal file
|
@ -0,0 +1,35 @@
|
|||
Windows x86 Makefile:
|
||||
extends: .srb2ci
|
||||
|
||||
stage: build
|
||||
|
||||
when: on_success
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "bin/"
|
||||
- "src/comptime.h"
|
||||
expose_as: "Win32-makefile"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-Win32-makefile"
|
||||
|
||||
variables:
|
||||
PREFIX: i686-w64-mingw32
|
||||
CC: /usr/bin/i686-w64-mingw32-gcc-posix
|
||||
CXX: /usr/bin/i686-w64-mingw32-g++-posix
|
||||
|
||||
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"
|
130
.gitlab/ci/jobs/windows-x86.yml
Normal file
130
.gitlab/ci/jobs/windows-x86.yml
Normal file
|
@ -0,0 +1,130 @@
|
|||
Windows x86:
|
||||
extends: .srb2ci
|
||||
|
||||
stage: build
|
||||
|
||||
when: manual
|
||||
|
||||
allow_failure: true
|
||||
|
||||
cache:
|
||||
- key: ccache-$CI_JOB_NAME_SLUG-$CI_COMMIT_REF_SLUG
|
||||
fallback_keys:
|
||||
- ccache-$CI_JOB_NAME_SLUG-$CI_DEFAULT_BRANCH
|
||||
- ccache-$CI_JOB_NAME_SLUG-master
|
||||
paths:
|
||||
- build/ccache
|
||||
- build/ccache_statslog
|
||||
|
||||
- key: apt-$CI_JOB_IMAGE
|
||||
paths:
|
||||
- build/apt-cache
|
||||
unprotect: true
|
||||
|
||||
- key: vcpkg-root
|
||||
paths:
|
||||
- build/vcpkg-root
|
||||
unprotect: true
|
||||
|
||||
- key: vcpkg-binary-cache-x86-mingw-static
|
||||
paths:
|
||||
- build/vcpkg-binary-cache
|
||||
unprotect: true
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "build/ninja-x86_mingw_static_vcpkg-debug/bin/"
|
||||
- "build/ninja-x86_mingw_static_vcpkg-debug/src/config.h"
|
||||
expose_as: "Win32"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-Win32"
|
||||
|
||||
variables:
|
||||
PREFIX: i686-w64-mingw32
|
||||
CC: /usr/bin/i686-w64-mingw32-gcc-posix
|
||||
CXX: /usr/bin/i686-w64-mingw32-g++-posix
|
||||
|
||||
script:
|
||||
- |
|
||||
# vcpkg
|
||||
echo -e "\e[0Ksection_start:`date +%s`:vcpkg-root[collapsed=true]\r\e[0KUpdating vcpkg"
|
||||
|
||||
if [ -d "build/vcpkg-root" ]; then
|
||||
pushd build/vcpkg-root
|
||||
git fetch https://github.com/Microsoft/vcpkg master
|
||||
git reset --hard FETCH_HEAD
|
||||
popd
|
||||
else
|
||||
mkdir -p build
|
||||
git clone https://github.com/Microsoft/vcpkg build/vcpkg-root
|
||||
fi
|
||||
|
||||
export VCPKG_ROOT=$(pwd)/build/vcpkg-root
|
||||
export VCPKG_BINARY_SOURCES="clear;files,$(pwd)/build/vcpkg-binary-cache,readwrite"
|
||||
|
||||
mkdir -p "build/vcpkg-binary-cache"
|
||||
|
||||
echo -e "\e[0Ksection_end:`date +%s`:vcpkg-root\r\e[0K"
|
||||
|
||||
- - |
|
||||
# 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"
|
||||
|
||||
- - |
|
||||
# apt_development
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages"
|
||||
- apt-get install ninja-build
|
||||
- |
|
||||
# apt_development
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
|
||||
|
||||
- - |
|
||||
# cmake
|
||||
echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles"
|
||||
# cmake
|
||||
echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles"
|
||||
- cmake --preset ninja-x86_mingw_static_vcpkg-debug -G "Unix Makefiles" -DSRB2_USE_CCACHE=YES -DSRB2_CONFIG_ERRORMODE=ON -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake
|
||||
- |
|
||||
# cmake
|
||||
echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K"
|
||||
|
||||
- - |
|
||||
# make
|
||||
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
|
||||
- cmake --build --preset ninja-x86_mingw_static_vcpkg-debug --parallel 1 -- --keep-going || cmake --build --preset ninja-x86_mingw_static_vcpkg-debug --parallel 1 -- --keep-going
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\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"
|
||||
|
||||
- - |
|
||||
# vcpkg_clean
|
||||
echo -e "\e[0Ksection_start:`date +%s`:vcpkg_clean[collapsed=true]\r\e[0KCleaning vcpkg-root"
|
||||
|
||||
if [ -d "build/vcpkg-root" ]; then
|
||||
pushd "build/vcpkg-root"
|
||||
git clean -f
|
||||
popd
|
||||
fi
|
||||
|
||||
echo -e "\e[0Ksection_end:`date +%s`:vcpkg_clean\r\e[0K"
|
||||
|
||||
- - |
|
||||
# ccache_stats
|
||||
echo -e "\e[0Ksection_start:`date +%s`:ccache_stats[collapsed=true]\r\e[0Kccache statistics:"
|
||||
- ccache --show-stats
|
||||
- ccache --show-log-stats || true
|
||||
- |
|
||||
# ccahe_stats
|
||||
echo -e "\e[0Ksection_end:`date +%s`:ccache_stats\r\e[0K"
|
145
.gitlab/ci/templates/srb2ci.yml
Normal file
145
.gitlab/ci/templates/srb2ci.yml
Normal file
|
@ -0,0 +1,145 @@
|
|||
.srb2ci:
|
||||
image: git.do.srb2.org:5050/stjr/srb2ci/srb2ci:stable
|
||||
|
||||
cache:
|
||||
- key: ccache-$CI_JOB_NAME_SLUG-$CI_COMMIT_REF_SLUG
|
||||
fallback_keys:
|
||||
- ccache-$CI_JOB_NAME_SLUG-$CI_DEFAULT_BRANCH
|
||||
- ccache-$CI_JOB_NAME_SLUG-master
|
||||
paths:
|
||||
- build/ccache
|
||||
- build/ccache_statslog
|
||||
|
||||
- key: apt-$CI_JOB_IMAGE
|
||||
paths:
|
||||
- build/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=$CI_PROJECT_DIR/build/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"
|
||||
- timeout 2m apt-get update || timeout 2m 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 nasm cmake ca-certificates
|
||||
- |
|
||||
# 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 = $CI_PROJECT_DIR | tee --append ~/.ccache/ccache.conf
|
||||
- |
|
||||
# cache_dir
|
||||
echo cache_dir = $CI_PROJECT_DIR/build/ccache | tee --append ~/.ccache/ccache.conf
|
||||
- |
|
||||
# compiler_check
|
||||
echo compiler_check = content | tee --append ~/.ccache/ccache.conf
|
||||
- |
|
||||
# stats_log
|
||||
echo stats_log = $CI_PROJECT_DIR/build/ccache_statslog | tee --append ~/.ccache/ccache.conf
|
||||
- |
|
||||
# max_size
|
||||
echo max_size = 300M | 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
|
||||
- ccache --show-log-stats || true
|
||||
- |
|
||||
# ccahe_stats
|
||||
echo -e "\e[0Ksection_end:`date +%s`:ccache_stats\r\e[0K"
|
|
@ -8,6 +8,7 @@ endif()
|
|||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
|
||||
|
||||
include(CMakeDependentOption)
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
file(STRINGS src/version.h SRB2_VERSION)
|
||||
string(REGEX MATCH "[0-9]+\\.[0-9.]+" SRB2_VERSION ${SRB2_VERSION})
|
||||
|
@ -72,6 +73,7 @@ option(SRB2_CONFIG_MOBJCONSISTANCY "Compile with MOBJCONSISTANCY defined." OFF)
|
|||
option(SRB2_CONFIG_PACKETDROP "Compile with PACKETDROP defined." OFF)
|
||||
option(SRB2_CONFIG_EXECINFO "Enable stack trace dump support." ON)
|
||||
option(SRB2_CONFIG_ZDEBUG "Compile with ZDEBUG defined." OFF)
|
||||
option(SRB2_CONFIG_FORCE_NO_MS_BITFIELDS "Compile without -mno-ms-bitfields compiler flag" OFF)
|
||||
# SRB2_CONFIG_PROFILEMODE is probably superceded by some CMake setting.
|
||||
option(SRB2_CONFIG_PROFILEMODE "Compile for profiling (GCC only)." OFF)
|
||||
set(SRB2_CONFIG_ASSET_DIRECTORY "" CACHE PATH "Path to directory that contains all asset files for the installer. If set, assets will be part of installation and cpack.")
|
||||
|
|
|
@ -27,10 +27,10 @@ list(TRANSFORM SRB2_ASSETS_DOCS PREPEND "${SRB2_ASSET_DIRECTORY_ABSOLUTE}")
|
|||
|
||||
set(SRB2_ASSETS_GAME
|
||||
"srb2.pk3"
|
||||
"player.dta"
|
||||
"characters.pk3"
|
||||
"zones.pk3"
|
||||
"patch.pk3"
|
||||
"music.dta"
|
||||
"music.pk3"
|
||||
"models.dat"
|
||||
)
|
||||
list(TRANSFORM SRB2_ASSETS_GAME PREPEND "/")
|
||||
|
|
|
@ -33,13 +33,10 @@ https://discord.gg/b3BGb8A
|
|||
Twitter:
|
||||
https://twitter.com/SonicTeamJr
|
||||
|
||||
Facebook:
|
||||
https://facebook.com/SonicRoboBlast2
|
||||
|
||||
|
||||
COPYRIGHT AND DISCLAIMER
|
||||
|
||||
Design and content in Sonic Robo Blast 2 is copyright 1998-2023 by Sonic Team Jr.
|
||||
Design and content in Sonic Robo Blast 2 is copyright 1998-2025 by Sonic Team Jr.
|
||||
|
||||
All original material in this game is copyrighted by their respective owners, and no copyright infringement is intended. Sonic Team Jr. is in no way affiliated with SEGA or Sonic Team, and we do not claim ownership of any of SEGA's intellectual property used in SRB2.
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ Upstream Author(s):
|
|||
|
||||
Copyright:
|
||||
|
||||
Copyright (C) 1998-2018 by Sonic Team Junior
|
||||
Copyright (C) 1998-2025 by Sonic Team Junior
|
||||
|
||||
License:
|
||||
|
||||
|
@ -21,7 +21,7 @@ License:
|
|||
The Debian packaging is:
|
||||
|
||||
Copyright (C) 2010 Callum Dickinson <gcfreak_ag20@hotmail.com>
|
||||
Copyright (C) 2010-2018 by Sonic Team Junior <stjr@srb2.org>
|
||||
Copyright (C) 2010-2025 by Sonic Team Junior <stjr@srb2.org>
|
||||
|
||||
and is licensed under the GPL version 2,
|
||||
see "/usr/share/common-licenses/GPL-2".
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
include(LibFindMacros)
|
||||
|
||||
libfind_pkg_check_modules(libopenmpt_PKGCONF openmpt)
|
||||
libfind_pkg_check_modules(libopenmpt_PKGCONF openmpt libopenmpt)
|
||||
|
||||
find_path(libopenmpt_INCLUDE_DIR
|
||||
NAMES libopenmpt.h
|
||||
PATHS
|
||||
${libopenmpt_PKGCONF_INCLUDE_DIRS}
|
||||
"${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/libopenmpt"
|
||||
"/usr/include/libopenmpt"
|
||||
"/usr/local/include/libopenmpt"
|
||||
"${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include"
|
||||
"/usr/include"
|
||||
"/usr/local/include"
|
||||
PATH_SUFFIXES
|
||||
+ libopenmpt
|
||||
)
|
||||
|
||||
find_library(libopenmpt_LIBRARY
|
||||
|
|
|
@ -12,7 +12,7 @@ Upstream Author(s):
|
|||
|
||||
Copyright:
|
||||
|
||||
Copyright (C) 1998-2018 by Sonic Team Junior
|
||||
Copyright (C) 1998-2025 by Sonic Team Junior
|
||||
|
||||
License:
|
||||
|
||||
|
@ -21,7 +21,7 @@ License:
|
|||
The Debian packaging is:
|
||||
|
||||
Copyright (C) 2010 Callum Dickinson <gcfreak_ag20@hotmail.com>
|
||||
Copyright (C) 2010-2018 by Sonic Team Junior <stjr@srb2.org>
|
||||
Copyright (C) 2010-2025 by Sonic Team Junior <stjr@srb2.org>
|
||||
|
||||
and is licensed under the GPL version 2,
|
||||
see "/usr/share/common-licenses/GPL-2".
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
===============================================================================
|
||||
Universal Doom Map Format Sonic Robo Blast 2 extensions v1.0 19.02.2024
|
||||
Universal Doom Map Format Sonic Robo Blast 2 extensions v1.0 19.06.2024
|
||||
|
||||
Copyright (c) 2024 Sonic Team Junior
|
||||
uses Universal Doom Map Format Specification v1.1 as a template,
|
||||
|
@ -126,7 +126,7 @@ Sonic Robo Blast 2 defines the following standardized fields:
|
|||
texturebottom = <string>; // Lower texture. Default = "-".
|
||||
texturemiddle = <string>; // Middle texture. Default = "-".
|
||||
|
||||
repeatcnt = <string>; // Number of middle texture repetitions. Default = 0
|
||||
repeatcnt = <integer>; // Number of middle texture repetitions. Default = 0.
|
||||
|
||||
sector = <integer>; // Sector index. No valid default.
|
||||
|
||||
|
@ -143,6 +143,9 @@ Sonic Robo Blast 2 defines the following standardized fields:
|
|||
offsetx_bottom = <float>; // X offset for lower texture. Default = 0.0.
|
||||
offsety_bottom = <float>; // Y offset for lower texture. Default = 0.0.
|
||||
|
||||
light = <integer>; // Light level, relative to 'sector' light level. Default = 0.
|
||||
lightabsolute = <bool>; // true = 'light' is an absolute value, ignoring 'sector' light level.
|
||||
|
||||
comment = <string>; // A comment. Implementors should attach no special
|
||||
// semantic meaning to this field.
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ linetagindicatesectors = true;
|
|||
|
||||
// The format interface handles the map data format - DoomMapSetIO for SRB2DB2, SRB2MapSetIO for Zone Builder
|
||||
formatinterface = "SRB2MapSetIO";
|
||||
|
||||
|
||||
//Maximum safe map size check (0 means skip check)
|
||||
safeboundary = 0;
|
||||
|
||||
|
@ -502,7 +502,7 @@ gen_sectortypes
|
|||
{
|
||||
0 = "Normal";
|
||||
512 = "Wind/Current <deprecated>";
|
||||
1024 = "Conveyor Belt <deprecated>";
|
||||
1024 = "Conveyor Belt <deprecated>";
|
||||
1280 = "Speed Pad";
|
||||
1536 = "Flip Gravity on Jump";
|
||||
}
|
||||
|
@ -3730,7 +3730,7 @@ thingtypes
|
|||
|
||||
3328 = "3D Mode Start";
|
||||
}
|
||||
|
||||
|
||||
starts
|
||||
{
|
||||
color = 1; // Blue
|
||||
|
|
|
@ -39,6 +39,7 @@ common
|
|||
defaulttexturescale = 1.0f;
|
||||
defaultflatscale = 1.0f;
|
||||
scaledtextureoffsets = true;
|
||||
scaledflatoffsets = true;
|
||||
|
||||
// Colormap/fade related options
|
||||
maxcolormapalpha = 25;
|
||||
|
@ -95,7 +96,7 @@ mapformat_udmf
|
|||
{
|
||||
include("SRB222_misc.cfg", "universalfields");
|
||||
}
|
||||
|
||||
|
||||
// Disable Doom-related modes that don't make sense for SRB2
|
||||
soundsupport = false;
|
||||
automapsupport = false;
|
||||
|
@ -114,7 +115,7 @@ mapformat_udmf
|
|||
|
||||
// Enables setting distinct brightness for floor, ceiling, and walls
|
||||
distinctfloorandceilingbrightness = true;
|
||||
distinctwallbrightness = false;
|
||||
distinctwallbrightness = true;
|
||||
|
||||
// Enables setting distinct brightness for upper, middle, and lower sidedef parts
|
||||
distinctsidedefpartbrightness = false;
|
||||
|
@ -194,4 +195,4 @@ mapformat_udmf
|
|||
{
|
||||
include("SRB222_linedefs.cfg", "udmf");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -240,7 +240,7 @@ universalfields
|
|||
type = 1;
|
||||
default = 1.0;
|
||||
}
|
||||
|
||||
|
||||
comment
|
||||
{
|
||||
type = 2;
|
||||
|
@ -252,19 +252,19 @@ universalfields
|
|||
type = 2;
|
||||
default = "";
|
||||
}
|
||||
|
||||
|
||||
stringarg0
|
||||
{
|
||||
type = 2;
|
||||
default = "";
|
||||
}
|
||||
|
||||
|
||||
stringarg1
|
||||
{
|
||||
type = 2;
|
||||
default = "";
|
||||
}
|
||||
|
||||
|
||||
executordelay
|
||||
{
|
||||
type = 0;
|
||||
|
@ -279,19 +279,19 @@ universalfields
|
|||
type = 2;
|
||||
default = "";
|
||||
}
|
||||
|
||||
//light
|
||||
//{
|
||||
// type = 0;
|
||||
// default = 0;
|
||||
//}
|
||||
//
|
||||
//lightabsolute
|
||||
//{
|
||||
// type = 3;
|
||||
// default = false;
|
||||
//}
|
||||
//
|
||||
|
||||
light
|
||||
{
|
||||
type = 0;
|
||||
default = 0;
|
||||
}
|
||||
|
||||
lightabsolute
|
||||
{
|
||||
type = 3;
|
||||
default = false;
|
||||
}
|
||||
|
||||
//light_top
|
||||
//{
|
||||
// type = 0;
|
||||
|
@ -326,8 +326,8 @@ universalfields
|
|||
//{
|
||||
// type = 3;
|
||||
// default = false;
|
||||
//}
|
||||
|
||||
//}
|
||||
|
||||
offsetx_bottom
|
||||
{
|
||||
type = 1;
|
||||
|
@ -339,7 +339,7 @@ universalfields
|
|||
type = 1;
|
||||
default = 0.0;
|
||||
}
|
||||
|
||||
|
||||
offsetx_top
|
||||
{
|
||||
type = 1;
|
||||
|
@ -357,43 +357,43 @@ universalfields
|
|||
type = 1;
|
||||
default = 0.0;
|
||||
}
|
||||
|
||||
|
||||
offsety_top
|
||||
{
|
||||
type = 1;
|
||||
default = 0.0;
|
||||
}
|
||||
|
||||
|
||||
scalex_bottom
|
||||
{
|
||||
type = 1;
|
||||
default = 1.0;
|
||||
}
|
||||
|
||||
|
||||
scalex_mid
|
||||
{
|
||||
type = 1;
|
||||
default = 1.0;
|
||||
}
|
||||
|
||||
|
||||
scalex_top
|
||||
{
|
||||
type = 1;
|
||||
default = 1.0;
|
||||
}
|
||||
|
||||
|
||||
scaley_bottom
|
||||
{
|
||||
type = 1;
|
||||
default = 1.0;
|
||||
}
|
||||
|
||||
|
||||
scaley_mid
|
||||
{
|
||||
type = 1;
|
||||
default = 1.0;
|
||||
}
|
||||
|
||||
|
||||
scaley_top
|
||||
{
|
||||
type = 1;
|
||||
|
@ -408,41 +408,41 @@ universalfields
|
|||
type = 2;
|
||||
default = "";
|
||||
}
|
||||
|
||||
|
||||
pitch
|
||||
{
|
||||
type = 0;
|
||||
}
|
||||
|
||||
|
||||
roll
|
||||
{
|
||||
type = 0;
|
||||
}
|
||||
|
||||
|
||||
scalex
|
||||
{
|
||||
type = 1;
|
||||
default = 1.0;
|
||||
}
|
||||
|
||||
|
||||
scaley
|
||||
{
|
||||
type = 1;
|
||||
default = 1.0;
|
||||
}
|
||||
|
||||
|
||||
stringarg0
|
||||
{
|
||||
type = 2;
|
||||
default = "";
|
||||
}
|
||||
|
||||
|
||||
stringarg1
|
||||
{
|
||||
type = 2;
|
||||
default = "";
|
||||
}
|
||||
|
||||
|
||||
mobjscale
|
||||
{
|
||||
type = 1;
|
||||
|
@ -450,7 +450,7 @@ universalfields
|
|||
managed = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sector
|
||||
{
|
||||
comment
|
||||
|
@ -530,7 +530,7 @@ universalfields
|
|||
type = 1;
|
||||
default = 1.0;
|
||||
}
|
||||
|
||||
|
||||
yscalefloor
|
||||
{
|
||||
type = 1;
|
||||
|
@ -542,7 +542,7 @@ universalfields
|
|||
type = 0;
|
||||
default = 0;
|
||||
}
|
||||
|
||||
|
||||
lightfloorabsolute
|
||||
{
|
||||
type = 3;
|
||||
|
@ -572,7 +572,7 @@ universalfields
|
|||
type = 1;
|
||||
default = 1.0;
|
||||
}
|
||||
|
||||
|
||||
yscaleceiling
|
||||
{
|
||||
type = 1;
|
||||
|
@ -584,12 +584,18 @@ universalfields
|
|||
type = 0;
|
||||
default = 0;
|
||||
}
|
||||
|
||||
|
||||
lightceilingabsolute
|
||||
{
|
||||
type = 3;
|
||||
default = false;
|
||||
}
|
||||
|
||||
triggertag
|
||||
{
|
||||
type = 0;
|
||||
default = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1127,12 +1127,12 @@ udmf
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bossinvisibles
|
||||
{
|
||||
title = "Misc. Invisible";
|
||||
color = 15; // White
|
||||
|
||||
|
||||
290
|
||||
{
|
||||
arrow = 0;
|
||||
|
@ -2021,7 +2021,7 @@ udmf
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
hazards
|
||||
{
|
||||
color = 17; // Orange
|
||||
|
@ -2983,7 +2983,7 @@ udmf
|
|||
{
|
||||
title = "Mace Spawnpoints";
|
||||
color = 11;
|
||||
|
||||
|
||||
1104
|
||||
{
|
||||
title = "Mace Spawn";
|
||||
|
@ -3188,7 +3188,7 @@ udmf
|
|||
title = "Flags";
|
||||
type = 12;
|
||||
enum = "maceflags";
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
1108
|
||||
|
@ -3320,7 +3320,7 @@ udmf
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
1100
|
||||
{
|
||||
title = "Chain (Decorative)";
|
||||
|
@ -3570,12 +3570,12 @@ udmf
|
|||
color = 2; // Green
|
||||
title = "Arid Canyon";
|
||||
|
||||
|
||||
|
||||
cacti
|
||||
{
|
||||
title = "Cacti";
|
||||
color = 17;
|
||||
|
||||
|
||||
1203
|
||||
{
|
||||
title = "Tiny Red Flower Cactus";
|
||||
|
@ -3654,12 +3654,12 @@ udmf
|
|||
height = 60;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
minecarts
|
||||
{
|
||||
title = "Minecart";
|
||||
color = 11;
|
||||
|
||||
|
||||
1219
|
||||
{
|
||||
title = "Minecart Spawner";
|
||||
|
@ -3706,7 +3706,7 @@ udmf
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
1200
|
||||
{
|
||||
title = "Tumbleweed (Big)";
|
||||
|
@ -3938,6 +3938,7 @@ udmf
|
|||
width = 30;
|
||||
height = 32;
|
||||
color = 17;
|
||||
hangs = 1;
|
||||
arg0
|
||||
{
|
||||
title = "Initial delay";
|
||||
|
@ -4610,7 +4611,7 @@ udmf
|
|||
title = "Botanic Serenity";
|
||||
width = 16;
|
||||
height = 32;
|
||||
|
||||
|
||||
flowers
|
||||
{
|
||||
title = "Flowers";
|
||||
|
@ -4705,7 +4706,7 @@ udmf
|
|||
sprite = "BSZ3F0";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
tulips
|
||||
{
|
||||
title = "Tulips";
|
||||
|
@ -4770,7 +4771,7 @@ udmf
|
|||
sprite = "BSZ5F0";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bushes
|
||||
{
|
||||
title = "Bushes";
|
||||
|
@ -4805,7 +4806,7 @@ udmf
|
|||
sprite = "BSZ6F0";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
vines
|
||||
{
|
||||
title = "Vines";
|
||||
|
@ -5062,7 +5063,7 @@ udmf
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
mario
|
||||
{
|
||||
color = 2; // Green
|
||||
|
@ -5573,7 +5574,7 @@ udmf
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
editor
|
||||
{
|
||||
color = 15; // White
|
||||
|
@ -5586,4 +5587,4 @@ udmf
|
|||
|
||||
3328 = "3D Mode Start";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ linetagindicatesectors = true;
|
|||
|
||||
// The format interface handles the map data format - DoomMapSetIO for SRB2DB2, SRB2MapSetIO for Zone Builder
|
||||
formatinterface = "DoomMapSetIO";
|
||||
|
||||
|
||||
//Maximum safe map size check (0 means skip check)
|
||||
safeboundary = 0;
|
||||
|
||||
|
@ -502,7 +502,7 @@ gen_sectortypes
|
|||
{
|
||||
0 = "Normal";
|
||||
512 = "Wind/Current <deprecated>";
|
||||
1024 = "Conveyor Belt <deprecated>";
|
||||
1024 = "Conveyor Belt <deprecated>";
|
||||
1280 = "Speed Pad";
|
||||
1536 = "Flip Gravity on Jump";
|
||||
}
|
||||
|
@ -3636,7 +3636,7 @@ thingtypes
|
|||
|
||||
3328 = "3D Mode Start";
|
||||
}
|
||||
|
||||
|
||||
starts
|
||||
{
|
||||
color = 1; // Blue
|
||||
|
|
7
scripts/arm64-osx-1015.cmake
Normal file
7
scripts/arm64-osx-1015.cmake
Normal file
|
@ -0,0 +1,7 @@
|
|||
set(VCPKG_TARGET_ARCHITECTURE arm64)
|
||||
set(VCPKG_OSX_DEPLOYMENT_TARGET 10.15)
|
||||
set(VCPKG_CRT_LINKAGE dynamic)
|
||||
set(VCPKG_LIBRARY_LINKAGE static)
|
||||
|
||||
set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
|
||||
set(VCPKG_OSX_ARCHITECTURES arm64)
|
25
scripts/make-macos-universal.sh
Executable file
25
scripts/make-macos-universal.sh
Executable file
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Makes a fused macOS Universal app bundle in the arm64 release preset dir
|
||||
# Only works if in master branch or in source tarball
|
||||
|
||||
set -e
|
||||
|
||||
rm -rf "build/ninja-x64_osx_vcpkg-release"
|
||||
rm -rf "build/ninja-arm64_osx_vcpkg-release"
|
||||
cmake --preset ninja-x64_osx_vcpkg-release -DVCPKG_OVERLAY_TRIPLETS=scripts/ -DVCPKG_TARGET_TRIPLET=x64-osx-1015 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 "-DSRB2_SDL2_EXE_NAME=srb2"
|
||||
cmake --build --preset ninja-x64_osx_vcpkg-release
|
||||
cmake --preset ninja-arm64_osx_vcpkg-release -DVCPKG_OVERLAY_TRIPLETS=scripts/ -DVCPKG_TARGET_TRIPLET=arm64-osx-1015 -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 "-DSRB2_SDL2_EXE_NAME=srb2"
|
||||
cmake --build --preset ninja-arm64_osx_vcpkg-release
|
||||
|
||||
mkdir -p build/dist
|
||||
rm -rf "build/dist/Sonic Robo Blast 2.app" "build/dist/srb2.app"
|
||||
|
||||
cp -r build/ninja-arm64_osx_vcpkg-release/bin/srb2.app build/dist/
|
||||
|
||||
lipo -create \
|
||||
-output "build/dist/srb2.app/Contents/MacOS/srb2" \
|
||||
build/ninja-x64_osx_vcpkg-release/bin/srb2.app/Contents/MacOS/srb2 \
|
||||
build/ninja-arm64_osx_vcpkg-release/bin/srb2.app/Contents/MacOS/srb2
|
||||
|
||||
mv build/dist/srb2.app "build/dist/Sonic Robo Blast 2.app"
|
7
scripts/x64-osx-1015.cmake
Normal file
7
scripts/x64-osx-1015.cmake
Normal file
|
@ -0,0 +1,7 @@
|
|||
set(VCPKG_TARGET_ARCHITECTURE x64)
|
||||
set(VCPKG_OSX_DEPLOYMENT_TARGET 10.15)
|
||||
set(VCPKG_CRT_LINKAGE dynamic)
|
||||
set(VCPKG_LIBRARY_LINKAGE static)
|
||||
|
||||
set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
|
||||
set(VCPKG_OSX_ARCHITECTURES x86_64)
|
|
@ -172,6 +172,11 @@ if("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if("${CMAKE_SYSTEM_NAME}" MATCHES "Haiku")
|
||||
target_compile_definitions(SRB2SDL2 PRIVATE -DNOEXECINFO)
|
||||
target_link_libraries(SRB2SDL2 PRIVATE network)
|
||||
endif()
|
||||
|
||||
if("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
|
||||
target_compile_definitions(SRB2SDL2 PRIVATE -DMACOSX)
|
||||
endif()
|
||||
|
@ -229,9 +234,12 @@ endif()
|
|||
|
||||
# Compatibility flag with later versions of GCC
|
||||
# We should really fix our code to not need this
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|x64|amd64|AMD64|em64t|EM64T)")
|
||||
target_compile_options(SRB2SDL2 PRIVATE -mno-ms-bitfields)
|
||||
if (NOT SRB2_CONFIG_FORCE_NO_MS_BITFIELDS)
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
check_cxx_compiler_flag("-mno-ms-bitfields" HAS_NO_MS_BITFIELDS)
|
||||
if(HAS_NO_MS_BITFIELDS)
|
||||
target_compile_options(SRB2SDL2 PRIVATE -mno-ms-bitfields)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
# Previously featured:\
|
||||
PANDORA\
|
||||
HAIKU\
|
||||
DUMMY\
|
||||
DJGPPDOS\
|
||||
SOLARIS\
|
||||
|
@ -17,6 +16,7 @@ all_systems:=\
|
|||
UNIX\
|
||||
LINUX\
|
||||
FREEBSD\
|
||||
HAIKU\
|
||||
|
||||
# check for user specified system
|
||||
ifeq (,$(filter $(all_systems),$(.VARIABLES)))
|
||||
|
@ -35,6 +35,8 @@ system:=$(shell uname -s)
|
|||
|
||||
ifeq ($(system),Linux)
|
||||
new_system:=LINUX
|
||||
else ifeq ($(system),Haiku)
|
||||
new_system:=HAIKU
|
||||
else
|
||||
|
||||
$(error \
|
||||
|
|
71
src/Makefile.d/haiku.mk
Normal file
71
src/Makefile.d/haiku.mk
Normal file
|
@ -0,0 +1,71 @@
|
|||
#
|
||||
# Makefile options for Haiku
|
||||
#
|
||||
|
||||
opts+=-DUNIXCOMMON -DLUA_USE_POSIX
|
||||
|
||||
ifndef DEDICATED
|
||||
ifndef DUMMY
|
||||
SDL?=1
|
||||
DEDICATED?=0
|
||||
endif
|
||||
endif
|
||||
|
||||
NOEXECINFO=1
|
||||
|
||||
ifeq (${SDL},1)
|
||||
EXENAME?=srb2haiku
|
||||
else ifeq (${DEDICATED},1)
|
||||
EXENAME?=srb2haikud
|
||||
endif
|
||||
|
||||
ifndef NONET
|
||||
libs+=-lnetwork
|
||||
endif
|
||||
|
||||
define _set =
|
||||
$(1)_CFLAGS?=$($(1)_opts)
|
||||
$(1)_LDFLAGS?=$($(1)_libs)
|
||||
endef
|
||||
|
||||
lib:=../libs/gme
|
||||
LIBGME_opts:=-I$(lib)/include
|
||||
LIBGME_libs:=-l:libgme.so.0
|
||||
$(eval $(call _set,LIBGME))
|
||||
|
||||
lib:=../libs/libopenmpt
|
||||
LIBOPENMPT_opts:=-I$(lib)/inc
|
||||
LIBOPENMPT_libs:=-l:libopenmpt.so.0
|
||||
$(eval $(call _set,LIBOPENMPT))
|
||||
|
||||
ifdef SDL
|
||||
lib:=../libs/SDL2_mixer
|
||||
mixer_opts:=-I$(lib)/include
|
||||
mixer_libs:=-l:libSDL2_mixer-2.0.so.0
|
||||
|
||||
lib:=../libs/SDL2
|
||||
SDL_opts:=-I$(lib)/include $(mixer_opts)
|
||||
SDL_libs:=$(mixer_libs) -l:libSDL2-2.0.so.0
|
||||
$(eval $(call _set,SDL))
|
||||
endif
|
||||
|
||||
lib:=../libs/zlib
|
||||
ZLIB_opts:=-I$(lib)
|
||||
ZLIB_libs:=-l:libz.so.1
|
||||
$(eval $(call _set,ZLIB))
|
||||
|
||||
ifndef PNG_CONFIG
|
||||
PNG_opts:=
|
||||
PNG_libs:=-l:libpng16.so.16
|
||||
$(eval $(call _set,PNG))
|
||||
endif
|
||||
|
||||
lib:=../libs/curl
|
||||
CURL_opts:=-I$(lib)/include
|
||||
CURL_libs:=-l:libcurl.so.4
|
||||
$(eval $(call _set,CURL))
|
||||
|
||||
lib:=../libs/miniupnpc
|
||||
MINIUPNPC_opts:=-I$(lib)/include
|
||||
MINIUPNPC_libs:=-l:libminiupnpc.so.17
|
||||
$(eval $(call _set,MINIUPNPC))
|
|
@ -35,6 +35,10 @@ endif
|
|||
else ifdef FREEBSD
|
||||
UNIX=1
|
||||
platform=freebsd
|
||||
else ifdef HAIKU
|
||||
# Give Haiku its own configuration, since it
|
||||
# isn't actually UNIX.
|
||||
include Makefile.d/haiku.mk
|
||||
else ifdef SOLARIS # FIXME: UNTESTED
|
||||
UNIX=1
|
||||
platform=solaris
|
||||
|
|
|
@ -33,11 +33,13 @@ else
|
|||
opts+=-DHAVE_MIXER
|
||||
sources+=sdl/mixer_sound.c
|
||||
|
||||
ifdef HAVE_MIXERX
|
||||
opts+=-DHAVE_MIXERX
|
||||
libs+=-lSDL2_mixer_ext
|
||||
else
|
||||
libs+=-lSDL2_mixer
|
||||
ifndef HAIKU # Haiku has a special import path
|
||||
ifdef HAVE_MIXERX
|
||||
opts+=-DHAVE_MIXERX
|
||||
libs+=-lSDL2_mixer_ext
|
||||
else
|
||||
libs+=-lSDL2_mixer
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
|
|
|
@ -1076,6 +1076,9 @@ static inline void AM_drawPlayers(void)
|
|||
if (!playeringame[i] || players[i].spectator)
|
||||
continue;
|
||||
|
||||
if (!players[i].mo)
|
||||
continue;
|
||||
|
||||
p = &players[i];
|
||||
if (p->skincolor > 0)
|
||||
color = R_GetTranslationColormap(TC_DEFAULT, p->skincolor, GTC_CACHE)[GREENS + 8];
|
||||
|
|
|
@ -71,7 +71,7 @@ apng_create_info_struct (png_structp pngp)
|
|||
{
|
||||
apng_infop ainfop;
|
||||
(void)pngp;
|
||||
if (( ainfop = calloc(sizeof (apng_info),1) ))
|
||||
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);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2007-2016 by John "JTE" Muniz.
|
||||
// Copyright (C) 2011-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 2011-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -387,7 +387,8 @@ void B_BuildTiccmd(player_t *player, ticcmd_t *cmd)
|
|||
}
|
||||
|
||||
// Bot AI isn't programmed in analog.
|
||||
CV_SetValue(&cv_analog[1], false);
|
||||
if (!dedicated)
|
||||
CV_SetValue(&cv_analog[1], false);
|
||||
|
||||
// Let Lua scripts build ticcmds
|
||||
if (LUA_HookTiccmd(player, cmd, HOOK(BotTiccmd)))
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -11,9 +11,6 @@
|
|||
/// \brief Macros to read/write from/to a UINT8 *,
|
||||
/// used for packet creation and such
|
||||
|
||||
#if defined (__alpha__) || defined (__arm__) || defined (__mips__) || defined (__ia64__) || defined (__clang__)
|
||||
#define DEALIGNED
|
||||
#endif
|
||||
|
||||
#include "endian.h"
|
||||
|
||||
|
@ -21,7 +18,6 @@
|
|||
//
|
||||
// Little-endian machines
|
||||
//
|
||||
#ifdef DEALIGNED
|
||||
#define WRITEUINT8(p,b) do { UINT8 *p_tmp = (void *)p; const UINT8 tv = ( UINT8)(b); memcpy(p, &tv, sizeof( UINT8)); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#define WRITESINT8(p,b) do { SINT8 *p_tmp = (void *)p; const SINT8 tv = ( UINT8)(b); memcpy(p, &tv, sizeof( UINT8)); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#define WRITEINT16(p,b) do { INT16 *p_tmp = (void *)p; const INT16 tv = ( INT16)(b); memcpy(p, &tv, sizeof( INT16)); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
|
@ -31,20 +27,8 @@
|
|||
#define WRITECHAR(p,b) do { char *p_tmp = (void *)p; const char tv = ( char)(b); memcpy(p, &tv, sizeof( char)); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#define WRITEFIXED(p,b) do { fixed_t *p_tmp = (void *)p; const fixed_t tv = (fixed_t)(b); memcpy(p, &tv, sizeof(fixed_t)); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#define WRITEANGLE(p,b) do { angle_t *p_tmp = (void *)p; const angle_t tv = (angle_t)(b); memcpy(p, &tv, sizeof(angle_t)); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#else
|
||||
#define WRITEUINT8(p,b) do { UINT8 *p_tmp = ( UINT8 *)p; *p_tmp = ( UINT8)(b); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#define WRITESINT8(p,b) do { SINT8 *p_tmp = ( SINT8 *)p; *p_tmp = ( SINT8)(b); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#define WRITEINT16(p,b) do { INT16 *p_tmp = ( INT16 *)p; *p_tmp = ( INT16)(b); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#define WRITEUINT16(p,b) do { UINT16 *p_tmp = ( UINT16 *)p; *p_tmp = ( UINT16)(b); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#define WRITEINT32(p,b) do { INT32 *p_tmp = ( INT32 *)p; *p_tmp = ( INT32)(b); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#define WRITEUINT32(p,b) do { UINT32 *p_tmp = ( UINT32 *)p; *p_tmp = ( UINT32)(b); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#define WRITECHAR(p,b) do { char *p_tmp = ( char *)p; *p_tmp = ( char)(b); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#define WRITEFIXED(p,b) do { fixed_t *p_tmp = (fixed_t *)p; *p_tmp = (fixed_t)(b); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#define WRITEANGLE(p,b) do { angle_t *p_tmp = (angle_t *)p; *p_tmp = (angle_t)(b); p_tmp++; p = (void *)p_tmp; } while (0)
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
#ifdef DEALIGNED
|
||||
#define READUINT8(p) ({ UINT8 *p_tmp = (void *)p; UINT8 b; memcpy(&b, p, sizeof( UINT8)); p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READSINT8(p) ({ SINT8 *p_tmp = (void *)p; SINT8 b; memcpy(&b, p, sizeof( SINT8)); p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READINT16(p) ({ INT16 *p_tmp = (void *)p; INT16 b; memcpy(&b, p, sizeof( INT16)); p_tmp++; p = (void *)p_tmp; b; })
|
||||
|
@ -55,17 +39,6 @@
|
|||
#define READFIXED(p) ({ fixed_t *p_tmp = (void *)p; fixed_t b; memcpy(&b, p, sizeof(fixed_t)); p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READANGLE(p) ({ angle_t *p_tmp = (void *)p; angle_t b; memcpy(&b, p, sizeof(angle_t)); p_tmp++; p = (void *)p_tmp; b; })
|
||||
#else
|
||||
#define READUINT8(p) ({ UINT8 *p_tmp = ( UINT8 *)p; UINT8 b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READSINT8(p) ({ SINT8 *p_tmp = ( SINT8 *)p; SINT8 b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READINT16(p) ({ INT16 *p_tmp = ( INT16 *)p; INT16 b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READUINT16(p) ({ UINT16 *p_tmp = ( UINT16 *)p; UINT16 b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READINT32(p) ({ INT32 *p_tmp = ( INT32 *)p; INT32 b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READUINT32(p) ({ UINT32 *p_tmp = ( UINT32 *)p; UINT32 b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READCHAR(p) ({ char *p_tmp = ( char *)p; char b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READFIXED(p) ({ fixed_t *p_tmp = (fixed_t *)p; fixed_t b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
||||
#define READANGLE(p) ({ angle_t *p_tmp = (angle_t *)p; angle_t b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
|
||||
#endif
|
||||
#else
|
||||
#define READUINT8(p) *(( UINT8 *)p)++
|
||||
#define READSINT8(p) *(( SINT8 *)p)++
|
||||
#define READINT16(p) *(( INT16 *)p)++
|
||||
|
@ -148,8 +121,6 @@ FUNCINLINE static ATTRINLINE UINT32 readulong(void *ptr)
|
|||
#define READANGLE(p) ({ angle_t *p_tmp = (angle_t *)p; angle_t b = readulong(p); p_tmp++; p = (void *)p_tmp; b; })
|
||||
#endif //SRB2_BIG_ENDIAN
|
||||
|
||||
#undef DEALIGNED
|
||||
|
||||
#define WRITESTRINGN(p, s, n) { \
|
||||
size_t tmp_i; \
|
||||
\
|
||||
|
|
160
src/command.c
160
src/command.c
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -648,7 +648,7 @@ static void COM_ExecuteString(char *ptext)
|
|||
{
|
||||
if ((com_flags & COM_LUA) && !(cmd->flags & COM_LUA))
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, "Command '%s' cannot be run from Lua.\n", cmd->name);
|
||||
CONS_Alert(CONS_WARNING, "Command '%s' cannot be run from a script.\n", cmd->name);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -705,7 +705,7 @@ static void add_alias(char *newname, char *newcmd)
|
|||
{
|
||||
if (!stricmp(newname, a->name))
|
||||
{
|
||||
Z_Free(a->value); // Free old cmd
|
||||
Z_Free(a->value); // Free old cmd
|
||||
a->value = newcmd;
|
||||
return;
|
||||
}
|
||||
|
@ -809,49 +809,60 @@ static void COM_CEchoDuration_f(void)
|
|||
|
||||
/** Executes a script file.
|
||||
*/
|
||||
static void COM_Exec_f(void)
|
||||
boolean COM_ExecFile(const char *scriptname, com_flags_t flags, boolean silent)
|
||||
{
|
||||
UINT8 *buf = NULL;
|
||||
char filename[256];
|
||||
|
||||
if (!D_CheckPathAllowed(scriptname, "tried to exec"))
|
||||
return false;
|
||||
|
||||
// load file
|
||||
// Try with Argv passed verbatim first, for back compat
|
||||
FIL_ReadFile(scriptname, &buf);
|
||||
|
||||
if (!buf)
|
||||
{
|
||||
// Now try by searching the file path
|
||||
// filename is modified with the full found path
|
||||
strlcpy(filename, scriptname, sizeof(filename));
|
||||
if (findfile(filename, NULL, true) != FS_NOTFOUND)
|
||||
FIL_ReadFile(filename, &buf);
|
||||
|
||||
if (!buf)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!silent)
|
||||
CONS_Printf(M_GetText("Executing %s\n"), scriptname);
|
||||
|
||||
// insert text file into the command buffer
|
||||
COM_BufAddTextEx((char *)buf, flags);
|
||||
COM_BufAddTextEx("\n", flags);
|
||||
|
||||
// free buffer
|
||||
Z_Free(buf);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void COM_Exec_f(void)
|
||||
{
|
||||
boolean silent;
|
||||
|
||||
if (COM_Argc() < 2 || COM_Argc() > 3)
|
||||
{
|
||||
CONS_Printf(M_GetText("exec <filename>: run a script file\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!D_CheckPathAllowed(COM_Argv(1), "tried to exec"))
|
||||
silent = COM_CheckParm("-silent");
|
||||
|
||||
if (COM_ExecFile(COM_Argv(1), com_flags, silent))
|
||||
return;
|
||||
|
||||
// load file
|
||||
// Try with Argv passed verbatim first, for back compat
|
||||
FIL_ReadFile(COM_Argv(1), &buf);
|
||||
|
||||
if (!buf)
|
||||
{
|
||||
// Now try by searching the file path
|
||||
// filename is modified with the full found path
|
||||
strcpy(filename, COM_Argv(1));
|
||||
if (findfile(filename, NULL, true) != FS_NOTFOUND)
|
||||
FIL_ReadFile(filename, &buf);
|
||||
|
||||
if (!buf)
|
||||
{
|
||||
if (!COM_CheckParm("-noerror"))
|
||||
CONS_Printf(M_GetText("couldn't execute file %s\n"), COM_Argv(1));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!COM_CheckParm("-silent"))
|
||||
CONS_Printf(M_GetText("executing %s\n"), COM_Argv(1));
|
||||
|
||||
// insert text file into the command buffer
|
||||
COM_BufAddTextEx((char *)buf, com_flags);
|
||||
COM_BufAddTextEx("\n", com_flags);
|
||||
|
||||
// free buffer
|
||||
Z_Free(buf);
|
||||
if (!COM_CheckParm("-noerror"))
|
||||
CONS_Printf(M_GetText("Couldn't execute file %s\n"), COM_Argv(1));
|
||||
}
|
||||
|
||||
/** Delays execution of the rest of the commands until the next frame.
|
||||
|
@ -1722,8 +1733,7 @@ badinput:
|
|||
|
||||
static boolean serverloading = false;
|
||||
|
||||
static consvar_t *
|
||||
ReadNetVar (UINT8 **p, char **return_value, boolean *return_stealth)
|
||||
static consvar_t *ReadNetVar(save_t *p, char **return_value, boolean *return_stealth)
|
||||
{
|
||||
UINT16 netid;
|
||||
char *val;
|
||||
|
@ -1731,10 +1741,10 @@ ReadNetVar (UINT8 **p, char **return_value, boolean *return_stealth)
|
|||
|
||||
consvar_t *cvar;
|
||||
|
||||
netid = READUINT16 (*p);
|
||||
val = (char *)*p;
|
||||
SKIPSTRING (*p);
|
||||
stealth = READUINT8 (*p);
|
||||
netid = P_ReadUINT16(p);
|
||||
val = (char *)&p->buf[p->pos];
|
||||
P_SkipString(p);
|
||||
stealth = P_ReadUINT8(p);
|
||||
|
||||
cvar = CV_FindNetVar(netid);
|
||||
|
||||
|
@ -1752,8 +1762,7 @@ ReadNetVar (UINT8 **p, char **return_value, boolean *return_stealth)
|
|||
}
|
||||
|
||||
#ifdef OLD22DEMOCOMPAT
|
||||
static consvar_t *
|
||||
ReadOldDemoVar (UINT8 **p, char **return_value, boolean *return_stealth)
|
||||
static consvar_t *ReadOldDemoVar(save_t *p, char **return_value, boolean *return_stealth)
|
||||
{
|
||||
UINT16 id;
|
||||
char *val;
|
||||
|
@ -1761,10 +1770,10 @@ ReadOldDemoVar (UINT8 **p, char **return_value, boolean *return_stealth)
|
|||
|
||||
old_demo_var_t *demovar;
|
||||
|
||||
id = READUINT16 (*p);
|
||||
val = (char *)*p;
|
||||
SKIPSTRING (*p);
|
||||
stealth = READUINT8 (*p);
|
||||
id = P_ReadUINT16(p);
|
||||
val = (char *)&p->buf[p->pos];
|
||||
P_SkipString(p);
|
||||
stealth = P_ReadUINT8(p);
|
||||
|
||||
demovar = CV_FindOldDemoVar(id);
|
||||
|
||||
|
@ -1783,8 +1792,7 @@ ReadOldDemoVar (UINT8 **p, char **return_value, boolean *return_stealth)
|
|||
}
|
||||
#endif/*OLD22DEMOCOMPAT*/
|
||||
|
||||
static consvar_t *
|
||||
ReadDemoVar (UINT8 **p, char **return_value, boolean *return_stealth)
|
||||
static consvar_t *ReadDemoVar(save_t *p, char **return_value, boolean *return_stealth)
|
||||
{
|
||||
char *name;
|
||||
char *val;
|
||||
|
@ -1792,11 +1800,11 @@ ReadDemoVar (UINT8 **p, char **return_value, boolean *return_stealth)
|
|||
|
||||
consvar_t *cvar;
|
||||
|
||||
name = (char *)*p;
|
||||
SKIPSTRING (*p);
|
||||
val = (char *)*p;
|
||||
SKIPSTRING (*p);
|
||||
stealth = READUINT8 (*p);
|
||||
name = (char *)&p->buf[p->pos];
|
||||
P_SkipString(p);
|
||||
val = (char *)&p->buf[p->pos];
|
||||
P_SkipString(p);
|
||||
stealth = P_ReadUINT8(p);
|
||||
|
||||
cvar = CV_FindVar(name);
|
||||
|
||||
|
@ -1826,41 +1834,46 @@ static void Got_NetVar(UINT8 **p, INT32 playernum)
|
|||
return;
|
||||
}
|
||||
|
||||
cvar = ReadNetVar(p, &svalue, &stealth);
|
||||
save_t save_p;
|
||||
save_p.buf = *p;
|
||||
save_p.size = MAXTEXTCMD;
|
||||
save_p.pos = 0;
|
||||
cvar = ReadNetVar(&save_p, &svalue, &stealth);
|
||||
*p = &save_p.buf[save_p.pos];
|
||||
|
||||
if (cvar)
|
||||
Setvalue(cvar, svalue, stealth);
|
||||
}
|
||||
|
||||
void CV_SaveVars(UINT8 **p, boolean in_demo)
|
||||
void CV_SaveVars(save_t *p, boolean in_demo)
|
||||
{
|
||||
consvar_t *cvar;
|
||||
UINT8 *count_p = *p;
|
||||
UINT8 *count_p = &p->buf[p->pos];
|
||||
UINT16 count = 0;
|
||||
|
||||
// send only changed cvars ...
|
||||
// the client will reset all netvars to default before loading
|
||||
WRITEUINT16(*p, 0x0000);
|
||||
P_WriteUINT16(p, 0x0000);
|
||||
for (cvar = consvar_vars; cvar; cvar = cvar->next)
|
||||
if ((cvar->flags & CV_NETVAR) && !CV_IsSetToDefault(cvar))
|
||||
{
|
||||
if (in_demo)
|
||||
{
|
||||
WRITESTRING(*p, cvar->name);
|
||||
P_WriteString(p, cvar->name);
|
||||
}
|
||||
else
|
||||
{
|
||||
WRITEUINT16(*p, cvar->netid);
|
||||
P_WriteUINT16(p, cvar->netid);
|
||||
}
|
||||
WRITESTRING(*p, cvar->string);
|
||||
WRITEUINT8(*p, false);
|
||||
P_WriteString(p, cvar->string);
|
||||
P_WriteUINT8(p, false);
|
||||
++count;
|
||||
}
|
||||
WRITEUINT16(count_p, count);
|
||||
}
|
||||
|
||||
static void CV_LoadVars(UINT8 **p,
|
||||
consvar_t *(*got)(UINT8 **p, char **ret_value, boolean *ret_stealth))
|
||||
static void CV_LoadVars(save_t *p,
|
||||
consvar_t *(*got)(save_t *p, char **ret_value, boolean *ret_stealth))
|
||||
{
|
||||
const boolean store = (client || demoplayback);
|
||||
|
||||
|
@ -1888,7 +1901,7 @@ static void CV_LoadVars(UINT8 **p,
|
|||
}
|
||||
}
|
||||
|
||||
count = READUINT16(*p);
|
||||
count = P_ReadUINT16(p);
|
||||
while (count--)
|
||||
{
|
||||
cvar = (*got)(p, &val, &stealth);
|
||||
|
@ -1921,19 +1934,19 @@ void CV_RevertNetVars(void)
|
|||
}
|
||||
}
|
||||
|
||||
void CV_LoadNetVars(UINT8 **p)
|
||||
void CV_LoadNetVars(save_t *p)
|
||||
{
|
||||
CV_LoadVars(p, ReadNetVar);
|
||||
}
|
||||
|
||||
#ifdef OLD22DEMOCOMPAT
|
||||
void CV_LoadOldDemoVars(UINT8 **p)
|
||||
void CV_LoadOldDemoVars(save_t *p)
|
||||
{
|
||||
CV_LoadVars(p, ReadOldDemoVar);
|
||||
}
|
||||
#endif
|
||||
|
||||
void CV_LoadDemoVars(UINT8 **p)
|
||||
void CV_LoadDemoVars(save_t *p)
|
||||
{
|
||||
CV_LoadVars(p, ReadDemoVar);
|
||||
}
|
||||
|
@ -1986,13 +1999,13 @@ static void CV_SetCVar(consvar_t *var, const char *value, boolean stealth)
|
|||
if (!var->string)
|
||||
I_Error("CV_Set: %s no string set!\n", var->name);
|
||||
#endif
|
||||
if (!var || !var->string || !value || !stricmp(var->string, value))
|
||||
if (!var || !var->string || !value || (var->can_change == NULL && !stricmp(var->string, value)))
|
||||
return; // no changes
|
||||
|
||||
if (var->flags & CV_NETVAR)
|
||||
{
|
||||
// send the value of the variable
|
||||
UINT8 buf[128];
|
||||
UINT8 buf[512];
|
||||
UINT8 *p = buf;
|
||||
|
||||
// Loading from a config in a netgame? Set revert value.
|
||||
|
@ -2065,11 +2078,10 @@ static void CV_SetValueMaybeStealth(consvar_t *var, INT32 value, boolean stealth
|
|||
if (var == &cv_forceskin) // Special handling.
|
||||
{
|
||||
const char *tmpskin = NULL;
|
||||
if ((value < 0) || (value >= numskins))
|
||||
;
|
||||
else
|
||||
if (value >= 0 && value < numskins)
|
||||
tmpskin = skins[value]->name;
|
||||
memcpy(val, tmpskin, SKINNAMESIZE);
|
||||
if (tmpskin)
|
||||
memcpy(val, tmpskin, SKINNAMESIZE);
|
||||
}
|
||||
else
|
||||
sprintf(val, "%d", value);
|
||||
|
@ -2492,7 +2504,7 @@ static boolean CV_Command(void)
|
|||
|
||||
if (CV_Immutable(v))
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, "Variable '%s' cannot be changed from Lua.\n", v->name);
|
||||
CONS_Alert(CONS_WARNING, "Variable '%s' cannot be changed from a script.\n", v->name);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include "doomdef.h"
|
||||
#include "p_saveg.h"
|
||||
|
||||
//===================================
|
||||
// Command buffer & command execution
|
||||
|
@ -65,6 +66,9 @@ void COM_ImmedExecute(const char *ptext);
|
|||
// Execute commands in buffer, flush them
|
||||
void COM_BufExecute(void);
|
||||
|
||||
// Executes a script from a file
|
||||
boolean COM_ExecFile(const char *scriptname, com_flags_t flags, boolean silent);
|
||||
|
||||
// As above; and progress the wait timer.
|
||||
void COM_BufTicker(void);
|
||||
|
||||
|
@ -218,19 +222,19 @@ void CV_AddValue(consvar_t *var, INT32 increment);
|
|||
void CV_SaveVariables(FILE *f);
|
||||
|
||||
// load/save gamesate (load and save option and for network join in game)
|
||||
void CV_SaveVars(UINT8 **p, boolean in_demo);
|
||||
void CV_SaveVars(save_t *p, boolean in_demo);
|
||||
|
||||
#define CV_SaveNetVars(p) CV_SaveVars(p, false)
|
||||
void CV_LoadNetVars(UINT8 **p);
|
||||
void CV_LoadNetVars(save_t *p);
|
||||
|
||||
// then revert after leaving a netgame
|
||||
void CV_RevertNetVars(void);
|
||||
|
||||
#define CV_SaveDemoVars(p) CV_SaveVars(p, true)
|
||||
void CV_LoadDemoVars(UINT8 **p);
|
||||
void CV_LoadDemoVars(save_t *p);
|
||||
|
||||
#ifdef OLD22DEMOCOMPAT
|
||||
void CV_LoadOldDemoVars(UINT8 **p);
|
||||
void CV_LoadOldDemoVars(save_t *p);
|
||||
#endif
|
||||
|
||||
// reset cheat netvars after cheats is deactivated
|
||||
|
|
|
@ -40,12 +40,14 @@
|
|||
* Last updated 2023 / 05 / 02 - v2.2.11 - patch.pk3 & zones.pk3
|
||||
* Last updated 2023 / 09 / 06 - v2.2.12 - patch.pk3
|
||||
* Last updated 2023 / 09 / 09 - v2.2.13 - none
|
||||
* Last updated 2025 / 01 / 16 - v2.2.14 - main assets
|
||||
* Last updated 2025 / 01 / 24 - v2.2.15 - main assets
|
||||
*/
|
||||
#define ASSET_HASH_SRB2_PK3 "ad911f29a28a18968ee5b2d11c2acb39"
|
||||
#define ASSET_HASH_ZONES_PK3 "1c8adf8d079ecb87d00081f158acf3c7"
|
||||
#define ASSET_HASH_PLAYER_DTA "2e7aaae8a6b1b77d90ffe7606ceadb6c"
|
||||
#define ASSET_HASH_SRB2_PK3 "3182ce524acc2072ddaa81acf4b6a9aa"
|
||||
#define ASSET_HASH_ZONES_PK3 "88ff4c300851ccdb0406698eadd89907"
|
||||
#define ASSET_HASH_CHARACTERS_PK3 "5c5936b8a690e007c0939bd0785a41fb"
|
||||
#ifdef USE_PATCH_DTA
|
||||
#define ASSET_HASH_PATCH_PK3 "3c7b73f34af7e9a7bceb2d5260f76172"
|
||||
#define ASSET_HASH_PATCH_PK3 "00000000000000000000000000000000"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -922,8 +922,6 @@ static void CON_InputDelChar(void)
|
|||
//
|
||||
boolean CON_Responder(event_t *ev)
|
||||
{
|
||||
static UINT8 consdown = false; // console is treated differently due to rare usage
|
||||
|
||||
// sequential completions a la 4dos
|
||||
static char completioncmd[80 + sizeof("find ")] = "find ";
|
||||
static char *completion = &completioncmd[sizeof("find ")-1];
|
||||
|
@ -943,32 +941,28 @@ boolean CON_Responder(event_t *ev)
|
|||
// let go keyup events, don't eat them
|
||||
if (ev->type != ev_keydown && ev->type != ev_text && ev->type != ev_console)
|
||||
{
|
||||
if (ev->key == gamecontrol[GC_CONSOLE][0] || ev->key == gamecontrol[GC_CONSOLE][1])
|
||||
consdown = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
key = ev->key;
|
||||
|
||||
// check for console toggle key
|
||||
if (ev->type != ev_console)
|
||||
if (ev->type == ev_keydown)
|
||||
{
|
||||
if (modeattacking || metalrecording || marathonmode)
|
||||
return false;
|
||||
|
||||
if (ev->type == ev_keydown && ((key == gamecontrol[GC_CONSOLE][0] || key == gamecontrol[GC_CONSOLE][1]) && !shiftdown))
|
||||
if ((key == gamecontrol[GC_CONSOLE][0] || key == gamecontrol[GC_CONSOLE][1]) && !shiftdown)
|
||||
{
|
||||
if (consdown) // ignore repeat
|
||||
return true;
|
||||
I_SetTextInputMode(con_destlines == 0); // inverse, since this is changed next tic.
|
||||
consoletoggle = true;
|
||||
consdown = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
// check other keys only if console prompt is active
|
||||
if (!consoleready && key < NUMINPUTS) // metzgermeister: boundary check!!
|
||||
{
|
||||
if (ev->type == ev_keydown && !menuactive && bindtable[key])
|
||||
if (!menuactive && bindtable[key])
|
||||
{
|
||||
COM_BufAddText(bindtable[key]);
|
||||
COM_BufAddText("\n");
|
||||
|
@ -980,14 +974,14 @@ boolean CON_Responder(event_t *ev)
|
|||
// escape key toggle off console
|
||||
if (key == KEY_ESCAPE)
|
||||
{
|
||||
I_SetTextInputMode(false);
|
||||
consoletoggle = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (ev->type == ev_text)
|
||||
else if (ev->type == ev_text)
|
||||
{
|
||||
if (!consoletoggle)
|
||||
if (!consoletoggle && consoleready)
|
||||
CON_InputAddChar(key);
|
||||
return true;
|
||||
}
|
||||
|
@ -1036,7 +1030,7 @@ boolean CON_Responder(event_t *ev)
|
|||
}
|
||||
else if (key == KEY_BACKSPACE)
|
||||
{
|
||||
if (ctrldown)
|
||||
if (ctrldown && input_cur != 0)
|
||||
{
|
||||
input_sel = M_JumpWordReverse(inputlines[inputline], input_cur);
|
||||
CON_InputDelSelection();
|
||||
|
@ -1094,7 +1088,9 @@ boolean CON_Responder(event_t *ev)
|
|||
|
||||
if (key == 'x' || key == 'X')
|
||||
{
|
||||
if (input_sel > input_cur)
|
||||
if (input_sel == input_cur) // Don't replace the clipboard without a text selection
|
||||
return true;
|
||||
else if (input_sel > input_cur)
|
||||
I_ClipboardCopy(&inputlines[inputline][input_cur], input_sel-input_cur);
|
||||
else
|
||||
I_ClipboardCopy(&inputlines[inputline][input_sel], input_cur-input_sel);
|
||||
|
@ -1104,7 +1100,9 @@ boolean CON_Responder(event_t *ev)
|
|||
}
|
||||
else if (key == 'c' || key == 'C')
|
||||
{
|
||||
if (input_sel > input_cur)
|
||||
if (input_sel == input_cur) // Don't replace the clipboard without a text selection
|
||||
return true;
|
||||
else if (input_sel > input_cur)
|
||||
I_ClipboardCopy(&inputlines[inputline][input_cur], input_sel-input_cur);
|
||||
else
|
||||
I_ClipboardCopy(&inputlines[inputline][input_sel], input_cur-input_sel);
|
||||
|
@ -1730,12 +1728,12 @@ static void CON_DrawBackpic(void)
|
|||
|
||||
// Get the lumpnum for CONSBACK, STARTUP (Only during game startup) or fallback into MISSING.
|
||||
if (con_startup)
|
||||
piclump = W_CheckNumForName("STARTUP");
|
||||
piclump = W_CheckNumForPatchName("STARTUP");
|
||||
else
|
||||
piclump = W_CheckNumForName("CONSBACK");
|
||||
piclump = W_CheckNumForPatchName("CONSBACK");
|
||||
|
||||
if (piclump == LUMPERROR)
|
||||
piclump = W_GetNumForName("MISSING");
|
||||
piclump = W_GetNumForPatchName("MISSING");
|
||||
|
||||
// Cache the patch.
|
||||
con_backpic = W_CachePatchNum(piclump, PU_PATCH);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
48
src/d_main.c
48
src/d_main.c
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2025 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -679,13 +679,13 @@ static void D_Display(void)
|
|||
s[sizeof s - 1] = '\0';
|
||||
|
||||
snprintf(s, sizeof s - 1, "get %d b/s", getbps);
|
||||
V_DrawRightAlignedString(BASEVIDWIDTH, BASEVIDHEIGHT-ST_HEIGHT-40, V_YELLOWMAP, s);
|
||||
V_DrawRightAlignedString(BASEVIDWIDTH, BASEVIDHEIGHT-40, V_YELLOWMAP, s);
|
||||
snprintf(s, sizeof s - 1, "send %d b/s", sendbps);
|
||||
V_DrawRightAlignedString(BASEVIDWIDTH, BASEVIDHEIGHT-ST_HEIGHT-30, V_YELLOWMAP, s);
|
||||
V_DrawRightAlignedString(BASEVIDWIDTH, BASEVIDHEIGHT-30, V_YELLOWMAP, s);
|
||||
snprintf(s, sizeof s - 1, "GameMiss %.2f%%", gamelostpercent);
|
||||
V_DrawRightAlignedString(BASEVIDWIDTH, BASEVIDHEIGHT-ST_HEIGHT-20, V_YELLOWMAP, s);
|
||||
V_DrawRightAlignedString(BASEVIDWIDTH, BASEVIDHEIGHT-20, V_YELLOWMAP, s);
|
||||
snprintf(s, sizeof s - 1, "SysMiss %.2f%%", lostpercent);
|
||||
V_DrawRightAlignedString(BASEVIDWIDTH, BASEVIDHEIGHT-ST_HEIGHT-10, V_YELLOWMAP, s);
|
||||
V_DrawRightAlignedString(BASEVIDWIDTH, BASEVIDHEIGHT-10, V_YELLOWMAP, s);
|
||||
}
|
||||
|
||||
if (cv_perfstats.value)
|
||||
|
@ -758,9 +758,9 @@ void D_SRB2Loop(void)
|
|||
/* Smells like a hack... Don't fade Sonic's ass into the title screen. */
|
||||
if (gamestate != GS_TITLESCREEN)
|
||||
{
|
||||
gstartuplumpnum = W_CheckNumForName("STARTUP");
|
||||
gstartuplumpnum = W_CheckNumForPatchName("STARTUP");
|
||||
if (gstartuplumpnum == LUMPERROR)
|
||||
gstartuplumpnum = W_GetNumForName("MISSING");
|
||||
gstartuplumpnum = W_GetNumForPatchName("MISSING");
|
||||
V_DrawScaledPatch(0, 0, 0, W_CachePatchNum(gstartuplumpnum, PU_PATCH));
|
||||
}
|
||||
|
||||
|
@ -983,7 +983,7 @@ void D_StartTitle(void)
|
|||
emeralds = 0;
|
||||
memset(&luabanks, 0, sizeof(luabanks));
|
||||
lastmaploaded = 0;
|
||||
pickedchar = R_SkinAvailable(cv_defaultskin.string);
|
||||
pickedchar = R_SkinAvailable(cv_skin.string);
|
||||
|
||||
// In case someone exits out at the same time they start a time attack run,
|
||||
// reset modeattacking
|
||||
|
@ -1024,7 +1024,7 @@ void D_StartTitle(void)
|
|||
#define REALLOC_FILE_LIST \
|
||||
if (list->files == NULL) \
|
||||
{ \
|
||||
list->files = calloc(sizeof(list->files), 2); \
|
||||
list->files = calloc(2, sizeof(list->files)); \
|
||||
list->numfiles = 1; \
|
||||
} \
|
||||
else \
|
||||
|
@ -1179,8 +1179,8 @@ static void IdentifyVersion(void)
|
|||
// Add the maps
|
||||
D_AddFile(&startupwadfiles, va(pandf,srb2waddir, "zones.pk3"));
|
||||
|
||||
// Add the players
|
||||
D_AddFile(&startupwadfiles, va(pandf,srb2waddir, "player.dta"));
|
||||
// Add the characters
|
||||
D_AddFile(&startupwadfiles, va(pandf,srb2waddir, "characters.pk3"));
|
||||
|
||||
#ifdef USE_PATCH_DTA
|
||||
// Add our crappy patches to fix our bugs
|
||||
|
@ -1199,7 +1199,7 @@ static void IdentifyVersion(void)
|
|||
I_Error("File "str" has been modified with non-music/sound lumps"); \
|
||||
}
|
||||
|
||||
MUSICTEST("music.dta")
|
||||
MUSICTEST("music.pk3")
|
||||
//MUSICTEST("patch_music.pk3")
|
||||
}
|
||||
#endif
|
||||
|
@ -1250,7 +1250,7 @@ void D_SRB2Main(void)
|
|||
// Print GPL notice for our console users (Linux)
|
||||
CONS_Printf(
|
||||
"\n\nSonic Robo Blast 2\n"
|
||||
"Copyright (C) 1998-2023 by Sonic Team Junior\n\n"
|
||||
"Copyright (C) 1998-2025 by Sonic Team Junior\n\n"
|
||||
"This program comes with ABSOLUTELY NO WARRANTY.\n\n"
|
||||
"This is free software, and you are welcome to redistribute it\n"
|
||||
"and/or modify it under the terms of the GNU General Public License\n"
|
||||
|
@ -1431,7 +1431,7 @@ void D_SRB2Main(void)
|
|||
// Make backups of some SOCcable tables.
|
||||
P_BackupTables();
|
||||
|
||||
mainwads = 3; // doesn't include music.dta
|
||||
mainwads = 3; // doesn't include music.pk3
|
||||
#ifdef USE_PATCH_DTA
|
||||
mainwads++;
|
||||
#endif
|
||||
|
@ -1446,11 +1446,11 @@ void D_SRB2Main(void)
|
|||
// Check MD5s of autoloaded files
|
||||
W_VerifyFileMD5(0, ASSET_HASH_SRB2_PK3); // srb2.pk3
|
||||
W_VerifyFileMD5(1, ASSET_HASH_ZONES_PK3); // zones.pk3
|
||||
W_VerifyFileMD5(2, ASSET_HASH_PLAYER_DTA); // player.dta
|
||||
W_VerifyFileMD5(2, ASSET_HASH_CHARACTERS_PK3); // characters.pk3
|
||||
#ifdef USE_PATCH_DTA
|
||||
W_VerifyFileMD5(3, ASSET_HASH_PATCH_PK3); // patch.pk3
|
||||
#endif
|
||||
// don't check music.dta because people like to modify it, and it doesn't matter if they do
|
||||
// don't check music.pk3 because people like to modify it, and it doesn't matter if they do
|
||||
// ...except it does if they slip maps in there, and that's what W_VerifyNMUSlumps is for.
|
||||
#endif //ifndef DEVELOP
|
||||
|
||||
|
@ -1535,7 +1535,7 @@ void D_SRB2Main(void)
|
|||
I_Error("Cannot find a map remotely named '%s'\n", word);
|
||||
else
|
||||
{
|
||||
if (!M_CheckParm("-server"))
|
||||
if (!(M_CheckParm("-server") || dedicated))
|
||||
G_SetUsedCheats(true);
|
||||
autostart = true;
|
||||
}
|
||||
|
@ -1600,7 +1600,7 @@ void D_SRB2Main(void)
|
|||
{
|
||||
if (!M_IsNextParm())
|
||||
I_Error("usage: -room <room_id>\nCheck the Master Server's webpage for room ID numbers.\n");
|
||||
ms_RoomId = atoi(M_GetNextParm());
|
||||
CV_SetValue(&cv_masterserver_room_id, atoi(M_GetNextParm()));
|
||||
|
||||
#ifdef UPDATE_ALERT
|
||||
GetMODVersion_Console();
|
||||
|
@ -1842,17 +1842,21 @@ static boolean check_top_dir(const char **path, const char *top)
|
|||
return true;
|
||||
}
|
||||
|
||||
static int cmp_strlen_desc(const void *a, const void *b)
|
||||
static int cmp_strlen_desc(const void *A, const void *B)
|
||||
{
|
||||
return ((int)strlen(*(const char*const*)b) - (int)strlen(*(const char*const*)a));
|
||||
const char *pA = A;
|
||||
const char *pB = B;
|
||||
size_t As = strlen(pA);
|
||||
size_t Bs = strlen(pB);
|
||||
return ((int)Bs - (int)As);
|
||||
}
|
||||
|
||||
boolean D_IsPathAllowed(const char *path)
|
||||
{
|
||||
const char *paths[] = {
|
||||
char *paths[] = {
|
||||
srb2home,
|
||||
srb2path,
|
||||
cv_addons_folder.string
|
||||
cv_addons_folder.zstring
|
||||
};
|
||||
|
||||
const size_t n_paths = sizeof paths / sizeof *paths;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -45,14 +45,15 @@ typedef enum
|
|||
SF_MARIODAMAGE = SF_NOJUMPDAMAGE|SF_STOMPDAMAGE, // The Mario method of being able to damage enemies, etc.
|
||||
SF_MACHINE = 1<<10, // Beep boop. Are you a robot?
|
||||
SF_DASHMODE = 1<<11, // Sonic Advance 2 style top speed increase?
|
||||
SF_FASTEDGE = 1<<12, // Faster edge teeter?
|
||||
SF_MULTIABILITY = 1<<13, // Revenge of Final Demo.
|
||||
SF_NONIGHTSROTATION = 1<<14, // Disable sprite rotation for NiGHTS
|
||||
SF_NONIGHTSSUPER = 1<<15, // Disable super colors for NiGHTS (if you have SF_SUPER)
|
||||
SF_NOSUPERSPRITES = 1<<16, // Don't use super sprites while super
|
||||
SF_NOSUPERJUMPBOOST = 1<<17, // Disable the jump boost given while super (i.e. Knuckles)
|
||||
SF_CANBUSTWALLS = 1<<18, // Can naturally bust walls on contact? (i.e. Knuckles)
|
||||
SF_NOSHIELDABILITY = 1<<19, // Disable shield abilities
|
||||
SF_FASTWAIT = 1<<12, // Faster wait animation?
|
||||
SF_FASTEDGE = 1<<13, // Faster edge teeter?
|
||||
SF_MULTIABILITY = 1<<14, // Revenge of Final Demo.
|
||||
SF_NONIGHTSROTATION = 1<<15, // Disable sprite rotation for NiGHTS
|
||||
SF_NONIGHTSSUPER = 1<<16, // Disable super colors for NiGHTS (if you have SF_SUPER)
|
||||
SF_NOSUPERSPRITES = 1<<17, // Don't use super sprites while super
|
||||
SF_NOSUPERJUMPBOOST = 1<<18, // Disable the jump boost given while super (i.e. Knuckles)
|
||||
SF_CANBUSTWALLS = 1<<19, // Can naturally bust walls on contact? (i.e. Knuckles)
|
||||
SF_NOSHIELDABILITY = 1<<20, // Disable shield abilities
|
||||
|
||||
// free up to and including 1<<31
|
||||
} skinflags_t;
|
||||
|
@ -158,10 +159,6 @@ typedef enum
|
|||
PF_FORCESTRAFE = 1<<28, // Turning inputs are translated into strafing inputs
|
||||
PF_CANCARRY = 1<<29, // Can carry another player?
|
||||
PF_FINISHED = 1<<30, // The player finished the level. NOT the same as exiting
|
||||
|
||||
// True if shield button down last tic
|
||||
// This may be the final flag, but 2.3 could free up the others
|
||||
PF_SHIELDDOWN = 1<<31,
|
||||
|
||||
// up to 1<<31 is free
|
||||
} pflags_t;
|
||||
|
|
|
@ -51,6 +51,8 @@ typedef struct thinker_s
|
|||
// killough 11/98: count of how many other objects reference
|
||||
// this one using pointers. Used for garbage collection.
|
||||
INT32 references;
|
||||
|
||||
boolean removing;
|
||||
boolean cachable;
|
||||
|
||||
#ifdef PARANOIA
|
||||
|
|
|
@ -26,23 +26,20 @@
|
|||
// Button/action code definitions.
|
||||
typedef enum
|
||||
{
|
||||
// First 3 bits are weapon change info, DO NOT USE!
|
||||
BT_WEAPONMASK = 0x07, //our first three bits.
|
||||
|
||||
BT_SHIELD = 1<<3, // shield or super action
|
||||
// First 4 bits are weapon change info, DO NOT USE!
|
||||
BT_WEAPONMASK = 0x0F, //our first four bits.
|
||||
|
||||
BT_WEAPONNEXT = 1<<4, // select next weapon
|
||||
BT_WEAPONPREV = 1<<5, // select previous weapon
|
||||
BT_WEAPONNEXT = 1<<4,
|
||||
BT_WEAPONPREV = 1<<5,
|
||||
|
||||
BT_ATTACK = 1<<6, // shoot rings
|
||||
BT_SPIN = 1<<7,
|
||||
BT_CAMLEFT = 1<<8, // turn camera left
|
||||
BT_CAMRIGHT = 1<<9, // turn camera right
|
||||
BT_TOSSFLAG = 1<<10,
|
||||
BT_JUMP = 1<<11,
|
||||
BT_FIRENORMAL = 1<<12, // Fire a normal ring no matter what
|
||||
|
||||
BT_ATTACK = 1<<6, // shoot rings
|
||||
BT_SPIN = 1<<7, // spin action
|
||||
BT_CAMLEFT = 1<<8, // turn camera left
|
||||
BT_CAMRIGHT = 1<<9, // turn camera right
|
||||
BT_TOSSFLAG = 1<<10, // toss flag or emeralds
|
||||
BT_JUMP = 1<<11, // jump action
|
||||
BT_FIRENORMAL = 1<<12, // fire a normal ring no matter what
|
||||
|
||||
// custom lua buttons
|
||||
BT_CUSTOM1 = 1<<13,
|
||||
BT_CUSTOM2 = 1<<14,
|
||||
BT_CUSTOM3 = 1<<15,
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
//
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Portions Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 2014-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 2014-2025 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
|
@ -65,10 +65,11 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
|
|||
#pragma warning(default : 4214 4244)
|
||||
#endif
|
||||
|
||||
#if defined (__unix__) || defined(__APPLE__) || (defined (UNIXCOMMON) && !defined (__HAIKU__))
|
||||
#if defined (__linux__)
|
||||
#include <sys/vfs.h>
|
||||
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||
#if defined (__linux__) || defined (__HAIKU__)
|
||||
#include <sys/statvfs.h>
|
||||
#else
|
||||
#include <sys/statvfs.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/mount.h>
|
||||
/*For meminfo*/
|
||||
|
@ -81,7 +82,7 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (__linux__) || (defined (UNIXCOMMON) && !defined (__HAIKU__))
|
||||
#if defined (__linux__) || defined (UNIXCOMMON)
|
||||
#ifndef NOTERMIOS
|
||||
#include <termios.h>
|
||||
#include <sys/ioctl.h> // ioctl
|
||||
|
@ -96,8 +97,10 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
|
|||
#if defined (__unix__) || (defined (UNIXCOMMON) && !defined (__APPLE__))
|
||||
#include <errno.h>
|
||||
#include <sys/wait.h>
|
||||
#ifndef __HAIKU__ // haiku's crash dialog is just objectively better
|
||||
#define NEWSIGNALHANDLER
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef NOMUMBLE
|
||||
#ifdef __linux__ // need -lrt
|
||||
|
@ -374,15 +377,24 @@ void I_Sleep(UINT32 ms)
|
|||
|
||||
void I_SleepDuration(precise_t duration)
|
||||
{
|
||||
#if defined(__linux__) || defined(__FreeBSD__)
|
||||
#if defined(__linux__) || defined(__FreeBSD__) || defined(__HAIKU__)
|
||||
UINT64 precision = I_GetPrecisePrecision();
|
||||
struct timespec ts = {
|
||||
.tv_sec = duration / precision,
|
||||
.tv_nsec = duration * 1000000000 / precision % 1000000000,
|
||||
};
|
||||
int status;
|
||||
do status = clock_nanosleep(CLOCK_MONOTONIC, 0, &ts, &ts);
|
||||
while (status == EINTR);
|
||||
precise_t dest = I_GetPreciseTime() + duration;
|
||||
precise_t slack = (precision / 5000); // 0.2 ms slack
|
||||
if (duration > slack)
|
||||
{
|
||||
duration -= slack;
|
||||
struct timespec ts = {
|
||||
.tv_sec = duration / precision,
|
||||
.tv_nsec = duration * 1000000000 / precision % 1000000000,
|
||||
};
|
||||
int status;
|
||||
do status = clock_nanosleep(CLOCK_MONOTONIC, 0, &ts, &ts);
|
||||
while (status == EINTR);
|
||||
}
|
||||
|
||||
// busy-wait the rest
|
||||
while (((INT64)dest - (INT64)I_GetPreciseTime()) > 0);
|
||||
#else
|
||||
UINT64 precision = I_GetPrecisePrecision();
|
||||
INT32 sleepvalue = cv_sleep.value;
|
||||
|
@ -705,10 +717,9 @@ typedef struct
|
|||
|
||||
static feild_t tty_con;
|
||||
|
||||
// when printing general stuff to stdout stderr (Sys_Printf)
|
||||
// we need to disable the tty console stuff
|
||||
// this increments so we can recursively disable
|
||||
static INT32 ttycon_hide = 0;
|
||||
// lock to prevent clearing partial lines, since not everything
|
||||
// printed ends on a newline.
|
||||
static boolean ttycon_ateol = true;
|
||||
// some key codes that the terminal may be using
|
||||
// TTimo NOTE: I'm not sure how relevant this is
|
||||
static INT32 tty_erase;
|
||||
|
@ -736,63 +747,31 @@ static inline void tty_FlushIn(void)
|
|||
// 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 ..
|
||||
// (there may be a way to find out if '\b' alone would work though)
|
||||
// Hanicef NOTE: using \b this way is unreliable because of terminal state,
|
||||
// it's better to use \r to reset the cursor to the beginning of the
|
||||
// line and clear from there.
|
||||
static void tty_Back(void)
|
||||
{
|
||||
char key;
|
||||
ssize_t d;
|
||||
key = '\b';
|
||||
d = write(STDOUT_FILENO, &key, 1);
|
||||
key = ' ';
|
||||
d = write(STDOUT_FILENO, &key, 1);
|
||||
key = '\b';
|
||||
d = write(STDOUT_FILENO, &key, 1);
|
||||
(void)d;
|
||||
write(STDOUT_FILENO, "\r", 1);
|
||||
if (tty_con.cursor>0)
|
||||
{
|
||||
write(STDOUT_FILENO, tty_con.buffer, tty_con.cursor);
|
||||
}
|
||||
write(STDOUT_FILENO, " \b", 2);
|
||||
}
|
||||
|
||||
static void tty_Clear(void)
|
||||
{
|
||||
size_t i;
|
||||
write(STDOUT_FILENO, "\r", 1);
|
||||
if (tty_con.cursor>0)
|
||||
{
|
||||
for (i=0; i<tty_con.cursor; i++)
|
||||
{
|
||||
tty_Back();
|
||||
write(STDOUT_FILENO, " ", 1);
|
||||
}
|
||||
write(STDOUT_FILENO, "\r", 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// clear the display of the line currently edited
|
||||
// bring cursor back to beginning of line
|
||||
static inline void tty_Hide(void)
|
||||
{
|
||||
//I_Assert(consolevent);
|
||||
if (ttycon_hide)
|
||||
{
|
||||
ttycon_hide++;
|
||||
return;
|
||||
}
|
||||
tty_Clear();
|
||||
ttycon_hide++;
|
||||
}
|
||||
|
||||
// show the current line
|
||||
// FIXME TTimo need to position the cursor if needed??
|
||||
static inline void tty_Show(void)
|
||||
{
|
||||
size_t i;
|
||||
ssize_t d;
|
||||
//I_Assert(consolevent);
|
||||
I_Assert(ttycon_hide>0);
|
||||
ttycon_hide--;
|
||||
if (ttycon_hide == 0 && tty_con.cursor)
|
||||
{
|
||||
for (i=0; i<tty_con.cursor; i++)
|
||||
{
|
||||
d = write(STDOUT_FILENO, tty_con.buffer+i, 1);
|
||||
}
|
||||
}
|
||||
(void)d;
|
||||
}
|
||||
|
||||
// never exit without calling this, or your terminal will be left in a pretty bad state
|
||||
|
@ -900,6 +879,11 @@ static void I_GetConsoleEvents(void)
|
|||
tty_con.cursor = 0;
|
||||
ev.key = KEY_ENTER;
|
||||
}
|
||||
else if (key == 0x4) // ^D, aka EOF
|
||||
{
|
||||
// shut down, most unix programs behave this way
|
||||
I_Quit();
|
||||
}
|
||||
else continue;
|
||||
}
|
||||
else if (tty_con.cursor < sizeof(tty_con.buffer))
|
||||
|
@ -999,20 +983,8 @@ static void I_GetConsoleEvents(void)
|
|||
static void I_StartupConsole(void)
|
||||
{
|
||||
HANDLE ci, co;
|
||||
const INT32 ded = M_CheckParm("-dedicated");
|
||||
BOOL gotConsole = FALSE;
|
||||
if (M_CheckParm("-console") || ded)
|
||||
gotConsole = AllocConsole();
|
||||
#ifdef _DEBUG
|
||||
else if (M_CheckParm("-noconsole") && !ded)
|
||||
#else
|
||||
else if (!M_CheckParm("-console") && !ded)
|
||||
#endif
|
||||
{
|
||||
FreeConsole();
|
||||
gotConsole = FALSE;
|
||||
}
|
||||
|
||||
BOOL gotConsole = AllocConsole();
|
||||
consolevent = !M_CheckParm("-noconsole");
|
||||
if (gotConsole)
|
||||
{
|
||||
SetConsoleTitleA("SRB2 Console");
|
||||
|
@ -1040,12 +1012,7 @@ static inline void I_ShutdownConsole(void){}
|
|||
static void I_GetConsoleEvents(void){}
|
||||
static inline void I_StartupConsole(void)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
consolevent = !M_CheckParm("-noconsole");
|
||||
#else
|
||||
consolevent = M_CheckParm("-console");
|
||||
#endif
|
||||
|
||||
framebuffer = M_CheckParm("-framebuffer");
|
||||
|
||||
if (framebuffer)
|
||||
|
@ -1063,6 +1030,9 @@ void I_OutputMsg(const char *fmt, ...)
|
|||
va_start(argptr,fmt);
|
||||
len = vsnprintf(NULL, 0, fmt, argptr);
|
||||
va_end(argptr);
|
||||
if (len == 0)
|
||||
return;
|
||||
|
||||
txt = malloc(len+1);
|
||||
va_start(argptr,fmt);
|
||||
vsprintf(txt, fmt, argptr);
|
||||
|
@ -1152,18 +1122,20 @@ void I_OutputMsg(const char *fmt, ...)
|
|||
}
|
||||
#else
|
||||
#ifdef HAVE_TERMIOS
|
||||
if (consolevent)
|
||||
if (consolevent && ttycon_ateol)
|
||||
{
|
||||
tty_Hide();
|
||||
tty_Clear();
|
||||
ttycon_ateol = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!framebuffer)
|
||||
fprintf(stderr, "%s", txt);
|
||||
#ifdef HAVE_TERMIOS
|
||||
if (consolevent)
|
||||
if (consolevent && txt[len-1] == '\n')
|
||||
{
|
||||
tty_Show();
|
||||
write(STDOUT_FILENO, tty_con.buffer, tty_con.cursor);
|
||||
ttycon_ateol = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1243,18 +1215,13 @@ void I_ShutdownSystem(void)
|
|||
void I_GetDiskFreeSpace(INT64* freespace)
|
||||
{
|
||||
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||
#if defined (SOLARIS) || defined (__HAIKU__)
|
||||
*freespace = INT32_MAX;
|
||||
return;
|
||||
#else // Both Linux and BSD have this, apparently.
|
||||
struct statfs stfs;
|
||||
if (statfs(srb2home, &stfs) == -1)
|
||||
struct statvfs stfs;
|
||||
if (statvfs(srb2home, &stfs) == -1)
|
||||
{
|
||||
*freespace = INT32_MAX;
|
||||
return;
|
||||
}
|
||||
*freespace = stfs.f_bavail * stfs.f_bsize;
|
||||
#endif
|
||||
#elif defined (_WIN32)
|
||||
static p_GetDiskFreeSpaceExA pfnGetDiskFreeSpaceEx = NULL;
|
||||
static boolean testwin95 = false;
|
||||
|
@ -1390,8 +1357,8 @@ static const char *searchWad(const char *searchDir)
|
|||
|
||||
#define CHECKWADPATH(ret) \
|
||||
do { \
|
||||
I_OutputMsg(",%s", returnWadPath); \
|
||||
if (isWadPathOk(returnWadPath)) \
|
||||
I_OutputMsg(",%s", ret); \
|
||||
if (isWadPathOk(ret)) \
|
||||
return ret; \
|
||||
} while (0)
|
||||
|
||||
|
@ -1416,7 +1383,9 @@ static const char *locateWad(void)
|
|||
#ifndef NOCWD
|
||||
// examine current dir
|
||||
strcpy(returnWadPath, ".");
|
||||
CHECKWADPATH(NULL);
|
||||
I_OutputMsg(",%s", returnWadPath);
|
||||
if (isWadPathOk(returnWadPath))
|
||||
return NULL;
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
@ -1433,9 +1402,15 @@ static const char *locateWad(void)
|
|||
|
||||
#ifndef NOHOME
|
||||
// find in $HOME
|
||||
I_OutputMsg(",HOME");
|
||||
if ((envstr = I_GetEnv("HOME")) != NULL)
|
||||
SEARCHWAD(envstr);
|
||||
{
|
||||
char *tmp = malloc(strlen(envstr) + 1 + sizeof(DEFAULTDIR));
|
||||
strcpy(tmp, envstr);
|
||||
strcat(tmp, "/");
|
||||
strcat(tmp, DEFAULTDIR);
|
||||
CHECKWADPATH(tmp);
|
||||
free(tmp);
|
||||
}
|
||||
#endif
|
||||
|
||||
// search paths
|
||||
|
@ -1462,8 +1437,10 @@ const char *I_LocateWad(void)
|
|||
{
|
||||
// change to the directory where we found srb2.pk3
|
||||
#if defined (_WIN32)
|
||||
waddir = _fullpath(NULL, waddir, MAX_PATH);
|
||||
SetCurrentDirectoryA(waddir);
|
||||
#else
|
||||
waddir = realpath(waddir, NULL);
|
||||
if (chdir(waddir) == -1)
|
||||
I_OutputMsg("Couldn't change working directory\n");
|
||||
#endif
|
||||
|
@ -1585,5 +1562,14 @@ void I_GetCursorPosition(INT32 *x, INT32 *y)
|
|||
(void)y;
|
||||
}
|
||||
|
||||
#include "../sdl/dosstr.c"
|
||||
void I_SetTextInputMode(boolean active)
|
||||
{
|
||||
(void)active;
|
||||
}
|
||||
|
||||
boolean I_GetTextInputMode(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#include "../sdl/dosstr.c"
|
||||
|
|
|
@ -157,7 +157,7 @@ void I_wake_all_cond(I_cond *anchor)
|
|||
pthread_mutex_lock(&thread_lock);
|
||||
if (*anchor == NULL)
|
||||
{
|
||||
*anchor = malloc(sizeof(pthread_t));
|
||||
*anchor = malloc(sizeof(pthread_cond_t));
|
||||
pthread_cond_init(*anchor, NULL);
|
||||
}
|
||||
pthread_mutex_unlock(&thread_lock);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "../doomdef.h"
|
||||
#include "../doomdef.h"
|
||||
#include "../command.h"
|
||||
#include "../i_video.h"
|
||||
|
||||
|
@ -76,4 +76,3 @@ void I_ReadScreen(UINT8 *scr)
|
|||
void I_BeginRead(void){}
|
||||
|
||||
void I_EndRead(void){}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -11,7 +11,6 @@
|
|||
/// \brief Lua SOC library
|
||||
|
||||
#include "deh_lua.h"
|
||||
#include "g_input.h"
|
||||
|
||||
// freeslot takes a name (string only!)
|
||||
// and allocates it to the appropriate free slot.
|
||||
|
@ -28,6 +27,12 @@ static inline int lib_freeslot(lua_State *L)
|
|||
if (!lua_lumploading)
|
||||
return luaL_error(L, "This function cannot be called from within a hook or coroutine!");
|
||||
|
||||
if (!deh_loaded)
|
||||
{
|
||||
initfreeslots();
|
||||
deh_loaded = true;
|
||||
}
|
||||
|
||||
while (n-- > 0)
|
||||
{
|
||||
s = Z_StrDup(luaL_checkstring(L,1));
|
||||
|
@ -594,20 +599,12 @@ static int ScanConstants(lua_State *L, boolean mathlib, const char *word)
|
|||
return luaL_error(L, "translation '%s' could not be found.\n", word);
|
||||
}
|
||||
|
||||
// TODO: 2.3: Delete these aliases
|
||||
else if (fastcmp(word, "BT_USE"))
|
||||
// TODO: 2.3: Delete this alias
|
||||
if (fastcmp(word, "BT_USE"))
|
||||
{
|
||||
CacheAndPushConstant(L, word, (lua_Integer)BT_SPIN);
|
||||
return 1;
|
||||
}
|
||||
else if (fastcmp(word, "GC_WEPSLOT8") || fastcmp(word, "GC_WEPSLOT9") || fastcmp(word, "GC_WEPSLOT10"))
|
||||
{
|
||||
// Using GC_WEPSLOT7 isn't accurate, but ensures that "if x >= GC_WEPSLOT1 and x <= GC_WEPSLOT10" keeps the intended effect
|
||||
CacheAndPushConstant(L, word, (lua_Integer)GC_WEPSLOT7);
|
||||
if (!mathlib)
|
||||
LUA_Deprecated(L, "GC_WEPSLOT8\"-\"GC_WEPSLOT10", "GC_WEPSLOT1\"-\"GC_WEPSLOT7");
|
||||
return 1;
|
||||
}
|
||||
|
||||
for (i = 0; INT_CONST[i].n; i++)
|
||||
if (fastcmp(word,INT_CONST[i].n)) {
|
||||
|
|
146
src/deh_soc.c
146
src/deh_soc.c
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2025 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -286,6 +286,7 @@ void readPlayer(MYFILE *f, INT32 num)
|
|||
}
|
||||
if (playertext)
|
||||
{
|
||||
// PLAYERTEXT is really weird, so this doesn't use deh_strlcpy.
|
||||
strlcpy(description[num].notes, playertext, NOTE_SIZE);
|
||||
strlcat(description[num].notes,
|
||||
myhashfgets(playertext, NOTE_SIZE, f), NOTE_SIZE);
|
||||
|
@ -324,7 +325,8 @@ void readPlayer(MYFILE *f, INT32 num)
|
|||
if (fastcmp(word, "PICNAME"))
|
||||
{
|
||||
SLOTFOUND
|
||||
strncpy(description[num].picname, word2, sizeof(description[num].picname)-1);
|
||||
deh_strlcpy(description[num].picname, word2, sizeof description[num].picname,
|
||||
va("Character %d: picname", num));
|
||||
}
|
||||
else if (fastcmp(word, "DISPLAYNAME"))
|
||||
{
|
||||
|
@ -345,7 +347,8 @@ void readPlayer(MYFILE *f, INT32 num)
|
|||
cur = strchr(cur, '#');
|
||||
}
|
||||
|
||||
strlcpy(description[num].displayname, stringvalue, sizeof description[num].displayname);
|
||||
deh_strlcpy(description[num].displayname, stringvalue, sizeof description[num].displayname,
|
||||
va("Character %d: displayname", num));
|
||||
}
|
||||
else if (fastcmp(word, "OPPOSITECOLOR") || fastcmp(word, "OPPOSITECOLOUR"))
|
||||
{
|
||||
|
@ -355,7 +358,8 @@ void readPlayer(MYFILE *f, INT32 num)
|
|||
else if (fastcmp(word, "NAMETAG") || fastcmp(word, "TAGNAME"))
|
||||
{
|
||||
SLOTFOUND
|
||||
strncpy(description[num].nametag, word2, sizeof(description[num].nametag)-1);
|
||||
deh_strlcpy(description[num].nametag, word2, sizeof description[num].nametag,
|
||||
va("Character %d: nametag", num));
|
||||
}
|
||||
else if (fastcmp(word, "TAGTEXTCOLOR") || fastcmp(word, "TAGTEXTCOLOUR"))
|
||||
{
|
||||
|
@ -387,7 +391,8 @@ void readPlayer(MYFILE *f, INT32 num)
|
|||
{
|
||||
// Send to free slot.
|
||||
SLOTFOUND
|
||||
strlcpy(description[num].skinname, word2, sizeof description[num].skinname);
|
||||
deh_strlcpy(description[num].skinname, word2, sizeof description[num].skinname,
|
||||
va("Character %d: skinname", num));
|
||||
strlwr(description[num].skinname);
|
||||
}
|
||||
else if (!failure)
|
||||
|
@ -1196,6 +1201,7 @@ void readgametype(MYFILE *f, char *gtname)
|
|||
}
|
||||
if (descr)
|
||||
{
|
||||
// DESCRIPTION is really weird, so this doesn't use deh_strlcpy.
|
||||
strlcpy(gtdescription, descr, sizeof (gtdescription));
|
||||
strlcat(gtdescription,
|
||||
myhashfgets(descr, sizeof (gtdescription), f),
|
||||
|
@ -1402,7 +1408,7 @@ void readlevelheader(MYFILE *f, INT32 num)
|
|||
{
|
||||
deh_strlcpy(mapheaderinfo[num-1]->lvlttl, word2,
|
||||
sizeof(mapheaderinfo[num-1]->lvlttl), va("Level header %d: levelname", num));
|
||||
strlcpy(mapheaderinfo[num-1]->selectheading, word2, sizeof(mapheaderinfo[num-1]->selectheading)); // not deh_ so only complains once
|
||||
strlcpy(mapheaderinfo[num-1]->selectheading, word2, sizeof(mapheaderinfo[num-1]->selectheading)); // not deh_strlcpy so only complains once
|
||||
continue;
|
||||
}
|
||||
// CHEAP HACK: move this over here for lowercase subtitles
|
||||
|
@ -1445,10 +1451,10 @@ void readlevelheader(MYFILE *f, INT32 num)
|
|||
// Newly allocated
|
||||
modoption = &mapheaderinfo[num-1]->customopts[j];
|
||||
|
||||
strncpy(modoption->option, word, 31);
|
||||
modoption->option[31] = '\0';
|
||||
strncpy(modoption->value, word2, 255);
|
||||
modoption->value[255] = '\0';
|
||||
deh_strlcpy(modoption->option, word, sizeof(modoption->option),
|
||||
va("Level header %d: custom option %d key", num, j));
|
||||
deh_strlcpy(modoption->value, word2, sizeof(modoption->value),
|
||||
va("Level header %d: custom option %d value", num, j));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1626,7 +1632,7 @@ void readlevelheader(MYFILE *f, INT32 num)
|
|||
else if (fastcmp(word, "KEYWORDS"))
|
||||
{
|
||||
deh_strlcpy(mapheaderinfo[num-1]->keywords, word2,
|
||||
sizeof(mapheaderinfo[num-1]->keywords), va("Level header %d: keywords", num));
|
||||
sizeof(mapheaderinfo[num-1]->keywords), va("Level header %d: keywords", num));
|
||||
}
|
||||
else if (fastcmp(word, "MUSIC"))
|
||||
{
|
||||
|
@ -1675,7 +1681,8 @@ void readlevelheader(MYFILE *f, INT32 num)
|
|||
}
|
||||
else if (fastcmp(word, "FORCECHARACTER"))
|
||||
{
|
||||
strlcpy(mapheaderinfo[num-1]->forcecharacter, word2, SKINNAMESIZE+1);
|
||||
deh_strlcpy(mapheaderinfo[num-1]->forcecharacter, word2, sizeof mapheaderinfo[num-1]->forcecharacter,
|
||||
va("Level header %d: forcecharacter", num));
|
||||
strlwr(mapheaderinfo[num-1]->forcecharacter); // skin names are lowercase
|
||||
}
|
||||
else if (fastcmp(word, "WEATHER"))
|
||||
|
@ -1683,7 +1690,10 @@ void readlevelheader(MYFILE *f, INT32 num)
|
|||
else if (fastcmp(word, "SKYNUM"))
|
||||
mapheaderinfo[num-1]->skynum = (INT16)i;
|
||||
else if (fastcmp(word, "INTERSCREEN"))
|
||||
strncpy(mapheaderinfo[num-1]->interscreen, word2, sizeof(mapheaderinfo[num-1]->interscreen)-1);
|
||||
{
|
||||
deh_strlcpy(mapheaderinfo[num-1]->interscreen, word2, sizeof mapheaderinfo[num-1]->interscreen,
|
||||
va("Level header %d: interscreen", num));
|
||||
}
|
||||
else if (fastcmp(word, "PRECUTSCENENUM"))
|
||||
mapheaderinfo[num-1]->precutscenenum = (UINT8)i;
|
||||
else if (fastcmp(word, "CUTSCENENUM"))
|
||||
|
@ -1985,14 +1995,17 @@ static void readcutscenescene(MYFILE *f, INT32 num, INT32 scenenum)
|
|||
picid = (UINT8)atoi(word + 3);
|
||||
if (picid > 8 || picid == 0)
|
||||
{
|
||||
deh_warning("CutSceneScene %d: unknown word '%s'", num, word);
|
||||
deh_warning("Cutscene %d, scene %d: pic number %d out of range (1 - %d)",
|
||||
num + 1, scenenum + 1, picid, 8);
|
||||
continue;
|
||||
}
|
||||
--picid;
|
||||
|
||||
if (fastcmp(word+4, "NAME"))
|
||||
{
|
||||
strncpy(cutscenes[num]->scene[scenenum].picname[picid], word2, 8);
|
||||
deh_strlcpy(cutscenes[num]->scene[scenenum].picname[picid], word2,
|
||||
sizeof cutscenes[num]->scene[scenenum].picname[picid],
|
||||
va("Cutscene %d, scene %d, pic %d: name", num + 1, scenenum + 1, picid + 1));
|
||||
}
|
||||
else if (fastcmp(word+4, "HIRES"))
|
||||
{
|
||||
|
@ -2011,12 +2024,13 @@ static void readcutscenescene(MYFILE *f, INT32 num, INT32 scenenum)
|
|||
cutscenes[num]->scene[scenenum].ycoord[picid] = usi;
|
||||
}
|
||||
else
|
||||
deh_warning("CutSceneScene %d: unknown word '%s'", num, word);
|
||||
deh_warning("Cutscene %d, scene %d: unknown word '%s'", num + 1, scenenum + 1, word);
|
||||
}
|
||||
else if (fastcmp(word, "MUSIC"))
|
||||
{
|
||||
strncpy(cutscenes[num]->scene[scenenum].musswitch, word2, 7);
|
||||
cutscenes[num]->scene[scenenum].musswitch[6] = 0;
|
||||
deh_strlcpy(cutscenes[num]->scene[scenenum].musswitch, word2,
|
||||
sizeof cutscenes[num]->scene[scenenum].musswitch,
|
||||
va("Cutscene %d, scene %d: music", num + 1, scenenum + 1));
|
||||
}
|
||||
else if (fastcmp(word, "MUSICTRACK"))
|
||||
{
|
||||
|
@ -2051,7 +2065,7 @@ static void readcutscenescene(MYFILE *f, INT32 num, INT32 scenenum)
|
|||
cutscenes[num]->scene[scenenum].fadecolor = (UINT8)i;
|
||||
}
|
||||
else
|
||||
deh_warning("CutSceneScene %d: unknown word '%s'", num, word);
|
||||
deh_warning("Cutscene %d, scene %d: unknown word '%s'", num + 1, scenenum + 1, word);
|
||||
}
|
||||
} while (!myfeof(f)); // finish when the line is empty
|
||||
|
||||
|
@ -2109,11 +2123,10 @@ void readcutscene(MYFILE *f, INT32 num)
|
|||
readcutscenescene(f, num, value - 1);
|
||||
}
|
||||
else
|
||||
deh_warning("Scene number %d out of range (1 - 128)", value);
|
||||
|
||||
deh_warning("Cutscene %d: scene number %d out of range (1 - 128)", num + 1, value);
|
||||
}
|
||||
else
|
||||
deh_warning("Cutscene %d: unknown word '%s', Scene <num> expected.", num, word);
|
||||
deh_warning("Cutscene %d: unknown word '%s', Scene <num> expected.", num + 1, word);
|
||||
}
|
||||
} while (!myfeof(f)); // finish when the line is empty
|
||||
|
||||
|
@ -2234,7 +2247,8 @@ static void readtextpromptpage(MYFILE *f, INT32 num, INT32 pagenum)
|
|||
|
||||
for (picid = 0; picid < MAX_PROMPT_PICS; picid++)
|
||||
{
|
||||
strncpy(textprompts[num]->page[pagenum].picname[picid], textprompts[num]->page[metapagenum].picname[picid], 8);
|
||||
// Doesn't use deh_strlcpy because it's not copying input.
|
||||
strlcpy(textprompts[num]->page[pagenum].picname[picid], textprompts[num]->page[metapagenum].picname[picid], sizeof textprompts[num]->page[pagenum].picname[picid]);
|
||||
textprompts[num]->page[pagenum].pichires[picid] = textprompts[num]->page[metapagenum].pichires[picid];
|
||||
textprompts[num]->page[pagenum].picduration[picid] = textprompts[num]->page[metapagenum].picduration[picid];
|
||||
textprompts[num]->page[pagenum].xcoord[picid] = textprompts[num]->page[metapagenum].xcoord[picid];
|
||||
|
@ -2247,14 +2261,17 @@ static void readtextpromptpage(MYFILE *f, INT32 num, INT32 pagenum)
|
|||
picid = (UINT8)atoi(word + 3);
|
||||
if (picid > MAX_PROMPT_PICS || picid == 0)
|
||||
{
|
||||
deh_warning("textpromptscene %d: unknown word '%s'", num, word);
|
||||
deh_warning("Text prompt %d, page %d: pic number %d out of range (1 - %d)",
|
||||
num + 1, pagenum + 1, picid, MAX_PROMPT_PICS);
|
||||
continue;
|
||||
}
|
||||
--picid;
|
||||
|
||||
if (fastcmp(word+4, "NAME"))
|
||||
{
|
||||
strncpy(textprompts[num]->page[pagenum].picname[picid], word2, 8);
|
||||
deh_strlcpy(textprompts[num]->page[pagenum].picname[picid], word2,
|
||||
sizeof textprompts[num]->page[pagenum].picname[picid],
|
||||
va("Text prompt %d, page %d, pic %d: name", num + 1, pagenum + 1, picid + 1));
|
||||
}
|
||||
else if (fastcmp(word+4, "HIRES"))
|
||||
{
|
||||
|
@ -2273,12 +2290,16 @@ static void readtextpromptpage(MYFILE *f, INT32 num, INT32 pagenum)
|
|||
textprompts[num]->page[pagenum].ycoord[picid] = usi;
|
||||
}
|
||||
else
|
||||
deh_warning("textpromptscene %d: unknown word '%s'", num, word);
|
||||
{
|
||||
deh_warning("Text prompt %d, page %d: unknown word '%s'",
|
||||
num + 1, pagenum + 1, word);
|
||||
}
|
||||
}
|
||||
else if (fastcmp(word, "MUSIC"))
|
||||
{
|
||||
strncpy(textprompts[num]->page[pagenum].musswitch, word2, 7);
|
||||
textprompts[num]->page[pagenum].musswitch[6] = 0;
|
||||
deh_strlcpy(textprompts[num]->page[pagenum].musswitch, word2,
|
||||
sizeof textprompts[num]->page[pagenum].musswitch,
|
||||
va("Text prompt %d, page %d: music", num + 1, pagenum + 1));
|
||||
}
|
||||
else if (fastcmp(word, "MUSICTRACK"))
|
||||
{
|
||||
|
@ -2293,30 +2314,35 @@ static void readtextpromptpage(MYFILE *f, INT32 num, INT32 pagenum)
|
|||
{
|
||||
if (*word2 != '\0')
|
||||
{
|
||||
INT32 j;
|
||||
size_t j;
|
||||
|
||||
// HACK: Add yellow control char now
|
||||
// so the drawing function doesn't call it repeatedly
|
||||
char name[34];
|
||||
char name[32 + 2];
|
||||
name[0] = '\x82'; // color yellow
|
||||
name[1] = 0;
|
||||
strncat(name, word2, 32);
|
||||
name[33] = 0;
|
||||
|
||||
// So that we still get a warning.
|
||||
deh_strlcpy(name + 1, word2, (sizeof(name)) - 1,
|
||||
va("Text prompt %d, page %d: name", num + 1, pagenum + 1));
|
||||
|
||||
// Replace _ with ' '
|
||||
for (j = 0; j < 32 && name[j]; j++)
|
||||
for (j = 1; j < sizeof(name) && name[j]; j++)
|
||||
{
|
||||
if (name[j] == '_')
|
||||
name[j] = ' ';
|
||||
}
|
||||
|
||||
strncpy(textprompts[num]->page[pagenum].name, name, sizeof(textprompts[num]->page[pagenum].name));
|
||||
strlcpy(textprompts[num]->page[pagenum].name, name, sizeof(textprompts[num]->page[pagenum].name));
|
||||
}
|
||||
else
|
||||
*textprompts[num]->page[pagenum].name = '\0';
|
||||
}
|
||||
else if (fastcmp(word, "ICON"))
|
||||
strncpy(textprompts[num]->page[pagenum].iconname, word2, 8);
|
||||
{
|
||||
deh_strlcpy(textprompts[num]->page[pagenum].iconname, word2,
|
||||
sizeof textprompts[num]->page[pagenum].iconname,
|
||||
va("Text prompt %d, page %d: icon", num + 1, pagenum + 1));
|
||||
}
|
||||
else if (fastcmp(word, "ICONALIGN"))
|
||||
textprompts[num]->page[pagenum].rightside = (i || word2[0] == 'R');
|
||||
else if (fastcmp(word, "ICONFLIP"))
|
||||
|
@ -2383,8 +2409,9 @@ static void readtextpromptpage(MYFILE *f, INT32 num, INT32 pagenum)
|
|||
{
|
||||
UINT8 metapagenum = usi - 1;
|
||||
|
||||
strncpy(textprompts[num]->page[pagenum].name, textprompts[num]->page[metapagenum].name, 32);
|
||||
strncpy(textprompts[num]->page[pagenum].iconname, textprompts[num]->page[metapagenum].iconname, 8);
|
||||
// Doesn't use deh_strlcpy because it's not copying input.
|
||||
strlcpy(textprompts[num]->page[pagenum].name, textprompts[num]->page[metapagenum].name, sizeof textprompts[num]->page[pagenum].name);
|
||||
strlcpy(textprompts[num]->page[pagenum].iconname, textprompts[num]->page[metapagenum].iconname, sizeof textprompts[num]->page[pagenum].iconname);
|
||||
textprompts[num]->page[pagenum].rightside = textprompts[num]->page[metapagenum].rightside;
|
||||
textprompts[num]->page[pagenum].iconflip = textprompts[num]->page[metapagenum].iconflip;
|
||||
textprompts[num]->page[pagenum].lines = textprompts[num]->page[metapagenum].lines;
|
||||
|
@ -2399,17 +2426,25 @@ static void readtextpromptpage(MYFILE *f, INT32 num, INT32 pagenum)
|
|||
}
|
||||
}
|
||||
else if (fastcmp(word, "TAG"))
|
||||
strncpy(textprompts[num]->page[pagenum].tag, word2, 33);
|
||||
{
|
||||
deh_strlcpy(textprompts[num]->page[pagenum].tag, word2,
|
||||
sizeof textprompts[num]->page[pagenum].tag,
|
||||
va("Text prompt %d, page %d: tag", num + 1, pagenum + 1));
|
||||
}
|
||||
else if (fastcmp(word, "NEXTPROMPT"))
|
||||
textprompts[num]->page[pagenum].nextprompt = usi;
|
||||
else if (fastcmp(word, "NEXTPAGE"))
|
||||
textprompts[num]->page[pagenum].nextpage = usi;
|
||||
else if (fastcmp(word, "NEXTTAG"))
|
||||
strncpy(textprompts[num]->page[pagenum].nexttag, word2, 33);
|
||||
{
|
||||
deh_strlcpy(textprompts[num]->page[pagenum].nexttag, word2,
|
||||
sizeof textprompts[num]->page[pagenum].nexttag,
|
||||
va("Text prompt %d, page %d: nexttag", num + 1, pagenum + 1));
|
||||
}
|
||||
else if (fastcmp(word, "TIMETONEXT"))
|
||||
textprompts[num]->page[pagenum].timetonext = get_number(word2);
|
||||
else
|
||||
deh_warning("PromptPage %d: unknown word '%s'", num, word);
|
||||
deh_warning("Text prompt %d, page %d: unknown word '%s'", num + 1, pagenum + 1, word);
|
||||
}
|
||||
} while (!myfeof(f)); // finish when the line is empty
|
||||
|
||||
|
@ -2469,11 +2504,11 @@ void readtextprompt(MYFILE *f, INT32 num)
|
|||
readtextpromptpage(f, num, value - 1);
|
||||
}
|
||||
else
|
||||
deh_warning("Page number %d out of range (1 - %d)", value, MAX_PAGES);
|
||||
deh_warning("Prompt %d: page number %d out of range (1 - %d)", num + 1, value, MAX_PAGES);
|
||||
|
||||
}
|
||||
else
|
||||
deh_warning("Prompt %d: unknown word '%s', Page <num> expected.", num, word);
|
||||
deh_warning("Prompt %d: unknown word '%s', Page <num> expected.", num + 1, word);
|
||||
}
|
||||
} while (!myfeof(f)); // finish when the line is empty
|
||||
|
||||
|
@ -2522,7 +2557,8 @@ void readmenu(MYFILE *f, INT32 num)
|
|||
|
||||
if (fastcmp(word, "BACKGROUNDNAME"))
|
||||
{
|
||||
strncpy(menupres[num].bgname, word2, 8);
|
||||
deh_strlcpy(menupres[num].bgname, word2,
|
||||
sizeof menupres[num].bgname, va("Menu %d: backgroundname", num));
|
||||
titlechanged = true;
|
||||
}
|
||||
else if (fastcmp(word, "HIDEBACKGROUND"))
|
||||
|
@ -2565,7 +2601,8 @@ void readmenu(MYFILE *f, INT32 num)
|
|||
}
|
||||
else if (fastcmp(word, "TITLEPICSNAME"))
|
||||
{
|
||||
strncpy(menupres[num].ttname, word2, 9);
|
||||
deh_strlcpy(menupres[num].ttname, word2,
|
||||
sizeof menupres[num].ttname, va("Menu %d: titlepicsname", num));
|
||||
titlechanged = true;
|
||||
}
|
||||
else if (fastcmp(word, "TITLEPICSX"))
|
||||
|
@ -2601,8 +2638,8 @@ void readmenu(MYFILE *f, INT32 num)
|
|||
}
|
||||
else if (fastcmp(word, "MUSIC"))
|
||||
{
|
||||
strncpy(menupres[num].musname, word2, 7);
|
||||
menupres[num].musname[6] = 0;
|
||||
deh_strlcpy(menupres[num].musname, word2,
|
||||
sizeof menupres[num].musname, va("Menu %d: music", num));
|
||||
titlechanged = true;
|
||||
}
|
||||
else if (fastcmp(word, "MUSICTRACK"))
|
||||
|
@ -2791,7 +2828,7 @@ void readframe(MYFILE *f, INT32 num)
|
|||
size_t z;
|
||||
boolean found = false;
|
||||
size_t actionlen = strlen(word2) + 1;
|
||||
char *actiontocompare = calloc(actionlen, 1);
|
||||
char *actiontocompare = calloc(1, actionlen);
|
||||
|
||||
strcpy(actiontocompare, word2);
|
||||
strupr(actiontocompare);
|
||||
|
@ -3584,22 +3621,20 @@ void readmaincfg(MYFILE *f)
|
|||
if (fastcmp(word, "EXECCFG"))
|
||||
{
|
||||
if (strchr(word2, '.'))
|
||||
COM_BufAddText(va("exec %s\n", word2));
|
||||
COM_ExecFile(word2, COM_LUA, false);
|
||||
else
|
||||
{
|
||||
lumpnum_t lumpnum;
|
||||
char newname[9];
|
||||
|
||||
strncpy(newname, word2, 8);
|
||||
|
||||
newname[8] = '\0';
|
||||
deh_strlcpy(newname, word2, sizeof newname, va("Maincfg: execcfg"));
|
||||
|
||||
lumpnum = W_CheckNumForName(newname);
|
||||
|
||||
if (lumpnum == LUMPERROR || W_LumpLength(lumpnum) == 0)
|
||||
CONS_Debug(DBG_SETUP, "SOC Error: script lump %s not found/not valid.\n", newname);
|
||||
else
|
||||
COM_BufInsertText(W_CacheLumpNum(lumpnum, PU_CACHE));
|
||||
COM_BufInsertTextEx(W_CacheLumpNum(lumpnum, PU_CACHE), COM_LUA);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3800,7 +3835,7 @@ void readmaincfg(MYFILE *f)
|
|||
}
|
||||
else if (fastcmp(word, "TITLEPICSNAME"))
|
||||
{
|
||||
strncpy(ttname, word2, sizeof(ttname)-1);
|
||||
deh_strlcpy(ttname, word2, sizeof ttname, va("Maincfg: titlepicsname"));
|
||||
titlechanged = true;
|
||||
}
|
||||
else if (fastcmp(word, "TITLEPICSX"))
|
||||
|
@ -3910,7 +3945,7 @@ void readmaincfg(MYFILE *f)
|
|||
}
|
||||
else if (fastcmp(word, "CUSTOMVERSION"))
|
||||
{
|
||||
strlcpy(customversionstring, word2, sizeof (customversionstring));
|
||||
deh_strlcpy(customversionstring, word2, sizeof customversionstring, va("Maincfg: customversion"));
|
||||
//titlechanged = true;
|
||||
}
|
||||
else if (fastcmp(word, "BOOTMAP"))
|
||||
|
@ -3925,6 +3960,7 @@ void readmaincfg(MYFILE *f)
|
|||
value = get_number(word2);
|
||||
|
||||
bootmap = (INT16)value;
|
||||
bootmapchanged = true;
|
||||
//titlechanged = true;
|
||||
}
|
||||
else if (fastcmp(word, "STARTCHAR"))
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -1081,11 +1081,11 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
|
|||
"S_FANG_FIRE1",
|
||||
"S_FANG_FIRE2",
|
||||
"S_FANG_FIRE3",
|
||||
"S_FANG_FIRE4",
|
||||
"S_FANG_FIREREPEAT",
|
||||
"S_FANG_LOBSHOT0",
|
||||
"S_FANG_LOBSHOT1",
|
||||
"S_FANG_LOBSHOT2",
|
||||
"S_FANG_LOBSHOT3",
|
||||
"S_FANG_WAIT1",
|
||||
"S_FANG_WAIT2",
|
||||
"S_FANG_WALLHIT",
|
||||
|
@ -1107,6 +1107,7 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
|
|||
"S_FANG_PINCHLOBSHOT2",
|
||||
"S_FANG_PINCHLOBSHOT3",
|
||||
"S_FANG_PINCHLOBSHOT4",
|
||||
"S_FANG_PINCHLOBSHOT5",
|
||||
"S_FANG_DIE1",
|
||||
"S_FANG_DIE2",
|
||||
"S_FANG_DIE3",
|
||||
|
@ -2245,6 +2246,10 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
|
|||
"S_LAMPPOST2", // with snow
|
||||
"S_HANGSTAR",
|
||||
"S_MISTLETOE",
|
||||
"S_SSZTREE",
|
||||
"S_SSZTREE_BRANCH",
|
||||
"S_SSZTREE2",
|
||||
"S_SSZTREE2_BRANCH",
|
||||
// Xmas GFZ bushes
|
||||
"S_XMASBLUEBERRYBUSH",
|
||||
"S_XMASBERRYBUSH",
|
||||
|
@ -2252,11 +2257,9 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
|
|||
// FHZ
|
||||
"S_FHZICE1",
|
||||
"S_FHZICE2",
|
||||
"S_ROSY_IDLE1",
|
||||
"S_ROSY_IDLE2",
|
||||
"S_ROSY_IDLE3",
|
||||
"S_ROSY_IDLE4",
|
||||
"S_ROSY_IDLE",
|
||||
"S_ROSY_JUMP",
|
||||
"S_ROSY_FALL",
|
||||
"S_ROSY_WALK",
|
||||
"S_ROSY_HUG",
|
||||
"S_ROSY_PAIN",
|
||||
|
@ -2365,6 +2368,9 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
|
|||
"S_DBALL5",
|
||||
"S_DBALL6",
|
||||
"S_EGGSTATUE2",
|
||||
"S_GINE",
|
||||
"S_PPAL",
|
||||
"S_PPEL",
|
||||
|
||||
// Shield Orb
|
||||
"S_ARMA1",
|
||||
|
@ -3249,6 +3255,7 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
|
|||
"S_MARIOBUSH2",
|
||||
"S_TOAD",
|
||||
|
||||
|
||||
// Nights-specific stuff
|
||||
"S_NIGHTSDRONE_MAN1",
|
||||
"S_NIGHTSDRONE_MAN2",
|
||||
|
@ -3552,6 +3559,12 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
|
|||
"S_YELLOWBRICKDEBRIS",
|
||||
|
||||
"S_NAMECHECK",
|
||||
|
||||
// LJ Knuckles
|
||||
"S_OLDK_STND",
|
||||
"S_OLDK_DIE0",
|
||||
"S_OLDK_DIE1",
|
||||
"S_OLDK_DIE2",
|
||||
};
|
||||
|
||||
// RegEx to generate this from info.h: ^\tMT_([^,]+), --> \t"MT_\1",
|
||||
|
@ -4023,6 +4036,10 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t
|
|||
"MT_LAMPPOST2", // with snow
|
||||
"MT_HANGSTAR",
|
||||
"MT_MISTLETOE",
|
||||
"MT_SSZTREE",
|
||||
"MT_SSZTREE_BRANCH",
|
||||
"MT_SSZTREE2",
|
||||
"MT_SSZTREE2_BRANCH",
|
||||
// Xmas GFZ bushes
|
||||
"MT_XMASBLUEBERRYBUSH",
|
||||
"MT_XMASBERRYBUSH",
|
||||
|
@ -4102,6 +4119,9 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t
|
|||
// Misc scenery
|
||||
"MT_DBALL",
|
||||
"MT_EGGSTATUE2",
|
||||
"MT_GINE",
|
||||
"MT_PPAL",
|
||||
"MT_PPEL",
|
||||
|
||||
// Powerup Indicators
|
||||
"MT_ELEMENTAL_ORB", // Elemental shield mobj
|
||||
|
@ -4329,6 +4349,8 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t
|
|||
|
||||
"MT_NAMECHECK",
|
||||
"MT_RAY",
|
||||
|
||||
"MT_OLDK",
|
||||
};
|
||||
|
||||
const char *const MOBJFLAG_LIST[] = {
|
||||
|
@ -4483,6 +4505,8 @@ const char *const PLAYERFLAG_LIST[] = {
|
|||
"CANCARRY", // Can carry?
|
||||
"FINISHED",
|
||||
|
||||
"SHIELDDOWN", // Shield has been pressed.
|
||||
|
||||
NULL // stop loop here.
|
||||
};
|
||||
|
||||
|
@ -5234,6 +5258,7 @@ struct int_const_s const INT_CONST[] = {
|
|||
{"SF_MARIODAMAGE",SF_MARIODAMAGE},
|
||||
{"SF_MACHINE",SF_MACHINE},
|
||||
{"SF_DASHMODE",SF_DASHMODE},
|
||||
{"SF_FASTWAIT",SF_FASTWAIT},
|
||||
{"SF_FASTEDGE",SF_FASTEDGE},
|
||||
{"SF_MULTIABILITY",SF_MULTIABILITY},
|
||||
{"SF_NONIGHTSROTATION",SF_NONIGHTSROTATION},
|
||||
|
@ -5582,8 +5607,7 @@ struct int_const_s const INT_CONST[] = {
|
|||
{"ROTAXIS_Z",ROTAXIS_Z},
|
||||
|
||||
// Buttons (ticcmd_t)
|
||||
{"BT_WEAPONMASK",BT_WEAPONMASK}, //our first three bits.
|
||||
{"BT_SHIELD",BT_SHIELD},
|
||||
{"BT_WEAPONMASK",BT_WEAPONMASK}, //our first four bits.
|
||||
{"BT_WEAPONNEXT",BT_WEAPONNEXT},
|
||||
{"BT_WEAPONPREV",BT_WEAPONPREV},
|
||||
{"BT_ATTACK",BT_ATTACK}, // shoot rings
|
||||
|
@ -5742,7 +5766,6 @@ struct int_const_s const INT_CONST[] = {
|
|||
{"JA_DIGITAL",JA_DIGITAL},
|
||||
{"JA_JUMP",JA_JUMP},
|
||||
{"JA_SPIN",JA_SPIN},
|
||||
{"JA_SHIELD",JA_SHIELD},
|
||||
{"JA_FIRE",JA_FIRE},
|
||||
{"JA_FIRENORMAL",JA_FIRENORMAL},
|
||||
{"JOYAXISRANGE",JOYAXISRANGE},
|
||||
|
@ -5764,7 +5787,9 @@ struct int_const_s const INT_CONST[] = {
|
|||
{"GC_WEPSLOT5",GC_WEPSLOT5},
|
||||
{"GC_WEPSLOT6",GC_WEPSLOT6},
|
||||
{"GC_WEPSLOT7",GC_WEPSLOT7},
|
||||
{"GC_SHIELD",GC_SHIELD},
|
||||
{"GC_WEPSLOT8",GC_WEPSLOT8},
|
||||
{"GC_WEPSLOT9",GC_WEPSLOT9},
|
||||
{"GC_WEPSLOT10",GC_WEPSLOT10},
|
||||
{"GC_FIRE",GC_FIRE},
|
||||
{"GC_FIRENORMAL",GC_FIRENORMAL},
|
||||
{"GC_TOSSFLAG",GC_TOSSFLAG},
|
||||
|
@ -5804,6 +5829,10 @@ struct int_const_s const INT_CONST[] = {
|
|||
{"MB_SCROLLUP",MB_SCROLLUP},
|
||||
{"MB_SCROLLDOWN",MB_SCROLLDOWN},
|
||||
|
||||
// screen.h constants
|
||||
{"BASEVIDWIDTH",BASEVIDWIDTH},
|
||||
{"BASEVIDHEIGHT",BASEVIDHEIGHT},
|
||||
|
||||
{NULL,0}
|
||||
};
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -20,6 +20,7 @@ boolean deh_loaded = false;
|
|||
boolean gamedataadded = false;
|
||||
boolean titlechanged = false;
|
||||
boolean introchanged = false;
|
||||
boolean bootmapchanged = false;
|
||||
|
||||
static int dbg_line;
|
||||
static INT32 deh_num_warning = 0;
|
||||
|
@ -192,11 +193,14 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
|
|||
INT32 i;
|
||||
|
||||
if (!deh_loaded)
|
||||
{
|
||||
initfreeslots();
|
||||
deh_loaded = true;
|
||||
}
|
||||
|
||||
deh_num_warning = 0;
|
||||
|
||||
gamedataadded = titlechanged = introchanged = false;
|
||||
gamedataadded = titlechanged = introchanged = bootmapchanged = false;
|
||||
|
||||
// it doesn't test the version of SRB2 and version of dehacked file
|
||||
dbg_line = -1; // start at -1 so the first line is 0.
|
||||
|
@ -587,7 +591,12 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
|
|||
|
||||
if (gamestate == GS_TITLESCREEN)
|
||||
{
|
||||
if (introchanged)
|
||||
if (bootmapchanged && bootmap)
|
||||
{
|
||||
menuactive = false;
|
||||
D_MapChange(bootmap, gametype, ultimatemode, true, 0, false, false);
|
||||
}
|
||||
else if (introchanged)
|
||||
{
|
||||
menuactive = false;
|
||||
I_UpdateMouseGrab();
|
||||
|
@ -605,14 +614,10 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
|
|||
if (deh_num_warning)
|
||||
{
|
||||
CONS_Printf(M_GetText("%d warning%s in the SOC lump\n"), deh_num_warning, deh_num_warning == 1 ? "" : "s");
|
||||
if (devparm) {
|
||||
if (devparm)
|
||||
I_Error("%s%s",va(M_GetText("%d warning%s in the SOC lump\n"), deh_num_warning, deh_num_warning == 1 ? "" : "s"), M_GetText("See log.txt for details.\n"));
|
||||
//while (!I_GetKey())
|
||||
//I_OsPolling();
|
||||
}
|
||||
}
|
||||
|
||||
deh_loaded = true;
|
||||
Z_Free(s);
|
||||
}
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ extern boolean deh_loaded;
|
|||
extern boolean gamedataadded;
|
||||
extern boolean titlechanged;
|
||||
extern boolean introchanged;
|
||||
extern boolean bootmapchanged;
|
||||
|
||||
#define MAX_ACTION_RECURSION 30
|
||||
extern const char *luaactions[MAX_ACTION_RECURSION];
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -168,7 +168,7 @@ extern char logfilename[1024];
|
|||
|
||||
// Does this version require an added patch file?
|
||||
// Comment or uncomment this as necessary.
|
||||
#define USE_PATCH_DTA
|
||||
//#define USE_PATCH_DTA
|
||||
|
||||
// Enforce a limit of loaded WAD files.
|
||||
//#define ENFORCE_WAD_LIMIT
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2025 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -209,19 +209,19 @@ typedef struct
|
|||
UINT8 picmode; // sequence mode after displaying last pic, 0 = persist, 1 = loop, 2 = destroy
|
||||
UINT8 pictoloop; // if picmode == loop, which pic to loop to?
|
||||
UINT8 pictostart; // initial pic number to show
|
||||
char picname[MAX_PROMPT_PICS][8];
|
||||
char picname[MAX_PROMPT_PICS][8+1];
|
||||
UINT8 pichires[MAX_PROMPT_PICS];
|
||||
UINT16 xcoord[MAX_PROMPT_PICS]; // gfx
|
||||
UINT16 ycoord[MAX_PROMPT_PICS]; // gfx
|
||||
UINT16 picduration[MAX_PROMPT_PICS];
|
||||
|
||||
char musswitch[7];
|
||||
char musswitch[6+1];
|
||||
UINT16 musswitchflags;
|
||||
UINT8 musicloop;
|
||||
|
||||
char tag[33]; // page tag
|
||||
char name[34]; // narrator name, extra char for color
|
||||
char iconname[8]; // narrator icon lump
|
||||
char tag[32+1]; // page tag
|
||||
char name[32+2]; // narrator name, extra char for color
|
||||
char iconname[8+1]; // narrator icon lump
|
||||
boolean rightside; // narrator side, false = left, true = right
|
||||
boolean iconflip; // narrator flip icon horizontally
|
||||
UINT8 hidehud; // hide hud, 0 = show all, 1 = hide depending on prompt position (top/bottom), 2 = hide all
|
||||
|
@ -233,7 +233,7 @@ typedef struct
|
|||
sfxenum_t textsfx; // sfx_ id for printing text
|
||||
UINT8 nextprompt; // next prompt to jump to, one-based. 0 = current prompt
|
||||
UINT8 nextpage; // next page to jump to, one-based. 0 = next page within prompt->numpages
|
||||
char nexttag[33]; // next tag to jump to. If set, this overrides nextprompt and nextpage.
|
||||
char nexttag[32+1]; // next tag to jump to. If set, this overrides nextprompt and nextpage.
|
||||
INT32 timetonext; // time in tics to jump to next page automatically. 0 = don't jump automatically
|
||||
char *text;
|
||||
} textpage_t;
|
||||
|
@ -287,8 +287,8 @@ typedef struct
|
|||
// (This is not ifdeffed so the map header structure can stay identical, just in case.)
|
||||
typedef struct
|
||||
{
|
||||
char option[32]; // 31 usable characters
|
||||
char value[256]; // 255 usable characters. If this seriously isn't enough then wtf.
|
||||
char option[31+1]; // 31 usable characters
|
||||
char value[255+1]; // 255 usable characters. If this seriously isn't enough then wtf.
|
||||
} customoption_t;
|
||||
|
||||
/** Map header information.
|
||||
|
@ -303,7 +303,7 @@ typedef struct
|
|||
INT16 nextlevel; ///< Map number of next level, or 1100-1102 to end.
|
||||
INT16 marathonnext; ///< See nextlevel, but for Marathon mode. Necessary to support hub worlds ala SUGOI.
|
||||
char keywords[32+1]; ///< Keywords separated by space to search for. 32 characters.
|
||||
char musname[7]; ///< Music track to play. "" for no music.
|
||||
char musname[6+1]; ///< Music track to play. "" for no music.
|
||||
UINT16 mustrack; ///< Subsong to play. Only really relevant for music modules and specific formats supported by GME. 0 to ignore.
|
||||
UINT32 muspos; ///< Music position to jump to.
|
||||
char forcecharacter[16+1]; ///< (SKINNAMESIZE+1) Skin to switch to or "" to disable.
|
||||
|
@ -330,7 +330,7 @@ typedef struct
|
|||
UINT16 levelflags; ///< LF_flags: merged booleans into one UINT16 for space, see below
|
||||
UINT8 menuflags; ///< LF2_flags: options that affect record attack / nights mode menus
|
||||
|
||||
char selectheading[22]; ///< Level select heading. Allows for controllable grouping.
|
||||
char selectheading[21+1]; ///< Level select heading. Allows for controllable grouping.
|
||||
UINT16 startrings; ///< Number of rings players start with.
|
||||
INT32 sstimer; ///< Timer for special stages.
|
||||
UINT32 ssspheres; ///< Sphere requirement in special stages.
|
||||
|
@ -352,9 +352,9 @@ typedef struct
|
|||
|
||||
// Music stuff.
|
||||
UINT32 musinterfadeout; ///< Fade out level music on intermission screen in milliseconds
|
||||
char musintername[7]; ///< Intermission screen music.
|
||||
char musintername[6+1]; ///< Intermission screen music.
|
||||
|
||||
char muspostbossname[7]; ///< Post-bossdeath music.
|
||||
char muspostbossname[6+1]; ///< Post-bossdeath music.
|
||||
UINT16 muspostbosstrack; ///< Post-bossdeath track.
|
||||
UINT32 muspostbosspos; ///< Post-bossdeath position
|
||||
UINT32 muspostbossfadein; ///< Post-bossdeath fade-in milliseconds.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -211,5 +211,15 @@ const char *I_GetSysName(void)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void I_SetTextInputMode(boolean active)
|
||||
{
|
||||
(void)active;
|
||||
}
|
||||
|
||||
boolean I_GetTextInputMode(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#include "../sdl/dosstr.c"
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -1065,12 +1065,12 @@ static const char *credits[] = {
|
|||
"Julio \"Chaos Zero 64\" Guir",
|
||||
"\"Hanicef\"",
|
||||
"\"Hannu_Hanhi\"", // For many OpenGL performance improvements!
|
||||
"\"hazepastel\"",
|
||||
"Kepa \"Nev3r\" Iceta",
|
||||
"Thomas \"Shadow Hog\" Igoe",
|
||||
"Iestyn \"Monster Iestyn\" Jealous",
|
||||
"\"Kaito Sinclaire\"",
|
||||
"\"Kalaron\"", // Coded some of Sryder13's collection of OpenGL fixes, especially fog
|
||||
"\"katsy\"",
|
||||
"Ronald \"Furyhunter\" Kinard", // The SDL2 port
|
||||
"\"Lat'\"", // SRB2-CHAT, the chat window from Kart
|
||||
"\"LZA\"",
|
||||
|
@ -1080,6 +1080,7 @@ static const char *credits[] = {
|
|||
"Louis-Antoine \"LJ Sonic\" de Moulins", // de Rochefort doesn't quite fit on the screen sorry lol
|
||||
"John \"JTE\" Muniz",
|
||||
"Colin \"Sonict\" Pfaff",
|
||||
"\"Radicalicious\"",
|
||||
"James \"james\" Robert Roman",
|
||||
"Sean \"Sryder13\" Ryder",
|
||||
"Ehab \"Wolfy\" Saeed",
|
||||
|
@ -1103,7 +1104,8 @@ static const char *credits[] = {
|
|||
"\"ChrispyPixels\"",
|
||||
"Paul \"Boinciel\" Clempson",
|
||||
"Sally \"TehRealSalt\" Cochenour",
|
||||
"\"Dave Lite\"",
|
||||
"\"DaJumpJump\"", // New Ringslinger graphics (2.2.14)
|
||||
"\"DeltaSanic\"",
|
||||
"Desmond \"Blade\" DesJardins",
|
||||
"Sherman \"CoatRack\" DesJardins",
|
||||
"\"DirkTheHusky\"",
|
||||
|
@ -1119,6 +1121,7 @@ static const char *credits[] = {
|
|||
"Alice \"Alacroix\" de Lemos",
|
||||
"Logan \"Hyperchaotix\" McCloud",
|
||||
"Alexander \"DrTapeworm\" Moench-Ford",
|
||||
"\"orbitalviolet\"", // summit showdown hehehehe (aka Evertone)
|
||||
"Andrew \"Senku Niola\" Moran",
|
||||
"\"MotorRoach\"",
|
||||
"Phillip \"TelosTurntable\" Robinson",
|
||||
|
@ -1127,6 +1130,7 @@ static const char *credits[] = {
|
|||
"David \"Instant Sonic\" Spencer Jr.",
|
||||
"\"SSNTails\"",
|
||||
"Daniel \"Inazuma\" Trinh",
|
||||
"Samuel \"Spectorious\" Tuttle",
|
||||
"\"VelocitOni\"",
|
||||
"Jarrett \"JEV3\" Voight",
|
||||
"",
|
||||
|
@ -1135,6 +1139,7 @@ static const char *credits[] = {
|
|||
"Victor \"VAdaPEGA\" Ara\x1Fjo", // Araújo
|
||||
"Malcolm \"RedXVI\" Brown",
|
||||
"Dave \"DemonTomatoDave\" Bulmer",
|
||||
"Dan Cidoni", // aka Krabs
|
||||
"Paul \"Boinciel\" Clempson",
|
||||
"\"Cyan Helkaraxe\"",
|
||||
"Claire \"clairebun\" Ellis",
|
||||
|
@ -1153,24 +1158,30 @@ static const char *credits[] = {
|
|||
"Colette \"fickleheart\" Bordelon",
|
||||
"Hank \"FuriousFox\" Brannock",
|
||||
"Matthew \"Fawfulfan\" Chapman",
|
||||
"Dan Cidoni", // aka Krabs
|
||||
"Paul \"Boinciel\" Clempson",
|
||||
"Sally \"TehRealSalt\" Cochenour",
|
||||
"Desmond \"Blade\" DesJardins",
|
||||
"Sherman \"CoatRack\" DesJardins",
|
||||
"Ben \"Mystic\" Geyer",
|
||||
"Nathan \"Jazz\" Giroux",
|
||||
"\"GomaTheMascar\"",
|
||||
"Vivian \"toaster\" Grannell",
|
||||
"James \"SeventhSentinel\" Hall",
|
||||
"Kepa \"Nev3r\" Iceta",
|
||||
"Thomas \"Shadow Hog\" Igoe",
|
||||
"Mujamel \"MK\" Khan",
|
||||
"\"Kaito Sinclaire\"",
|
||||
"Alexander \"DrTapeworm\" Moench-Ford",
|
||||
"\"Radicalicious\"",
|
||||
"\"Revan\"",
|
||||
"Anna \"QueenDelta\" Sandlin",
|
||||
"Wessel \"sphere\" Smit",
|
||||
"\"SSNTails\"",
|
||||
"Aaron \"Othius\" Stojkov",
|
||||
"Rob Tisdell",
|
||||
"\"Torgo\"",
|
||||
"Samuel \"Spectorious\" Tuttle",
|
||||
"Jarrett \"JEV3\" Voight",
|
||||
"Johnny \"Sonikku\" Wallbank",
|
||||
"Marco \"mazmazz\" Zafra",
|
||||
|
@ -2336,7 +2347,7 @@ void F_SkyScroll(const char *patchname)
|
|||
}
|
||||
|
||||
#define LOADTTGFX(arr, name, maxf) \
|
||||
lumpnum = W_CheckNumForName(name); \
|
||||
lumpnum = W_CheckNumForPatchName(name); \
|
||||
if (lumpnum != LUMPERROR) \
|
||||
{ \
|
||||
arr[0] = W_CachePatchName(name, PU_PATCH_LOWPRIORITY); \
|
||||
|
@ -2350,7 +2361,7 @@ else if (strlen(name) <= 6) \
|
|||
{ \
|
||||
sprintf(&lumpname[cnt], "%.2hu", (UINT16)(i+1)); \
|
||||
lumpname[8] = 0; \
|
||||
lumpnum = W_CheckNumForName(lumpname); \
|
||||
lumpnum = W_CheckNumForPatchName(lumpname); \
|
||||
if (lumpnum != LUMPERROR) \
|
||||
arr[i] = W_CachePatchName(lumpname, PU_PATCH_LOWPRIORITY); \
|
||||
else \
|
||||
|
@ -3435,7 +3446,7 @@ void F_TitleScreenTicker(boolean run)
|
|||
{
|
||||
for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed)
|
||||
if (th->removing)
|
||||
continue;
|
||||
|
||||
mo2 = (mobj_t *)th;
|
||||
|
@ -3645,7 +3656,7 @@ static void F_DrawContinueCharacter(INT32 dx, INT32 dy, UINT8 n)
|
|||
(
|
||||
HUD_HOOK(continue), luahuddrawlist_continue[n], contPlayers[n],
|
||||
dx, dy, contskins[n]->highresscale,
|
||||
(INT32)(&contskins[n] - skins), cont_spr2[n][0], cont_spr2[n][1], cont_spr2[n][2] + 1, contColors[n], // add 1 to rotation to convert internal angle numbers (0-7) to WAD editor angle numbers (1-8)
|
||||
(INT32)(contskins[n]->skinnum), cont_spr2[n][0], cont_spr2[n][1], cont_spr2[n][2] + 1, contColors[n], // add 1 to rotation to convert internal angle numbers (0-7) to WAD editor angle numbers (1-8)
|
||||
imcontinuing ? continuetime : timetonext, imcontinuing
|
||||
);
|
||||
}
|
||||
|
@ -3711,7 +3722,7 @@ void F_ContinueDrawer(void)
|
|||
else if (ncontinues > 10)
|
||||
{
|
||||
if (!(continuetime & 1) || continuetime > 17)
|
||||
V_DrawContinueIcon(x, 68, 0, (INT32)(&contskins[0] - skins), contColors[0]);
|
||||
V_DrawContinueIcon(x, 68, 0, contskins[0]->skinnum, contColors[0]);
|
||||
V_DrawScaledPatch(x+12, 66, 0, stlivex);
|
||||
V_DrawRightAlignedString(x+38, 64, 0,
|
||||
va("%d",(imcontinuing ? ncontinues-1 : ncontinues)));
|
||||
|
@ -3725,7 +3736,7 @@ void F_ContinueDrawer(void)
|
|||
{
|
||||
if (i == (ncontinues/2) && ((continuetime & 1) || continuetime > 17))
|
||||
continue;
|
||||
V_DrawContinueIcon(x - (i*30), 68, 0, (INT32)(&contskins[0] - skins), contColors[0]);
|
||||
V_DrawContinueIcon(x - (i*30), 68, 0, contskins[0]->skinnum, contColors[0]);
|
||||
}
|
||||
x = BASEVIDWIDTH>>1;
|
||||
}
|
||||
|
@ -4116,7 +4127,7 @@ static void F_GetPageTextGeometry(UINT8 *pagelines, boolean *rightside, INT32 *b
|
|||
// reuse:
|
||||
// cutnum -> promptnum
|
||||
// scenenum -> pagenum
|
||||
lumpnum_t iconlump = W_CheckNumForName(textprompts[cutnum]->page[scenenum].iconname);
|
||||
lumpnum_t iconlump = W_CheckNumForPatchName(textprompts[cutnum]->page[scenenum].iconname);
|
||||
|
||||
*pagelines = textprompts[cutnum]->page[scenenum].lines ? textprompts[cutnum]->page[scenenum].lines : 4;
|
||||
*rightside = (iconlump != LUMPERROR && textprompts[cutnum]->page[scenenum].rightside);
|
||||
|
@ -4508,7 +4519,7 @@ void F_TextPromptDrawer(void)
|
|||
if (!promptactive)
|
||||
return;
|
||||
|
||||
iconlump = W_CheckNumForName(textprompts[cutnum]->page[scenenum].iconname);
|
||||
iconlump = W_CheckNumForPatchName(textprompts[cutnum]->page[scenenum].iconname);
|
||||
F_GetPageTextGeometry(&pagelines, &rightside, &boxh, &texth, &texty, &namey, &chevrony, &textx, &textr);
|
||||
|
||||
// Draw gfx first
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -444,12 +444,11 @@ filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *want
|
|||
strcpy(&searchpath[searchpathindex[depthleft]],dent->d_name);
|
||||
|
||||
#if defined(__linux__) || defined(__FreeBSD__)
|
||||
if (dent->d_type == DT_UNKNOWN)
|
||||
if (lstat(searchpath,&fsstat) == 0 && S_ISDIR(fsstat.st_mode))
|
||||
if (dent->d_type == DT_UNKNOWN || dent->d_type == DT_LNK)
|
||||
if (stat(searchpath,&fsstat) == 0 && S_ISDIR(fsstat.st_mode))
|
||||
dent->d_type = DT_DIR;
|
||||
|
||||
// Linux and FreeBSD has a special field for file type on dirent, so use that to speed up lookups.
|
||||
// FIXME: should we also follow symlinks?
|
||||
if (dent->d_type == DT_DIR && depthleft)
|
||||
#else
|
||||
if (stat(searchpath,&fsstat) < 0) // do we want to follow symlinks? if not: change it to lstat
|
||||
|
@ -699,6 +698,15 @@ static void initdirpath(char *dirpath, size_t *dirpathindex, int depthleft)
|
|||
dirpathindex[depthleft]--;
|
||||
}
|
||||
|
||||
//sortdir by name?
|
||||
static int lumpnamecompare(const void *A, const void *B)
|
||||
{
|
||||
const lumpinfo_t *pA = A;
|
||||
const lumpinfo_t *pB = B;
|
||||
return strcmp((pA->fullname), (pB->fullname));
|
||||
|
||||
}
|
||||
|
||||
lumpinfo_t *getdirectoryfiles(const char *path, UINT16 *nlmp, UINT16 *nfolders)
|
||||
{
|
||||
DIR **dirhandle;
|
||||
|
@ -889,6 +897,9 @@ lumpinfo_t *getdirectoryfiles(const char *path, UINT16 *nlmp, UINT16 *nfolders)
|
|||
free(dirpathindex);
|
||||
free(dirhandle);
|
||||
|
||||
//sort files and directories
|
||||
qsort (lumpinfo, numlumps, sizeof(lumpinfo_t), lumpnamecompare);
|
||||
|
||||
(*nlmp) = numlumps;
|
||||
return lumpinfo;
|
||||
}
|
||||
|
@ -1179,7 +1190,7 @@ boolean preparefilemenu(boolean samedepth)
|
|||
size_t i;
|
||||
|
||||
if (filenamebuf == NULL)
|
||||
filenamebuf = calloc(sizeof(char) * MAX_WADPATH, numwadfiles);
|
||||
filenamebuf = calloc(numwadfiles, sizeof(char) * MAX_WADPATH);
|
||||
|
||||
for (i = 0; i < numwadfiles; i++)
|
||||
{
|
||||
|
|
55
src/g_demo.c
55
src/g_demo.c
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -67,6 +67,8 @@ static UINT8 *metalbuffer = NULL;
|
|||
static UINT8 *metal_p;
|
||||
static UINT16 metalversion;
|
||||
|
||||
consvar_t cv_resyncdemo = CVAR_INIT("resyncdemo", "On", 0, CV_OnOff, NULL);
|
||||
|
||||
// extra data stuff (events registered this frame while recording)
|
||||
static struct {
|
||||
UINT8 flags; // EZT flags
|
||||
|
@ -98,7 +100,7 @@ demoghost *ghosts = NULL;
|
|||
// DEMO RECORDING
|
||||
//
|
||||
|
||||
#define DEMOVERSION 0x0012
|
||||
#define DEMOVERSION 0x0011
|
||||
#define DEMOHEADER "\xF0" "SRB2Replay" "\x0F"
|
||||
|
||||
#define DF_GHOST 0x01 // This demo contains ghost data too!
|
||||
|
@ -183,11 +185,7 @@ void G_ReadDemoTiccmd(ticcmd_t *cmd, INT32 playernum)
|
|||
if (ziptic & ZT_ANGLE)
|
||||
oldcmd.angleturn = READINT16(demo_p);
|
||||
if (ziptic & ZT_BUTTONS)
|
||||
{
|
||||
oldcmd.buttons = (oldcmd.buttons & (BT_CAMLEFT|BT_CAMRIGHT)) | (READUINT16(demo_p) & ~(BT_CAMLEFT|BT_CAMRIGHT));
|
||||
if (demoversion < 0x0012 && oldcmd.buttons & BT_SPIN)
|
||||
oldcmd.buttons |= BT_SHIELD; // Copy BT_SPIN to BT_SHIELD for pre-Shield-button demos
|
||||
}
|
||||
if (ziptic & ZT_AIMING)
|
||||
oldcmd.aiming = READINT16(demo_p);
|
||||
if (ziptic & ZT_LATENCY)
|
||||
|
@ -549,6 +547,9 @@ void G_ConsGhostTic(void)
|
|||
|
||||
testmo = players[0].mo;
|
||||
|
||||
if (P_MobjWasRemoved(testmo))
|
||||
return; // No valid mobj exists, probably because of unexpected quit
|
||||
|
||||
// Grab ghost data.
|
||||
ziptic = READUINT8(demo_p);
|
||||
if (ziptic & GZT_XYZ)
|
||||
|
@ -609,7 +610,7 @@ void G_ConsGhostTic(void)
|
|||
mobj = NULL;
|
||||
for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed)
|
||||
if (th->removing)
|
||||
continue;
|
||||
mobj = (mobj_t *)th;
|
||||
if (mobj->type == (mobjtype_t)type && mobj->x == x && mobj->y == y && mobj->z == z)
|
||||
|
@ -664,11 +665,14 @@ void G_ConsGhostTic(void)
|
|||
CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced!\n"));
|
||||
demosynced = false;
|
||||
|
||||
P_UnsetThingPosition(testmo);
|
||||
testmo->x = oldghost.x;
|
||||
testmo->y = oldghost.y;
|
||||
P_SetThingPosition(testmo);
|
||||
testmo->z = oldghost.z;
|
||||
if (cv_resyncdemo.value)
|
||||
{
|
||||
P_UnsetThingPosition(testmo);
|
||||
testmo->x = oldghost.x;
|
||||
testmo->y = oldghost.y;
|
||||
P_SetThingPosition(testmo);
|
||||
testmo->z = oldghost.z;
|
||||
}
|
||||
}
|
||||
|
||||
if (*demo_p == DEMOMARKER)
|
||||
|
@ -1446,6 +1450,7 @@ void G_BeginRecording(void)
|
|||
char *filename;
|
||||
UINT16 totalfiles;
|
||||
UINT8 *m;
|
||||
save_t savebuffer;
|
||||
|
||||
if (demo_p)
|
||||
return;
|
||||
|
@ -1595,7 +1600,11 @@ void G_BeginRecording(void)
|
|||
}
|
||||
|
||||
// Save netvar data
|
||||
CV_SaveDemoVars(&demo_p);
|
||||
savebuffer.buf = demo_p;
|
||||
savebuffer.size = demoend - demo_p;
|
||||
savebuffer.pos = 0;
|
||||
CV_SaveDemoVars(&savebuffer);
|
||||
demo_p = &savebuffer.buf[savebuffer.pos];
|
||||
|
||||
memset(&oldcmd,0,sizeof(oldcmd));
|
||||
memset(&oldghost,0,sizeof(oldghost));
|
||||
|
@ -2228,10 +2237,24 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
// net var data
|
||||
#ifdef OLD22DEMOCOMPAT
|
||||
if (demoversion < 0x000d)
|
||||
CV_LoadOldDemoVars(&demo_p);
|
||||
{
|
||||
save_t savebuffer;
|
||||
savebuffer.buf = demo_p;
|
||||
savebuffer.size = demoend - demo_p;
|
||||
savebuffer.pos = 0;
|
||||
CV_LoadOldDemoVars(&savebuffer);
|
||||
demo_p = &savebuffer.buf[savebuffer.pos];
|
||||
}
|
||||
else
|
||||
#endif
|
||||
CV_LoadDemoVars(&demo_p);
|
||||
{
|
||||
save_t savebuffer;
|
||||
savebuffer.buf = demo_p;
|
||||
savebuffer.size = demoend - demo_p;
|
||||
savebuffer.pos = 0;
|
||||
CV_LoadDemoVars(&savebuffer);
|
||||
demo_p = &savebuffer.buf[savebuffer.pos];
|
||||
}
|
||||
|
||||
// Sigh ... it's an empty demo.
|
||||
if (*demo_p == DEMOMARKER)
|
||||
|
@ -2669,7 +2692,7 @@ void G_DoPlayMetal(void)
|
|||
// find metal sonic
|
||||
for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed)
|
||||
if (th->removing)
|
||||
continue;
|
||||
|
||||
mo = (mobj_t *)th;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -35,6 +35,7 @@ typedef enum
|
|||
} demo_file_override_e;
|
||||
|
||||
extern demo_file_override_e demofileoverride;
|
||||
extern consvar_t cv_resyncdemo;
|
||||
|
||||
// Quit after playing a demo from cmdline.
|
||||
extern boolean singledemo;
|
||||
|
|
340
src/g_game.c
340
src/g_game.c
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -256,8 +256,6 @@ boolean precache = true; // if true, load all graphics at start
|
|||
|
||||
INT16 prevmap, nextmap;
|
||||
|
||||
static UINT8 *savebuffer;
|
||||
|
||||
// Analog Control
|
||||
static void UserAnalog_OnChange(void);
|
||||
static void UserAnalog2_OnChange(void);
|
||||
|
@ -403,29 +401,27 @@ consvar_t cv_cam_lockonboss[2] = {
|
|||
CVAR_INIT ("cam2_lockaimassist", "Full", CV_SAVE|CV_ALLOWLUA, lockedassist_cons_t, NULL),
|
||||
};
|
||||
|
||||
consvar_t cv_moveaxis = CVAR_INIT ("joyaxis_move", "Y-Axis", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_sideaxis = CVAR_INIT ("joyaxis_side", "X-Axis", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_lookaxis = CVAR_INIT ("joyaxis_look", "X-Rudder-", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_turnaxis = CVAR_INIT ("joyaxis_turn", "Z-Axis", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_jumpaxis = CVAR_INIT ("joyaxis_jump", "None", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_spinaxis = CVAR_INIT ("joyaxis_spin", "None", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_shieldaxis = CVAR_INIT ("joyaxis_shield", "None", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_fireaxis = CVAR_INIT ("joyaxis_fire", "Z-Rudder", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_firenaxis = CVAR_INIT ("joyaxis_firenormal", "Z-Axis", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_deadzone = CVAR_INIT ("joy_deadzone", "0.125", CV_FLOAT|CV_SAVE, zerotoone_cons_t, NULL);
|
||||
consvar_t cv_digitaldeadzone = CVAR_INIT ("joy_digdeadzone", "0.25", CV_FLOAT|CV_SAVE, zerotoone_cons_t, NULL);
|
||||
consvar_t cv_moveaxis = CVAR_INIT ("joyaxis_move", "Y-Axis", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_sideaxis = CVAR_INIT ("joyaxis_side", "X-Axis", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_lookaxis = CVAR_INIT ("joyaxis_look", "X-Rudder-", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_turnaxis = CVAR_INIT ("joyaxis_turn", "Z-Axis", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_jumpaxis = CVAR_INIT ("joyaxis_jump", "None", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_spinaxis = CVAR_INIT ("joyaxis_spin", "None", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_fireaxis = CVAR_INIT ("joyaxis_fire", "Z-Rudder", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_firenaxis = CVAR_INIT ("joyaxis_firenormal", "Z-Axis", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_deadzone = CVAR_INIT ("joy_deadzone", "0.125", CV_FLOAT|CV_SAVE, zerotoone_cons_t, NULL);
|
||||
consvar_t cv_digitaldeadzone = CVAR_INIT ("joy_digdeadzone", "0.25", CV_FLOAT|CV_SAVE, zerotoone_cons_t, NULL);
|
||||
|
||||
consvar_t cv_moveaxis2 = CVAR_INIT ("joyaxis2_move", "Y-Axis", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_sideaxis2 = CVAR_INIT ("joyaxis2_side", "X-Axis", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_lookaxis2 = CVAR_INIT ("joyaxis2_look", "X-Rudder-", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_turnaxis2 = CVAR_INIT ("joyaxis2_turn", "Z-Axis", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_jumpaxis2 = CVAR_INIT ("joyaxis2_jump", "None", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_spinaxis2 = CVAR_INIT ("joyaxis2_spin", "None", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_shieldaxis2 = CVAR_INIT ("joyaxis2_shield", "None", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_fireaxis2 = CVAR_INIT ("joyaxis2_fire", "Z-Rudder", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_firenaxis2 = CVAR_INIT ("joyaxis2_firenormal", "Z-Axis", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_deadzone2 = CVAR_INIT ("joy_deadzone2", "0.125", CV_FLOAT|CV_SAVE, zerotoone_cons_t, NULL);
|
||||
consvar_t cv_digitaldeadzone2 = CVAR_INIT ("joy_digdeadzone2", "0.25", CV_FLOAT|CV_SAVE, zerotoone_cons_t, NULL);
|
||||
consvar_t cv_moveaxis2 = CVAR_INIT ("joyaxis2_move", "Y-Axis", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_sideaxis2 = CVAR_INIT ("joyaxis2_side", "X-Axis", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_lookaxis2 = CVAR_INIT ("joyaxis2_look", "X-Rudder-", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_turnaxis2 = CVAR_INIT ("joyaxis2_turn", "Z-Axis", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_jumpaxis2 = CVAR_INIT ("joyaxis2_jump", "None", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_spinaxis2 = CVAR_INIT ("joyaxis2_spin", "None", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_fireaxis2 = CVAR_INIT ("joyaxis2_fire", "Z-Rudder", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_firenaxis2 = CVAR_INIT ("joyaxis2_firenormal", "Z-Axis", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_deadzone2 = CVAR_INIT ("joy_deadzone2", "0.125", CV_FLOAT|CV_SAVE, zerotoone_cons_t, NULL);
|
||||
consvar_t cv_digitaldeadzone2 = CVAR_INIT ("joy_digdeadzone2", "0.25", CV_FLOAT|CV_SAVE, zerotoone_cons_t, NULL);
|
||||
|
||||
player_t *seenplayer; // player we're aiming at right now
|
||||
|
||||
|
@ -896,9 +892,6 @@ INT32 JoyAxis(joyaxis_e axissel)
|
|||
case JA_SPIN:
|
||||
axisval = cv_spinaxis.value;
|
||||
break;
|
||||
case JA_SHIELD:
|
||||
axisval = cv_shieldaxis.value;
|
||||
break;
|
||||
case JA_FIRE:
|
||||
axisval = cv_fireaxis.value;
|
||||
break;
|
||||
|
@ -972,9 +965,6 @@ INT32 Joy2Axis(joyaxis_e axissel)
|
|||
case JA_SPIN:
|
||||
axisval = cv_spinaxis2.value;
|
||||
break;
|
||||
case JA_SHIELD:
|
||||
axisval = cv_shieldaxis2.value;
|
||||
break;
|
||||
case JA_FIRE:
|
||||
axisval = cv_fireaxis2.value;
|
||||
break;
|
||||
|
@ -1342,10 +1332,10 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
if (PLAYERINPUTDOWN(ssplayer, GC_WEAPONPREV))
|
||||
cmd->buttons |= BT_WEAPONPREV; // Previous Weapon
|
||||
|
||||
#if NUM_WEAPONS > 7
|
||||
"Add extra inputs to g_input.h/gamecontrols_e, and fix conflicts in d_ticcmd.h/ticcmd_t/buttons"
|
||||
#if NUM_WEAPONS > 10
|
||||
"Add extra inputs to g_input.h/gamecontrols_e"
|
||||
#endif
|
||||
//use the three avaliable bits to determine the weapon.
|
||||
//use the four avaliable bits to determine the weapon.
|
||||
cmd->buttons &= ~BT_WEAPONMASK;
|
||||
for (i = 0; i < NUM_WEAPONS; ++i)
|
||||
if (PLAYERINPUTDOWN(ssplayer, GC_WEPSLOT1 + i))
|
||||
|
@ -1363,15 +1353,9 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
axis = PlayerJoyAxis(ssplayer, JA_FIRENORMAL);
|
||||
if (PLAYERINPUTDOWN(ssplayer, GC_FIRENORMAL) || (usejoystick && axis > 0))
|
||||
cmd->buttons |= BT_FIRENORMAL;
|
||||
|
||||
// Toss flag button
|
||||
|
||||
if (PLAYERINPUTDOWN(ssplayer, GC_TOSSFLAG))
|
||||
cmd->buttons |= BT_TOSSFLAG;
|
||||
|
||||
// Shield button
|
||||
axis = PlayerJoyAxis(ssplayer, JA_SHIELD);
|
||||
if (PLAYERINPUTDOWN(ssplayer, GC_SHIELD) || (usejoystick && axis > 0))
|
||||
cmd->buttons |= BT_SHIELD;
|
||||
|
||||
// Lua scriptable buttons
|
||||
if (PLAYERINPUTDOWN(ssplayer, GC_CUSTOM1))
|
||||
|
@ -1386,6 +1370,13 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
if (PLAYERINPUTDOWN(ssplayer, GC_SPIN) || (usejoystick && axis > 0))
|
||||
cmd->buttons |= BT_SPIN;
|
||||
|
||||
if (gamestate == GS_INTRO) // prevent crash in intro
|
||||
{
|
||||
cmd->angleturn = ticcmd_oldangleturn[forplayer];
|
||||
cmd->aiming = G_ClipAimingPitch(myaiming);
|
||||
return;
|
||||
}
|
||||
|
||||
// Centerview can be a toggle in simple mode!
|
||||
{
|
||||
static boolean last_centerviewdown[2], centerviewhold[2]; // detect taps for toggle behavior
|
||||
|
@ -1420,7 +1411,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
|
||||
ticcmd_centerviewdown[forplayer] = true;
|
||||
}
|
||||
else if (ticcmd_centerviewdown[forplayer])
|
||||
else if (ticcmd_centerviewdown[forplayer] || (leveltime < 5))
|
||||
{
|
||||
if (controlstyle == CS_SIMPLE)
|
||||
{
|
||||
|
@ -1435,6 +1426,9 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
{
|
||||
if (
|
||||
P_MobjWasRemoved(ticcmd_ztargetfocus[forplayer]) ||
|
||||
(leveltime < 5) ||
|
||||
(player->playerstate != PST_LIVE) ||
|
||||
player->exiting ||
|
||||
!ticcmd_ztargetfocus[forplayer]->health ||
|
||||
(ticcmd_ztargetfocus[forplayer]->type == MT_EGGMOBILE3 && !ticcmd_ztargetfocus[forplayer]->movecount) // Sea Egg is moving around underground and shouldn't be tracked
|
||||
)
|
||||
|
@ -1466,7 +1460,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
P_SetTarget(&newtarget->target, ticcmd_ztargetfocus[forplayer]);
|
||||
newtarget->drawonlyforplayer = player; // Hide it from the other player in splitscreen, and yourself when spectating
|
||||
|
||||
if (player->mo && P_AproxDistance(
|
||||
if (player->mo && R_PointToDist2(0, 0,
|
||||
player->mo->x - ticcmd_ztargetfocus[forplayer]->x,
|
||||
player->mo->y - ticcmd_ztargetfocus[forplayer]->y
|
||||
) > 50*player->mo->scale)
|
||||
|
@ -1926,6 +1920,8 @@ void G_DoLoadLevel(boolean resetplayer)
|
|||
//
|
||||
void G_StartTitleCard(void)
|
||||
{
|
||||
ST_stopTitleCard();
|
||||
|
||||
// The title card has been disabled for this map.
|
||||
// Oh well.
|
||||
if (!G_IsTitleCardAvailable())
|
||||
|
@ -2614,6 +2610,7 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
|||
boolean spectator;
|
||||
boolean outofcoop;
|
||||
boolean removing;
|
||||
boolean muted;
|
||||
INT16 bot;
|
||||
SINT8 pity;
|
||||
INT16 rings;
|
||||
|
@ -2631,6 +2628,7 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
|||
spectator = players[player].spectator;
|
||||
outofcoop = players[player].outofcoop;
|
||||
removing = players[player].removing;
|
||||
muted = players[player].muted;
|
||||
pflags = (players[player].pflags & (PF_FLIPCAM|PF_ANALOGMODE|PF_DIRECTIONCHAR|PF_AUTOBRAKE|PF_TAGIT|PF_GAMETYPEOVER));
|
||||
playerangleturn = players[player].angleturn;
|
||||
oldrelangleturn = players[player].oldrelangleturn;
|
||||
|
@ -2708,6 +2706,7 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
|||
p->spectator = spectator;
|
||||
p->outofcoop = outofcoop;
|
||||
p->removing = removing;
|
||||
p->muted = muted;
|
||||
p->angleturn = playerangleturn;
|
||||
p->oldrelangleturn = oldrelangleturn;
|
||||
|
||||
|
@ -2764,7 +2763,6 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
|||
p->pflags |= PF_SPINDOWN;
|
||||
p->pflags |= PF_ATTACKDOWN;
|
||||
p->pflags |= PF_JUMPDOWN;
|
||||
p->pflags |= PF_SHIELDDOWN;
|
||||
|
||||
p->playerstate = PST_LIVE;
|
||||
p->panim = PA_IDLE; // standing animation
|
||||
|
@ -3059,7 +3057,7 @@ void G_ChangePlayerReferences(mobj_t *oldmo, mobj_t *newmo)
|
|||
// scan all thinkers
|
||||
for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed)
|
||||
if (th->removing)
|
||||
continue;
|
||||
|
||||
mo2 = (mobj_t *)th;
|
||||
|
@ -3342,7 +3340,7 @@ void G_AddPlayer(INT32 playernum)
|
|||
|
||||
p->playerstate = PST_REBORN;
|
||||
|
||||
p->height = mobjinfo[MT_PLAYER].height;
|
||||
p->height = skins[p->skin]->height;
|
||||
|
||||
if (G_GametypeUsesLives() || ((netgame || multiplayer) && (gametyperules & GTR_FRIENDLY)))
|
||||
p->lives = cv_startinglives.value;
|
||||
|
@ -4018,7 +4016,7 @@ INT16 G_GetNextMap(boolean ignoretokens, boolean silent)
|
|||
INT32 i;
|
||||
INT16 newmapnum;
|
||||
boolean spec = G_IsSpecialStage(gamemap);
|
||||
|
||||
|
||||
// go to next level
|
||||
// newmapnum is 0-based, unlike gamemap
|
||||
if (nextmapoverride != 0)
|
||||
|
@ -4122,7 +4120,7 @@ INT16 G_GetNextMap(boolean ignoretokens, boolean silent)
|
|||
|
||||
if (spec && (!gottoken || ignoretokens) && !nextmapoverride)
|
||||
newmapnum = lastmap; // Exiting from a special stage? Go back to the game. Tails 08-11-2001
|
||||
|
||||
|
||||
if (!(gametyperules & GTR_CAMPAIGN))
|
||||
{
|
||||
if (cv_advancemap.value == 0) // Stay on same map.
|
||||
|
@ -4130,7 +4128,7 @@ INT16 G_GetNextMap(boolean ignoretokens, boolean silent)
|
|||
else if (cv_advancemap.value == 2) // Go to random map.
|
||||
newmapnum = RandMap(G_TOLFlag(gametype_to_use), prevmap);
|
||||
}
|
||||
|
||||
|
||||
return newmapnum;
|
||||
}
|
||||
|
||||
|
@ -4140,7 +4138,7 @@ INT16 G_GetNextMap(boolean ignoretokens, boolean silent)
|
|||
static void G_DoCompleted(void)
|
||||
{
|
||||
INT32 i;
|
||||
|
||||
|
||||
tokenlist = 0; // Reset the list
|
||||
|
||||
if (modeattacking && pausedelay)
|
||||
|
@ -4168,7 +4166,7 @@ static void G_DoCompleted(void)
|
|||
//Get and set prevmap/nextmap
|
||||
prevmap = (INT16)(gamemap-1);
|
||||
nextmap = G_GetNextMap(false, false);
|
||||
|
||||
|
||||
automapactive = false;
|
||||
|
||||
// We are committed to this map now.
|
||||
|
@ -4386,7 +4384,7 @@ void G_LoadGameSettings(void)
|
|||
// Loads the main data file, which stores information such as emblems found, etc.
|
||||
void G_LoadGameData(gamedata_t *data)
|
||||
{
|
||||
size_t length;
|
||||
save_t savebuffer;
|
||||
INT32 i, j;
|
||||
|
||||
UINT32 versionID;
|
||||
|
@ -4428,18 +4426,18 @@ void G_LoadGameData(gamedata_t *data)
|
|||
return;
|
||||
}
|
||||
|
||||
length = FIL_ReadFile(va(pandf, srb2home, gamedatafilename), &savebuffer);
|
||||
if (!length)
|
||||
savebuffer.size = FIL_ReadFile(va(pandf, srb2home, gamedatafilename), &savebuffer.buf);
|
||||
if (!savebuffer.size)
|
||||
{
|
||||
// No gamedata. We can save a new one.
|
||||
data->loaded = true;
|
||||
return;
|
||||
}
|
||||
|
||||
save_p = savebuffer;
|
||||
savebuffer.pos = 0;
|
||||
|
||||
// Version check
|
||||
versionID = READUINT32(save_p);
|
||||
versionID = P_ReadUINT32(&savebuffer);
|
||||
if (versionID != GAMEDATA_ID
|
||||
#ifdef COMPAT_GAMEDATA_ID // backwards compat behavior
|
||||
&& versionID != COMPAT_GAMEDATA_ID
|
||||
|
@ -4450,8 +4448,7 @@ void G_LoadGameData(gamedata_t *data)
|
|||
if (strcmp(srb2home,"."))
|
||||
gdfolder = srb2home;
|
||||
|
||||
Z_Free(savebuffer);
|
||||
save_p = NULL;
|
||||
Z_Free(savebuffer.buf);
|
||||
I_Error("Game data is from another version of SRB2.\nDelete %s(maybe in %s) and try again.", gamedatafilename, gdfolder);
|
||||
}
|
||||
|
||||
|
@ -4463,14 +4460,14 @@ void G_LoadGameData(gamedata_t *data)
|
|||
}
|
||||
#endif
|
||||
|
||||
data->totalplaytime = READUINT32(save_p);
|
||||
data->totalplaytime = P_ReadUINT32(&savebuffer);
|
||||
|
||||
#ifdef COMPAT_GAMEDATA_ID
|
||||
if (versionID == COMPAT_GAMEDATA_ID)
|
||||
{
|
||||
// We'll temporarily use the old condition when loading an older file.
|
||||
// The proper mod-specific hash will get saved in afterwards.
|
||||
boolean modded = READUINT8(save_p);
|
||||
boolean modded = P_ReadUINT8(&savebuffer);
|
||||
|
||||
if (modded && !savemoddata)
|
||||
{
|
||||
|
@ -4490,13 +4487,13 @@ void G_LoadGameData(gamedata_t *data)
|
|||
strcpy(currentfilename, gamedatafilename);
|
||||
STRBUFCPY(backupfilename, strcat(currentfilename, bak));
|
||||
|
||||
FIL_WriteFile(va(pandf, srb2home, backupfilename), savebuffer, length);
|
||||
FIL_WriteFile(va(pandf, srb2home, backupfilename), &savebuffer.buf, savebuffer.size);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
// Quick & dirty hash for what mod this save file is for.
|
||||
UINT32 modID = READUINT32(save_p);
|
||||
UINT32 modID = P_ReadUINT32(&savebuffer);
|
||||
UINT32 expectedID = quickncasehash(timeattackfolder, sizeof timeattackfolder);
|
||||
|
||||
if (modID != expectedID)
|
||||
|
@ -4508,50 +4505,50 @@ void G_LoadGameData(gamedata_t *data)
|
|||
|
||||
// TODO put another cipher on these things? meh, I don't care...
|
||||
for (i = 0; i < NUMMAPS; i++)
|
||||
if ((data->mapvisited[i] = READUINT8(save_p)) > MV_MAX)
|
||||
if ((data->mapvisited[i] = P_ReadUINT8(&savebuffer)) > MV_MAX)
|
||||
goto datacorrupt;
|
||||
|
||||
// To save space, use one bit per collected/achieved/unlocked flag
|
||||
for (i = 0; i < max_emblems;)
|
||||
{
|
||||
rtemp = READUINT8(save_p);
|
||||
rtemp = P_ReadUINT8(&savebuffer);
|
||||
for (j = 0; j < 8 && j+i < max_emblems; ++j)
|
||||
data->collected[j+i] = ((rtemp >> j) & 1);
|
||||
i += j;
|
||||
}
|
||||
for (i = 0; i < max_extraemblems;)
|
||||
{
|
||||
rtemp = READUINT8(save_p);
|
||||
rtemp = P_ReadUINT8(&savebuffer);
|
||||
for (j = 0; j < 8 && j+i < max_extraemblems; ++j)
|
||||
data->extraCollected[j+i] = ((rtemp >> j) & 1);
|
||||
i += j;
|
||||
}
|
||||
for (i = 0; i < max_unlockables;)
|
||||
{
|
||||
rtemp = READUINT8(save_p);
|
||||
rtemp = P_ReadUINT8(&savebuffer);
|
||||
for (j = 0; j < 8 && j+i < max_unlockables; ++j)
|
||||
data->unlocked[j+i] = ((rtemp >> j) & 1);
|
||||
i += j;
|
||||
}
|
||||
for (i = 0; i < max_conditionsets;)
|
||||
{
|
||||
rtemp = READUINT8(save_p);
|
||||
rtemp = P_ReadUINT8(&savebuffer);
|
||||
for (j = 0; j < 8 && j+i < max_conditionsets; ++j)
|
||||
data->achieved[j+i] = ((rtemp >> j) & 1);
|
||||
i += j;
|
||||
}
|
||||
|
||||
data->timesBeaten = READUINT32(save_p);
|
||||
data->timesBeatenWithEmeralds = READUINT32(save_p);
|
||||
data->timesBeatenUltimate = READUINT32(save_p);
|
||||
data->timesBeaten = P_ReadUINT32(&savebuffer);
|
||||
data->timesBeatenWithEmeralds = P_ReadUINT32(&savebuffer);
|
||||
data->timesBeatenUltimate = P_ReadUINT32(&savebuffer);
|
||||
|
||||
// Main records
|
||||
for (i = 0; i < NUMMAPS; ++i)
|
||||
{
|
||||
recscore = READUINT32(save_p);
|
||||
rectime = (tic_t)READUINT32(save_p);
|
||||
recrings = READUINT16(save_p);
|
||||
save_p++; // compat
|
||||
recscore = P_ReadUINT32(&savebuffer);
|
||||
rectime = (tic_t)P_ReadUINT32(&savebuffer);
|
||||
recrings = P_ReadUINT16(&savebuffer);
|
||||
P_ReadUINT8(&savebuffer); // compat
|
||||
|
||||
if (recrings > 10000 || recscore > MAXSCORE)
|
||||
goto datacorrupt;
|
||||
|
@ -4568,16 +4565,16 @@ void G_LoadGameData(gamedata_t *data)
|
|||
// Nights records
|
||||
for (i = 0; i < NUMMAPS; ++i)
|
||||
{
|
||||
if ((recmares = READUINT8(save_p)) == 0)
|
||||
if ((recmares = P_ReadUINT8(&savebuffer)) == 0)
|
||||
continue;
|
||||
|
||||
G_AllocNightsRecordData((INT16)i, data);
|
||||
|
||||
for (curmare = 0; curmare < (recmares+1); ++curmare)
|
||||
{
|
||||
data->nightsrecords[i]->score[curmare] = READUINT32(save_p);
|
||||
data->nightsrecords[i]->grade[curmare] = READUINT8(save_p);
|
||||
data->nightsrecords[i]->time[curmare] = (tic_t)READUINT32(save_p);
|
||||
data->nightsrecords[i]->score[curmare] = P_ReadUINT32(&savebuffer);
|
||||
data->nightsrecords[i]->grade[curmare] = P_ReadUINT8(&savebuffer);
|
||||
data->nightsrecords[i]->time[curmare] = (tic_t)P_ReadUINT32(&savebuffer);
|
||||
|
||||
if (data->nightsrecords[i]->grade[curmare] > GRADE_S)
|
||||
{
|
||||
|
@ -4589,8 +4586,7 @@ void G_LoadGameData(gamedata_t *data)
|
|||
}
|
||||
|
||||
// done
|
||||
Z_Free(savebuffer);
|
||||
save_p = NULL;
|
||||
Z_Free(savebuffer.buf);
|
||||
|
||||
// Don't consider loaded until it's a success!
|
||||
// It used to do this much earlier, but this would cause the gamedata to
|
||||
|
@ -4611,8 +4607,7 @@ void G_LoadGameData(gamedata_t *data)
|
|||
if (strcmp(srb2home,"."))
|
||||
gdfolder = srb2home;
|
||||
|
||||
Z_Free(savebuffer);
|
||||
save_p = NULL;
|
||||
Z_Free(savebuffer.buf);
|
||||
|
||||
I_Error("Corrupt game data file.\nDelete %s(maybe in %s) and try again.", gamedatafilename, gdfolder);
|
||||
}
|
||||
|
@ -4622,9 +4617,8 @@ void G_LoadGameData(gamedata_t *data)
|
|||
// Saves the main data file, which stores information such as emblems found, etc.
|
||||
void G_SaveGameData(gamedata_t *data)
|
||||
{
|
||||
UINT8 *data_p;
|
||||
save_t savebuffer;
|
||||
|
||||
size_t length;
|
||||
INT32 i, j;
|
||||
UINT8 btemp;
|
||||
|
||||
|
@ -4636,30 +4630,31 @@ void G_SaveGameData(gamedata_t *data)
|
|||
if (!data->loaded)
|
||||
return; // If never loaded (-nodata), don't save
|
||||
|
||||
data_p = savebuffer = (UINT8 *)malloc(GAMEDATASIZE);
|
||||
if (!data_p)
|
||||
savebuffer.size = GAMEDATASIZE;
|
||||
savebuffer.buf = (UINT8 *)malloc(savebuffer.size);
|
||||
if (!savebuffer.buf)
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, M_GetText("No more free memory for saving game data\n"));
|
||||
return;
|
||||
}
|
||||
savebuffer.pos = 0;
|
||||
|
||||
if (usedCheats)
|
||||
{
|
||||
free(savebuffer);
|
||||
savebuffer = NULL;
|
||||
free(savebuffer.buf);
|
||||
return;
|
||||
}
|
||||
|
||||
// Version test
|
||||
WRITEUINT32(data_p, GAMEDATA_ID);
|
||||
P_WriteUINT32(&savebuffer, GAMEDATA_ID);
|
||||
|
||||
WRITEUINT32(data_p, data->totalplaytime);
|
||||
P_WriteUINT32(&savebuffer, data->totalplaytime);
|
||||
|
||||
WRITEUINT32(data_p, quickncasehash(timeattackfolder, sizeof timeattackfolder));
|
||||
P_WriteUINT32(&savebuffer, quickncasehash(timeattackfolder, sizeof timeattackfolder));
|
||||
|
||||
// TODO put another cipher on these things? meh, I don't care...
|
||||
for (i = 0; i < NUMMAPS; i++)
|
||||
WRITEUINT8(data_p, (data->mapvisited[i] & MV_MAX));
|
||||
P_WriteUINT8(&savebuffer, (data->mapvisited[i] & MV_MAX));
|
||||
|
||||
// To save space, use one bit per collected/achieved/unlocked flag
|
||||
for (i = 0; i < MAXEMBLEMS;)
|
||||
|
@ -4667,7 +4662,7 @@ void G_SaveGameData(gamedata_t *data)
|
|||
btemp = 0;
|
||||
for (j = 0; j < 8 && j+i < MAXEMBLEMS; ++j)
|
||||
btemp |= (data->collected[j+i] << j);
|
||||
WRITEUINT8(data_p, btemp);
|
||||
P_WriteUINT8(&savebuffer, btemp);
|
||||
i += j;
|
||||
}
|
||||
for (i = 0; i < MAXEXTRAEMBLEMS;)
|
||||
|
@ -4675,7 +4670,7 @@ void G_SaveGameData(gamedata_t *data)
|
|||
btemp = 0;
|
||||
for (j = 0; j < 8 && j+i < MAXEXTRAEMBLEMS; ++j)
|
||||
btemp |= (data->extraCollected[j+i] << j);
|
||||
WRITEUINT8(data_p, btemp);
|
||||
P_WriteUINT8(&savebuffer, btemp);
|
||||
i += j;
|
||||
}
|
||||
for (i = 0; i < MAXUNLOCKABLES;)
|
||||
|
@ -4683,7 +4678,7 @@ void G_SaveGameData(gamedata_t *data)
|
|||
btemp = 0;
|
||||
for (j = 0; j < 8 && j+i < MAXUNLOCKABLES; ++j)
|
||||
btemp |= (data->unlocked[j+i] << j);
|
||||
WRITEUINT8(data_p, btemp);
|
||||
P_WriteUINT8(&savebuffer, btemp);
|
||||
i += j;
|
||||
}
|
||||
for (i = 0; i < MAXCONDITIONSETS;)
|
||||
|
@ -4691,30 +4686,30 @@ void G_SaveGameData(gamedata_t *data)
|
|||
btemp = 0;
|
||||
for (j = 0; j < 8 && j+i < MAXCONDITIONSETS; ++j)
|
||||
btemp |= (data->achieved[j+i] << j);
|
||||
WRITEUINT8(data_p, btemp);
|
||||
P_WriteUINT8(&savebuffer, btemp);
|
||||
i += j;
|
||||
}
|
||||
|
||||
WRITEUINT32(data_p, data->timesBeaten);
|
||||
WRITEUINT32(data_p, data->timesBeatenWithEmeralds);
|
||||
WRITEUINT32(data_p, data->timesBeatenUltimate);
|
||||
P_WriteUINT32(&savebuffer, data->timesBeaten);
|
||||
P_WriteUINT32(&savebuffer, data->timesBeatenWithEmeralds);
|
||||
P_WriteUINT32(&savebuffer, data->timesBeatenUltimate);
|
||||
|
||||
// Main records
|
||||
for (i = 0; i < NUMMAPS; i++)
|
||||
{
|
||||
if (data->mainrecords[i])
|
||||
{
|
||||
WRITEUINT32(data_p, data->mainrecords[i]->score);
|
||||
WRITEUINT32(data_p, data->mainrecords[i]->time);
|
||||
WRITEUINT16(data_p, data->mainrecords[i]->rings);
|
||||
P_WriteUINT32(&savebuffer, data->mainrecords[i]->score);
|
||||
P_WriteUINT32(&savebuffer, data->mainrecords[i]->time);
|
||||
P_WriteUINT16(&savebuffer, data->mainrecords[i]->rings);
|
||||
}
|
||||
else
|
||||
{
|
||||
WRITEUINT32(data_p, 0);
|
||||
WRITEUINT32(data_p, 0);
|
||||
WRITEUINT16(data_p, 0);
|
||||
P_WriteUINT32(&savebuffer, 0);
|
||||
P_WriteUINT32(&savebuffer, 0);
|
||||
P_WriteUINT16(&savebuffer, 0);
|
||||
}
|
||||
WRITEUINT8(data_p, 0); // compat
|
||||
P_WriteUINT8(&savebuffer, 0); // compat
|
||||
}
|
||||
|
||||
// NiGHTS records
|
||||
|
@ -4722,25 +4717,22 @@ void G_SaveGameData(gamedata_t *data)
|
|||
{
|
||||
if (!data->nightsrecords[i] || !data->nightsrecords[i]->nummares)
|
||||
{
|
||||
WRITEUINT8(data_p, 0);
|
||||
P_WriteUINT8(&savebuffer, 0);
|
||||
continue;
|
||||
}
|
||||
|
||||
WRITEUINT8(data_p, data->nightsrecords[i]->nummares);
|
||||
P_WriteUINT8(&savebuffer, data->nightsrecords[i]->nummares);
|
||||
|
||||
for (curmare = 0; curmare < (data->nightsrecords[i]->nummares + 1); ++curmare)
|
||||
{
|
||||
WRITEUINT32(data_p, data->nightsrecords[i]->score[curmare]);
|
||||
WRITEUINT8(data_p, data->nightsrecords[i]->grade[curmare]);
|
||||
WRITEUINT32(data_p, data->nightsrecords[i]->time[curmare]);
|
||||
P_WriteUINT32(&savebuffer, data->nightsrecords[i]->score[curmare]);
|
||||
P_WriteUINT8(&savebuffer, data->nightsrecords[i]->grade[curmare]);
|
||||
P_WriteUINT32(&savebuffer, data->nightsrecords[i]->time[curmare]);
|
||||
}
|
||||
}
|
||||
|
||||
length = data_p - savebuffer;
|
||||
|
||||
FIL_WriteFile(va(pandf, srb2home, gamedatafilename), savebuffer, length);
|
||||
free(savebuffer);
|
||||
savebuffer = NULL;
|
||||
FIL_WriteFile(va(pandf, srb2home, gamedatafilename), savebuffer.buf, savebuffer.pos);
|
||||
free(savebuffer.buf);
|
||||
}
|
||||
|
||||
#define VERSIONSIZE 16
|
||||
|
@ -4751,7 +4743,7 @@ void G_SaveGameData(gamedata_t *data)
|
|||
//
|
||||
void G_LoadGame(UINT32 slot, INT16 mapoverride)
|
||||
{
|
||||
size_t length;
|
||||
save_t savebuffer;
|
||||
char vcheck[VERSIONSIZE];
|
||||
char savename[255];
|
||||
|
||||
|
@ -4768,18 +4760,18 @@ void G_LoadGame(UINT32 slot, INT16 mapoverride)
|
|||
else
|
||||
sprintf(savename, savegamename, slot);
|
||||
|
||||
length = FIL_ReadFile(savename, &savebuffer);
|
||||
if (!length)
|
||||
savebuffer.size = FIL_ReadFile(savename, &savebuffer.buf);
|
||||
if (!savebuffer.size)
|
||||
{
|
||||
CONS_Printf(M_GetText("Couldn't read file %s\n"), savename);
|
||||
return;
|
||||
}
|
||||
|
||||
save_p = savebuffer;
|
||||
savebuffer.pos = 0;
|
||||
|
||||
memset(vcheck, 0, sizeof (vcheck));
|
||||
sprintf(vcheck, (marathonmode ? "back-up %d" : "version %d"), VERSION);
|
||||
if (strcmp((const char *)save_p, (const char *)vcheck))
|
||||
if (strcmp((const char *)&savebuffer.buf[savebuffer.pos], (const char *)vcheck))
|
||||
{
|
||||
#ifdef SAVEGAME_OTHERVERSIONS
|
||||
M_StartMessage(M_GetText("Save game from different version.\nYou can load this savegame, but\nsaving afterwards will be disabled.\n\nDo you want to continue anyway?\n\n(Press 'Y' to confirm)\n"),
|
||||
|
@ -4789,15 +4781,14 @@ void G_LoadGame(UINT32 slot, INT16 mapoverride)
|
|||
M_ClearMenus(true); // so ESC backs out to title
|
||||
M_StartMessage(M_GetText("Save game from different version\n\nPress ESC\n"), NULL, MM_NOTHING);
|
||||
Command_ExitGame_f();
|
||||
Z_Free(savebuffer);
|
||||
save_p = savebuffer = NULL;
|
||||
Z_Free(savebuffer.buf);
|
||||
|
||||
// no cheating!
|
||||
memset(&savedata, 0, sizeof(savedata));
|
||||
#endif
|
||||
return; // bad version
|
||||
}
|
||||
save_p += VERSIONSIZE;
|
||||
savebuffer.pos += VERSIONSIZE;
|
||||
|
||||
// if (demoplayback) // reset game engine
|
||||
// G_StopDemo();
|
||||
|
@ -4806,13 +4797,12 @@ void G_LoadGame(UINT32 slot, INT16 mapoverride)
|
|||
// automapactive = false;
|
||||
|
||||
// dearchive all the modifications
|
||||
if (!P_LoadGame(mapoverride))
|
||||
if (!P_LoadGame(&savebuffer, mapoverride))
|
||||
{
|
||||
M_ClearMenus(true); // so ESC backs out to title
|
||||
M_StartMessage(M_GetText("Savegame file corrupted\n\nPress ESC\n"), NULL, MM_NOTHING);
|
||||
Command_ExitGame_f();
|
||||
Z_Free(savebuffer);
|
||||
save_p = savebuffer = NULL;
|
||||
Z_Free(savebuffer.buf);
|
||||
|
||||
// no cheating!
|
||||
memset(&savedata, 0, sizeof(savedata));
|
||||
|
@ -4820,13 +4810,12 @@ void G_LoadGame(UINT32 slot, INT16 mapoverride)
|
|||
}
|
||||
if (marathonmode)
|
||||
{
|
||||
marathontime = READUINT32(save_p);
|
||||
marathonmode |= READUINT8(save_p);
|
||||
marathontime = P_ReadUINT32(&savebuffer);
|
||||
marathonmode |= P_ReadUINT8(&savebuffer);
|
||||
}
|
||||
|
||||
// done
|
||||
Z_Free(savebuffer);
|
||||
save_p = savebuffer = NULL;
|
||||
Z_Free(savebuffer.buf);
|
||||
|
||||
displayplayer = consoleplayer;
|
||||
multiplayer = splitscreen = false;
|
||||
|
@ -4844,6 +4833,7 @@ void G_LoadGame(UINT32 slot, INT16 mapoverride)
|
|||
//
|
||||
void G_SaveGame(UINT32 slot, INT16 mapnum)
|
||||
{
|
||||
save_t savebuffer;
|
||||
boolean saved;
|
||||
char savename[256] = "";
|
||||
const char *backup;
|
||||
|
@ -4857,33 +4847,32 @@ void G_SaveGame(UINT32 slot, INT16 mapnum)
|
|||
gameaction = ga_nothing;
|
||||
{
|
||||
char name[VERSIONSIZE];
|
||||
size_t length;
|
||||
|
||||
save_p = savebuffer = (UINT8 *)malloc(SAVEGAMESIZE);
|
||||
if (!save_p)
|
||||
savebuffer.size = SAVEGAMESIZE;
|
||||
savebuffer.buf = (UINT8 *)malloc(savebuffer.size);
|
||||
if (!savebuffer.buf)
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, M_GetText("No more free memory for saving game data\n"));
|
||||
return;
|
||||
}
|
||||
savebuffer.pos = 0;
|
||||
|
||||
memset(name, 0, sizeof (name));
|
||||
sprintf(name, (marathonmode ? "back-up %d" : "version %d"), VERSION);
|
||||
WRITEMEM(save_p, name, VERSIONSIZE);
|
||||
P_WriteMem(&savebuffer, name, VERSIONSIZE);
|
||||
|
||||
P_SaveGame(mapnum);
|
||||
P_SaveGame(&savebuffer, mapnum);
|
||||
if (marathonmode)
|
||||
{
|
||||
UINT32 writetime = marathontime;
|
||||
if (!(marathonmode & MA_INGAME))
|
||||
writetime += TICRATE*5; // live event backup penalty because we don't know how long it takes to get to the next map
|
||||
WRITEUINT32(save_p, writetime);
|
||||
WRITEUINT8(save_p, (marathonmode & ~MA_INIT));
|
||||
P_WriteUINT32(&savebuffer, writetime);
|
||||
P_WriteUINT8(&savebuffer, (marathonmode & ~MA_INIT));
|
||||
}
|
||||
|
||||
length = save_p - savebuffer;
|
||||
saved = FIL_WriteFile(backup, savebuffer, length);
|
||||
free(savebuffer);
|
||||
save_p = savebuffer = NULL;
|
||||
saved = FIL_WriteFile(backup, savebuffer.buf, savebuffer.pos);
|
||||
free(savebuffer.buf);
|
||||
}
|
||||
|
||||
gameaction = ga_nothing;
|
||||
|
@ -4895,11 +4884,10 @@ void G_SaveGame(UINT32 slot, INT16 mapnum)
|
|||
}
|
||||
|
||||
#define BADSAVE goto cleanup;
|
||||
#define CHECKPOS if (save_p >= end_p) BADSAVE
|
||||
void G_SaveGameOver(UINT32 slot, boolean modifylives)
|
||||
{
|
||||
save_t savebuffer;
|
||||
boolean saved = false;
|
||||
size_t length;
|
||||
char vcheck[VERSIONSIZE];
|
||||
char savename[255];
|
||||
const char *backup;
|
||||
|
@ -4910,42 +4898,38 @@ void G_SaveGameOver(UINT32 slot, boolean modifylives)
|
|||
sprintf(savename, savegamename, slot);
|
||||
backup = va("%s",savename);
|
||||
|
||||
length = FIL_ReadFile(savename, &savebuffer);
|
||||
if (!length)
|
||||
savebuffer.size = FIL_ReadFile(savename, &savebuffer.buf);
|
||||
if (!savebuffer.size)
|
||||
{
|
||||
CONS_Printf(M_GetText("Couldn't read file %s\n"), savename);
|
||||
return;
|
||||
}
|
||||
|
||||
savebuffer.pos = 0;
|
||||
|
||||
{
|
||||
char temp[sizeof(timeattackfolder)];
|
||||
UINT8 *end_p = savebuffer + length;
|
||||
UINT8 *lives_p;
|
||||
SINT8 pllives;
|
||||
#ifdef NEWSKINSAVES
|
||||
INT16 backwardsCompat = 0;
|
||||
#endif
|
||||
|
||||
save_p = savebuffer;
|
||||
// Version check
|
||||
memset(vcheck, 0, sizeof (vcheck));
|
||||
sprintf(vcheck, (marathonmode ? "back-up %d" : "version %d"), VERSION);
|
||||
if (strcmp((const char *)save_p, (const char *)vcheck)) BADSAVE
|
||||
save_p += VERSIONSIZE;
|
||||
if (strcmp((const char *)&savebuffer.buf[savebuffer.pos], (const char *)vcheck)) BADSAVE
|
||||
savebuffer.pos += VERSIONSIZE;
|
||||
|
||||
// P_UnArchiveMisc()
|
||||
(void)READINT16(save_p);
|
||||
CHECKPOS
|
||||
(void)READUINT16(save_p); // emeralds
|
||||
CHECKPOS
|
||||
READSTRINGN(save_p, temp, sizeof(temp)); // mod it belongs to
|
||||
(void)P_ReadINT16(&savebuffer);
|
||||
(void)P_ReadUINT16(&savebuffer); // emeralds
|
||||
P_ReadStringN(&savebuffer, temp, sizeof(temp)); // mod it belongs to
|
||||
if (strcmp(temp, timeattackfolder)) BADSAVE
|
||||
|
||||
// P_UnArchivePlayer()
|
||||
CHECKPOS
|
||||
#ifdef NEWSKINSAVES
|
||||
backwardsCompat = READUINT16(save_p);
|
||||
CHECKPOS
|
||||
backwardsCompat = P_ReadUINT16(&savebuffer);
|
||||
|
||||
if (backwardsCompat == NEWSKINSAVES) // New save, read skin names
|
||||
#endif
|
||||
|
@ -4953,47 +4937,37 @@ void G_SaveGameOver(UINT32 slot, boolean modifylives)
|
|||
char ourSkinName[SKINNAMESIZE+1];
|
||||
char botSkinName[SKINNAMESIZE+1];
|
||||
|
||||
READSTRINGN(save_p, ourSkinName, SKINNAMESIZE);
|
||||
CHECKPOS
|
||||
P_ReadStringN(&savebuffer, ourSkinName, SKINNAMESIZE);
|
||||
|
||||
READSTRINGN(save_p, botSkinName, SKINNAMESIZE);
|
||||
CHECKPOS
|
||||
P_ReadStringN(&savebuffer, botSkinName, SKINNAMESIZE);
|
||||
}
|
||||
|
||||
WRITEUINT8(save_p, numgameovers);
|
||||
CHECKPOS
|
||||
P_WriteUINT8(&savebuffer, numgameovers);
|
||||
|
||||
lives_p = save_p;
|
||||
pllives = READSINT8(save_p); // lives
|
||||
CHECKPOS
|
||||
lives_p = &savebuffer.buf[savebuffer.pos];
|
||||
pllives = P_ReadSINT8(&savebuffer); // lives
|
||||
if (modifylives && pllives < startinglivesbalance[numgameovers])
|
||||
{
|
||||
pllives = startinglivesbalance[numgameovers];
|
||||
WRITESINT8(lives_p, pllives);
|
||||
*lives_p = startinglivesbalance[numgameovers];
|
||||
}
|
||||
|
||||
(void)READINT32(save_p); // Score
|
||||
CHECKPOS
|
||||
(void)READINT32(save_p); // continues
|
||||
(void)P_ReadINT32(&savebuffer); // Score
|
||||
(void)P_ReadINT32(&savebuffer); // continues
|
||||
|
||||
// File end marker check
|
||||
CHECKPOS
|
||||
switch (READUINT8(save_p))
|
||||
switch (P_ReadUINT8(&savebuffer))
|
||||
{
|
||||
case 0xb7:
|
||||
{
|
||||
UINT8 i, banksinuse;
|
||||
CHECKPOS
|
||||
banksinuse = READUINT8(save_p);
|
||||
CHECKPOS
|
||||
banksinuse = P_ReadUINT8(&savebuffer);
|
||||
if (banksinuse > NUM_LUABANKS)
|
||||
BADSAVE
|
||||
for (i = 0; i < banksinuse; i++)
|
||||
{
|
||||
(void)READINT32(save_p);
|
||||
CHECKPOS
|
||||
(void)P_ReadINT32(&savebuffer);
|
||||
}
|
||||
if (READUINT8(save_p) != 0x1d)
|
||||
if (P_ReadUINT8(&savebuffer) != 0x1d)
|
||||
BADSAVE
|
||||
}
|
||||
case 0x1d:
|
||||
|
@ -5003,7 +4977,7 @@ void G_SaveGameOver(UINT32 slot, boolean modifylives)
|
|||
}
|
||||
|
||||
// done
|
||||
saved = FIL_WriteFile(backup, savebuffer, length);
|
||||
saved = FIL_WriteFile(backup, savebuffer.buf, savebuffer.size);
|
||||
}
|
||||
|
||||
cleanup:
|
||||
|
@ -5011,11 +4985,9 @@ cleanup:
|
|||
CONS_Printf(M_GetText("Game saved.\n"));
|
||||
else if (!saved)
|
||||
CONS_Alert(CONS_ERROR, M_GetText("Error while writing to %s for save slot %u, base: %s\n"), backup, slot, (marathonmode ? liveeventbackup : savegamename));
|
||||
Z_Free(savebuffer);
|
||||
save_p = savebuffer = NULL;
|
||||
Z_Free(savebuffer.buf);
|
||||
|
||||
}
|
||||
#undef CHECKPOS
|
||||
#undef BADSAVE
|
||||
|
||||
//
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -71,8 +71,8 @@ typedef enum {
|
|||
#define P_ControlStyle(player) ((((player)->pflags & PF_ANALOGMODE) ? CS_LMAOGALOG : 0) | (((player)->pflags & PF_DIRECTIONCHAR) ? CS_STANDARD : 0))
|
||||
|
||||
extern consvar_t cv_autobrake, cv_autobrake2;
|
||||
extern consvar_t cv_sideaxis, cv_turnaxis, cv_moveaxis, cv_lookaxis, cv_jumpaxis, cv_spinaxis, cv_shieldaxis, cv_fireaxis, cv_firenaxis, cv_deadzone, cv_digitaldeadzone;
|
||||
extern consvar_t cv_sideaxis2,cv_turnaxis2,cv_moveaxis2,cv_lookaxis2,cv_jumpaxis2,cv_spinaxis2,cv_shieldaxis2,cv_fireaxis2,cv_firenaxis2,cv_deadzone2,cv_digitaldeadzone2;
|
||||
extern consvar_t cv_sideaxis,cv_turnaxis,cv_moveaxis,cv_lookaxis,cv_jumpaxis,cv_spinaxis,cv_fireaxis,cv_firenaxis,cv_deadzone,cv_digitaldeadzone;
|
||||
extern consvar_t cv_sideaxis2,cv_turnaxis2,cv_moveaxis2,cv_lookaxis2,cv_jumpaxis2,cv_spinaxis2,cv_fireaxis2,cv_firenaxis2,cv_deadzone2,cv_digitaldeadzone2;
|
||||
extern consvar_t cv_ghost_bestscore, cv_ghost_besttime, cv_ghost_bestrings, cv_ghost_last, cv_ghost_guest;
|
||||
|
||||
// hi here's some new controls
|
||||
|
@ -100,7 +100,6 @@ typedef enum
|
|||
|
||||
JA_JUMP = JA_DIGITAL,
|
||||
JA_SPIN,
|
||||
JA_SHIELD,
|
||||
JA_FIRE,
|
||||
JA_FIRENORMAL,
|
||||
} joyaxis_e;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -576,7 +576,9 @@ static const char *gamecontrolname[NUM_GAMECONTROLS] =
|
|||
"weapon5",
|
||||
"weapon6",
|
||||
"weapon7",
|
||||
"shield",
|
||||
"weapon8",
|
||||
"weapon9",
|
||||
"weapon10",
|
||||
"fire",
|
||||
"firenormal",
|
||||
"tossflag",
|
||||
|
@ -691,7 +693,6 @@ void G_DefineDefaultControls(void)
|
|||
gamecontroldefault[gcs_fps][GC_CENTERVIEW ][0] = KEY_LCTRL;
|
||||
gamecontroldefault[gcs_fps][GC_JUMP ][0] = KEY_SPACE;
|
||||
gamecontroldefault[gcs_fps][GC_SPIN ][0] = KEY_LSHIFT;
|
||||
gamecontroldefault[gcs_fps][GC_SHIELD ][0] = KEY_LALT;
|
||||
gamecontroldefault[gcs_fps][GC_FIRE ][0] = KEY_RCTRL;
|
||||
gamecontroldefault[gcs_fps][GC_FIRE ][1] = KEY_MOUSE1+0;
|
||||
gamecontroldefault[gcs_fps][GC_FIRENORMAL ][0] = KEY_RALT;
|
||||
|
@ -712,7 +713,6 @@ void G_DefineDefaultControls(void)
|
|||
gamecontroldefault[gcs_platform][GC_CENTERVIEW ][0] = KEY_END;
|
||||
gamecontroldefault[gcs_platform][GC_JUMP ][0] = KEY_SPACE;
|
||||
gamecontroldefault[gcs_platform][GC_SPIN ][0] = KEY_LSHIFT;
|
||||
gamecontroldefault[gcs_platform][GC_SHIELD ][0] = KEY_LALT;
|
||||
gamecontroldefault[gcs_platform][GC_FIRE ][0] = 's';
|
||||
gamecontroldefault[gcs_platform][GC_FIRE ][1] = KEY_MOUSE1+0;
|
||||
gamecontroldefault[gcs_platform][GC_FIRENORMAL ][0] = 'w';
|
||||
|
@ -728,6 +728,9 @@ void G_DefineDefaultControls(void)
|
|||
gamecontroldefault[i][GC_WEPSLOT5 ][0] = '5';
|
||||
gamecontroldefault[i][GC_WEPSLOT6 ][0] = '6';
|
||||
gamecontroldefault[i][GC_WEPSLOT7 ][0] = '7';
|
||||
gamecontroldefault[i][GC_WEPSLOT8 ][0] = '8';
|
||||
gamecontroldefault[i][GC_WEPSLOT9 ][0] = '9';
|
||||
gamecontroldefault[i][GC_WEPSLOT10 ][0] = '0';
|
||||
gamecontroldefault[i][GC_TOSSFLAG ][0] = '\'';
|
||||
gamecontroldefault[i][GC_CAMTOGGLE ][0] = 'v';
|
||||
gamecontroldefault[i][GC_CAMRESET ][0] = 'r';
|
||||
|
@ -743,34 +746,34 @@ void G_DefineDefaultControls(void)
|
|||
// Gamepad controls -- same for both schemes
|
||||
gamecontroldefault[i][GC_JUMP ][1] = KEY_JOY1+0; // A
|
||||
gamecontroldefault[i][GC_SPIN ][1] = KEY_JOY1+2; // X
|
||||
gamecontroldefault[i][GC_SHIELD ][1] = KEY_JOY1+1; // B
|
||||
gamecontroldefault[i][GC_CUSTOM1 ][1] = KEY_JOY1+3; // Y
|
||||
gamecontroldefault[i][GC_CUSTOM2 ][1] = KEY_JOY1+4; // LB
|
||||
gamecontroldefault[i][GC_CENTERVIEW ][1] = KEY_JOY1+5; // RB
|
||||
gamecontroldefault[i][GC_CUSTOM1 ][1] = KEY_JOY1+1; // B
|
||||
gamecontroldefault[i][GC_CUSTOM2 ][1] = KEY_JOY1+3; // Y
|
||||
gamecontroldefault[i][GC_CUSTOM3 ][1] = KEY_JOY1+8; // Left Stick
|
||||
gamecontroldefault[i][GC_CAMTOGGLE ][1] = KEY_JOY1+9; // Right Stick
|
||||
gamecontroldefault[i][GC_SCORES ][1] = KEY_JOY1+6; // Back
|
||||
gamecontroldefault[i][GC_CAMTOGGLE ][1] = KEY_JOY1+4; // LB
|
||||
gamecontroldefault[i][GC_CENTERVIEW ][1] = KEY_JOY1+5; // RB
|
||||
gamecontroldefault[i][GC_SCREENSHOT ][1] = KEY_JOY1+6; // Back
|
||||
gamecontroldefault[i][GC_SYSTEMMENU ][0] = KEY_JOY1+7; // Start
|
||||
gamecontroldefault[i][GC_VIEWPOINTNEXT][1] = KEY_HAT1+0; // D-Pad Up
|
||||
gamecontroldefault[i][GC_TOSSFLAG ][1] = KEY_HAT1+1; // D-Pad Down
|
||||
gamecontroldefault[i][GC_WEAPONPREV ][1] = KEY_HAT1+2; // D-Pad Left
|
||||
gamecontroldefault[i][GC_WEAPONNEXT ][1] = KEY_HAT1+3; // D-Pad Right
|
||||
gamecontroldefault[i][GC_VIEWPOINTNEXT][1] = KEY_JOY1+9; // Right Stick
|
||||
gamecontroldefault[i][GC_TOSSFLAG ][1] = KEY_HAT1+0; // D-Pad Up
|
||||
gamecontroldefault[i][GC_SCORES ][1] = KEY_HAT1+1; // D-Pad Down
|
||||
|
||||
// Second player controls only have joypad defaults
|
||||
gamecontrolbisdefault[i][GC_JUMP ][1] = KEY_2JOY1+0; // A
|
||||
gamecontrolbisdefault[i][GC_SPIN ][1] = KEY_2JOY1+2; // X
|
||||
gamecontrolbisdefault[i][GC_SHIELD ][1] = KEY_2JOY1+1; // B
|
||||
gamecontrolbisdefault[i][GC_CUSTOM1 ][1] = KEY_2JOY1+3; // Y
|
||||
gamecontrolbisdefault[i][GC_CUSTOM2 ][1] = KEY_2JOY1+4; // LB
|
||||
gamecontrolbisdefault[i][GC_CENTERVIEW ][1] = KEY_2JOY1+5; // RB
|
||||
gamecontrolbisdefault[i][GC_CUSTOM1 ][1] = KEY_2JOY1+1; // B
|
||||
gamecontrolbisdefault[i][GC_CUSTOM2 ][1] = KEY_2JOY1+3; // Y
|
||||
gamecontrolbisdefault[i][GC_CUSTOM3 ][1] = KEY_2JOY1+8; // Left Stick
|
||||
gamecontrolbisdefault[i][GC_CAMTOGGLE ][1] = KEY_2JOY1+9; // Right Stick
|
||||
//gamecontrolbisdefault[i][GC_SCORES ][1] = KEY_2JOY1+6; // Back
|
||||
gamecontrolbisdefault[i][GC_CAMTOGGLE ][1] = KEY_2JOY1+4; // LB
|
||||
gamecontrolbisdefault[i][GC_CENTERVIEW ][1] = KEY_2JOY1+5; // RB
|
||||
gamecontrolbisdefault[i][GC_SCREENSHOT ][1] = KEY_2JOY1+6; // Back
|
||||
//gamecontrolbisdefault[i][GC_SYSTEMMENU ][0] = KEY_2JOY1+7; // Start
|
||||
gamecontrolbisdefault[i][GC_VIEWPOINTNEXT][1] = KEY_2HAT1+0; // D-Pad Up
|
||||
gamecontrolbisdefault[i][GC_TOSSFLAG ][1] = KEY_2HAT1+1; // D-Pad Down
|
||||
gamecontrolbisdefault[i][GC_WEAPONPREV ][1] = KEY_2HAT1+2; // D-Pad Left
|
||||
gamecontrolbisdefault[i][GC_WEAPONNEXT ][1] = KEY_2HAT1+3; // D-Pad Right
|
||||
gamecontrolbisdefault[i][GC_VIEWPOINTNEXT][1] = KEY_2JOY1+9; // Right Stick
|
||||
gamecontrolbisdefault[i][GC_TOSSFLAG ][1] = KEY_2HAT1+0; // D-Pad Up
|
||||
//gamecontrolbisdefault[i][GC_SCORES ][1] = KEY_2HAT1+1; // D-Pad Down
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -74,7 +74,9 @@ typedef enum
|
|||
GC_WEPSLOT5,
|
||||
GC_WEPSLOT6,
|
||||
GC_WEPSLOT7,
|
||||
GC_SHIELD,
|
||||
GC_WEPSLOT8,
|
||||
GC_WEPSLOT9,
|
||||
GC_WEPSLOT10,
|
||||
GC_FIRE,
|
||||
GC_FIRENORMAL,
|
||||
GC_TOSSFLAG,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2020-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 2020-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -114,7 +114,7 @@ void HWR_ProcessPolygon(FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPt
|
|||
polygonArray[polygonArraySize].numVerts = iNumPts;
|
||||
polygonArray[polygonArraySize].polyFlags = PolyFlags;
|
||||
polygonArray[polygonArraySize].texture = current_texture;
|
||||
polygonArray[polygonArraySize].shader = (shader_target != -1) ? HWR_GetShaderFromTarget(shader_target) : shader_target;
|
||||
polygonArray[polygonArraySize].shader = (shader_target != SHADER_NONE) ? HWR_GetShaderFromTarget(shader_target) : shader_target;
|
||||
polygonArray[polygonArraySize].horizonSpecial = horizonSpecial;
|
||||
// default to polygonArraySize so we don't lose order on horizon lines
|
||||
// (yes, it's supposed to be negative, since we're sorting in that direction)
|
||||
|
@ -311,7 +311,6 @@ void HWR_RenderBatches(void)
|
|||
int nextIndex = polygonIndexArray[polygonReadPos];
|
||||
if (polygonArray[index].hash != polygonArray[nextIndex].hash)
|
||||
{
|
||||
changeState = true;
|
||||
nextShader = polygonArray[nextIndex].shader;
|
||||
nextTexture = polygonArray[nextIndex].texture;
|
||||
nextPolyFlags = polygonArray[nextIndex].polyFlags;
|
||||
|
@ -320,14 +319,17 @@ void HWR_RenderBatches(void)
|
|||
nextTexture = 0;
|
||||
if (currentShader != nextShader && cv_glshaders.value && gl_shadersavailable)
|
||||
{
|
||||
changeState = true;
|
||||
changeShader = true;
|
||||
}
|
||||
if (currentTexture != nextTexture)
|
||||
{
|
||||
changeState = true;
|
||||
changeTexture = true;
|
||||
}
|
||||
if (currentPolyFlags != nextPolyFlags)
|
||||
{
|
||||
changeState = true;
|
||||
changePolyFlags = true;
|
||||
}
|
||||
if (cv_glshaders.value && gl_shadersavailable)
|
||||
|
@ -339,6 +341,7 @@ void HWR_RenderBatches(void)
|
|||
currentSurfaceInfo.LightInfo.fade_start != nextSurfaceInfo.LightInfo.fade_start ||
|
||||
currentSurfaceInfo.LightInfo.fade_end != nextSurfaceInfo.LightInfo.fade_end)
|
||||
{
|
||||
changeState = true;
|
||||
changeSurfaceInfo = true;
|
||||
}
|
||||
}
|
||||
|
@ -346,6 +349,7 @@ void HWR_RenderBatches(void)
|
|||
{
|
||||
if (currentSurfaceInfo.PolyColor.rgba != nextSurfaceInfo.PolyColor.rgba)
|
||||
{
|
||||
changeState = true;
|
||||
changeSurfaceInfo = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2020-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 2020-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -450,15 +450,10 @@ static void HWR_GenerateTexture(INT32 texnum, GLMapTexture_t *grtex, GLMipmap_t
|
|||
|
||||
texture = textures[texnum];
|
||||
|
||||
mipmap->flags = TF_WRAPXY;
|
||||
mipmap->width = (UINT16)texture->width;
|
||||
mipmap->height = (UINT16)texture->height;
|
||||
mipmap->format = textureformat;
|
||||
|
||||
blockwidth = texture->width;
|
||||
blockheight = texture->height;
|
||||
blocksize = (blockwidth * blockheight);
|
||||
block = MakeBlock(&grtex->mipmap);
|
||||
blocksize = blockwidth * blockheight;
|
||||
block = MakeBlock(mipmap);
|
||||
|
||||
// Composite the columns together.
|
||||
for (i = 0, patch = texture->patches; i < texture->patchcount; i++, patch++)
|
||||
|
@ -488,7 +483,7 @@ static void HWR_GenerateTexture(INT32 texnum, GLMapTexture_t *grtex, GLMipmap_t
|
|||
realpatch = W_CachePatchNumPwad(wadnum, lumpnum, PU_PATCH);
|
||||
}
|
||||
|
||||
HWR_DrawTexturePatchInCache(&grtex->mipmap, blockwidth, blockheight, texture, patch, realpatch);
|
||||
HWR_DrawTexturePatchInCache(mipmap, blockwidth, blockheight, texture, patch, realpatch);
|
||||
|
||||
if (free_patch)
|
||||
Patch_Free(realpatch);
|
||||
|
@ -680,25 +675,24 @@ void HWR_InitMapTextures(void)
|
|||
gl_maptexturesloaded = false;
|
||||
}
|
||||
|
||||
static void DeleteTextureMipmap(GLMipmap_t *grMipmap)
|
||||
static void DeleteTextureMipmap(GLMipmap_t *grMipmap, boolean delete_mipmap)
|
||||
{
|
||||
HWD.pfnDeleteTexture(grMipmap);
|
||||
|
||||
// Chroma-keyed textures do not own their texture data, so do not free it
|
||||
if (!(grMipmap->flags & TF_CHROMAKEYED))
|
||||
if (delete_mipmap)
|
||||
Z_Free(grMipmap->data);
|
||||
}
|
||||
|
||||
static void FreeMapTexture(GLMapTexture_t *tex)
|
||||
static void FreeMapTexture(GLMapTexture_t *tex, boolean delete_chromakeys)
|
||||
{
|
||||
if (tex->mipmap.nextcolormap)
|
||||
{
|
||||
DeleteTextureMipmap(tex->mipmap.nextcolormap);
|
||||
DeleteTextureMipmap(tex->mipmap.nextcolormap, delete_chromakeys);
|
||||
free(tex->mipmap.nextcolormap);
|
||||
tex->mipmap.nextcolormap = NULL;
|
||||
}
|
||||
|
||||
DeleteTextureMipmap(&tex->mipmap);
|
||||
DeleteTextureMipmap(&tex->mipmap, true);
|
||||
}
|
||||
|
||||
void HWR_FreeMapTextures(void)
|
||||
|
@ -707,8 +701,8 @@ void HWR_FreeMapTextures(void)
|
|||
|
||||
for (i = 0; i < gl_numtextures; i++)
|
||||
{
|
||||
FreeMapTexture(&gl_textures[i]);
|
||||
FreeMapTexture(&gl_flats[i]);
|
||||
FreeMapTexture(&gl_textures[i], true);
|
||||
FreeMapTexture(&gl_flats[i], false);
|
||||
}
|
||||
|
||||
// now the heap don't have any 'user' pointing to our
|
||||
|
@ -741,22 +735,7 @@ void HWR_LoadMapTextures(size_t pnumtextures)
|
|||
// --------------------------------------------------------------------------
|
||||
// Make sure texture is downloaded and set it as the source
|
||||
// --------------------------------------------------------------------------
|
||||
static void GetMapTexture(INT32 tex, GLMapTexture_t *grtex, GLMipmap_t *mipmap)
|
||||
{
|
||||
// Generate texture if missing from the cache
|
||||
if (!mipmap->data && !mipmap->downloaded)
|
||||
HWR_GenerateTexture(tex, grtex, mipmap);
|
||||
|
||||
// If hardware does not have the texture, then call pfnSetTexture to upload it
|
||||
if (!mipmap->downloaded)
|
||||
HWD.pfnSetTexture(mipmap);
|
||||
HWR_SetCurrentTexture(mipmap);
|
||||
|
||||
// The system-memory data can be purged now.
|
||||
Z_ChangeTag(mipmap->data, PU_HWRCACHE_UNLOCKED);
|
||||
}
|
||||
|
||||
GLMapTexture_t *HWR_GetTexture(INT32 tex)
|
||||
GLMapTexture_t *HWR_GetTexture(INT32 tex, boolean chromakeyed)
|
||||
{
|
||||
if (tex < 0 || tex >= (signed)gl_numtextures)
|
||||
{
|
||||
|
@ -769,7 +748,46 @@ GLMapTexture_t *HWR_GetTexture(INT32 tex)
|
|||
|
||||
GLMapTexture_t *grtex = &gl_textures[tex];
|
||||
|
||||
GetMapTexture(tex, grtex, &grtex->mipmap);
|
||||
GLMipmap_t *grMipmap = &grtex->mipmap;
|
||||
GLMipmap_t *originalMipmap = grMipmap;
|
||||
|
||||
if (!originalMipmap->downloaded)
|
||||
{
|
||||
originalMipmap->flags = TF_WRAPXY;
|
||||
originalMipmap->width = (UINT16)textures[tex]->width;
|
||||
originalMipmap->height = (UINT16)textures[tex]->height;
|
||||
originalMipmap->format = textureformat;
|
||||
}
|
||||
|
||||
// If chroma-keyed, create or use a different mipmap for the variant
|
||||
if (chromakeyed && !textures[tex]->transparency)
|
||||
{
|
||||
// Allocate it if it wasn't already
|
||||
if (!originalMipmap->nextcolormap)
|
||||
{
|
||||
GLMipmap_t *newMipmap = calloc(1, sizeof (*grMipmap));
|
||||
if (newMipmap == NULL)
|
||||
I_Error("%s: Out of memory", "HWR_GetTexture");
|
||||
|
||||
newMipmap->flags = originalMipmap->flags | TF_CHROMAKEYED;
|
||||
newMipmap->width = originalMipmap->width;
|
||||
newMipmap->height = originalMipmap->height;
|
||||
newMipmap->format = originalMipmap->format;
|
||||
originalMipmap->nextcolormap = newMipmap;
|
||||
}
|
||||
|
||||
// Generate, upload and bind the variant texture instead of the original one
|
||||
grMipmap = originalMipmap->nextcolormap;
|
||||
}
|
||||
|
||||
if (!grMipmap->data)
|
||||
HWR_GenerateTexture(tex, grtex, grMipmap);
|
||||
|
||||
if (!grMipmap->downloaded)
|
||||
HWD.pfnSetTexture(grMipmap);
|
||||
HWR_SetCurrentTexture(grMipmap);
|
||||
|
||||
Z_ChangeTag(grMipmap->data, PU_HWRCACHE_UNLOCKED);
|
||||
|
||||
return grtex;
|
||||
}
|
||||
|
@ -1240,20 +1258,29 @@ void HWR_SetMapPalette(void)
|
|||
|
||||
// Creates a hardware lighttable from the supplied lighttable.
|
||||
// Returns the id of the hw lighttable, usable in FSurfaceInfo.
|
||||
UINT32 HWR_CreateLightTable(UINT8 *lighttable)
|
||||
UINT32 HWR_CreateLightTable(UINT8 *lighttable, RGBA_t *hw_lighttable)
|
||||
{
|
||||
UINT32 i, id;
|
||||
UINT32 i;
|
||||
RGBA_t *palette = HWR_GetTexturePalette();
|
||||
RGBA_t *hw_lighttable = Z_Malloc(256 * 32 * sizeof(RGBA_t), PU_STATIC, NULL);
|
||||
|
||||
// To make the palette index -> RGBA mapping easier for the shader,
|
||||
// the hardware lighttable is composed of RGBA colors instead of palette indices.
|
||||
for (i = 0; i < 256 * 32; i++)
|
||||
hw_lighttable[i] = palette[lighttable[i]];
|
||||
|
||||
id = HWD.pfnCreateLightTable(hw_lighttable);
|
||||
Z_Free(hw_lighttable);
|
||||
return id;
|
||||
return HWD.pfnCreateLightTable(hw_lighttable);
|
||||
}
|
||||
|
||||
// Updates a hardware lighttable of a given id from the supplied lighttable.
|
||||
void HWR_UpdateLightTable(UINT32 id, UINT8 *lighttable, RGBA_t *hw_lighttable)
|
||||
{
|
||||
UINT32 i;
|
||||
RGBA_t *palette = HWR_GetTexturePalette();
|
||||
|
||||
for (i = 0; i < 256 * 32; i++)
|
||||
hw_lighttable[i] = palette[lighttable[i]];
|
||||
|
||||
HWD.pfnUpdateLightTable(id, hw_lighttable);
|
||||
}
|
||||
|
||||
// get hwr lighttable id for colormap, create it if it doesn't already exist
|
||||
|
@ -1267,25 +1294,41 @@ UINT32 HWR_GetLightTableID(extracolormap_t *colormap)
|
|||
default_colormap = true;
|
||||
}
|
||||
|
||||
// create hw lighttable if there isn't one
|
||||
if (!colormap->gl_lighttable_id)
|
||||
{
|
||||
UINT8 *colormap_pointer;
|
||||
UINT8 *colormap_pointer;
|
||||
|
||||
if (default_colormap)
|
||||
colormap_pointer = colormaps; // don't actually use the data from the "default colormap"
|
||||
else
|
||||
colormap_pointer = colormap->colormap;
|
||||
colormap->gl_lighttable_id = HWR_CreateLightTable(colormap_pointer);
|
||||
if (default_colormap)
|
||||
colormap_pointer = colormaps; // don't actually use the data from the "default colormap"
|
||||
else
|
||||
colormap_pointer = colormap->colormap;
|
||||
|
||||
// create hw lighttable if there isn't one
|
||||
if (colormap->gl_lighttable.data == NULL)
|
||||
{
|
||||
Z_Malloc(256 * 32 * sizeof(RGBA_t), PU_HWRLIGHTTABLEDATA, &colormap->gl_lighttable.data);
|
||||
}
|
||||
|
||||
return colormap->gl_lighttable_id;
|
||||
// Generate the texture for this light table
|
||||
if (!colormap->gl_lighttable.id)
|
||||
{
|
||||
colormap->gl_lighttable.id = HWR_CreateLightTable(colormap_pointer, colormap->gl_lighttable.data);
|
||||
}
|
||||
// Update the texture if it was directly changed by a script
|
||||
else if (colormap->gl_lighttable.needs_update)
|
||||
{
|
||||
HWR_UpdateLightTable(colormap->gl_lighttable.id, colormap_pointer, colormap->gl_lighttable.data);
|
||||
}
|
||||
|
||||
colormap->gl_lighttable.needs_update = false;
|
||||
|
||||
return colormap->gl_lighttable.id;
|
||||
}
|
||||
|
||||
// Note: all hardware lighttable ids assigned before this
|
||||
// call become invalid and must not be used.
|
||||
void HWR_ClearLightTables(void)
|
||||
{
|
||||
Z_FreeTag(PU_HWRLIGHTTABLEDATA);
|
||||
|
||||
if (vid.glstate == VID_GL_LIBRARY_LOADED)
|
||||
HWD.pfnClearLightTables();
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -71,6 +71,7 @@ EXPORT void HWRAPI(SetShaderInfo) (hwdshaderinfo_t info, INT32 value);
|
|||
|
||||
EXPORT void HWRAPI(SetPaletteLookup)(UINT8 *lut);
|
||||
EXPORT UINT32 HWRAPI(CreateLightTable)(RGBA_t *hw_lighttable);
|
||||
EXPORT void HWRAPI(UpdateLightTable)(UINT32 id, RGBA_t *hw_lighttable);
|
||||
EXPORT void HWRAPI(ClearLightTables)(void);
|
||||
EXPORT void HWRAPI(SetScreenPalette)(RGBA_t *palette);
|
||||
|
||||
|
@ -125,6 +126,7 @@ struct hwdriver_s
|
|||
|
||||
SetPaletteLookup pfnSetPaletteLookup;
|
||||
CreateLightTable pfnCreateLightTable;
|
||||
UpdateLightTable pfnUpdateLightTable;
|
||||
ClearLightTables pfnClearLightTables;
|
||||
SetScreenPalette pfnSetScreenPalette;
|
||||
};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -120,7 +120,7 @@ void HWR_GetPatch(patch_t *patch);
|
|||
void HWR_GetMappedPatch(patch_t *patch, const UINT8 *colormap);
|
||||
void HWR_GetFadeMask(lumpnum_t fademasklumpnum);
|
||||
|
||||
GLMapTexture_t *HWR_GetTexture(INT32 tex);
|
||||
GLMapTexture_t *HWR_GetTexture(INT32 tex, boolean chromakeyed);
|
||||
void HWR_GetLevelFlat(levelflat_t *levelflat, boolean chromakeyed);
|
||||
void HWR_GetRawFlat(lumpnum_t flatlumpnum);
|
||||
|
||||
|
@ -133,7 +133,8 @@ void HWR_UnlockCachedPatch(GLPatch_t *gpatch);
|
|||
|
||||
void HWR_SetPalette(RGBA_t *palette);
|
||||
void HWR_SetMapPalette(void);
|
||||
UINT32 HWR_CreateLightTable(UINT8 *lighttable);
|
||||
UINT32 HWR_CreateLightTable(UINT8 *lighttable, RGBA_t *hw_lighttable);
|
||||
void HWR_UpdateLightTable(UINT32 id, UINT8 *lighttable, RGBA_t *hw_lighttable);
|
||||
UINT32 HWR_GetLightTableID(extracolormap_t *colormap);
|
||||
void HWR_ClearLightTables(void);
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -395,6 +395,8 @@ light_t *t_lspr[NUMSPRITES] =
|
|||
&lspr[NOLIGHT], // SPR_XMS4
|
||||
&lspr[NOLIGHT], // SPR_XMS5
|
||||
&lspr[NOLIGHT], // SPR_XMS6
|
||||
&lspr[NOLIGHT], // SPR_SNTT
|
||||
&lspr[NOLIGHT], // SPR_SSTT
|
||||
&lspr[NOLIGHT], // SPR_FHZI
|
||||
&lspr[NOLIGHT], // SPR_ROSY
|
||||
|
||||
|
@ -428,6 +430,8 @@ light_t *t_lspr[NUMSPRITES] =
|
|||
// Misc Scenery
|
||||
&lspr[NOLIGHT], // SPR_STLG
|
||||
&lspr[NOLIGHT], // SPR_DBAL
|
||||
&lspr[NOLIGHT], // SPR_GINE
|
||||
&lspr[NOLIGHT], // SPR_PPAL
|
||||
|
||||
// Powerup Indicators
|
||||
&lspr[NOLIGHT], // SPR_ARMA
|
||||
|
@ -614,6 +618,9 @@ light_t *t_lspr[NUMSPRITES] =
|
|||
&lspr[NOLIGHT], // SPR_GWLG
|
||||
&lspr[NOLIGHT], // SPR_GWLR
|
||||
|
||||
// LJ Knuckles
|
||||
&lspr[NOLIGHT], // SPR_OLDK,
|
||||
|
||||
// Free slots
|
||||
&lspr[NOLIGHT],
|
||||
&lspr[NOLIGHT],
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -309,6 +309,43 @@ static FUINT HWR_CalcSlopeLight(FUINT lightnum, angle_t dir, fixed_t delta)
|
|||
return (FUINT)finallight;
|
||||
}
|
||||
|
||||
static UINT8 HWR_SideLightLevel(side_t *side, INT16 base_lightlevel)
|
||||
{
|
||||
return max(0, min(255, side->light +
|
||||
((side->lightabsolute) ? 0 : base_lightlevel)));
|
||||
}
|
||||
|
||||
/* TODO: implement per-texture lighting
|
||||
static UINT8 HWR_TopLightLevel(side_t *side, INT16 base_lightlevel)
|
||||
{
|
||||
return max(0, min(255, side->light_top +
|
||||
((side->lightabsolute_top) ? 0 : HWR_SideLightLevel(side, base_lightlevel))));
|
||||
}
|
||||
|
||||
static UINT8 HWR_MidLightLevel(side_t *side, INT16 base_lightlevel)
|
||||
{
|
||||
return max(0, min(255, side->light_mid +
|
||||
((side->lightabsolute_mid) ? 0 : HWR_SideLightLevel(side, base_lightlevel))));
|
||||
}
|
||||
|
||||
static UINT8 HWR_BottomLightLevel(side_t *side, INT16 base_lightlevel)
|
||||
{
|
||||
return max(0, min(255, side->light_bottom +
|
||||
((side->lightabsolute_bottom) ? 0 : HWR_SideLightLevel(side, base_lightlevel))));
|
||||
}
|
||||
*/
|
||||
|
||||
static UINT8 HWR_FloorLightLevel(sector_t *sector, INT16 base_lightlevel)
|
||||
{
|
||||
return max(0, min(255, sector->floorlightlevel +
|
||||
((sector->floorlightabsolute) ? 0 : base_lightlevel)));
|
||||
}
|
||||
|
||||
static UINT8 HWR_CeilingLightLevel(sector_t *sector, INT16 base_lightlevel)
|
||||
{
|
||||
return max(0, min(255, sector->ceilinglightlevel +
|
||||
((sector->ceilinglightabsolute) ? 0 : base_lightlevel)));
|
||||
}
|
||||
// ==========================================================================
|
||||
// FLOOR/CEILING GENERATION FROM SUBSECTORS
|
||||
// ==========================================================================
|
||||
|
@ -705,8 +742,9 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum,
|
|||
fixed_t v2x = FloatToFixed(wallVerts[1].x);
|
||||
fixed_t v2y = FloatToFixed(wallVerts[1].z);
|
||||
|
||||
FUINT lightnum = HWR_SideLightLevel(gl_sidedef, sector->lightlevel);
|
||||
const UINT8 alpha = Surf->PolyColor.s.alpha;
|
||||
FUINT lightnum = HWR_CalcWallLight(sector->lightlevel, v1x, v1y, v2x, v2y);
|
||||
lightnum = HWR_CalcWallLight(lightnum, v1x, v1y, v2x, v2y);
|
||||
extracolormap_t *colormap = NULL;
|
||||
|
||||
if (!r_renderwalls)
|
||||
|
@ -750,13 +788,13 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum,
|
|||
{
|
||||
if (pfloor && (pfloor->fofflags & FOF_FOG))
|
||||
{
|
||||
lightnum = pfloor->master->frontsector->lightlevel;
|
||||
lightnum = HWR_SideLightLevel(gl_sidedef, pfloor->master->frontsector->lightlevel);
|
||||
colormap = pfloor->master->frontsector->extra_colormap;
|
||||
lightnum = colormap ? lightnum : HWR_CalcWallLight(lightnum, v1x, v1y, v2x, v2y);
|
||||
}
|
||||
else
|
||||
{
|
||||
lightnum = *list[i].lightlevel;
|
||||
lightnum = HWR_SideLightLevel(gl_sidedef, *list[i].lightlevel);
|
||||
colormap = *list[i].extra_colormap;
|
||||
lightnum = colormap ? lightnum : HWR_CalcWallLight(lightnum, v1x, v1y, v2x, v2y);
|
||||
}
|
||||
|
@ -916,6 +954,7 @@ static boolean HWR_BlendMidtextureSurface(FSurfaceInfo *pSurf)
|
|||
|
||||
static void HWR_RenderMidtexture(INT32 gl_midtexture, float cliplow, float cliphigh, fixed_t worldtop, fixed_t worldbottom, fixed_t worldhigh, fixed_t worldlow, fixed_t worldtopslope, fixed_t worldbottomslope, fixed_t worldhighslope, fixed_t worldlowslope, UINT32 lightnum, FOutVector *inWallVerts)
|
||||
{
|
||||
sector_t *front, *back;
|
||||
FOutVector wallVerts[4];
|
||||
|
||||
FSurfaceInfo Surf;
|
||||
|
@ -925,6 +964,16 @@ static void HWR_RenderMidtexture(INT32 gl_midtexture, float cliplow, float cliph
|
|||
if (!HWR_BlendMidtextureSurface(&Surf))
|
||||
return;
|
||||
|
||||
if (gl_linedef->frontsector->heightsec != -1)
|
||||
front = §ors[gl_linedef->frontsector->heightsec];
|
||||
else
|
||||
front = gl_linedef->frontsector;
|
||||
|
||||
if (gl_linedef->backsector->heightsec != -1)
|
||||
back = §ors[gl_linedef->backsector->heightsec];
|
||||
else
|
||||
back = gl_linedef->backsector;
|
||||
|
||||
fixed_t texheight = FixedDiv(textureheight[gl_midtexture], abs(gl_sidedef->scaley_mid));
|
||||
INT32 repeats;
|
||||
|
||||
|
@ -934,15 +983,15 @@ static void HWR_RenderMidtexture(INT32 gl_midtexture, float cliplow, float cliph
|
|||
{
|
||||
fixed_t high, low;
|
||||
|
||||
if (gl_frontsector->ceilingheight > gl_backsector->ceilingheight)
|
||||
high = gl_backsector->ceilingheight;
|
||||
if (front->ceilingheight > back->ceilingheight)
|
||||
high = back->ceilingheight;
|
||||
else
|
||||
high = gl_frontsector->ceilingheight;
|
||||
high = front->ceilingheight;
|
||||
|
||||
if (gl_frontsector->floorheight > gl_backsector->floorheight)
|
||||
low = gl_frontsector->floorheight;
|
||||
if (front->floorheight > back->floorheight)
|
||||
low = front->floorheight;
|
||||
else
|
||||
low = gl_backsector->floorheight;
|
||||
low = back->floorheight;
|
||||
|
||||
repeats = (high - low) / texheight;
|
||||
if ((high - low) % texheight)
|
||||
|
@ -951,7 +1000,7 @@ static void HWR_RenderMidtexture(INT32 gl_midtexture, float cliplow, float cliph
|
|||
else
|
||||
repeats = 1;
|
||||
|
||||
GLMapTexture_t *grTex = HWR_GetTexture(gl_midtexture);
|
||||
GLMapTexture_t *grTex = HWR_GetTexture(gl_midtexture, true);
|
||||
float xscale = FixedToFloat(gl_sidedef->scalex_mid);
|
||||
float yscale = FixedToFloat(gl_sidedef->scaley_mid);
|
||||
|
||||
|
@ -969,8 +1018,8 @@ static void HWR_RenderMidtexture(INT32 gl_midtexture, float cliplow, float cliph
|
|||
if (gl_curline->polyseg)
|
||||
{
|
||||
// Change this when polyobjects support slopes
|
||||
popentop = popentopslope = gl_curline->backsector->ceilingheight;
|
||||
popenbottom = popenbottomslope = gl_curline->backsector->floorheight;
|
||||
popentop = popentopslope = back->ceilingheight;
|
||||
popenbottom = popenbottomslope = back->floorheight;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1167,7 +1216,7 @@ static void HWR_ProcessSeg(void)
|
|||
float cliplow = (float)gl_curline->offset;
|
||||
float cliphigh = cliplow + (gl_curline->flength * FRACUNIT);
|
||||
|
||||
FUINT lightnum = gl_frontsector->lightlevel;
|
||||
FUINT lightnum = HWR_SideLightLevel(gl_sidedef, gl_frontsector->lightlevel);
|
||||
extracolormap_t *colormap = gl_frontsector->extra_colormap;
|
||||
lightnum = colormap ? lightnum : HWR_CalcWallLight(lightnum, vs.x, vs.y, ve.x, ve.y);
|
||||
|
||||
|
@ -1210,7 +1259,7 @@ static void HWR_ProcessSeg(void)
|
|||
// check TOP TEXTURE
|
||||
if ((worldhighslope < worldtopslope || worldhigh < worldtop) && gl_toptexture)
|
||||
{
|
||||
grTex = HWR_GetTexture(gl_toptexture);
|
||||
grTex = HWR_GetTexture(gl_toptexture, false);
|
||||
xscale = FixedToFloat(abs(gl_sidedef->scalex_top));
|
||||
yscale = FixedToFloat(abs(gl_sidedef->scaley_top));
|
||||
|
||||
|
@ -1300,7 +1349,7 @@ static void HWR_ProcessSeg(void)
|
|||
// check BOTTOM TEXTURE
|
||||
if ((worldlowslope > worldbottomslope || worldlow > worldbottom) && gl_bottomtexture)
|
||||
{
|
||||
grTex = HWR_GetTexture(gl_bottomtexture);
|
||||
grTex = HWR_GetTexture(gl_bottomtexture, false);
|
||||
xscale = FixedToFloat(abs(gl_sidedef->scalex_bottom));
|
||||
yscale = FixedToFloat(abs(gl_sidedef->scaley_bottom));
|
||||
|
||||
|
@ -1414,7 +1463,7 @@ static void HWR_ProcessSeg(void)
|
|||
// Single sided line... Deal only with the middletexture (if one exists)
|
||||
if (gl_midtexture && gl_linedef->special != SPECIAL_HORIZON_LINE) // (Ignore horizon line for OGL)
|
||||
{
|
||||
grTex = HWR_GetTexture(gl_midtexture);
|
||||
grTex = HWR_GetTexture(gl_midtexture, false);
|
||||
xscale = FixedToFloat(gl_sidedef->scalex_mid);
|
||||
yscale = FixedToFloat(gl_sidedef->scaley_mid);
|
||||
|
||||
|
@ -1533,14 +1582,14 @@ static void HWR_ProcessSeg(void)
|
|||
if ((high1 < lowcut && highslope1 < lowcutslope) || (low1 > highcut && lowslope1 > highcutslope))
|
||||
continue;
|
||||
|
||||
side_t *side = R_GetFFloorSide(gl_curline, rover);
|
||||
side_t *side = R_GetFFloorSide(gl_curline->linedef, rover, gl_backsector);
|
||||
|
||||
boolean do_texture_skew;
|
||||
boolean dont_peg_bottom;
|
||||
|
||||
if (rover->master->flags & ML_TFERLINE)
|
||||
{
|
||||
line_t *newline = R_GetFFloorLine(gl_curline, rover);
|
||||
line_t *newline = R_GetFFloorLine(gl_curline->linedef, rover, gl_backsector);
|
||||
do_texture_skew = newline->flags & ML_SKEWTD;
|
||||
dont_peg_bottom = newline->flags & ML_DONTPEGBOTTOM;
|
||||
}
|
||||
|
@ -1588,7 +1637,7 @@ static void HWR_ProcessSeg(void)
|
|||
// -- Monster Iestyn 26/06/18
|
||||
fixed_t texturevpeg = side->rowoffset + side->offsety_mid;
|
||||
|
||||
grTex = HWR_GetTexture(texnum);
|
||||
grTex = HWR_GetTexture(texnum, true);
|
||||
xscale = FixedToFloat(side->scalex_mid);
|
||||
yscale = FixedToFloat(side->scaley_mid);
|
||||
|
||||
|
@ -1628,11 +1677,11 @@ static void HWR_ProcessSeg(void)
|
|||
{
|
||||
blendmode = PF_Fog|PF_NoTexture;
|
||||
|
||||
lightnum = rover->master->frontsector->lightlevel;
|
||||
lightnum = HWR_SideLightLevel(gl_sidedef, rover->master->frontsector->lightlevel);
|
||||
colormap = rover->master->frontsector->extra_colormap;
|
||||
lightnum = colormap ? lightnum : HWR_CalcWallLight(lightnum, vs.x, vs.y, ve.x, ve.y);
|
||||
|
||||
Surf.PolyColor.s.alpha = HWR_FogBlockAlpha(rover->master->frontsector->lightlevel, rover->master->frontsector->extra_colormap);
|
||||
Surf.PolyColor.s.alpha = HWR_FogBlockAlpha(HWR_SideLightLevel(gl_sidedef, rover->master->frontsector->lightlevel), rover->master->frontsector->extra_colormap);
|
||||
|
||||
if (gl_frontsector->numlights)
|
||||
HWR_SplitWall(gl_frontsector, wallVerts, 0, &Surf, rover->fofflags, rover, blendmode);
|
||||
|
@ -1643,7 +1692,7 @@ static void HWR_ProcessSeg(void)
|
|||
{
|
||||
blendmode = PF_Masked;
|
||||
|
||||
if ((rover->fofflags & FOF_TRANSLUCENT && !(rover->fofflags & FOF_SPLAT)) || rover->blend)
|
||||
if ((rover->fofflags & FOF_TRANSLUCENT && !((rover->fofflags & FOF_SPLAT) && rover->alpha >= 255)) || rover->blend)
|
||||
{
|
||||
blendmode = rover->blend ? HWR_GetBlendModeFlag(rover->blend) : PF_Translucent;
|
||||
Surf.PolyColor.s.alpha = max(0, min(rover->alpha, 255));
|
||||
|
@ -1689,14 +1738,14 @@ static void HWR_ProcessSeg(void)
|
|||
if ((high1 < lowcut && highslope1 < lowcutslope) || (low1 > highcut && lowslope1 > highcutslope))
|
||||
continue;
|
||||
|
||||
side_t *side = R_GetFFloorSide(gl_curline, rover);
|
||||
side_t *side = R_GetFFloorSide(gl_curline->linedef, rover, gl_backsector);
|
||||
|
||||
boolean do_texture_skew;
|
||||
boolean dont_peg_bottom;
|
||||
|
||||
if (rover->master->flags & ML_TFERLINE)
|
||||
{
|
||||
line_t *newline = R_GetFFloorLine(gl_curline, rover);
|
||||
line_t *newline = R_GetFFloorLine(gl_curline->linedef, rover, gl_backsector);
|
||||
do_texture_skew = newline->flags & ML_SKEWTD;
|
||||
dont_peg_bottom = newline->flags & ML_DONTPEGBOTTOM;
|
||||
}
|
||||
|
@ -1745,7 +1794,7 @@ static void HWR_ProcessSeg(void)
|
|||
// -- Monster Iestyn 26/06/18
|
||||
fixed_t texturevpeg = side->rowoffset + side->offsety_mid;
|
||||
|
||||
grTex = HWR_GetTexture(texnum);
|
||||
grTex = HWR_GetTexture(texnum, true);
|
||||
xscale = FixedToFloat(side->scalex_mid);
|
||||
yscale = FixedToFloat(side->scaley_mid);
|
||||
|
||||
|
@ -1785,7 +1834,7 @@ static void HWR_ProcessSeg(void)
|
|||
{
|
||||
blendmode = PF_Fog|PF_NoTexture;
|
||||
|
||||
lightnum = rover->master->frontsector->lightlevel;
|
||||
lightnum = HWR_SideLightLevel(gl_sidedef, rover->master->frontsector->lightlevel);
|
||||
colormap = rover->master->frontsector->extra_colormap;
|
||||
lightnum = colormap ? lightnum : HWR_CalcWallLight(lightnum, vs.x, vs.y, ve.x, ve.y);
|
||||
|
||||
|
@ -1800,7 +1849,7 @@ static void HWR_ProcessSeg(void)
|
|||
{
|
||||
blendmode = PF_Masked;
|
||||
|
||||
if ((rover->fofflags & FOF_TRANSLUCENT && !(rover->fofflags & FOF_SPLAT)) || rover->blend)
|
||||
if ((rover->fofflags & FOF_TRANSLUCENT && !((rover->fofflags & FOF_SPLAT) && rover->alpha >= 255)) || rover->blend)
|
||||
{
|
||||
blendmode = rover->blend ? HWR_GetBlendModeFlag(rover->blend) : PF_Translucent;
|
||||
Surf.PolyColor.s.alpha = max(0, min(rover->alpha, 255));
|
||||
|
@ -2447,14 +2496,14 @@ static void HWR_Subsector(size_t num)
|
|||
continue;
|
||||
if (sub->validcount == validcount)
|
||||
continue;
|
||||
|
||||
|
||||
// rendering heights for bottom and top planes
|
||||
bottomCullHeight = P_GetFFloorBottomZAt(rover, viewx, viewy);
|
||||
topCullHeight = P_GetFFloorTopZAt(rover, viewx, viewy);
|
||||
|
||||
|
||||
if (gl_frontsector->cullheight)
|
||||
{
|
||||
if (HWR_DoCulling(gl_frontsector->cullheight, viewsector->cullheight, gl_viewz, FIXED_TO_FLOAT(bottomCullHeight), FIXED_TO_FLOAT(topCullHeight)))
|
||||
if (HWR_DoCulling(gl_frontsector->cullheight, viewsector->cullheight, gl_viewz, FIXED_TO_FLOAT(*rover->bottomheight), FIXED_TO_FLOAT(*rover->topheight)))
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -2471,17 +2520,17 @@ static void HWR_Subsector(size_t num)
|
|||
UINT8 alpha;
|
||||
|
||||
light = R_GetPlaneLight(gl_frontsector, centerHeight, viewz < bottomCullHeight ? true : false);
|
||||
alpha = HWR_FogBlockAlpha(*gl_frontsector->lightlist[light].lightlevel, rover->master->frontsector->extra_colormap);
|
||||
alpha = HWR_FogBlockAlpha(HWR_FloorLightLevel(rover->master->frontsector, *gl_frontsector->lightlist[light].lightlevel), rover->master->frontsector->extra_colormap);
|
||||
|
||||
HWR_AddTransparentFloor(0,
|
||||
&extrasubsectors[num],
|
||||
false,
|
||||
*rover->bottomheight,
|
||||
*gl_frontsector->lightlist[light].lightlevel,
|
||||
HWR_FloorLightLevel(rover->master->frontsector, *gl_frontsector->lightlist[light].lightlevel),
|
||||
alpha, rover->master->frontsector, PF_Fog|PF_NoTexture,
|
||||
true, false, rover->master->frontsector->extra_colormap);
|
||||
}
|
||||
else if ((rover->fofflags & FOF_TRANSLUCENT && !(rover->fofflags & FOF_SPLAT)) || rover->blend) // SoM: Flags are more efficient
|
||||
else if ((rover->fofflags & FOF_TRANSLUCENT && !((rover->fofflags & FOF_SPLAT) && rover->alpha >= 255)) || rover->blend) // SoM: Flags are more efficient
|
||||
{
|
||||
light = R_GetPlaneLight(gl_frontsector, centerHeight, viewz < bottomCullHeight ? true : false);
|
||||
|
||||
|
@ -2489,7 +2538,7 @@ static void HWR_Subsector(size_t num)
|
|||
&extrasubsectors[num],
|
||||
false,
|
||||
*rover->bottomheight,
|
||||
*gl_frontsector->lightlist[light].lightlevel,
|
||||
HWR_FloorLightLevel(rover->master->frontsector, *gl_frontsector->lightlist[light].lightlevel),
|
||||
max(0, min(rover->alpha, 255)), rover->master->frontsector,
|
||||
HWR_RippleBlend(gl_frontsector, rover, false) | (rover->blend ? HWR_GetBlendModeFlag(rover->blend) : PF_Translucent),
|
||||
false, rover->fofflags & FOF_SPLAT, *gl_frontsector->lightlist[light].extra_colormap);
|
||||
|
@ -2498,8 +2547,9 @@ static void HWR_Subsector(size_t num)
|
|||
{
|
||||
HWR_GetLevelFlat(&levelflats[*rover->bottompic], rover->fofflags & FOF_SPLAT);
|
||||
light = R_GetPlaneLight(gl_frontsector, centerHeight, viewz < bottomCullHeight ? true : false);
|
||||
HWR_RenderPlane(sub, &extrasubsectors[num], false, *rover->bottomheight, HWR_RippleBlend(gl_frontsector, rover, false)|PF_Occlude, *gl_frontsector->lightlist[light].lightlevel, &levelflats[*rover->bottompic],
|
||||
rover->master->frontsector, 255, *gl_frontsector->lightlist[light].extra_colormap);
|
||||
HWR_RenderPlane(sub, &extrasubsectors[num], false, *rover->bottomheight, HWR_RippleBlend(gl_frontsector, rover, false)|PF_Occlude,
|
||||
HWR_FloorLightLevel(rover->master->frontsector, *gl_frontsector->lightlist[light].lightlevel),
|
||||
&levelflats[*rover->bottompic], rover->master->frontsector, 255, *gl_frontsector->lightlist[light].extra_colormap);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2516,17 +2566,17 @@ static void HWR_Subsector(size_t num)
|
|||
UINT8 alpha;
|
||||
|
||||
light = R_GetPlaneLight(gl_frontsector, centerHeight, viewz < topCullHeight ? true : false);
|
||||
alpha = HWR_FogBlockAlpha(*gl_frontsector->lightlist[light].lightlevel, rover->master->frontsector->extra_colormap);
|
||||
alpha = HWR_FogBlockAlpha(HWR_CeilingLightLevel(rover->master->frontsector, *gl_frontsector->lightlist[light].lightlevel), rover->master->frontsector->extra_colormap);
|
||||
|
||||
HWR_AddTransparentFloor(0,
|
||||
&extrasubsectors[num],
|
||||
true,
|
||||
*rover->topheight,
|
||||
*gl_frontsector->lightlist[light].lightlevel,
|
||||
HWR_CeilingLightLevel(rover->master->frontsector, *gl_frontsector->lightlist[light].lightlevel),
|
||||
alpha, rover->master->frontsector, PF_Fog|PF_NoTexture,
|
||||
true, false, rover->master->frontsector->extra_colormap);
|
||||
}
|
||||
else if ((rover->fofflags & FOF_TRANSLUCENT && !(rover->fofflags & FOF_SPLAT)) || rover->blend)
|
||||
else if ((rover->fofflags & FOF_TRANSLUCENT && !((rover->fofflags & FOF_SPLAT) && rover->alpha >= 255)) || rover->blend)
|
||||
{
|
||||
light = R_GetPlaneLight(gl_frontsector, centerHeight, viewz < topCullHeight ? true : false);
|
||||
|
||||
|
@ -2534,7 +2584,7 @@ static void HWR_Subsector(size_t num)
|
|||
&extrasubsectors[num],
|
||||
true,
|
||||
*rover->topheight,
|
||||
*gl_frontsector->lightlist[light].lightlevel,
|
||||
HWR_CeilingLightLevel(rover->master->frontsector, *gl_frontsector->lightlist[light].lightlevel),
|
||||
max(0, min(rover->alpha, 255)), rover->master->frontsector,
|
||||
HWR_RippleBlend(gl_frontsector, rover, false) | (rover->blend ? HWR_GetBlendModeFlag(rover->blend) : PF_Translucent),
|
||||
false, rover->fofflags & FOF_SPLAT, *gl_frontsector->lightlist[light].extra_colormap);
|
||||
|
@ -2543,8 +2593,9 @@ static void HWR_Subsector(size_t num)
|
|||
{
|
||||
HWR_GetLevelFlat(&levelflats[*rover->toppic], rover->fofflags & FOF_SPLAT);
|
||||
light = R_GetPlaneLight(gl_frontsector, centerHeight, viewz < topCullHeight ? true : false);
|
||||
HWR_RenderPlane(sub, &extrasubsectors[num], true, *rover->topheight, HWR_RippleBlend(gl_frontsector, rover, false)|PF_Occlude, *gl_frontsector->lightlist[light].lightlevel, &levelflats[*rover->toppic],
|
||||
rover->master->frontsector, 255, *gl_frontsector->lightlist[light].extra_colormap);
|
||||
HWR_RenderPlane(sub, &extrasubsectors[num], true, *rover->topheight, HWR_RippleBlend(gl_frontsector, rover, false)|PF_Occlude,
|
||||
HWR_CeilingLightLevel(rover->master->frontsector, *gl_frontsector->lightlist[light].lightlevel),
|
||||
&levelflats[*rover->toppic], rover->master->frontsector, 255, *gl_frontsector->lightlist[light].extra_colormap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2880,7 +2931,7 @@ static void HWR_DrawDropShadow(mobj_t *thing, fixed_t scale)
|
|||
}
|
||||
|
||||
HWR_Lighting(&sSurf, 0, colormap);
|
||||
sSurf.PolyColor.s.alpha = alpha;
|
||||
sSurf.PolyColor.s.alpha = FixedMul(thing->alpha, alpha);
|
||||
|
||||
if (HWR_UseShader())
|
||||
{
|
||||
|
@ -3055,10 +3106,15 @@ static void HWR_SplitSprite(gl_vissprite_t *spr)
|
|||
// co-ordinates
|
||||
memcpy(wallVerts, baseWallVerts, sizeof(baseWallVerts));
|
||||
|
||||
fixed_t newalpha = spr->mobj->alpha;
|
||||
|
||||
// if sprite has linkdraw, then dont write to z-buffer (by not using PF_Occlude)
|
||||
// this will result in sprites drawn afterwards to be drawn on top like intended when using linkdraw.
|
||||
if ((spr->mobj->flags2 & MF2_LINKDRAW) && spr->mobj->tracer)
|
||||
{
|
||||
newalpha = spr->mobj->tracer->alpha;
|
||||
occlusion = 0;
|
||||
}
|
||||
else
|
||||
occlusion = PF_Occlude;
|
||||
|
||||
|
@ -3095,6 +3151,8 @@ static void HWR_SplitSprite(gl_vissprite_t *spr)
|
|||
if (!occlusion) use_linkdraw_hack = true;
|
||||
}
|
||||
|
||||
Surf.PolyColor.s.alpha = FixedMul(newalpha, Surf.PolyColor.s.alpha);
|
||||
|
||||
if (HWR_UseShader())
|
||||
{
|
||||
shader = SHADER_SPRITE;
|
||||
|
@ -3291,7 +3349,7 @@ static void HWR_DrawBoundingBox(gl_vissprite_t *vis)
|
|||
v[15].y = v[16].y = v[17].y = v[21].y = v[22].y = v[23].y = vis->gzt; // top
|
||||
|
||||
Surf.PolyColor = V_GetColor(R_GetBoundingBoxColor(vis->mobj));
|
||||
|
||||
|
||||
HWR_ProcessPolygon(&Surf, v, 24, (cv_renderhitboxgldepth.value ? 0 : PF_NoDepthTest)|PF_Modulated|PF_NoTexture|PF_WireFrame, SHADER_NONE, false);
|
||||
}
|
||||
|
||||
|
@ -3543,11 +3601,15 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
|
|||
FBITFIELD blend = 0;
|
||||
FBITFIELD occlusion;
|
||||
boolean use_linkdraw_hack = false;
|
||||
fixed_t newalpha = spr->mobj->alpha;
|
||||
|
||||
// if sprite has linkdraw, then dont write to z-buffer (by not using PF_Occlude)
|
||||
// this will result in sprites drawn afterwards to be drawn on top like intended when using linkdraw.
|
||||
if ((spr->mobj->flags2 & MF2_LINKDRAW) && spr->mobj->tracer)
|
||||
{
|
||||
occlusion = 0;
|
||||
newalpha = spr->mobj->tracer->alpha;
|
||||
}
|
||||
else
|
||||
occlusion = PF_Occlude;
|
||||
|
||||
|
@ -3584,6 +3646,8 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
|
|||
if (!occlusion) use_linkdraw_hack = true;
|
||||
}
|
||||
|
||||
Surf.PolyColor.s.alpha = FixedMul(newalpha, Surf.PolyColor.s.alpha);
|
||||
|
||||
if (spr->renderflags & RF_SHADOWEFFECTS)
|
||||
{
|
||||
INT32 alpha = Surf.PolyColor.s.alpha;
|
||||
|
@ -3893,7 +3957,7 @@ void HWR_AddTransparentFloor(levelflat_t *levelflat, extrasubsector_t *xsub, boo
|
|||
|
||||
planeinfo[numplanes].isceiling = isceiling;
|
||||
planeinfo[numplanes].fixedheight = fixedheight;
|
||||
planeinfo[numplanes].lightlevel = (planecolormap && (planecolormap->flags & CMF_FOG)) ? 255 : lightlevel;
|
||||
planeinfo[numplanes].lightlevel = (planecolormap && (planecolormap->flags & CMF_FOG)) ? lightlevel : 255; // TODO: 2.3: Make transparent FOF planes always use light level
|
||||
planeinfo[numplanes].levelflat = levelflat;
|
||||
planeinfo[numplanes].xsub = xsub;
|
||||
planeinfo[numplanes].alpha = alpha;
|
||||
|
@ -3925,7 +3989,7 @@ void HWR_AddTransparentPolyobjectFloor(levelflat_t *levelflat, polyobj_t *polyse
|
|||
|
||||
polyplaneinfo[numpolyplanes].isceiling = isceiling;
|
||||
polyplaneinfo[numpolyplanes].fixedheight = fixedheight;
|
||||
polyplaneinfo[numpolyplanes].lightlevel = (planecolormap && (planecolormap->flags & CMF_FOG)) ? 255 : lightlevel;
|
||||
polyplaneinfo[numpolyplanes].lightlevel = (planecolormap && (planecolormap->flags & CMF_FOG)) ? lightlevel : 255; // TODO: 2.3: Make transparent polyobject planes always use light level
|
||||
polyplaneinfo[numpolyplanes].levelflat = levelflat;
|
||||
polyplaneinfo[numpolyplanes].polysector = polysector;
|
||||
polyplaneinfo[numpolyplanes].alpha = alpha;
|
||||
|
@ -4086,7 +4150,7 @@ static void HWR_CreateDrawNodes(void)
|
|||
else if (sortnode[sortindex[i]].wall)
|
||||
{
|
||||
if (!(sortnode[sortindex[i]].wall->blend & PF_NoTexture))
|
||||
HWR_GetTexture(sortnode[sortindex[i]].wall->texnum);
|
||||
HWR_GetTexture(sortnode[sortindex[i]].wall->texnum, true);
|
||||
HWR_RenderWall(sortnode[sortindex[i]].wall->wallVerts, &sortnode[sortindex[i]].wall->Surf, sortnode[sortindex[i]].wall->blend, sortnode[sortindex[i]].wall->fogwall,
|
||||
sortnode[sortindex[i]].wall->lightlevel, sortnode[sortindex[i]].wall->wallcolormap);
|
||||
}
|
||||
|
@ -5066,6 +5130,8 @@ static void HWR_DrawSkyBackground(player_t *player)
|
|||
|
||||
HWD.pfnSetBlend(PF_Translucent|PF_NoDepthTest|PF_Modulated);
|
||||
|
||||
HWR_GetTexture(texturetranslation[skytexture], false);
|
||||
|
||||
if (cv_glskydome.value)
|
||||
{
|
||||
FTransform dometransform;
|
||||
|
@ -5081,8 +5147,6 @@ static void HWR_DrawSkyBackground(player_t *player)
|
|||
HWR_SetTransformAiming(&dometransform, player, false);
|
||||
dometransform.angley = (float)((viewangle-ANGLE_270)>>ANGLETOFINESHIFT)*(360.0f/(float)FINEANGLES);
|
||||
|
||||
HWR_GetTexture(texturetranslation[skytexture]);
|
||||
|
||||
if (gl_sky.texture != texturetranslation[skytexture])
|
||||
{
|
||||
HWR_ClearSkyDome();
|
||||
|
@ -5102,7 +5166,6 @@ static void HWR_DrawSkyBackground(player_t *player)
|
|||
float aspectratio;
|
||||
float angleturn;
|
||||
|
||||
HWR_GetTexture(texturetranslation[skytexture]);
|
||||
aspectratio = (float)vid.width/(float)vid.height;
|
||||
|
||||
//Hurdler: the sky is the only texture who need 4.0f instead of 1.0
|
||||
|
@ -5221,7 +5284,9 @@ static void HWR_SetTransformAiming(FTransform *trans, player_t *player, boolean
|
|||
if (cv_glshearing.value == 1 || (cv_glshearing.value == 2 && R_IsViewpointThirdPerson(player, skybox)))
|
||||
{
|
||||
fixed_t fixedaiming = AIMINGTODY(aimingangle);
|
||||
trans->viewaiming = FIXED_TO_FLOAT(fixedaiming);
|
||||
trans->viewaiming = FIXED_TO_FLOAT(fixedaiming) * ((float)vid.width / vid.height) / ((float)BASEVIDWIDTH / BASEVIDHEIGHT);
|
||||
if (splitscreen)
|
||||
trans->viewaiming *= 2.125; // splitscreen adjusts fov with 0.8, so compensate (but only halfway, since splitscreen means only half the screen is used)
|
||||
trans->shearing = true;
|
||||
gl_aimingangle = 0;
|
||||
}
|
||||
|
@ -5540,7 +5605,7 @@ void HWR_RenderPlayerView(INT32 viewnumber, player_t *player)
|
|||
// Can't have palette rendering if shaders are disabled.
|
||||
boolean HWR_ShouldUsePaletteRendering(void)
|
||||
{
|
||||
return (cv_glpaletterendering.value && HWR_UseShader());
|
||||
return (pMasterPalette != NULL && cv_glpaletterendering.value && HWR_UseShader());
|
||||
}
|
||||
|
||||
// enable or disable palette rendering state depending on settings and availability
|
||||
|
@ -5657,7 +5722,7 @@ consvar_t cv_glbatching = CVAR_INIT ("gr_batching", "On", 0, CV_OnOff, NULL);
|
|||
|
||||
static CV_PossibleValue_t glpalettedepth_cons_t[] = {{16, "16 bits"}, {24, "24 bits"}, {0, NULL}};
|
||||
|
||||
consvar_t cv_glpaletterendering = CVAR_INIT ("gr_paletterendering", "Off", CV_SAVE|CV_CALL, CV_OnOff, CV_glpaletterendering_OnChange);
|
||||
consvar_t cv_glpaletterendering = CVAR_INIT ("gr_paletterendering", "On", CV_SAVE|CV_CALL, CV_OnOff, CV_glpaletterendering_OnChange);
|
||||
consvar_t cv_glpalettedepth = CVAR_INIT ("gr_palettedepth", "16 bits", CV_SAVE|CV_CALL, glpalettedepth_cons_t, CV_glpalettedepth_OnChange);
|
||||
|
||||
#define ONLY_IF_GL_LOADED if (vid.glstate != VID_GL_LIBRARY_LOADED) return;
|
||||
|
@ -5729,6 +5794,7 @@ void HWR_AddCommands(void)
|
|||
CV_RegisterVar(&cv_glskydome);
|
||||
CV_RegisterVar(&cv_glspritebillboarding);
|
||||
CV_RegisterVar(&cv_glfakecontrast);
|
||||
CV_RegisterVar(&cv_glslopecontrast);
|
||||
CV_RegisterVar(&cv_glshearing);
|
||||
CV_RegisterVar(&cv_glshaders);
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -1093,19 +1093,19 @@ static modelspr2frames_t *HWR_GetModelSprite2Frames(md2_t *md2, UINT16 spr2)
|
|||
return &md2->model->superspr2frames[spr2];
|
||||
}
|
||||
|
||||
if (md2->model->spr2frames)
|
||||
if (md2->model->spr2frames[spr2].numframes)
|
||||
return &md2->model->spr2frames[spr2];
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static modelspr2frames_t *HWR_GetModelSprite2(md2_t *md2, skin_t *skin, UINT16 spr2, player_t *player)
|
||||
static UINT16 HWR_GetModelSprite2Num(md2_t *md2, skin_t *skin, UINT16 spr2, player_t *player)
|
||||
{
|
||||
UINT16 super = 0;
|
||||
UINT8 i = 0;
|
||||
|
||||
if (!md2 || !md2->model || !skin)
|
||||
return HWR_GetModelSprite2Frames(md2, 0);
|
||||
return 0;
|
||||
|
||||
while (!HWR_GetModelSprite2Frames(md2, spr2)
|
||||
&& spr2 != SPR2_STND
|
||||
|
@ -1145,7 +1145,7 @@ static modelspr2frames_t *HWR_GetModelSprite2(md2_t *md2, skin_t *skin, UINT16 s
|
|||
if (i >= 32) // probably an infinite loop...
|
||||
spr2 = 0;
|
||||
|
||||
return HWR_GetModelSprite2Frames(md2, spr2);
|
||||
return spr2;
|
||||
}
|
||||
|
||||
// Adjust texture coords of model to fit into a patch's max_s and max_t
|
||||
|
@ -1154,6 +1154,9 @@ static void adjustTextureCoords(model_t *model, patch_t *patch)
|
|||
int i;
|
||||
GLPatch_t *gpatch = ((GLPatch_t *)patch->hardware);
|
||||
|
||||
if (!gpatch)
|
||||
return;
|
||||
|
||||
for (i = 0; i < model->numMeshes; i++)
|
||||
{
|
||||
int j;
|
||||
|
@ -1190,6 +1193,90 @@ static void adjustTextureCoords(model_t *model, patch_t *patch)
|
|||
model->max_t = gpatch->max_t;
|
||||
}
|
||||
|
||||
static INT32 GetAnimDuration(mobj_t *mobj) //part of p_mobj's setplayermobjstate logic, used to make sure that anim durations are actually correct when the speed gets adjusted on players
|
||||
{
|
||||
player_t *player = mobj->player;
|
||||
INT32 tics = mobj->state->tics;
|
||||
|
||||
if (!(mobj->frame & FF_ANIMATE) && mobj->anim_duration) //set manually by something through lua
|
||||
return mobj->anim_duration;
|
||||
|
||||
if (!player && mobj->type == MT_TAILSOVERLAY && mobj->tracer) //so tails overlays interpolate properly
|
||||
player = mobj->tracer->player;
|
||||
if (player)
|
||||
{
|
||||
if (player->panim == PA_EDGE && (player->charflags & SF_FASTEDGE))
|
||||
tics = 2;
|
||||
else if (player->powers[pw_tailsfly] && (!(player->mo->eflags & MFE_UNDERWATER) || (mobj->type == MT_PLAYER))) //tailsoverlay does not get adjusted from these rules when underwater
|
||||
{
|
||||
if (player->fly1 > 0)
|
||||
tics = 1;
|
||||
else if (!(player->mo->eflags & MFE_UNDERWATER))
|
||||
tics = 2;
|
||||
else
|
||||
tics = 4;
|
||||
}
|
||||
else if (!(disableSpeedAdjust || player->charflags & SF_NOSPEEDADJUST))
|
||||
{
|
||||
fixed_t speed;// = FixedDiv(player->speed, FixedMul(mobj->scale, player->mo->movefactor));
|
||||
if (player->panim == PA_FALL)
|
||||
{
|
||||
speed = FixedDiv(abs(mobj->momz), mobj->scale);
|
||||
if (speed < 10<<FRACBITS)
|
||||
tics = 4;
|
||||
else if (speed < 20<<FRACBITS)
|
||||
tics = 3;
|
||||
else if (speed < 30<<FRACBITS)
|
||||
tics = 2;
|
||||
else
|
||||
tics = 1;
|
||||
}
|
||||
else if (player->panim == PA_ABILITY2 && player->charability2 == CA2_SPINDASH)
|
||||
{
|
||||
fixed_t step = (player->maxdash - player->mindash)/4;
|
||||
speed = (player->dashspeed - player->mindash);
|
||||
if (speed > 3*step)
|
||||
tics = 1;
|
||||
else if (speed > step)
|
||||
tics = 2;
|
||||
else
|
||||
tics = 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
speed = FixedDiv(player->speed, FixedMul(mobj->scale, player->mo->movefactor));
|
||||
if (player->panim == PA_ROLL || player->panim == PA_JUMP)
|
||||
{
|
||||
if (speed > 16<<FRACBITS)
|
||||
tics = 1;
|
||||
else
|
||||
tics = 2;
|
||||
}
|
||||
else if (P_IsObjectOnGround(mobj) || ((player->charability == CA_FLOAT || player->charability == CA_SLOWFALL) && player->secondjump == 1) || player->powers[pw_super]) // Only if on the ground or superflying.
|
||||
{
|
||||
if (player->panim == PA_WALK)
|
||||
{
|
||||
if (speed > 12<<FRACBITS)
|
||||
tics = 2;
|
||||
else if (speed > 6<<FRACBITS)
|
||||
tics = 3;
|
||||
else
|
||||
tics = 4;
|
||||
}
|
||||
else if ((player->panim == PA_RUN) || (player->panim == PA_DASH))
|
||||
{
|
||||
if (speed > 52<<FRACBITS)
|
||||
tics = 1;
|
||||
else
|
||||
tics = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return tics;
|
||||
}
|
||||
|
||||
//
|
||||
// HWR_DrawModel
|
||||
//
|
||||
|
@ -1263,12 +1350,13 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
|
|||
{
|
||||
patch_t *gpatch, *blendgpatch;
|
||||
GLPatch_t *hwrPatch = NULL, *hwrBlendPatch = NULL;
|
||||
float durs = (float)spr->mobj->state->tics;
|
||||
float durs = GetAnimDuration(spr->mobj);
|
||||
float tics = (float)spr->mobj->tics;
|
||||
const boolean papersprite = (R_ThingIsPaperSprite(spr->mobj) && !R_ThingIsFloorSprite(spr->mobj));
|
||||
const UINT8 flip = (UINT8)(!(spr->mobj->eflags & MFE_VERTICALFLIP) != !R_ThingVerticallyFlipped(spr->mobj));
|
||||
const UINT8 hflip = (UINT8)(!(spr->mobj->mirrored) != !R_ThingHorizontallyFlipped(spr->mobj));
|
||||
spritedef_t *sprdef;
|
||||
UINT16 spr2 = 0;
|
||||
spriteframe_t *sprframe;
|
||||
INT32 mod;
|
||||
interpmobjstate_t interp;
|
||||
|
@ -1283,8 +1371,13 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
|
|||
}
|
||||
|
||||
// Apparently people don't like jump frames like that, so back it goes
|
||||
//if (tics > durs)
|
||||
//durs = tics;
|
||||
if (tics > durs)
|
||||
durs = tics;
|
||||
|
||||
// Make linkdraw objects use their tracer's alpha value
|
||||
fixed_t newalpha = spr->mobj->alpha;
|
||||
if ((spr->mobj->flags2 & MF2_LINKDRAW) && spr->mobj->tracer)
|
||||
newalpha = spr->mobj->tracer->alpha;
|
||||
|
||||
INT32 blendmode;
|
||||
if (spr->mobj->frame & FF_BLENDMASK)
|
||||
|
@ -1300,6 +1393,8 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
|
|||
Surf.PolyFlags = HWR_GetBlendModeFlag(blendmode);
|
||||
}
|
||||
|
||||
Surf.PolyColor.s.alpha = FixedMul(newalpha, Surf.PolyColor.s.alpha);
|
||||
|
||||
// don't forget to enable the depth test because we can't do this
|
||||
// like before: model polygons are not sorted
|
||||
|
||||
|
@ -1438,13 +1533,17 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
|
|||
|
||||
frame = (spr->mobj->frame & FF_FRAMEMASK);
|
||||
if (spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
|
||||
spr2frames = HWR_GetModelSprite2(md2, spr->mobj->skin, spr->mobj->sprite2, spr->mobj->player);
|
||||
{
|
||||
spr2 = HWR_GetModelSprite2Num(md2, spr->mobj->skin, spr->mobj->sprite2, spr->mobj->player);
|
||||
spr2frames = HWR_GetModelSprite2Frames(md2, spr2);
|
||||
}
|
||||
if (spr2frames)
|
||||
{
|
||||
spritedef_t *defaultdef = P_GetSkinSpritedef(spr->mobj->skin, spr2);
|
||||
mod = spr2frames->numframes;
|
||||
#ifndef DONTHIDEDIFFANIMLENGTH // by default, different anim length is masked by the mod
|
||||
if (mod > (INT32)sprdef->numframes)
|
||||
mod = sprdef->numframes;
|
||||
if (mod > (INT32)defaultdef->numframes)
|
||||
mod = defaultdef->numframes;
|
||||
#endif
|
||||
if (!mod)
|
||||
mod = 1;
|
||||
|
@ -1592,7 +1691,6 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
|
|||
HWD.pfnDrawModel(md2->model, frame, durs, tics, nextFrame, &p, md2->scale * xs, md2->scale * ys, flip, hflip, &Surf);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2021 by Sonic Team Junior.
|
||||
// Copyright (C) 2021-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -448,6 +448,101 @@ void HWR_LoadAllCustomShaders(void)
|
|||
HWR_LoadCustomShadersFromFile(i, W_FileHasFolders(wadfiles[i]));
|
||||
}
|
||||
|
||||
static const char version_directives[][14] = {
|
||||
"#version 330\n",
|
||||
"#version 150\n",
|
||||
"#version 140\n",
|
||||
"#version 130\n",
|
||||
"#version 120\n",
|
||||
"#version 110\n",
|
||||
};
|
||||
|
||||
static boolean HWR_VersionDirectiveExists(const char* source)
|
||||
{
|
||||
return strncmp(source, "#version", 8) == 0;
|
||||
}
|
||||
|
||||
static char* HWR_PrependVersionDirective(const char* source, UINT32 version_index)
|
||||
{
|
||||
const UINT32 version_len = sizeof(version_directives[version_index]) - 1;
|
||||
const UINT32 source_len = strlen(source);
|
||||
|
||||
char* result = Z_Malloc(source_len + version_len + 1, PU_STATIC, NULL);
|
||||
strcpy(result, version_directives[version_index]);
|
||||
strcpy(result + version_len, source);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static void HWR_ReplaceVersionInplace(char* shader, UINT32 version_index)
|
||||
{
|
||||
shader[9] = version_directives[version_index][9];
|
||||
shader[10] = version_directives[version_index][10];
|
||||
shader[11] = version_directives[version_index][11];
|
||||
}
|
||||
|
||||
static boolean HWR_CheckVersionDirectives(const char* vert, const char* frag)
|
||||
{
|
||||
return HWR_VersionDirectiveExists(vert) && HWR_VersionDirectiveExists(frag);
|
||||
}
|
||||
|
||||
static void HWR_TryToCompileShaderWithImplicitVersion(INT32 shader_index, INT32 shaderxlat_id)
|
||||
{
|
||||
char* vert_shader = gl_shaders[shader_index].vertex;
|
||||
char* frag_shader = gl_shaders[shader_index].fragment;
|
||||
|
||||
boolean vert_shader_version_exists = HWR_VersionDirectiveExists(vert_shader);
|
||||
boolean frag_shader_version_exists = HWR_VersionDirectiveExists(frag_shader);
|
||||
|
||||
if(!vert_shader_version_exists) {
|
||||
CONS_Alert(CONS_WARNING, "HWR_LoadCustomShadersFromFile: vertex shader '%s' is missing a #version directive\n", HWR_GetShaderName(shaderxlat_id));
|
||||
}
|
||||
|
||||
if(!frag_shader_version_exists) {
|
||||
CONS_Alert(CONS_WARNING, "HWR_LoadCustomShadersFromFile: fragment shader '%s' is missing a #version directive\n", HWR_GetShaderName(shaderxlat_id));
|
||||
}
|
||||
|
||||
// try to compile as is
|
||||
HWR_CompileShader(shader_index);
|
||||
if (gl_shaders[shader_index].compiled)
|
||||
return;
|
||||
|
||||
// try each version directive
|
||||
for(UINT32 i = 0; i < sizeof(version_directives) / sizeof(version_directives[0]); ++i) {
|
||||
CONS_Alert(CONS_NOTICE, "HWR_TryToCompileShaderWithImplicitVersion: Trying %s\n", version_directives[i]);
|
||||
|
||||
if(!vert_shader_version_exists) {
|
||||
// first time reallocation would have to be made
|
||||
|
||||
if(i == 0) {
|
||||
void* old = (void*)gl_shaders[shader_index].vertex;
|
||||
vert_shader = gl_shaders[shader_index].vertex = HWR_PrependVersionDirective(vert_shader, i);
|
||||
Z_Free(old);
|
||||
} else {
|
||||
HWR_ReplaceVersionInplace(vert_shader, i);
|
||||
}
|
||||
}
|
||||
|
||||
if(!frag_shader_version_exists) {
|
||||
if(i == 0) {
|
||||
void* old = (void*)gl_shaders[shader_index].fragment;
|
||||
frag_shader = gl_shaders[shader_index].fragment = HWR_PrependVersionDirective(frag_shader, i);
|
||||
Z_Free(old);
|
||||
} else {
|
||||
HWR_ReplaceVersionInplace(frag_shader, i);
|
||||
}
|
||||
}
|
||||
|
||||
HWR_CompileShader(shader_index);
|
||||
if (gl_shaders[shader_index].compiled) {
|
||||
CONS_Alert(CONS_NOTICE, "HWR_TryToCompileShaderWithImplicitVersion: Compiled with %s\n",
|
||||
version_directives[i]);
|
||||
CONS_Alert(CONS_WARNING, "Implicit GLSL version is used. Correct behavior is not guaranteed\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void HWR_LoadCustomShadersFromFile(UINT16 wadnum, boolean PK3)
|
||||
{
|
||||
UINT16 lump;
|
||||
|
@ -610,7 +705,13 @@ skip_field:
|
|||
gl_shaders[shader_index].fragment = Z_StrDup(gl_shadersources[i].fragment);
|
||||
if (!gl_shaders[shader_index].vertex)
|
||||
gl_shaders[shader_index].vertex = Z_StrDup(gl_shadersources[i].vertex);
|
||||
HWR_CompileShader(shader_index);
|
||||
|
||||
if(!HWR_CheckVersionDirectives(gl_shaders[shader_index].vertex, gl_shaders[shader_index].fragment)) {
|
||||
HWR_TryToCompileShaderWithImplicitVersion(shader_index, i);
|
||||
} else {
|
||||
HWR_CompileShader(shader_index);
|
||||
}
|
||||
|
||||
if (!gl_shaders[shader_index].compiled)
|
||||
CONS_Alert(CONS_ERROR, "HWR_LoadCustomShadersFromFile: A compilation error occured for the %s shader in file %s. See the console messages above for more information.\n", shaderxlat[i].type, wadfiles[wadnum]->filename);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2021 by Sonic Team Junior.
|
||||
// Copyright (C) 2021-2024 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -117,7 +117,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, // handle to DLL module
|
|||
#define pwglDeleteContext wglDeleteContext;
|
||||
#define pwglMakeCurrent wglMakeCurrent;
|
||||
#else
|
||||
static HMODULE OGL32, GLU32;
|
||||
static HMODULE OGL32;
|
||||
typedef void *(WINAPI *PFNwglGetProcAddress) (const char *);
|
||||
static PFNwglGetProcAddress pwglGetProcAddress;
|
||||
typedef HGLRC (WINAPI *PFNwglCreateContext) (HDC hdc);
|
||||
|
@ -132,13 +132,6 @@ static PFNwglMakeCurrent pwglMakeCurrent;
|
|||
void *GetGLFunc(const char *proc)
|
||||
{
|
||||
void *func = NULL;
|
||||
if (strncmp(proc, "glu", 3) == 0)
|
||||
{
|
||||
if (GLU32)
|
||||
func = GetProcAddress(GLU32, proc);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
if (pwglGetProcAddress)
|
||||
func = pwglGetProcAddress(proc);
|
||||
if (!func)
|
||||
|
@ -155,8 +148,6 @@ boolean LoadGL(void)
|
|||
if (!OGL32)
|
||||
return 0;
|
||||
|
||||
GLU32 = LoadLibrary("GLU32.DLL");
|
||||
|
||||
pwglGetProcAddress = GetGLFunc("wglGetProcAddress");
|
||||
pwglCreateContext = GetGLFunc("wglCreateContext");
|
||||
pwglDeleteContext = GetGLFunc("wglDeleteContext");
|
||||
|
@ -528,7 +519,6 @@ EXPORT void HWRAPI(Shutdown) (void)
|
|||
ReleaseDC(hWnd, hDC);
|
||||
hDC = NULL;
|
||||
}
|
||||
FreeLibrary(GLU32);
|
||||
FreeLibrary(OGL32);
|
||||
GL_DBG_Printf ("HWRAPI Shutdown(DONE)\n");
|
||||
}
|
||||
|
|
|
@ -96,6 +96,7 @@ static GLint min_filter = GL_LINEAR;
|
|||
static GLint mag_filter = GL_LINEAR;
|
||||
static GLint anisotropic_filter = 0;
|
||||
static boolean model_lighting = false;
|
||||
boolean supportMipMap = false;
|
||||
|
||||
const GLubyte *gl_version = NULL;
|
||||
const GLubyte *gl_renderer = NULL;
|
||||
|
@ -417,9 +418,6 @@ static PFNglCopyTexImage2D pglCopyTexImage2D;
|
|||
typedef void (APIENTRY * PFNglCopyTexSubImage2D) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
static PFNglCopyTexSubImage2D pglCopyTexSubImage2D;
|
||||
#endif
|
||||
/* GLU functions */
|
||||
typedef GLint (APIENTRY * PFNgluBuild2DMipmaps) (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data);
|
||||
static PFNgluBuild2DMipmaps pgluBuild2DMipmaps;
|
||||
|
||||
/* 1.2 functions for 3D textures */
|
||||
typedef void (APIENTRY * PFNglTexImage3D) (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
|
@ -708,9 +706,6 @@ void SetupGLFunc4(void)
|
|||
pglUniform3fv = GetGLFunc("glUniform3fv");
|
||||
pglGetUniformLocation = GetGLFunc("glGetUniformLocation");
|
||||
#endif
|
||||
|
||||
// GLU
|
||||
pgluBuild2DMipmaps = GetGLFunc("gluBuild2DMipmaps");
|
||||
}
|
||||
|
||||
EXPORT boolean HWRAPI(InitShaders) (void)
|
||||
|
@ -718,7 +713,7 @@ EXPORT boolean HWRAPI(InitShaders) (void)
|
|||
#ifdef GL_SHADERS
|
||||
if (!pglUseProgram)
|
||||
return false;
|
||||
|
||||
|
||||
gl_fallback_shader.vertex_shader = Z_StrDup(GLSL_FALLBACK_VERTEX_SHADER);
|
||||
gl_fallback_shader.fragment_shader = Z_StrDup(GLSL_FALLBACK_FRAGMENT_SHADER);
|
||||
|
||||
|
@ -1617,7 +1612,8 @@ EXPORT void HWRAPI(UpdateTexture) (GLMipmap_t *pTexInfo)
|
|||
//pglTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
|
||||
if (MipMap)
|
||||
{
|
||||
pgluBuild2DMipmaps(GL_TEXTURE_2D, GL_LUMINANCE_ALPHA, w, h, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
|
||||
pglTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE_ALPHA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_LOD, 0);
|
||||
if (pTexInfo->flags & TF_TRANSPARENT)
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 0); // No mippmaps on transparent stuff
|
||||
|
@ -1638,7 +1634,8 @@ EXPORT void HWRAPI(UpdateTexture) (GLMipmap_t *pTexInfo)
|
|||
//pglTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
|
||||
if (MipMap)
|
||||
{
|
||||
pgluBuild2DMipmaps(GL_TEXTURE_2D, GL_ALPHA, w, h, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
|
||||
pglTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_LOD, 0);
|
||||
if (pTexInfo->flags & TF_TRANSPARENT)
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 0); // No mippmaps on transparent stuff
|
||||
|
@ -1658,7 +1655,8 @@ EXPORT void HWRAPI(UpdateTexture) (GLMipmap_t *pTexInfo)
|
|||
{
|
||||
if (MipMap)
|
||||
{
|
||||
pgluBuild2DMipmaps(GL_TEXTURE_2D, textureformatGL, w, h, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
|
||||
pglTexImage2D(GL_TEXTURE_2D, 0, textureformatGL, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
|
||||
// Control the mipmap level of detail
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_LOD, 0); // the lower the number, the higer the detail
|
||||
if (pTexInfo->flags & TF_TRANSPARENT)
|
||||
|
@ -2241,7 +2239,7 @@ EXPORT void HWRAPI(SetSpecialState) (hwdspecialstate_t IdState, INT32 Value)
|
|||
mag_filter = GL_LINEAR;
|
||||
min_filter = GL_NEAREST;
|
||||
}
|
||||
if (!pgluBuild2DMipmaps)
|
||||
if (!supportMipMap)
|
||||
{
|
||||
MipMap = GL_FALSE;
|
||||
min_filter = GL_LINEAR;
|
||||
|
@ -3257,6 +3255,24 @@ EXPORT UINT32 HWRAPI(CreateLightTable)(RGBA_t *hw_lighttable)
|
|||
return item->id;
|
||||
}
|
||||
|
||||
EXPORT void HWRAPI(UpdateLightTable)(UINT32 id, RGBA_t *hw_lighttable)
|
||||
{
|
||||
LTListItem *item = LightTablesHead;
|
||||
while (item && item->id != id)
|
||||
item = item->next;
|
||||
|
||||
if (item)
|
||||
{
|
||||
pglBindTexture(GL_TEXTURE_2D, item->id);
|
||||
|
||||
// Just update it
|
||||
pglTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 256, 32, GL_RGBA, GL_UNSIGNED_BYTE, hw_lighttable);
|
||||
|
||||
// restore previously bound texture
|
||||
pglBindTexture(GL_TEXTURE_2D, tex_downloaded);
|
||||
}
|
||||
}
|
||||
|
||||
// Delete light table textures, ids given before become invalid and must not be used.
|
||||
EXPORT void HWRAPI(ClearLightTables)(void)
|
||||
{
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
|
||||
#else
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
|
||||
#ifdef STATIC_OPENGL // Because of the 1.3 functions, you'll need GLext to compile it if static
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
|
@ -127,6 +126,7 @@ extern GLint screen_width;
|
|||
extern GLint screen_height;
|
||||
extern GLbyte screen_depth;
|
||||
extern GLint maximumAnisotropy;
|
||||
extern boolean supportMipMap;
|
||||
|
||||
/** \brief OpenGL flags for video driver
|
||||
*/
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue