mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-28 15:11:55 +00:00
Merge remote-tracking branch 'stjr/next' into lua-gfx-2
This commit is contained in:
commit
6d5f5a5247
40 changed files with 1182 additions and 684 deletions
4
.gitattributes
vendored
4
.gitattributes
vendored
|
@ -1,15 +1,17 @@
|
|||
#Source code
|
||||
/Makefile text=auto
|
||||
/src/*.c text=auto
|
||||
/src/*.h text=auto
|
||||
/src/*.s text=auto
|
||||
/src/*.m text=auto
|
||||
/src/*.xpm text=auto
|
||||
/src/Makefile text=auto
|
||||
/tools/Makefile text=auto
|
||||
/src/Make*.cfg text=auto
|
||||
/src/CMakeLists.txt text=auto
|
||||
*.mk -whitespace text=auto
|
||||
# Windows EOL
|
||||
*.cs -crlf -whitespace
|
||||
*.mk -crlf -whitespace
|
||||
*.bat -crlf -whitespace
|
||||
*.dev -crlf -whitespace
|
||||
*.dsp -crlf -whitespace
|
||||
|
|
484
.gitlab-ci.yml
Normal file
484
.gitlab-ci.yml
Normal file
|
@ -0,0 +1,484 @@
|
|||
variables:
|
||||
GIT_STRATEGY: clone
|
||||
GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_CONCURRENT_ID/$CI_PROJECT_PATH
|
||||
|
||||
default:
|
||||
image: debian:stable-slim
|
||||
|
||||
cache:
|
||||
- key: ccache-$CI_PROJECT_PATH_SLUG-$CI_JOB_NAME_SLUG
|
||||
fallback_keys:
|
||||
- cache-$CI_PROJECT_PATH_SLUG-$CI_DEFAULT_BRANCH
|
||||
- cache-$CI_PROJECT_PATH_SLUG-default
|
||||
paths:
|
||||
- ccache
|
||||
- ccache_statslog
|
||||
|
||||
- key: apt-$CI_JOB_IMAGE
|
||||
paths:
|
||||
- apt-cache
|
||||
unprotect: true
|
||||
|
||||
before_script:
|
||||
- - |
|
||||
# debconf
|
||||
echo -e "\e[0Ksection_start:`date +%s`:debconf[collapsed=true]\r\e[0KSetup debconf's environment"
|
||||
- export DEBIAN_FRONTEND="noninteractive"
|
||||
- export DEBIAN_PRIORITY="low"
|
||||
- export DEBCONF_NONINTERACTIVE_SEEN="true"
|
||||
- |
|
||||
# debconf
|
||||
echo -e "\e[0Ksection_end:`date +%s`:debconf\r\e[0K"
|
||||
- - |
|
||||
# dpkg_aa
|
||||
echo -e "\e[0Ksection_start:`date +%s`:dpkg_aa[collapsed=true]\r\e[0KAdding architectures to dpkg"
|
||||
- dpkg --add-architecture i386
|
||||
- dpkg --add-architecture amd64
|
||||
- dpkg --add-architecture arm64
|
||||
- |
|
||||
# dpkg_aa
|
||||
echo -e "\e[0Ksection_end:`date +%s`:dpkg_aa\r\e[0K"
|
||||
- - |
|
||||
# apt_conf
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apt_conf[collapsed=true]\r\e[0KSetting up APT conf"
|
||||
- export APT_CACHE_DIR=`pwd`/apt-cache
|
||||
- mkdir --parents --verbose $APT_CACHE_DIR/partial/
|
||||
- touch /etc/apt/apt.conf.d/99build
|
||||
- |
|
||||
# apt.conf
|
||||
echo Adding options to apt.conf':'
|
||||
- |
|
||||
# APT::Install-Recommends
|
||||
echo APT::Install-Recommends "false"\; | tee --append /etc/apt/apt.conf.d/99build
|
||||
- |
|
||||
# quit
|
||||
echo quiet "1"\; | tee --append /etc/apt/apt.conf.d/99build
|
||||
- |
|
||||
# APT::Get::Assume-Yes
|
||||
echo APT::Get::Assume-Yes "true"\; | tee --append /etc/apt/apt.conf.d/99build
|
||||
- |
|
||||
# Dir::Cache::Archives
|
||||
echo Dir::Cache::Archives "$APT_CACHE_DIR"\; | tee --append /etc/apt/apt.conf.d/99build
|
||||
- |
|
||||
# apt_conf
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apt_conf\r\e[0K"
|
||||
- - |
|
||||
# apt_update
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apt_update[collapsed=true]\r\e[0KUpdating APT listing"
|
||||
- apt-get update
|
||||
- |
|
||||
# apt_update
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apt_update\r\e[0K"
|
||||
|
||||
- - |
|
||||
# apt_pre
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apt_pre[collapsed=true]\r\e[0KInstalling pre packages"
|
||||
- apt-get install apt-utils
|
||||
- |
|
||||
# apt_pre
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apt_pre\r\e[0K"
|
||||
|
||||
- - |
|
||||
# apt_upgrade
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apt_upgrade[collapsed=true]\r\e[0KUpdating existing packages"
|
||||
- apt-get upgrade
|
||||
- |
|
||||
# apt_update
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apt_upgrade\r\e[0K"
|
||||
|
||||
- - |
|
||||
# apt_common
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apt_common[collapsed=true]\r\e[0KInstalling common packages"
|
||||
- apt-get install make git ccache nasm
|
||||
- |
|
||||
# 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 --verbose
|
||||
- ccache --show-log-stats --verbose
|
||||
- |
|
||||
# ccahe_stats
|
||||
echo -e "\e[0Ksection_end:`date +%s`:ccache_stats\r\e[0K"
|
||||
|
||||
stages:
|
||||
- build
|
||||
|
||||
Debian testing GCC:
|
||||
stage: build
|
||||
image: debian:testing-slim
|
||||
|
||||
allow_failure: true
|
||||
|
||||
artifacts:
|
||||
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
|
||||
- |
|
||||
# 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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
- |
|
||||
# apt_development
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
|
||||
|
||||
- - |
|
||||
# make
|
||||
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
|
||||
- make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX64=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX64=1
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
||||
|
||||
Debian stable:i386:
|
||||
stage: build
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "bin/"
|
||||
- "src/comptime.h"
|
||||
expose_as: "Debian i386"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-i686"
|
||||
|
||||
variables:
|
||||
CC: i686-linux-gnu-gcc
|
||||
OBJCOPY: i686-linux-gnu-objcopy
|
||||
OBJDUMP: i686-linux-gnu-objdump
|
||||
PKG_CONFIG_PATH: /usr/lib/i386-linux-gnu/pkgconfig
|
||||
|
||||
script:
|
||||
- - |
|
||||
# apt_toolchain
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apt_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
|
||||
- apt-get install gcc-i686-linux-gnu || apt-get install gcc
|
||||
- |
|
||||
# apt_toolchain
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apt_toolchain\r\e[0K"
|
||||
|
||||
- - |
|
||||
# apt_development
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages"
|
||||
- apt-get install libsdl2-mixer-dev:i386 libpng-dev:i386 libcurl4-openssl-dev:i386 libgme-dev:i386 libopenmpt-dev:i386
|
||||
- |
|
||||
# apt_development
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
|
||||
|
||||
- - |
|
||||
# make
|
||||
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
|
||||
- make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX=1
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
||||
|
||||
Debian stable:arm64:
|
||||
stage: build
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "bin/"
|
||||
- "src/comptime.h"
|
||||
expose_as: "Debian arm64"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-aarch64"
|
||||
|
||||
variables:
|
||||
CC: aarch64-linux-gnu-gcc
|
||||
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
|
||||
- |
|
||||
# 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=1C || 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"
|
||||
|
||||
Windows x64:
|
||||
stage: build
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- "bin/"
|
||||
- "src/comptime.h"
|
||||
expose_as: "Win64"
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-Win64"
|
||||
|
||||
variables:
|
||||
PREFIX: x86_64-w64-mingw32
|
||||
|
||||
script:
|
||||
- - |
|
||||
# apt_toolchain
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apt_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
|
||||
- apt-get install gcc-mingw-w64-x86-64-win32
|
||||
- |
|
||||
# apt_toolchain
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apt_toolchain\r\e[0K"
|
||||
|
||||
- - |
|
||||
# make
|
||||
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
|
||||
- make --directory=src --keep-going CCACHE=1 ERRORMODE=1 MINGW64=1 SDL=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 MINGW64=1 SDL=1
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
||||
|
||||
Debian stable Clang:
|
||||
stage: build
|
||||
|
||||
allow_failure: true
|
||||
|
||||
artifacts:
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-clang"
|
||||
|
||||
variables:
|
||||
CC: clang
|
||||
WFLAGS: -Wno-cast-align
|
||||
CFLAGS: -Wno-cast-align
|
||||
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
|
||||
- |
|
||||
# apt_development
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
|
||||
|
||||
- - |
|
||||
# make
|
||||
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
|
||||
- make --directory=src --keep-going CCACHE=1 ERRORMODE=1 NONX86=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 NONX86=1
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
||||
|
||||
Debian stable musl:
|
||||
stage: build
|
||||
|
||||
allow_failure: true
|
||||
|
||||
artifacts:
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-musl"
|
||||
|
||||
variables:
|
||||
CC: musl-gcc
|
||||
LDD: musl-ldd
|
||||
|
||||
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 musl-tools
|
||||
- |
|
||||
# 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 SDL=0 NOHW=1 NOZLIB=1 NOCURL=1 NOGME=1 NOOPENMPT=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 NONX86=1 SDL=0 NOHW=1 NOZLIB=1 NOCURL=1 NOGME=1 NOOPENMPT=1
|
||||
- |
|
||||
# make
|
||||
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
|
||||
|
||||
Debian testing Clang:
|
||||
extends: Debian stable Clang
|
||||
|
||||
image: debian:testing-slim
|
||||
|
||||
artifacts:
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-testing-clang"
|
||||
|
||||
variables:
|
||||
CC: clang
|
||||
WFLAGS: -Wno-cast-align -Wno-deprecated-non-prototype
|
||||
CFLAGS: -Wno-cast-align -Wno-deprecated-non-prototype
|
||||
LDFLAGS: -Wl,-fuse-ld=gold
|
||||
|
||||
Debian testing musl:
|
||||
extends: Debian stable musl
|
||||
|
||||
image: debian:testing-slim
|
||||
|
||||
artifacts:
|
||||
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-testing-musl"
|
||||
|
||||
variables:
|
||||
CC: musl-gcc
|
||||
LDD: musl-ldd
|
||||
LDFLAGS: -Wl,-fuse-ld=gold
|
|
@ -3,12 +3,12 @@ ifdef ComSpec
|
|||
COMSPEC=$(ComSpec)
|
||||
endif
|
||||
ifdef COMSPEC
|
||||
OBJCOPY=objcopy.exe
|
||||
OBJDUMP=objdump.exe
|
||||
OBJCOPY?=objcopy.exe
|
||||
OBJDUMP?=objdump.exe
|
||||
GZIP?=gzip.exe
|
||||
else
|
||||
OBJCOPY=objcopy
|
||||
OBJDUMP=objdump
|
||||
OBJCOPY?=objcopy
|
||||
OBJDUMP?=objdump
|
||||
GZIP?=gzip
|
||||
endif
|
||||
DBGNAME=$(BIN).debug
|
||||
|
|
|
@ -140,9 +140,9 @@ endif
|
|||
|
||||
OBJDUMP_OPTS?=--wide --source --line-numbers
|
||||
|
||||
OBJCOPY:=$(call Prefix,objcopy)
|
||||
OBJDUMP:=$(call Prefix,objdump)
|
||||
WINDRES:=$(call Prefix,windres)
|
||||
OBJCOPY?=$(call Prefix,objcopy)
|
||||
OBJDUMP?=$(call Prefix,objdump)
|
||||
WINDRES?=$(call Prefix,windres)
|
||||
|
||||
GZIP?=gzip
|
||||
GZIP_OPTS?=-9 -f -n
|
||||
|
|
|
@ -56,15 +56,18 @@ endif
|
|||
|
||||
# This must have high to low order.
|
||||
gcc_versions:=\
|
||||
102 101\
|
||||
93 92 91\
|
||||
84 83 82 81\
|
||||
75 74 73 72 71\
|
||||
64 63 62 61\
|
||||
55 54 53 52 51\
|
||||
132 131 130\
|
||||
123 122 121 120\
|
||||
114 113 112 111 110\
|
||||
105 104 103 102 101 100\
|
||||
95 94 93 92 91 90\
|
||||
85 84 83 82 81 80\
|
||||
75 74 73 72 71 70\
|
||||
64 63 62 61 60\
|
||||
55 54 53 52 51 50\
|
||||
49 48 47 46 45 44 43 42 41 40
|
||||
|
||||
latest_gcc_version:=10.2
|
||||
latest_gcc_version:=13.2
|
||||
|
||||
# Automatically set version flag, but not if one was
|
||||
# manually set. And don't bother if this is a clean only
|
||||
|
@ -74,13 +77,18 @@ ifeq (,$(call Wildvar,GCC% destructive))
|
|||
# can't use $(CC) --version here since that uses argv[0] to display the name
|
||||
# also gcc outputs the information to stderr, so I had to do 2>&1
|
||||
# this program really doesn't like identifying itself
|
||||
version:=$(shell $(CC) -v 2>&1)
|
||||
shellversion:=$(shell $(CC) -v 2>&1)
|
||||
# Try to remove "-win32"
|
||||
version:=$(subst -win32,.0,$(shellversion))
|
||||
|
||||
# check if this is in fact GCC
|
||||
ifneq (,$(findstring gcc version,$(version)))
|
||||
|
||||
# in stark contrast to the name, gcc will give me a nicely formatted version number for free
|
||||
version:=$(shell $(CC) -dumpfullversion)
|
||||
shellversion:=$(shell $(CC) -dumpfullversion)
|
||||
|
||||
# Try to remove "-win32"
|
||||
version:=$(subst -win32,.0,$(shellversion))
|
||||
|
||||
# Turn version into words of major, minor
|
||||
v:=$(subst ., ,$(version))
|
||||
|
|
|
@ -543,13 +543,13 @@ static void CON_RecalcSize(void)
|
|||
con_scalefactor = 1;
|
||||
break;
|
||||
case V_SMALLSCALEPATCH:
|
||||
con_scalefactor = vid.smalldupx;
|
||||
con_scalefactor = vid.smalldup;
|
||||
break;
|
||||
case V_MEDSCALEPATCH:
|
||||
con_scalefactor = vid.meddupx;
|
||||
con_scalefactor = vid.meddup;
|
||||
break;
|
||||
default: // Full scaling
|
||||
con_scalefactor = vid.dupx;
|
||||
con_scalefactor = vid.dup;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -667,7 +667,7 @@ static void CON_MoveConsole(void)
|
|||
}
|
||||
|
||||
// Not instant - Increment fracmovement fractionally
|
||||
fracmovement += FixedMul(cons_speed.value*vid.fdupy, renderdeltatics);
|
||||
fracmovement += FixedMul(cons_speed.value*vid.fdup, renderdeltatics);
|
||||
|
||||
if (con_curlines < con_destlines) // Move the console downwards
|
||||
{
|
||||
|
@ -1764,9 +1764,9 @@ static void CON_DrawBackpic(void)
|
|||
con_backpic = W_CachePatchNum(piclump, PU_PATCH);
|
||||
|
||||
// Center the backpic, and draw a vertically cropped patch.
|
||||
w = (con_backpic->width * vid.dupx);
|
||||
w = con_backpic->width * vid.dup;
|
||||
x = (vid.width / 2) - (w / 2);
|
||||
h = con_curlines/vid.dupy;
|
||||
h = con_curlines/vid.dup;
|
||||
|
||||
// If the patch doesn't fill the entire screen,
|
||||
// then fill the sides with a solid color.
|
||||
|
|
|
@ -1933,6 +1933,13 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
|
|||
"S_SMALLGRABCHAIN",
|
||||
"S_BIGGRABCHAIN",
|
||||
|
||||
// Blue spring on a ball
|
||||
"S_BLUESPRINGBALL",
|
||||
"S_BLUESPRINGBALL2",
|
||||
"S_BLUESPRINGBALL3",
|
||||
"S_BLUESPRINGBALL4",
|
||||
"S_BLUESPRINGBALL5",
|
||||
|
||||
// Yellow spring on a ball
|
||||
"S_YELLOWSPRINGBALL",
|
||||
"S_YELLOWSPRINGBALL2",
|
||||
|
@ -3891,6 +3898,7 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t
|
|||
"MT_BIGMACE", // Big Mace
|
||||
"MT_SMALLGRABCHAIN", // Small Grab Chain
|
||||
"MT_BIGGRABCHAIN", // Big Grab Chain
|
||||
"MT_BLUESPRINGBALL", // Blue spring on a ball
|
||||
"MT_YELLOWSPRINGBALL", // Yellow spring on a ball
|
||||
"MT_REDSPRINGBALL", // Red spring on a ball
|
||||
"MT_SMALLFIREBAR", // Small Firebar
|
||||
|
|
|
@ -14,13 +14,18 @@ size_t I_GetFreeMem(size_t *total)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void I_Sleep(UINT32 ms){}
|
||||
void I_Sleep(UINT32 ms)
|
||||
{
|
||||
(void)ms;
|
||||
}
|
||||
|
||||
precise_t I_GetPreciseTime(void) {
|
||||
precise_t I_GetPreciseTime(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
UINT64 I_GetPrecisePrecision(void) {
|
||||
UINT64 I_GetPrecisePrecision(void)
|
||||
{
|
||||
return 1000000;
|
||||
}
|
||||
|
||||
|
@ -182,10 +187,12 @@ const char *I_ClipboardPaste(void)
|
|||
|
||||
size_t I_GetRandomBytes(char *destination, size_t amount)
|
||||
{
|
||||
(void)destination;
|
||||
(void)amount;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void I_RegisterSysCommands(void) {}
|
||||
void I_RegisterSysCommands(void){}
|
||||
|
||||
void I_GetCursorPosition(INT32 *x, INT32 *y)
|
||||
{
|
||||
|
|
|
@ -1327,7 +1327,7 @@ void F_CreditDrawer(void)
|
|||
y += 12<<FRACBITS;
|
||||
break;
|
||||
}
|
||||
if (FixedMul(y,vid.dupy) > vid.height)
|
||||
if (FixedMul(y,vid.dup) > vid.height)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1362,7 +1362,7 @@ void F_CreditTicker(void)
|
|||
case 1: y += 30<<FRACBITS; break;
|
||||
default: y += 12<<FRACBITS; break;
|
||||
}
|
||||
if (FixedMul(y,vid.dupy) > vid.height)
|
||||
if (FixedMul(y,vid.dup) > vid.height)
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -2082,7 +2082,7 @@ void F_EndingDrawer(void)
|
|||
if (goodending && finalecount >= TICRATE && finalecount < INFLECTIONPOINT)
|
||||
{
|
||||
INT32 workingtime = finalecount - TICRATE;
|
||||
fixed_t radius = ((vid.width/vid.dupx)*(INFLECTIONPOINT - TICRATE - workingtime))/(INFLECTIONPOINT - TICRATE);
|
||||
fixed_t radius = ((vid.width/vid.dup)*(INFLECTIONPOINT - TICRATE - workingtime))/(INFLECTIONPOINT - TICRATE);
|
||||
angle_t fa;
|
||||
INT32 eemeralds_cur[4];
|
||||
char patchname[7] = "CEMGx0";
|
||||
|
@ -2287,7 +2287,6 @@ void F_InitMenuPresValues(void)
|
|||
void F_SkyScroll(const char *patchname)
|
||||
{
|
||||
INT32 x, basey = 0;
|
||||
INT32 dupz = (vid.dupx < vid.dupy ? vid.dupx : vid.dupy);
|
||||
patch_t *pat;
|
||||
|
||||
if (rendermode == render_none)
|
||||
|
@ -2315,17 +2314,17 @@ void F_SkyScroll(const char *patchname)
|
|||
curbgy %= pat->height * 16;
|
||||
|
||||
// Ooh, fancy frame interpolation
|
||||
x = ((curbgx*dupz) + FixedInt((rendertimefrac-FRACUNIT) * curbgxspeed*dupz)) / 16;
|
||||
basey = ((curbgy*dupz) + FixedInt((rendertimefrac-FRACUNIT) * curbgyspeed*dupz)) / 16;
|
||||
x = ((curbgx*vid.dup) + FixedInt((rendertimefrac-FRACUNIT) * curbgxspeed*vid.dup)) / 16;
|
||||
basey = ((curbgy*vid.dup) + FixedInt((rendertimefrac-FRACUNIT) * curbgyspeed*vid.dup)) / 16;
|
||||
|
||||
if (x > 0) // Make sure that we don't leave the left or top sides empty
|
||||
x -= pat->width * dupz;
|
||||
x -= pat->width * vid.dup;
|
||||
if (basey > 0)
|
||||
basey -= pat->height * dupz;
|
||||
basey -= pat->height * vid.dup;
|
||||
|
||||
for (; x < vid.width; x += pat->width * dupz)
|
||||
for (; x < vid.width; x += pat->width * vid.dup)
|
||||
{
|
||||
for (INT32 y = basey; y < vid.height; y += pat->height * dupz)
|
||||
for (INT32 y = basey; y < vid.height; y += pat->height * vid.dup)
|
||||
V_DrawScaledPatch(x, y, V_NOSCALESTART, pat);
|
||||
}
|
||||
|
||||
|
@ -2603,7 +2602,7 @@ static void F_LoadAlacroixGraphics(SINT8 newttscale)
|
|||
|
||||
static void F_FigureActiveTtScale(void)
|
||||
{
|
||||
SINT8 newttscale = max(1, min(6, vid.dupx));
|
||||
SINT8 newttscale = max(1, min(6, vid.dup));
|
||||
SINT8 oldttscale = activettscale;
|
||||
|
||||
if (newttscale == testttscale)
|
||||
|
@ -4095,7 +4094,7 @@ static fixed_t F_GetPromptHideHudBound(void)
|
|||
F_GetPageTextGeometry(&pagelines, &rightside, &boxh, &texth, &texty, &namey, &chevrony, &textx, &textr);
|
||||
|
||||
// calc boxheight (see V_DrawPromptBack)
|
||||
boxh *= vid.dupy;
|
||||
boxh *= vid.dup;
|
||||
boxh = (boxh * 4) + (boxh/2)*5; // 4 lines of space plus gaps between and some leeway
|
||||
|
||||
// return a coordinate to check
|
||||
|
|
89
src/g_demo.c
89
src/g_demo.c
|
@ -1891,16 +1891,9 @@ UINT8 G_CmpDemoTime(char *oldname, char *newname)
|
|||
p++; // VERSION
|
||||
p++; // SUBVERSION
|
||||
oldversion = READUINT16(p);
|
||||
switch(oldversion) // demoversion
|
||||
if (oldversion < 0x000c || oldversion > DEMOVERSION)
|
||||
{
|
||||
case DEMOVERSION: // latest always supported
|
||||
case 0x000f: // The previous demoversions also supported
|
||||
case 0x000e:
|
||||
case 0x000d: // all that changed between then and now was longer color name
|
||||
case 0x000c:
|
||||
break;
|
||||
// too old, cannot support.
|
||||
default:
|
||||
// too old (or new), cannot support
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("File '%s' invalid format. It will be overwritten.\n"), oldname);
|
||||
Z_Free(buffer);
|
||||
return UINT8_MAX;
|
||||
|
@ -1973,14 +1966,11 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
UINT8 i;
|
||||
lumpnum_t l;
|
||||
char skin[17],color[MAXCOLORNAME+1],*n,*pdemoname;
|
||||
UINT8 version,subversion,charability,charability2,thrustfactor,accelstart,acceleration,cnamelen;
|
||||
UINT8 version,subversion,charability,charability2,thrustfactor,accelstart,acceleration;
|
||||
pflags_t pflags;
|
||||
UINT32 randseed, followitem;
|
||||
fixed_t camerascale,shieldscale,actionspd,mindash,maxdash,normalspeed,runspeed,jumpfactor,height,spinheight;
|
||||
char msg[1024];
|
||||
#ifdef OLD22DEMOCOMPAT
|
||||
boolean use_old_demo_vars = false;
|
||||
#endif
|
||||
|
||||
skin[16] = '\0';
|
||||
color[MAXCOLORNAME] = '\0';
|
||||
|
@ -2039,23 +2029,13 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
subversion = READUINT8(demo_p);
|
||||
demoversion = READUINT16(demo_p);
|
||||
demo_forwardmove_rng = (demoversion < 0x0010);
|
||||
switch(demoversion)
|
||||
{
|
||||
case 0x000f:
|
||||
case 0x000d:
|
||||
case 0x000e:
|
||||
case DEMOVERSION: // latest always supported
|
||||
cnamelen = MAXCOLORNAME;
|
||||
break;
|
||||
#ifdef OLD22DEMOCOMPAT
|
||||
// all that changed between then and now was longer color name
|
||||
case 0x000c:
|
||||
cnamelen = 16;
|
||||
use_old_demo_vars = true;
|
||||
break;
|
||||
if (demoversion < 0x000c || demoversion > DEMOVERSION)
|
||||
#else
|
||||
if (demoversion < 0x000d || demoversion > DEMOVERSION)
|
||||
#endif
|
||||
// too old, cannot support.
|
||||
default:
|
||||
{
|
||||
// too old (or new), cannot support
|
||||
snprintf(msg, 1024, M_GetText("%s is an incompatible replay format and cannot be played.\n"), pdemoname);
|
||||
CONS_Alert(CONS_ERROR, "%s", msg);
|
||||
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||
|
@ -2182,8 +2162,8 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
demo_p += 16;
|
||||
|
||||
// Color
|
||||
M_Memcpy(color,demo_p,cnamelen);
|
||||
demo_p += cnamelen;
|
||||
M_Memcpy(color, demo_p, (demoversion < 0x000d) ? 16 : MAXCOLORNAME);
|
||||
demo_p += (demoversion < 0x000d) ? 16 : MAXCOLORNAME;
|
||||
|
||||
charability = READUINT8(demo_p);
|
||||
charability2 = READUINT8(demo_p);
|
||||
|
@ -2219,7 +2199,7 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
|
||||
// net var data
|
||||
#ifdef OLD22DEMOCOMPAT
|
||||
if (use_old_demo_vars)
|
||||
if (demoversion < 0x000d)
|
||||
CV_LoadOldDemoVars(&demo_p);
|
||||
else
|
||||
#endif
|
||||
|
@ -2352,19 +2332,13 @@ UINT8 G_CheckDemoForError(char *defdemoname)
|
|||
demo_p++; // version
|
||||
demo_p++; // subversion
|
||||
our_demo_version = READUINT16(demo_p);
|
||||
switch(our_demo_version)
|
||||
{
|
||||
case 0x000d:
|
||||
case 0x000e:
|
||||
case 0x000f:
|
||||
case DEMOVERSION: // latest always supported
|
||||
break;
|
||||
#ifdef OLD22DEMOCOMPAT
|
||||
case 0x000c:
|
||||
break;
|
||||
if (our_demo_version < 0x000c || our_demo_version > DEMOVERSION)
|
||||
#else
|
||||
if (our_demo_version < 0x000d || our_demo_version > DEMOVERSION)
|
||||
#endif
|
||||
// too old, cannot support.
|
||||
default:
|
||||
{
|
||||
// too old (or new), cannot support
|
||||
return DFILE_ERROR_NOTDEMO;
|
||||
}
|
||||
demo_p += 16; // demo checksum
|
||||
|
@ -2386,7 +2360,6 @@ void G_AddGhost(char *defdemoname)
|
|||
INT32 i;
|
||||
lumpnum_t l;
|
||||
char name[17],skin[17],color[MAXCOLORNAME+1],*n,*pdemoname,md5[16];
|
||||
UINT8 cnamelen;
|
||||
demoghost *gh;
|
||||
UINT8 flags, subversion;
|
||||
UINT8 *buffer,*p;
|
||||
|
@ -2438,20 +2411,9 @@ void G_AddGhost(char *defdemoname)
|
|||
p++; // VERSION
|
||||
subversion = READUINT8(p); // SUBVERSION
|
||||
ghostversion = READUINT16(p);
|
||||
switch(ghostversion)
|
||||
if (ghostversion < 0x000c || ghostversion > DEMOVERSION)
|
||||
{
|
||||
case 0x000f:
|
||||
case 0x000d:
|
||||
case 0x000e:
|
||||
case DEMOVERSION: // latest always supported
|
||||
cnamelen = MAXCOLORNAME;
|
||||
break;
|
||||
// all that changed between then and now was longer color name
|
||||
case 0x000c:
|
||||
cnamelen = 16;
|
||||
break;
|
||||
// too old, cannot support.
|
||||
default:
|
||||
// too old (or new), cannot support
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("Ghost %s: Demo version incompatible.\n"), pdemoname);
|
||||
Z_Free(pdemoname);
|
||||
Z_Free(buffer);
|
||||
|
@ -2514,8 +2476,8 @@ void G_AddGhost(char *defdemoname)
|
|||
p += 16;
|
||||
|
||||
// Color
|
||||
M_Memcpy(color, p,cnamelen);
|
||||
p += cnamelen;
|
||||
M_Memcpy(color, p, (ghostversion < 0x000d) ? 16 : MAXCOLORNAME);
|
||||
p += (ghostversion < 0x000d) ? 16 : MAXCOLORNAME;
|
||||
|
||||
// Ghosts do not have a player structure to put this in.
|
||||
p++; // charability
|
||||
|
@ -2698,16 +2660,9 @@ void G_DoPlayMetal(void)
|
|||
metal_p++; // VERSION
|
||||
metal_p++; // SUBVERSION
|
||||
metalversion = READUINT16(metal_p);
|
||||
switch(metalversion)
|
||||
if (metalversion < 0x000c || metalversion > DEMOVERSION)
|
||||
{
|
||||
case DEMOVERSION: // latest always supported
|
||||
case 0x000f:
|
||||
case 0x000e: // There are checks wheter the momentum is from older demo versions or not
|
||||
case 0x000d: // all that changed between then and now was longer color name
|
||||
case 0x000c:
|
||||
break;
|
||||
// too old, cannot support.
|
||||
default:
|
||||
// too old (or new), cannot support
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Failed to load bot recording for this map, format version incompatible.\n"));
|
||||
Z_Free(metalbuffer);
|
||||
return;
|
||||
|
|
|
@ -78,10 +78,8 @@ void HWR_DrawPatch(patch_t *gpatch, INT32 x, INT32 y, INT32 option)
|
|||
// | /|
|
||||
// |/ |
|
||||
// 0--1
|
||||
float sdupx = FIXED_TO_FLOAT(vid.fdupx)*2.0f;
|
||||
float sdupy = FIXED_TO_FLOAT(vid.fdupy)*2.0f;
|
||||
float pdupx = FIXED_TO_FLOAT(vid.fdupx)*2.0f;
|
||||
float pdupy = FIXED_TO_FLOAT(vid.fdupy)*2.0f;
|
||||
float sdup = FIXED_TO_FLOAT(vid.fdup)*2.0f;
|
||||
float pdup = FIXED_TO_FLOAT(vid.fdup)*2.0f;
|
||||
|
||||
// make patch ready in hardware cache
|
||||
HWR_GetPatch(gpatch);
|
||||
|
@ -90,25 +88,23 @@ void HWR_DrawPatch(patch_t *gpatch, INT32 x, INT32 y, INT32 option)
|
|||
switch (option & V_SCALEPATCHMASK)
|
||||
{
|
||||
case V_NOSCALEPATCH:
|
||||
pdupx = pdupy = 2.0f;
|
||||
pdup = 2.0f;
|
||||
break;
|
||||
case V_SMALLSCALEPATCH:
|
||||
pdupx = 2.0f * FIXED_TO_FLOAT(vid.fsmalldupx);
|
||||
pdupy = 2.0f * FIXED_TO_FLOAT(vid.fsmalldupy);
|
||||
pdup = 2.0f * FIXED_TO_FLOAT(vid.fsmalldup);
|
||||
break;
|
||||
case V_MEDSCALEPATCH:
|
||||
pdupx = 2.0f * FIXED_TO_FLOAT(vid.fmeddupx);
|
||||
pdupy = 2.0f * FIXED_TO_FLOAT(vid.fmeddupy);
|
||||
pdup = 2.0f * FIXED_TO_FLOAT(vid.fmeddup);
|
||||
break;
|
||||
}
|
||||
|
||||
if (option & V_NOSCALESTART)
|
||||
sdupx = sdupy = 2.0f;
|
||||
sdup = 2.0f;
|
||||
|
||||
v[0].x = v[3].x = (x*sdupx-(gpatch->leftoffset)*pdupx)/vid.width - 1;
|
||||
v[2].x = v[1].x = (x*sdupx+(gpatch->width-gpatch->leftoffset)*pdupx)/vid.width - 1;
|
||||
v[0].y = v[1].y = 1-(y*sdupy-(gpatch->topoffset)*pdupy)/vid.height;
|
||||
v[2].y = v[3].y = 1-(y*sdupy+(gpatch->height-gpatch->topoffset)*pdupy)/vid.height;
|
||||
v[0].x = v[3].x = (x*sdup-(gpatch->leftoffset)*pdup)/vid.width - 1;
|
||||
v[2].x = v[1].x = (x*sdup+(gpatch->width-gpatch->leftoffset)*pdup)/vid.width - 1;
|
||||
v[0].y = v[1].y = 1-(y*sdup-(gpatch->topoffset)*pdup)/vid.height;
|
||||
v[2].y = v[3].y = 1-(y*sdup+(gpatch->height-gpatch->topoffset)*pdup)/vid.height;
|
||||
|
||||
v[0].z = v[1].z = v[2].z = v[3].z = 1.0f;
|
||||
|
||||
|
@ -138,7 +134,7 @@ void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t p
|
|||
// | /|
|
||||
// |/ |
|
||||
// 0--1
|
||||
float dupx, dupy, fscalew, fscaleh, fwidth, fheight;
|
||||
float dup, fscalew, fscaleh, fwidth, fheight;
|
||||
|
||||
UINT8 perplayershuffle = 0;
|
||||
|
||||
|
@ -158,25 +154,21 @@ void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t p
|
|||
else opacity = softwaretranstogl[10-alphalevel];
|
||||
}
|
||||
|
||||
dupx = (float)vid.dupx;
|
||||
dupy = (float)vid.dupy;
|
||||
dup = (float)vid.dup;
|
||||
|
||||
switch (option & V_SCALEPATCHMASK)
|
||||
{
|
||||
case V_NOSCALEPATCH:
|
||||
dupx = dupy = 1.0f;
|
||||
dup = 1.0f;
|
||||
break;
|
||||
case V_SMALLSCALEPATCH:
|
||||
dupx = (float)vid.smalldupx;
|
||||
dupy = (float)vid.smalldupy;
|
||||
dup = (float)vid.smalldup;
|
||||
break;
|
||||
case V_MEDSCALEPATCH:
|
||||
dupx = (float)vid.meddupx;
|
||||
dupy = (float)vid.meddupy;
|
||||
dup = (float)vid.meddup;
|
||||
break;
|
||||
}
|
||||
|
||||
dupx = dupy = (dupx < dupy ? dupx : dupy);
|
||||
fscalew = fscaleh = FIXED_TO_FLOAT(pscale);
|
||||
if (vscale != pscale)
|
||||
fscaleh = FIXED_TO_FLOAT(vscale);
|
||||
|
@ -270,8 +262,8 @@ void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t p
|
|||
|
||||
if (!(option & V_NOSCALESTART))
|
||||
{
|
||||
cx = cx * dupx;
|
||||
cy = cy * dupy;
|
||||
cx = cx * dup;
|
||||
cy = cy * dup;
|
||||
|
||||
if (!(option & V_SCALEPATCHMASK))
|
||||
{
|
||||
|
@ -288,40 +280,40 @@ void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t p
|
|||
}
|
||||
}
|
||||
// centre screen
|
||||
if (fabsf((float)vid.width - (float)BASEVIDWIDTH * dupx) > 1.0E-36f)
|
||||
if (fabsf((float)vid.width - (float)BASEVIDWIDTH * dup) > 1.0E-36f)
|
||||
{
|
||||
if (option & V_SNAPTORIGHT)
|
||||
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx));
|
||||
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dup));
|
||||
else if (!(option & V_SNAPTOLEFT))
|
||||
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx))/2;
|
||||
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dup))/2;
|
||||
if (perplayershuffle & 4)
|
||||
cx -= ((float)vid.width - ((float)BASEVIDWIDTH * dupx))/4;
|
||||
cx -= ((float)vid.width - ((float)BASEVIDWIDTH * dup))/4;
|
||||
else if (perplayershuffle & 8)
|
||||
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx))/4;
|
||||
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dup))/4;
|
||||
}
|
||||
if (fabsf((float)vid.height - (float)BASEVIDHEIGHT * dupy) > 1.0E-36f)
|
||||
if (fabsf((float)vid.height - (float)BASEVIDHEIGHT * dup) > 1.0E-36f)
|
||||
{
|
||||
if (option & V_SNAPTOBOTTOM)
|
||||
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy));
|
||||
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dup));
|
||||
else if (!(option & V_SNAPTOTOP))
|
||||
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy))/2;
|
||||
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dup))/2;
|
||||
if (perplayershuffle & 1)
|
||||
cy -= ((float)vid.height - ((float)BASEVIDHEIGHT * dupy))/4;
|
||||
cy -= ((float)vid.height - ((float)BASEVIDHEIGHT * dup))/4;
|
||||
else if (perplayershuffle & 2)
|
||||
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy))/4;
|
||||
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dup))/4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pscale != FRACUNIT || vscale != FRACUNIT || (splitscreen && option & V_PERPLAYER))
|
||||
{
|
||||
fwidth = (float)(gpatch->width) * fscalew * dupx;
|
||||
fheight = (float)(gpatch->height) * fscaleh * dupy;
|
||||
fwidth = (float)(gpatch->width) * fscalew * dup;
|
||||
fheight = (float)(gpatch->height) * fscaleh * dup;
|
||||
}
|
||||
else
|
||||
{
|
||||
fwidth = (float)(gpatch->width) * dupx;
|
||||
fheight = (float)(gpatch->height) * dupy;
|
||||
fwidth = (float)(gpatch->width) * dup;
|
||||
fheight = (float)(gpatch->height) * dup;
|
||||
}
|
||||
|
||||
// positions of the cx, cy, are between 0 and vid.width/vid.height now, we need them to be between -1 and 1
|
||||
|
@ -384,7 +376,7 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
|
|||
// | /|
|
||||
// |/ |
|
||||
// 0--1
|
||||
float dupx, dupy, fscalew, fscaleh, fwidth, fheight;
|
||||
float dup, fscalew, fscaleh, fwidth, fheight;
|
||||
|
||||
UINT8 perplayershuffle = 0;
|
||||
|
||||
|
@ -396,25 +388,21 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
|
|||
|
||||
hwrPatch = ((GLPatch_t *)gpatch->hardware);
|
||||
|
||||
dupx = (float)vid.dupx;
|
||||
dupy = (float)vid.dupy;
|
||||
dup = (float)vid.dup;
|
||||
|
||||
switch (option & V_SCALEPATCHMASK)
|
||||
{
|
||||
case V_NOSCALEPATCH:
|
||||
dupx = dupy = 1.0f;
|
||||
dup = 1.0f;
|
||||
break;
|
||||
case V_SMALLSCALEPATCH:
|
||||
dupx = (float)vid.smalldupx;
|
||||
dupy = (float)vid.smalldupy;
|
||||
dup = (float)vid.smalldup;
|
||||
break;
|
||||
case V_MEDSCALEPATCH:
|
||||
dupx = (float)vid.meddupx;
|
||||
dupy = (float)vid.meddupy;
|
||||
dup = (float)vid.meddup;
|
||||
break;
|
||||
}
|
||||
|
||||
dupx = dupy = (dupx < dupy ? dupx : dupy);
|
||||
fscalew = fscaleh = FIXED_TO_FLOAT(pscale);
|
||||
if (vscale != pscale)
|
||||
fscaleh = FIXED_TO_FLOAT(vscale);
|
||||
|
@ -492,8 +480,8 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
|
|||
|
||||
if (!(option & V_NOSCALESTART))
|
||||
{
|
||||
cx = cx * dupx;
|
||||
cy = cy * dupy;
|
||||
cx = cx * dup;
|
||||
cy = cy * dup;
|
||||
|
||||
if (!(option & V_SCALEPATCHMASK))
|
||||
{
|
||||
|
@ -501,27 +489,27 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
|
|||
// no the patch is cropped do not do this ever
|
||||
|
||||
// centre screen
|
||||
if (fabsf((float)vid.width - (float)BASEVIDWIDTH * dupx) > 1.0E-36f)
|
||||
if (fabsf((float)vid.width - (float)BASEVIDWIDTH * dup) > 1.0E-36f)
|
||||
{
|
||||
if (option & V_SNAPTORIGHT)
|
||||
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx));
|
||||
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dup));
|
||||
else if (!(option & V_SNAPTOLEFT))
|
||||
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx))/2;
|
||||
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dup))/2;
|
||||
if (perplayershuffle & 4)
|
||||
cx -= ((float)vid.width - ((float)BASEVIDWIDTH * dupx))/4;
|
||||
cx -= ((float)vid.width - ((float)BASEVIDWIDTH * dup))/4;
|
||||
else if (perplayershuffle & 8)
|
||||
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx))/4;
|
||||
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dup))/4;
|
||||
}
|
||||
if (fabsf((float)vid.height - (float)BASEVIDHEIGHT * dupy) > 1.0E-36f)
|
||||
if (fabsf((float)vid.height - (float)BASEVIDHEIGHT * dup) > 1.0E-36f)
|
||||
{
|
||||
if (option & V_SNAPTOBOTTOM)
|
||||
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy));
|
||||
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dup));
|
||||
else if (!(option & V_SNAPTOTOP))
|
||||
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy))/2;
|
||||
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dup))/2;
|
||||
if (perplayershuffle & 1)
|
||||
cy -= ((float)vid.height - ((float)BASEVIDHEIGHT * dupy))/4;
|
||||
cy -= ((float)vid.height - ((float)BASEVIDHEIGHT * dup))/4;
|
||||
else if (perplayershuffle & 2)
|
||||
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy))/4;
|
||||
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dup))/4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -537,13 +525,13 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
|
|||
|
||||
if (pscale != FRACUNIT || vscale != FRACUNIT || (splitscreen && option & V_PERPLAYER))
|
||||
{
|
||||
fwidth *= fscalew * dupx;
|
||||
fheight *= fscaleh * dupy;
|
||||
fwidth *= fscalew * dup;
|
||||
fheight *= fscaleh * dup;
|
||||
}
|
||||
else
|
||||
{
|
||||
fwidth *= dupx;
|
||||
fheight *= dupy;
|
||||
fwidth *= dup;
|
||||
fheight *= dup;
|
||||
}
|
||||
|
||||
// positions of the cx, cy, are between 0 and vid.width/vid.height now, we need them to be between -1 and 1
|
||||
|
@ -679,9 +667,9 @@ void HWR_DrawPic(INT32 x, INT32 y, lumpnum_t lumpnum)
|
|||
// 0--1
|
||||
|
||||
v[0].x = v[3].x = 2.0f * (float)x/vid.width - 1;
|
||||
v[2].x = v[1].x = 2.0f * (float)(x + patch->width*FIXED_TO_FLOAT(vid.fdupx))/vid.width - 1;
|
||||
v[2].x = v[1].x = 2.0f * (float)(x + patch->width*FIXED_TO_FLOAT(vid.fdup))/vid.width - 1;
|
||||
v[0].y = v[1].y = 1.0f - 2.0f * (float)y/vid.height;
|
||||
v[2].y = v[3].y = 1.0f - 2.0f * (float)(y + patch->height*FIXED_TO_FLOAT(vid.fdupy))/vid.height;
|
||||
v[2].y = v[3].y = 1.0f - 2.0f * (float)(y + patch->height*FIXED_TO_FLOAT(vid.fdup))/vid.height;
|
||||
|
||||
v[0].z = v[1].z = v[2].z = v[3].z = 1.0f;
|
||||
|
||||
|
@ -871,35 +859,33 @@ void HWR_DrawFadeFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color, UINT16 ac
|
|||
|
||||
if (!(color & V_NOSCALESTART))
|
||||
{
|
||||
float dupx = (float)vid.dupx, dupy = (float)vid.dupy;
|
||||
fx *= vid.dup;
|
||||
fy *= vid.dup;
|
||||
fw *= vid.dup;
|
||||
fh *= vid.dup;
|
||||
|
||||
fx *= dupx;
|
||||
fy *= dupy;
|
||||
fw *= dupx;
|
||||
fh *= dupy;
|
||||
|
||||
if (fabsf((float)vid.width - (float)BASEVIDWIDTH * dupx) > 1.0E-36f)
|
||||
if (fabsf((float)vid.width - (float)BASEVIDWIDTH * vid.dup) > 1.0E-36f)
|
||||
{
|
||||
if (color & V_SNAPTORIGHT)
|
||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx));
|
||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * vid.dup));
|
||||
else if (!(color & V_SNAPTOLEFT))
|
||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 2;
|
||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * vid.dup)) / 2;
|
||||
if (perplayershuffle & 4)
|
||||
fx -= ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 4;
|
||||
fx -= ((float)vid.width - ((float)BASEVIDWIDTH * vid.dup)) / 4;
|
||||
else if (perplayershuffle & 8)
|
||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 4;
|
||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * vid.dup)) / 4;
|
||||
}
|
||||
if (fabsf((float)vid.height - (float)BASEVIDHEIGHT * dupy) > 1.0E-36f)
|
||||
if (fabsf((float)vid.height - (float)BASEVIDHEIGHT * vid.dup) > 1.0E-36f)
|
||||
{
|
||||
// same thing here
|
||||
if (color & V_SNAPTOBOTTOM)
|
||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy));
|
||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * vid.dup));
|
||||
else if (!(color & V_SNAPTOTOP))
|
||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 2;
|
||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * vid.dup)) / 2;
|
||||
if (perplayershuffle & 1)
|
||||
fy -= ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 4;
|
||||
fy -= ((float)vid.height - ((float)BASEVIDHEIGHT * vid.dup)) / 4;
|
||||
else if (perplayershuffle & 2)
|
||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 4;
|
||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * vid.dup)) / 4;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1037,10 +1023,10 @@ void HWR_DrawViewBorder(INT32 clearlines)
|
|||
clearlines = BASEVIDHEIGHT; // refresh all
|
||||
|
||||
// calc view size based on original game resolution
|
||||
baseviewwidth = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_viewwidth), vid.fdupx)); //(cv_viewsize.value * BASEVIDWIDTH/10)&~7;
|
||||
baseviewheight = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_viewheight), vid.fdupy));
|
||||
top = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_baseviewwindowy), vid.fdupy));
|
||||
side = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_viewwindowx), vid.fdupx));
|
||||
baseviewwidth = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_viewwidth), vid.fdup)); //(cv_viewsize.value * BASEVIDWIDTH/10)&~7;
|
||||
baseviewheight = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_viewheight), vid.fdup));
|
||||
top = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_baseviewwindowy), vid.fdup));
|
||||
side = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_viewwindowx), vid.fdup));
|
||||
|
||||
// top
|
||||
HWR_DrawFlatFill(0, 0,
|
||||
|
@ -1255,35 +1241,35 @@ void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color, UINT32
|
|||
|
||||
if (!(color & V_NOSCALESTART))
|
||||
{
|
||||
float dupx = (float)vid.dupx, dupy = (float)vid.dupy;
|
||||
float dup = (float)vid.dup;
|
||||
|
||||
fx *= dupx;
|
||||
fy *= dupy;
|
||||
fw *= dupx;
|
||||
fh *= dupy;
|
||||
fx *= dup;
|
||||
fy *= dup;
|
||||
fw *= dup;
|
||||
fh *= dup;
|
||||
|
||||
if (fabsf((float)vid.width - (float)BASEVIDWIDTH * dupx) > 1.0E-36f)
|
||||
if (fabsf((float)vid.width - (float)BASEVIDWIDTH * dup) > 1.0E-36f)
|
||||
{
|
||||
if (color & V_SNAPTORIGHT)
|
||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx));
|
||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dup));
|
||||
else if (!(color & V_SNAPTOLEFT))
|
||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 2;
|
||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dup)) / 2;
|
||||
if (perplayershuffle & 4)
|
||||
fx -= ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 4;
|
||||
fx -= ((float)vid.width - ((float)BASEVIDWIDTH * dup)) / 4;
|
||||
else if (perplayershuffle & 8)
|
||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 4;
|
||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dup)) / 4;
|
||||
}
|
||||
if (fabsf((float)vid.height - (float)BASEVIDHEIGHT * dupy) > 1.0E-36f)
|
||||
if (fabsf((float)vid.height - (float)BASEVIDHEIGHT * dup) > 1.0E-36f)
|
||||
{
|
||||
// same thing here
|
||||
if (color & V_SNAPTOBOTTOM)
|
||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy));
|
||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dup));
|
||||
else if (!(color & V_SNAPTOTOP))
|
||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 2;
|
||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dup)) / 2;
|
||||
if (perplayershuffle & 1)
|
||||
fy -= ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 4;
|
||||
fy -= ((float)vid.height - ((float)BASEVIDHEIGHT * dup)) / 4;
|
||||
else if (perplayershuffle & 2)
|
||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 4;
|
||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dup)) / 4;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1421,8 +1407,6 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
|
|||
|
||||
if (!(color & V_NOSCALESTART))
|
||||
{
|
||||
float dupx = (float)vid.dupx, dupy = (float)vid.dupy;
|
||||
|
||||
if (x == 0 && y == 0 && w == BASEVIDWIDTH && h == BASEVIDHEIGHT)
|
||||
{
|
||||
RGBA_t rgbaColour = V_GetColor(color);
|
||||
|
@ -1435,33 +1419,33 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
|
|||
return;
|
||||
}
|
||||
|
||||
fx *= dupx;
|
||||
fy *= dupy;
|
||||
fw *= dupx;
|
||||
fh *= dupy;
|
||||
fx *= vid.dup;
|
||||
fy *= vid.dup;
|
||||
fw *= vid.dup;
|
||||
fh *= vid.dup;
|
||||
|
||||
if (fabsf((float)vid.width - (float)BASEVIDWIDTH * dupx) > 1.0E-36f)
|
||||
if (fabsf((float)vid.width - (float)BASEVIDWIDTH * vid.dup) > 1.0E-36f)
|
||||
{
|
||||
if (color & V_SNAPTORIGHT)
|
||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx));
|
||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * vid.dup));
|
||||
else if (!(color & V_SNAPTOLEFT))
|
||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 2;
|
||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * vid.dup)) / 2;
|
||||
if (perplayershuffle & 4)
|
||||
fx -= ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 4;
|
||||
fx -= ((float)vid.width - ((float)BASEVIDWIDTH * vid.dup)) / 4;
|
||||
else if (perplayershuffle & 8)
|
||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 4;
|
||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * vid.dup)) / 4;
|
||||
}
|
||||
if (fabsf((float)vid.height - (float)BASEVIDHEIGHT * dupy) > 1.0E-36f)
|
||||
if (fabsf((float)vid.height - (float)BASEVIDHEIGHT * vid.dup) > 1.0E-36f)
|
||||
{
|
||||
// same thing here
|
||||
if (color & V_SNAPTOBOTTOM)
|
||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy));
|
||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * vid.dup));
|
||||
else if (!(color & V_SNAPTOTOP))
|
||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 2;
|
||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * vid.dup)) / 2;
|
||||
if (perplayershuffle & 1)
|
||||
fy -= ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 4;
|
||||
fy -= ((float)vid.height - ((float)BASEVIDHEIGHT * vid.dup)) / 4;
|
||||
else if (perplayershuffle & 2)
|
||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 4;
|
||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * vid.dup)) / 4;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -341,6 +341,7 @@ light_t *t_lspr[NUMSPRITES] =
|
|||
&lspr[NOLIGHT], // SPR_BMCH
|
||||
&lspr[NOLIGHT], // SPR_SMCE
|
||||
&lspr[NOLIGHT], // SPR_BMCE
|
||||
&lspr[NOLIGHT], // SPR_BSPB
|
||||
&lspr[NOLIGHT], // SPR_YSPB
|
||||
&lspr[NOLIGHT], // SPR_RSPB
|
||||
&lspr[REDBALL_L], // SPR_SFBR
|
||||
|
|
|
@ -229,6 +229,8 @@ void HWR_Lighting(FSurfaceInfo *Surface, INT32 light_level, extracolormap_t *col
|
|||
// Clamp the light level, since it can sometimes go out of the 0-255 range from animations
|
||||
light_level = min(max(light_level, 0), 255);
|
||||
|
||||
V_CubeApply(&tint_color.s.red, &tint_color.s.green, &tint_color.s.blue);
|
||||
V_CubeApply(&fade_color.s.red, &fade_color.s.green, &fade_color.s.blue);
|
||||
Surface->PolyColor.rgba = poly_color.rgba;
|
||||
Surface->TintColor.rgba = tint_color.rgba;
|
||||
Surface->FadeColor.rgba = fade_color.rgba;
|
||||
|
@ -4064,14 +4066,11 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
|
|||
float xscale, yscale;
|
||||
float xoffset, yoffset;
|
||||
float leftoffset, topoffset;
|
||||
float scale = spr->scale;
|
||||
float zoffset = (P_MobjFlip(spr->mobj) * 0.05f);
|
||||
pslope_t *splatslope = NULL;
|
||||
INT32 i;
|
||||
|
||||
renderflags_t renderflags = spr->renderflags;
|
||||
if (renderflags & RF_SHADOWEFFECTS)
|
||||
scale *= spr->shadowscale;
|
||||
|
||||
if (spr->rotateflags & SRF_3D || renderflags & RF_NOSPLATBILLBOARD)
|
||||
angle = spr->mobj->angle;
|
||||
|
|
|
@ -486,7 +486,7 @@ void HWR_InitModels(void)
|
|||
size_t i;
|
||||
INT32 s;
|
||||
FILE *f;
|
||||
char name[24], filename[32];
|
||||
char name[26], filename[32];
|
||||
float scale, offset;
|
||||
size_t prefixlen;
|
||||
|
||||
|
@ -585,7 +585,7 @@ modelfound:
|
|||
void HWR_AddPlayerModel(int skin) // For skins that were added after startup
|
||||
{
|
||||
FILE *f;
|
||||
char name[24], filename[32];
|
||||
char name[26], filename[32];
|
||||
float scale, offset;
|
||||
size_t prefixlen;
|
||||
|
||||
|
@ -644,7 +644,7 @@ void HWR_AddSpriteModel(size_t spritenum) // For sprites that were added after s
|
|||
// name[24] is used to check for names in the models.dat file that match with sprites or player skins
|
||||
// sprite names are always 4 characters long, and names is for player skins can be up to 19 characters long
|
||||
// PLAYERMODELPREFIX is 6 characters long
|
||||
char name[24], filename[32];
|
||||
char name[26], filename[32];
|
||||
float scale, offset;
|
||||
|
||||
if (nomd2s)
|
||||
|
|
|
@ -672,6 +672,9 @@ void GeneratePolygonNormals(model_t *model, int ztag)
|
|||
|
||||
for (k = 0; k < mesh->numTriangles; k++)
|
||||
{
|
||||
/// TODO: normalize vectors
|
||||
(void)vertices;
|
||||
(void)polyNormals;
|
||||
// Vector::Normal(vertices, polyNormals);
|
||||
vertices += 3 * 3;
|
||||
polyNormals++;
|
||||
|
|
35
src/info.c
35
src/info.c
|
@ -250,6 +250,7 @@ char sprnames[NUMSPRITES + 1][5] =
|
|||
"BMCH", // Big Mace Chain
|
||||
"SMCE", // Small Mace
|
||||
"BMCE", // Big Mace
|
||||
"BSPB", // Blue spring on a ball
|
||||
"YSPB", // Yellow spring on a ball
|
||||
"RSPB", // Red spring on a ball
|
||||
"SFBR", // Small Firebar
|
||||
|
@ -2297,6 +2298,13 @@ state_t states[NUMSTATES] =
|
|||
{SPR_SMCH, 1, -1, {NULL}, 0, 0, S_NULL}, // S_SMALLGRABCHAIN
|
||||
{SPR_BMCH, 1, -1, {NULL}, 0, 0, S_NULL}, // S_BIGGRABCHAIN
|
||||
|
||||
// Blue spring on a ball
|
||||
{SPR_BSPB, 0, -1, {NULL}, 0, 0, S_NULL}, // S_BLUESPRINGBALL
|
||||
{SPR_BSPB, 4, 4, {A_Pain}, 0, 0, S_BLUESPRINGBALL3}, // S_BLUESPRINGBALL2
|
||||
{SPR_BSPB, 3, 1, {NULL}, 0, 0, S_BLUESPRINGBALL4}, // S_BLUESPRINGBALL3
|
||||
{SPR_BSPB, 2, 1, {NULL}, 0, 0, S_BLUESPRINGBALL5}, // S_BLUESPRINGBALL4
|
||||
{SPR_BSPB, 1, 1, {NULL}, 0, 0, S_BLUESPRINGBALL}, // S_BLUESPRINGBALL5
|
||||
|
||||
// Yellow spring on a ball
|
||||
{SPR_YSPB, 0, -1, {NULL}, 0, 0, S_NULL}, // S_YELLOWSPRINGBALL
|
||||
{SPR_YSPB, 4, 4, {A_Pain}, 0, 0, S_YELLOWSPRINGBALL3}, // S_YELLOWSPRINGBALL2
|
||||
|
@ -11679,6 +11687,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_BLUESPRINGBALL
|
||||
1133, // doomednum
|
||||
S_BLUESPRINGBALL, // spawnstate
|
||||
1000, // spawnhealth
|
||||
S_BLUESPRINGBALL2, // seestate
|
||||
sfx_None, // seesound
|
||||
0, // reactiontime
|
||||
sfx_None, // attacksound
|
||||
S_NULL, // painstate
|
||||
0, // painchance
|
||||
sfx_spring, // painsound
|
||||
S_NULL, // meleestate
|
||||
S_NULL, // missilestate
|
||||
S_NULL, // deathstate
|
||||
S_NULL, // xdeathstate
|
||||
sfx_None, // deathsound
|
||||
24*FRACUNIT, // speed
|
||||
17*FRACUNIT, // radius
|
||||
34*FRACUNIT, // height
|
||||
1, // display offset
|
||||
11*FRACUNIT, // mass
|
||||
0, // damage
|
||||
sfx_mswing, // activesound
|
||||
MF_SCENERY|MF_SPRING|MF_NOGRAVITY, // flags
|
||||
S_BLUESPRINGBALL2 // raisestate
|
||||
},
|
||||
|
||||
{ // MT_YELLOWSPRINGBALL
|
||||
1134, // doomednum
|
||||
S_YELLOWSPRINGBALL, // spawnstate
|
||||
|
|
|
@ -797,6 +797,7 @@ typedef enum sprite
|
|||
SPR_BMCH, // Big Mace Chain
|
||||
SPR_SMCE, // Small Mace
|
||||
SPR_BMCE, // Big Mace
|
||||
SPR_BSPB, // Blue spring on a ball
|
||||
SPR_YSPB, // Yellow spring on a ball
|
||||
SPR_RSPB, // Red spring on a ball
|
||||
SPR_SFBR, // Small Firebar
|
||||
|
@ -2744,6 +2745,13 @@ typedef enum state
|
|||
S_SMALLGRABCHAIN,
|
||||
S_BIGGRABCHAIN,
|
||||
|
||||
// Blue spring on a ball
|
||||
S_BLUESPRINGBALL,
|
||||
S_BLUESPRINGBALL2,
|
||||
S_BLUESPRINGBALL3,
|
||||
S_BLUESPRINGBALL4,
|
||||
S_BLUESPRINGBALL5,
|
||||
|
||||
// Yellow spring on a ball
|
||||
S_YELLOWSPRINGBALL,
|
||||
S_YELLOWSPRINGBALL2,
|
||||
|
@ -4722,6 +4730,7 @@ typedef enum mobj_type
|
|||
MT_BIGMACE, // Big Mace
|
||||
MT_SMALLGRABCHAIN, // Small Grab Chain
|
||||
MT_BIGGRABCHAIN, // Big Grab Chain
|
||||
MT_BLUESPRINGBALL, // Blue spring on a ball
|
||||
MT_YELLOWSPRINGBALL, // Yellow spring on a ball
|
||||
MT_REDSPRINGBALL, // Red spring on a ball
|
||||
MT_SMALLFIREBAR, // Small Firebar
|
||||
|
|
|
@ -1567,6 +1567,19 @@ static int lib_pInstaThrust(lua_State *L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int lib_pInstaThrustEvenIn2D(lua_State *L)
|
||||
{
|
||||
mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
angle_t angle = luaL_checkangle(L, 2);
|
||||
fixed_t move = luaL_checkfixed(L, 3);
|
||||
NOHUD
|
||||
INLEVEL
|
||||
if (!mo)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
P_InstaThrustEvenIn2D(mo, angle, move);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_pReturnThrustX(lua_State *L)
|
||||
{
|
||||
angle_t angle;
|
||||
|
@ -2214,6 +2227,40 @@ static int lib_pThrust(lua_State *L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int lib_pThrustEvenIn2D(lua_State *L)
|
||||
{
|
||||
mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
angle_t angle = luaL_checkangle(L, 2);
|
||||
fixed_t move = luaL_checkfixed(L, 3);
|
||||
NOHUD
|
||||
INLEVEL
|
||||
if (!mo)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
P_ThrustEvenIn2D(mo, angle, move);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_pVectorInstaThrust(lua_State *L)
|
||||
{
|
||||
fixed_t xa = luaL_checkfixed(L, 1);
|
||||
fixed_t xb = luaL_checkfixed(L, 2);
|
||||
fixed_t xc = luaL_checkfixed(L, 3);
|
||||
fixed_t ya = luaL_checkfixed(L, 4);
|
||||
fixed_t yb = luaL_checkfixed(L, 5);
|
||||
fixed_t yc = luaL_checkfixed(L, 6);
|
||||
fixed_t za = luaL_checkfixed(L, 7);
|
||||
fixed_t zb = luaL_checkfixed(L, 8);
|
||||
fixed_t zc = luaL_checkfixed(L, 9);
|
||||
fixed_t momentum = luaL_checkfixed(L, 10);
|
||||
mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 11, META_MOBJ));
|
||||
NOHUD
|
||||
INLEVEL
|
||||
if (!mo)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
P_VectorInstaThrust(xa, xb, xc, ya, yb, yc, za, zb, zc, momentum, mo);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_pSetMobjStateNF(lua_State *L)
|
||||
{
|
||||
mobj_t *mobj = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
|
@ -3544,7 +3591,7 @@ static int lib_gAddGametype(lua_State *L)
|
|||
// Partly lifted from Got_AddPlayer
|
||||
static int lib_gAddPlayer(lua_State *L)
|
||||
{
|
||||
INT16 i, newplayernum, botcount = 1;
|
||||
INT16 i, newplayernum;
|
||||
player_t *newplayer;
|
||||
SINT8 skinnum = 0, bot;
|
||||
|
||||
|
@ -3552,10 +3599,8 @@ static int lib_gAddPlayer(lua_State *L)
|
|||
{
|
||||
if (!playeringame[i])
|
||||
break;
|
||||
|
||||
if (players[i].bot)
|
||||
botcount++; // How many of us are there already?
|
||||
}
|
||||
|
||||
if (i >= MAXPLAYERS)
|
||||
{
|
||||
lua_pushnil(L);
|
||||
|
@ -4125,6 +4170,7 @@ static luaL_Reg lib[] = {
|
|||
{"P_DoPlayerFinish",lib_pDoPlayerFinish},
|
||||
{"P_DoPlayerExit",lib_pDoPlayerExit},
|
||||
{"P_InstaThrust",lib_pInstaThrust},
|
||||
{"P_InstaThrustEvenIn2D",lib_pInstaThrustEvenIn2D},
|
||||
{"P_ReturnThrustX",lib_pReturnThrustX},
|
||||
{"P_ReturnThrustY",lib_pReturnThrustY},
|
||||
{"P_LookForEnemies",lib_pLookForEnemies},
|
||||
|
@ -4178,6 +4224,8 @@ static luaL_Reg lib[] = {
|
|||
|
||||
// p_spec
|
||||
{"P_Thrust",lib_pThrust},
|
||||
{"P_ThrustEvenIn2D",lib_pThrustEvenIn2D},
|
||||
{"P_VectorInstaThrust",lib_pVectorInstaThrust},
|
||||
{"P_SetMobjStateNF",lib_pSetMobjStateNF},
|
||||
{"P_DoSuperTransformation",lib_pDoSuperTransformation},
|
||||
{"P_ExplodeMissile",lib_pExplodeMissile},
|
||||
|
|
|
@ -1474,19 +1474,11 @@ static int libd_height(lua_State *L)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int libd_dupx(lua_State *L)
|
||||
static int libd_dup(lua_State *L)
|
||||
{
|
||||
HUDONLY
|
||||
lua_pushinteger(L, vid.dupx); // push integral scale (patch scale)
|
||||
lua_pushfixed(L, vid.fdupx); // push fixed point scale (position scale)
|
||||
return 2;
|
||||
}
|
||||
|
||||
static int libd_dupy(lua_State *L)
|
||||
{
|
||||
HUDONLY
|
||||
lua_pushinteger(L, vid.dupy); // push integral scale (patch scale)
|
||||
lua_pushfixed(L, vid.fdupy); // push fixed point scale (position scale)
|
||||
lua_pushinteger(L, vid.dup); // push integral scale (patch scale)
|
||||
lua_pushfixed(L, vid.fdup); // push fixed point scale (position scale)
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
@ -1606,8 +1598,8 @@ static luaL_Reg lib_draw[] = {
|
|||
// properties
|
||||
{"width", libd_width},
|
||||
{"height", libd_height},
|
||||
{"dupx", libd_dupx},
|
||||
{"dupy", libd_dupy},
|
||||
{"dupx", libd_dup},
|
||||
{"dupy", libd_dup},
|
||||
{"renderer", libd_renderer},
|
||||
{"localTransFlag", libd_getlocaltransflag},
|
||||
{"userTransFlag", libd_getusertransflag},
|
||||
|
|
|
@ -462,7 +462,7 @@ static void GIF_headwrite(void)
|
|||
// Image width/height
|
||||
if (gif_downscale)
|
||||
{
|
||||
scrbuf_downscaleamt = vid.dupx;
|
||||
scrbuf_downscaleamt = vid.dup;
|
||||
rwidth = (vid.width / scrbuf_downscaleamt);
|
||||
rheight = (vid.height / scrbuf_downscaleamt);
|
||||
}
|
||||
|
|
61
src/m_menu.c
61
src/m_menu.c
|
@ -214,7 +214,7 @@ static fixed_t lsoffs[2];
|
|||
#define lshli levelselectselect[2]
|
||||
|
||||
#define lshseperation 101
|
||||
#define lsbasevseperation ((62*vid.height)/(BASEVIDHEIGHT*vid.dupy)) //62
|
||||
#define lsbasevseperation ((62*vid.height)/(BASEVIDHEIGHT*vid.dup)) //62
|
||||
#define lsheadingheight 16
|
||||
#define getheadingoffset(row) (levelselect.rows[row].header[0] ? lsheadingheight : 0)
|
||||
#define lsvseperation(row) (lsbasevseperation + getheadingoffset(row))
|
||||
|
@ -3574,16 +3574,16 @@ void M_Drawer(void)
|
|||
{
|
||||
if (customversionstring[0] != '\0')
|
||||
{
|
||||
V_DrawThinString(vid.dupx, vid.height - 17*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT, "Mod version:");
|
||||
V_DrawThinString(vid.dupx, vid.height - 9*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, customversionstring);
|
||||
V_DrawThinString(vid.dup, vid.height - 17*vid.dup, V_NOSCALESTART|V_TRANSLUCENT, "Mod version:");
|
||||
V_DrawThinString(vid.dup, vid.height - 9*vid.dup, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, customversionstring);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef DEVELOP // Development -- show revision / branch info
|
||||
V_DrawThinString(vid.dupx, vid.height - 17*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, compbranch);
|
||||
V_DrawThinString(vid.dupx, vid.height - 9*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, comprevision);
|
||||
V_DrawThinString(vid.dup, vid.height - 17*vid.dup, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, compbranch);
|
||||
V_DrawThinString(vid.dup, vid.height - 9*vid.dup, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, comprevision);
|
||||
#else // Regular build
|
||||
V_DrawThinString(vid.dupx, vid.height - 9*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, va("%s", VERSIONSTRING));
|
||||
V_DrawThinString(vid.dup, vid.height - 9*vid.dup, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, va("%s", VERSIONSTRING));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -5757,16 +5757,15 @@ static void M_DrawRecordAttackForeground(void)
|
|||
|
||||
INT32 i;
|
||||
INT32 height = (fg->height / 2);
|
||||
INT32 dupz = (vid.dupx < vid.dupy ? vid.dupx : vid.dupy);
|
||||
|
||||
for (i = -12; i < (BASEVIDHEIGHT/height) + 12; i++)
|
||||
{
|
||||
INT32 y = ((i*height) - (height - ((FixedInt(recatkdrawtimer*2))%height)));
|
||||
// don't draw above the screen
|
||||
{
|
||||
INT32 sy = FixedMul(y, dupz<<FRACBITS) >> FRACBITS;
|
||||
if (vid.height != BASEVIDHEIGHT * dupz)
|
||||
sy += (vid.height - (BASEVIDHEIGHT * dupz)) / 2;
|
||||
INT32 sy = FixedMul(y, vid.dup<<FRACBITS) >> FRACBITS;
|
||||
if (vid.height != BASEVIDHEIGHT * vid.dup)
|
||||
sy += (vid.height - (BASEVIDHEIGHT * vid.dup)) / 2;
|
||||
if ((sy+height) < 0)
|
||||
continue;
|
||||
}
|
||||
|
@ -5790,13 +5789,12 @@ static void M_DrawRecordAttackForeground(void)
|
|||
static void M_DrawNightsAttackMountains(void)
|
||||
{
|
||||
static fixed_t bgscrollx;
|
||||
INT32 dupz = (vid.dupx < vid.dupy ? vid.dupx : vid.dupy);
|
||||
patch_t *background = W_CachePatchName(curbgname, PU_PATCH);
|
||||
INT16 w = background->width;
|
||||
INT32 x = FixedInt(-bgscrollx) % w;
|
||||
INT32 y = BASEVIDHEIGHT - (background->height * 2);
|
||||
|
||||
if (vid.height != BASEVIDHEIGHT * dupz)
|
||||
if (vid.height != BASEVIDHEIGHT * vid.dup)
|
||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 158);
|
||||
V_DrawFill(0, y+50, vid.width, BASEVIDHEIGHT, V_SNAPTOLEFT|31);
|
||||
|
||||
|
@ -5952,7 +5950,7 @@ static void M_DrawLevelPlatterMenu(void)
|
|||
}
|
||||
|
||||
// draw from top to bottom
|
||||
while (y < (vid.height/vid.dupy))
|
||||
while (y < (vid.height/vid.dup))
|
||||
{
|
||||
M_DrawLevelPlatterRow(iter, y);
|
||||
y += lsvseperation(iter);
|
||||
|
@ -7799,9 +7797,9 @@ static void M_DrawSoundTest(void)
|
|||
}
|
||||
}
|
||||
|
||||
y = (BASEVIDWIDTH-(vid.width/vid.dupx))/2;
|
||||
y = (BASEVIDWIDTH-(vid.width/vid.dup))/2;
|
||||
|
||||
V_DrawFill(y, 20, vid.width/vid.dupx, 24, 159);
|
||||
V_DrawFill(y, 20, vid.width/vid.dup, 24, 159);
|
||||
{
|
||||
static fixed_t st_scroll = -FRACUNIT;
|
||||
const char* titl;
|
||||
|
@ -8371,8 +8369,8 @@ static void M_DrawLoadGameData(void)
|
|||
INT32 i, prev_i = 1, savetodraw, x, y, hsep = 90;
|
||||
skin_t *charskin = NULL;
|
||||
|
||||
if (vid.width != BASEVIDWIDTH*vid.dupx)
|
||||
hsep = (hsep*vid.width)/(BASEVIDWIDTH*vid.dupx);
|
||||
if (vid.width != BASEVIDWIDTH*vid.dup)
|
||||
hsep = (hsep*vid.width)/(BASEVIDWIDTH*vid.dup);
|
||||
|
||||
for (i = 2; prev_i; i = -(i + ((UINT32)i >> 31))) // draws from outwards in; 2, -2, 1, -1, 0
|
||||
{
|
||||
|
@ -9357,7 +9355,7 @@ static void M_DrawSetupChoosePlayerMenu(void)
|
|||
INT16 bgwidth = charbg->width;
|
||||
INT16 fgwidth = charfg->width;
|
||||
INT32 x, y;
|
||||
INT32 w = (vid.width/vid.dupx);
|
||||
INT32 w = (vid.width/vid.dup);
|
||||
|
||||
if (abs(char_scroll) > FRACUNIT/4)
|
||||
char_scroll -= FixedMul((char_scroll>>2), renderdeltatics);
|
||||
|
@ -9393,7 +9391,7 @@ static void M_DrawSetupChoosePlayerMenu(void)
|
|||
// Background and borders
|
||||
V_DrawFill(0, 0, bgwidth, vid.height, V_SNAPTOTOP|colormap[101]);
|
||||
{
|
||||
INT32 sw = (BASEVIDWIDTH * vid.dupx);
|
||||
INT32 sw = (BASEVIDWIDTH * vid.dup);
|
||||
INT32 bw = (vid.width - sw) / 2;
|
||||
col = colormap[106];
|
||||
if (bw)
|
||||
|
@ -10815,7 +10813,7 @@ void M_DrawMarathon(void)
|
|||
const char *cvstring;
|
||||
char *work;
|
||||
angle_t fa;
|
||||
INT32 dupz = (vid.dupx < vid.dupy ? vid.dupx : vid.dupy), xspan = (vid.width/dupz), yspan = (vid.height/dupz), diffx = (xspan - BASEVIDWIDTH)/2, diffy = (yspan - BASEVIDHEIGHT)/2, maxy = BASEVIDHEIGHT + diffy;
|
||||
INT32 xspan = (vid.width/vid.dup), yspan = (vid.height/vid.dup), diffx = (xspan - BASEVIDWIDTH)/2, diffy = (yspan - BASEVIDHEIGHT)/2, maxy = BASEVIDHEIGHT + diffy;
|
||||
|
||||
curbgxspeed = 0;
|
||||
curbgyspeed = 18;
|
||||
|
@ -10888,16 +10886,17 @@ void M_DrawMarathon(void)
|
|||
INT32 trans = V_60TRANS+((cnt&~3)<<(V_ALPHASHIFT-2));
|
||||
INT32 height = fg->height / 2;
|
||||
char patchname[7] = "CEMGx0";
|
||||
INT32 dup;
|
||||
|
||||
dupz = (w*7)/6; //(w*42*120)/(360*6); -- I don't know why this works but I'm not going to complain.
|
||||
dupz = ((dupz>>FRACBITS) % height);
|
||||
dup = (w*7)/6; //(w*42*120)/(360*6); -- I don't know why this works but I'm not going to complain.
|
||||
dup = ((dup>>FRACBITS) % height);
|
||||
y = height/2;
|
||||
while (y+dupz >= -diffy)
|
||||
while (y+dup >= -diffy)
|
||||
y -= height;
|
||||
while (y-2-dupz < maxy)
|
||||
while (y-2-dup < maxy)
|
||||
{
|
||||
V_DrawFixedPatch(((BASEVIDWIDTH-190)<<(FRACBITS-1)), (y-2-dupz)<<FRACBITS, FRACUNIT/2, trans, fg, NULL);
|
||||
V_DrawFixedPatch(((BASEVIDWIDTH+190)<<(FRACBITS-1)), (y+dupz)<<FRACBITS, FRACUNIT/2, trans|V_FLIP, fg, NULL);
|
||||
V_DrawFixedPatch(((BASEVIDWIDTH-190)<<(FRACBITS-1)), (y-2-dup)<<FRACBITS, FRACUNIT/2, trans, fg, NULL);
|
||||
V_DrawFixedPatch(((BASEVIDWIDTH+190)<<(FRACBITS-1)), (y+dup)<<FRACBITS, FRACUNIT/2, trans|V_FLIP, fg, NULL);
|
||||
y += height;
|
||||
}
|
||||
|
||||
|
@ -10915,16 +10914,16 @@ void M_DrawMarathon(void)
|
|||
}
|
||||
|
||||
height = 18; // prevents the need for the next line
|
||||
//dupz = (w*height)/18;
|
||||
dupz = ((w>>FRACBITS) % height);
|
||||
y = dupz+(height/4);
|
||||
x = 105+dupz;
|
||||
//dup = (w*height)/18;
|
||||
dup = ((w>>FRACBITS) % height);
|
||||
y = dup+(height/4);
|
||||
x = 105+dup;
|
||||
while (y >= -diffy)
|
||||
{
|
||||
x -= height;
|
||||
y -= height;
|
||||
}
|
||||
while (y-dupz < maxy && x < (xspan/2))
|
||||
while (y-dup < maxy && x < (xspan/2))
|
||||
{
|
||||
V_DrawFill((BASEVIDWIDTH/2)-x-height, -diffy, height, diffy+y+height, 153);
|
||||
V_DrawFill((BASEVIDWIDTH/2)+x, (maxy-y)-height, height, height+y, 153);
|
||||
|
|
|
@ -989,7 +989,7 @@ static inline boolean M_PNGLib(void)
|
|||
|
||||
static void M_PNGFrame(png_structp png_ptr, png_infop png_info_ptr, png_bytep png_buf)
|
||||
{
|
||||
png_uint_16 downscale = apng_downscale ? vid.dupx : 1;
|
||||
png_uint_16 downscale = apng_downscale ? vid.dup : 1;
|
||||
|
||||
png_uint_32 pitch = png_get_rowbytes(png_ptr, png_info_ptr);
|
||||
PNG_CONST png_uint_32 width = vid.width / downscale;
|
||||
|
@ -1055,7 +1055,7 @@ static boolean M_SetupaPNG(png_const_charp filename, png_bytep pal)
|
|||
|
||||
apng_downscale = (!!cv_apng_downscale.value);
|
||||
|
||||
downscale = apng_downscale ? vid.dupx : 1;
|
||||
downscale = apng_downscale ? vid.dup : 1;
|
||||
|
||||
apng_FILE = fopen(filename,"wb+"); // + mode for reading
|
||||
if (!apng_FILE)
|
||||
|
|
|
@ -96,7 +96,7 @@ void Ban_Load_File(boolean warning)
|
|||
|
||||
Ban_Clear();
|
||||
|
||||
for (size_t i=0; fgets(buffer, (int)sizeof(buffer), f); i++)
|
||||
for (; fgets(buffer, (int)sizeof(buffer), f);)
|
||||
{
|
||||
address = strtok(buffer, " \t\r\n");
|
||||
mask = strtok(NULL, " \t\r\n");
|
||||
|
|
|
@ -1241,7 +1241,7 @@ static void SetColorLocal(INT32 playernum, UINT16 color)
|
|||
//
|
||||
static void SendNameAndColor(void)
|
||||
{
|
||||
char buf[MAXPLAYERNAME+6];
|
||||
char buf[MAXPLAYERNAME+7];
|
||||
char *p;
|
||||
|
||||
p = buf;
|
||||
|
|
|
@ -535,6 +535,9 @@ boolean P_Teleport(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle
|
|||
boolean P_SetMobjStateNF(mobj_t *mobj, statenum_t state);
|
||||
boolean P_CheckMissileSpawn(mobj_t *th);
|
||||
void P_Thrust(mobj_t *mo, angle_t angle, fixed_t move);
|
||||
void P_ThrustEvenIn2D(mobj_t *mo, angle_t angle, fixed_t move);
|
||||
void P_VectorInstaThrust(fixed_t xa, fixed_t xb, fixed_t xc, fixed_t ya, fixed_t yb, fixed_t yc,
|
||||
fixed_t za, fixed_t zb, fixed_t zc, fixed_t momentum, mobj_t *mo);
|
||||
void P_DoSuperTransformation(player_t *player, boolean giverings);
|
||||
void P_ExplodeMissile(mobj_t *mo);
|
||||
void P_CheckGravity(mobj_t *mo, boolean affect);
|
||||
|
|
|
@ -3730,7 +3730,9 @@ void P_SlideMove(mobj_t *mo)
|
|||
|
||||
boolean papercol = false;
|
||||
vertex_t v1, v2; // fake vertexes
|
||||
line_t junk; // fake linedef
|
||||
static line_t junk; // fake linedef
|
||||
|
||||
memset(&junk, 0x00, sizeof(junk));
|
||||
|
||||
if (tmhitthing && mo->z + mo->height > tmhitthing->z && mo->z < tmhitthing->z + tmhitthing->height)
|
||||
{
|
||||
|
|
|
@ -10544,6 +10544,7 @@ static fixed_t P_DefaultMobjShadowScale (mobj_t *thing)
|
|||
case MT_SMALLGRABCHAIN:
|
||||
case MT_BIGGRABCHAIN:
|
||||
|
||||
case MT_BLUESPRINGBALL:
|
||||
case MT_YELLOWSPRINGBALL:
|
||||
case MT_REDSPRINGBALL:
|
||||
|
||||
|
|
|
@ -175,7 +175,7 @@ static void P_NetArchivePlayers(void)
|
|||
WRITEUINT16(save_p, players[i].flashpal);
|
||||
WRITEUINT16(save_p, players[i].flashcount);
|
||||
|
||||
WRITEUINT8(save_p, players[i].skincolor);
|
||||
WRITEUINT16(save_p, players[i].skincolor);
|
||||
WRITEINT32(save_p, players[i].skin);
|
||||
WRITEUINT32(save_p, players[i].availabilities);
|
||||
WRITEUINT32(save_p, players[i].score);
|
||||
|
@ -404,7 +404,7 @@ static void P_NetUnArchivePlayers(void)
|
|||
players[i].flashpal = READUINT16(save_p);
|
||||
players[i].flashcount = READUINT16(save_p);
|
||||
|
||||
players[i].skincolor = READUINT8(save_p);
|
||||
players[i].skincolor = READUINT16(save_p);
|
||||
players[i].skin = READINT32(save_p);
|
||||
players[i].availabilities = READUINT32(save_p);
|
||||
players[i].score = READUINT32(save_p);
|
||||
|
|
|
@ -106,8 +106,7 @@ void P_Thrust(mobj_t *mo, angle_t angle, fixed_t move)
|
|||
mo->momy += FixedMul(move, FINESINE(angle));
|
||||
}
|
||||
|
||||
#if 0
|
||||
static inline void P_ThrustEvenIn2D(mobj_t *mo, angle_t angle, fixed_t move)
|
||||
void P_ThrustEvenIn2D(mobj_t *mo, angle_t angle, fixed_t move)
|
||||
{
|
||||
angle >>= ANGLETOFINESHIFT;
|
||||
|
||||
|
@ -115,7 +114,7 @@ static inline void P_ThrustEvenIn2D(mobj_t *mo, angle_t angle, fixed_t move)
|
|||
mo->momy += FixedMul(move, FINESINE(angle));
|
||||
}
|
||||
|
||||
static inline void P_VectorInstaThrust(fixed_t xa, fixed_t xb, fixed_t xc, fixed_t ya, fixed_t yb, fixed_t yc,
|
||||
void P_VectorInstaThrust(fixed_t xa, fixed_t xb, fixed_t xc, fixed_t ya, fixed_t yb, fixed_t yc,
|
||||
fixed_t za, fixed_t zb, fixed_t zc, fixed_t momentum, mobj_t *mo)
|
||||
{
|
||||
fixed_t a1, b1, c1, a2, b2, c2, i, j, k;
|
||||
|
@ -145,7 +144,6 @@ static inline void P_VectorInstaThrust(fixed_t xa, fixed_t xb, fixed_t xc, fixed
|
|||
mo->momy = j;
|
||||
mo->momz = k;
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// P_InstaThrust
|
||||
|
|
|
@ -249,7 +249,7 @@ static void FlipCam2_OnChange(void)
|
|||
//
|
||||
// killough 5/2/98: reformatted
|
||||
//
|
||||
INT32 R_PointOnSide(fixed_t x, fixed_t y, node_t *node)
|
||||
INT32 R_PointOnSide(fixed_t x, fixed_t y, node_t *restrict node)
|
||||
{
|
||||
if (!node->dx)
|
||||
return x <= node->x ? node->dy > 0 : node->dy < 0;
|
||||
|
@ -261,9 +261,10 @@ INT32 R_PointOnSide(fixed_t x, fixed_t y, node_t *node)
|
|||
fixed_t dy = (y >> 1) - (node->y >> 1);
|
||||
|
||||
// Try to quickly decide by looking at sign bits.
|
||||
if ((node->dy ^ node->dx ^ dx ^ dy) < 0)
|
||||
return (node->dy ^ dx) < 0; // (left is negative)
|
||||
return FixedMul(dy, node->dx>>FRACBITS) >= FixedMul(node->dy>>FRACBITS, dx);
|
||||
// also use a mask to avoid branch prediction
|
||||
INT32 mask = (node->dy ^ node->dx ^ dx ^ dy) >> 31;
|
||||
return (mask & ((node->dy ^ dx) < 0)) | // (left is negative)
|
||||
(~mask & (FixedMul(dy, node->dx>>FRACBITS) >= FixedMul(node->dy>>FRACBITS, dx)));
|
||||
}
|
||||
|
||||
// killough 5/2/98: reformatted
|
||||
|
|
|
@ -75,6 +75,6 @@ void R_SetupSkyDraw(void)
|
|||
*/
|
||||
void R_SetSkyScale(void)
|
||||
{
|
||||
fixed_t difference = vid.fdupx-(vid.dupx<<FRACBITS);
|
||||
skyscale = FixedDiv(fovtan, vid.fdupx+difference);
|
||||
fixed_t difference = vid.fdup-(vid.dup<<FRACBITS);
|
||||
skyscale = FixedDiv(fovtan, vid.fdup+difference);
|
||||
}
|
||||
|
|
10
src/screen.c
10
src/screen.c
|
@ -494,7 +494,7 @@ void SCR_CalculateFPS(void)
|
|||
void SCR_DisplayTicRate(void)
|
||||
{
|
||||
INT32 ticcntcolor = 0;
|
||||
const INT32 h = vid.height-(8*vid.dupy);
|
||||
const INT32 h = vid.height-(8*vid.dup);
|
||||
UINT32 cap = R_GetFramerateCap();
|
||||
double fps = round(averageFPS);
|
||||
|
||||
|
@ -530,7 +530,7 @@ void SCR_DisplayTicRate(void)
|
|||
|
||||
width = V_StringWidth(drawnstr, V_NOSCALESTART);
|
||||
|
||||
V_DrawString(vid.width - ((7 * 8 * vid.dupx) + V_StringWidth("FPS: ", V_NOSCALESTART)), h,
|
||||
V_DrawString(vid.width - ((7 * 8 * vid.dup) + V_StringWidth("FPS: ", V_NOSCALESTART)), h,
|
||||
V_YELLOWMAP|V_NOSCALESTART|V_USERHUDTRANS, "FPS:");
|
||||
V_DrawString(vid.width - width, h,
|
||||
ticcntcolor|V_NOSCALESTART|V_USERHUDTRANS, drawnstr);
|
||||
|
@ -589,7 +589,7 @@ void SCR_ClosedCaptions(void)
|
|||
|
||||
if (closedcaptions[i].b)
|
||||
{
|
||||
y -= closedcaptions[i].b * vid.dupy;
|
||||
y -= closedcaptions[i].b * vid.dup;
|
||||
if (renderisnewtic)
|
||||
{
|
||||
closedcaptions[i].b--;
|
||||
|
@ -639,9 +639,9 @@ void SCR_DisplayMarathonInfo(void)
|
|||
#define PRIMEV1 13
|
||||
#define PRIMEV2 17 // I can't believe it! I'm on TV!
|
||||
antisplice[0] += (entertic - oldentertics)*PRIMEV2;
|
||||
antisplice[0] %= PRIMEV1*((vid.width/vid.dupx)+1);
|
||||
antisplice[0] %= PRIMEV1*((vid.width/vid.dup)+1);
|
||||
antisplice[1] += (entertic - oldentertics)*PRIMEV1;
|
||||
antisplice[1] %= PRIMEV1*((vid.width/vid.dupx)+1);
|
||||
antisplice[1] %= PRIMEV1*((vid.width/vid.dup)+1);
|
||||
str = va("%i:%02i:%02i.%02i",
|
||||
G_TicsToHours(marathontime),
|
||||
G_TicsToMinutes(marathontime, false),
|
||||
|
|
12
src/screen.h
12
src/screen.h
|
@ -59,19 +59,19 @@ typedef struct viddef_s
|
|||
} u;
|
||||
INT32 recalc; // if true, recalc vid-based stuff
|
||||
UINT8 *direct; // linear frame buffer, or vga base mem.
|
||||
INT32 dupx, dupy; // scale 1, 2, 3 value for menus & overlays
|
||||
INT32/*fixed_t*/ fdupx, fdupy; // same as dupx, dupy, but exact value when aspect ratio isn't 320/200
|
||||
INT32 dup; // scale 1, 2, 3 value for menus & overlays
|
||||
INT32/*fixed_t*/ fdup; // same as dup, but exact value when aspect ratio isn't 320/200
|
||||
INT32 bpp; // BYTES per pixel: 1 = 256color, 2 = highcolor
|
||||
|
||||
INT32 baseratio; // Used to get the correct value for lighting walls
|
||||
|
||||
// for Win32 version
|
||||
DNWH WndParent; // handle of the application's window
|
||||
UINT8 smalldupx, smalldupy; // factor for a little bit of scaling
|
||||
UINT8 meddupx, meddupy; // factor for moderate, but not full, scaling
|
||||
UINT8 smalldup; // factor for a little bit of scaling
|
||||
UINT8 meddup; // factor for moderate, but not full, scaling
|
||||
#ifdef HWRENDER
|
||||
INT32/*fixed_t*/ fsmalldupx, fsmalldupy;
|
||||
INT32/*fixed_t*/ fmeddupx, fmeddupy;
|
||||
INT32/*fixed_t*/ fsmalldup;
|
||||
INT32/*fixed_t*/ fmeddup;
|
||||
INT32 glstate;
|
||||
#endif
|
||||
} viddef_t;
|
||||
|
|
|
@ -2266,7 +2266,7 @@ void I_Sleep(UINT32 ms)
|
|||
}
|
||||
|
||||
#ifdef NEWSIGNALHANDLER
|
||||
static void newsignalhandler_Warn(const char *pr)
|
||||
ATTRNORETURN static FUNCNORETURN void newsignalhandler_Warn(const char *pr)
|
||||
{
|
||||
char text[128];
|
||||
|
||||
|
@ -3035,11 +3035,11 @@ size_t I_GetFreeMem(size_t *total)
|
|||
#ifdef FREEBSD
|
||||
u_int v_free_count, v_page_size, v_page_count;
|
||||
size_t size = sizeof(v_free_count);
|
||||
sysctlbyname("vm.stat.vm.v_free_count", &v_free_count, &size, NULL, 0);
|
||||
size_t size = sizeof(v_page_size);
|
||||
sysctlbyname("vm.stat.vm.v_page_size", &v_page_size, &size, NULL, 0);
|
||||
size_t size = sizeof(v_page_count);
|
||||
sysctlbyname("vm.stat.vm.v_page_count", &v_page_count, &size, NULL, 0);
|
||||
sysctlbyname("vm.stats.vm.v_free_count", &v_free_count, &size, NULL, 0);
|
||||
size = sizeof(v_page_size);
|
||||
sysctlbyname("vm.stats.vm.v_page_size", &v_page_size, &size, NULL, 0);
|
||||
size = sizeof(v_page_count);
|
||||
sysctlbyname("vm.stats.vm.v_page_count", &v_page_count, &size, NULL, 0);
|
||||
|
||||
if (total)
|
||||
*total = v_page_count * v_page_size;
|
||||
|
|
|
@ -513,10 +513,10 @@ static void ST_drawDebugInfo(void)
|
|||
|
||||
#define VFLAGS V_MONOSPACE|V_SNAPTOTOP|V_SNAPTORIGHT
|
||||
|
||||
if ((moviemode == MM_GIF && cv_gif_downscale.value) || vid.dupx == 1)
|
||||
if ((moviemode == MM_GIF && cv_gif_downscale.value) || vid.dup == 1)
|
||||
{
|
||||
textfunc = V_DrawRightAlignedString;
|
||||
lowh = ((vid.height/vid.dupy) - 16);
|
||||
lowh = ((vid.height/vid.dup) - 16);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
552
src/v_video.c
552
src/v_video.c
File diff suppressed because it is too large
Load diff
|
@ -36,7 +36,7 @@ cv_rsaturation, cv_ysaturation, cv_gsaturation, cv_csaturation, cv_bsaturation,
|
|||
// Allocates buffer screens, call before R_Init.
|
||||
void V_Init(void);
|
||||
|
||||
// Recalculates the viddef (dupx, dupy, etc.) according to the current screen resolution.
|
||||
// Recalculates the viddef (dup, fdup, etc.) according to the current screen resolution.
|
||||
void V_Recalc(void);
|
||||
|
||||
// Color look-up table
|
||||
|
|
|
@ -536,7 +536,7 @@ void Y_IntermissionDrawer(void)
|
|||
|
||||
if (animatetic && (tic_t)intertic >= animatetic)
|
||||
{
|
||||
const INT32 scradjust = (vid.width/vid.dupx)>>3; // 40 for BASEVIDWIDTH
|
||||
const INT32 scradjust = (vid.width/vid.dup)>>3; // 40 for BASEVIDWIDTH
|
||||
INT32 animatetimer = (intertic - animatetic);
|
||||
if (animatetimer <= 16)
|
||||
{
|
||||
|
@ -687,7 +687,7 @@ void Y_IntermissionDrawer(void)
|
|||
|
||||
if (intertic > 1)
|
||||
{
|
||||
if (stagefailed && data.spec.emeraldy < (vid.height/vid.dupy)+16)
|
||||
if (stagefailed && data.spec.emeraldy < (vid.height/vid.dup)+16)
|
||||
{
|
||||
emeraldx += intertic - 6;
|
||||
}
|
||||
|
@ -1163,7 +1163,7 @@ void Y_Ticker(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (data.spec.emeraldy < (vid.height/vid.dupy)+16)
|
||||
if (data.spec.emeraldy < (vid.height/vid.dup)+16)
|
||||
{
|
||||
data.spec.emeraldy += (++data.spec.emeraldmomy);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue