Merge branch 'next' of https://git.magicalgirl.moe/STJr/SRB2.git into morehints

# Conflicts:
#	src/m_menu.c
This commit is contained in:
toaster 2020-01-08 19:18:35 +00:00
commit a2ae30c2e2
243 changed files with 22761 additions and 9878 deletions

View file

@ -459,11 +459,15 @@ matrix:
- os: linux - os: linux
addons: addons:
apt: apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:stjr/srb2'
packages: packages:
- libsdl2-mixer-dev - libsdl2-mixer-dev
- libpng-dev - libpng-dev
- libgl1-mesa-dev - libgl1-mesa-dev
- libgme-dev - libgme-dev
- libopenmpt-dev
- p7zip-full - p7zip-full
- gcc-4.8 - gcc-4.8
compiler: gcc-4.8 compiler: gcc-4.8
@ -473,43 +477,24 @@ matrix:
AND env(DPL_TERMINATE_MAIN) != "1" AND env(DPL_TERMINATE_MAIN) != "1"
env: env:
- _DPL_JOB_ENABLED=1 - _DPL_JOB_ENABLED=1
- _DPL_JOB_NAME=bionic - _DPL_JOB_NAME=eoan
- _DPL_DPUT_TARGET=1 - _DPL_DPUT_TARGET=1
- _DPL_PACKAGE_SOURCE=1 - _DPL_PACKAGE_SOURCE=1
- PACKAGE_DISTRO=bionic - PACKAGE_DISTRO=eoan
- PACKAGE_SUBVERSION=~18.04bionic - PACKAGE_SUBVERSION=~19.10eoan
#gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
- os: linux
addons:
apt:
packages:
- libsdl2-mixer-dev
- libpng-dev
- libgl1-mesa-dev
- libgme-dev
- p7zip-full
- gcc-4.8
compiler: gcc-4.8
dist: trusty
if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1")
AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1"))
AND env(DPL_TERMINATE_MAIN) != "1"
env:
- _DPL_JOB_ENABLED=1
- _DPL_JOB_NAME=trusty
- _DPL_DPUT_TARGET=1
- _DPL_PACKAGE_SOURCE=1
- PACKAGE_DISTRO=trusty
- PACKAGE_SUBVERSION=~14.04trusty
#gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5 #gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
- os: linux - os: linux
addons: addons:
apt: apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:stjr/srb2'
packages: packages:
- libsdl2-mixer-dev - libsdl2-mixer-dev
- libpng-dev - libpng-dev
- libgl1-mesa-dev - libgl1-mesa-dev
- libgme-dev - libgme-dev
- libopenmpt-dev
- p7zip-full - p7zip-full
- gcc-4.8 - gcc-4.8
compiler: gcc-4.8 compiler: gcc-4.8
@ -528,11 +513,15 @@ matrix:
- os: linux - os: linux
addons: addons:
apt: apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:stjr/srb2'
packages: packages:
- libsdl2-mixer-dev - libsdl2-mixer-dev
- libpng-dev - libpng-dev
- libgl1-mesa-dev - libgl1-mesa-dev
- libgme-dev - libgme-dev
- libopenmpt-dev
- p7zip-full - p7zip-full
- gcc-4.8 - gcc-4.8
compiler: gcc-4.8 compiler: gcc-4.8
@ -542,20 +531,24 @@ matrix:
AND env(DPL_TERMINATE_MAIN) != "1" AND env(DPL_TERMINATE_MAIN) != "1"
env: env:
- _DPL_JOB_ENABLED=1 - _DPL_JOB_ENABLED=1
- _DPL_JOB_NAME=cosmic - _DPL_JOB_NAME=bionic
- _DPL_DPUT_TARGET=1 - _DPL_DPUT_TARGET=1
- _DPL_PACKAGE_SOURCE=1 - _DPL_PACKAGE_SOURCE=1
- PACKAGE_DISTRO=cosmic - PACKAGE_DISTRO=bionic
- PACKAGE_SUBVERSION=~18.10cosmic - PACKAGE_SUBVERSION=~18.04bionic
#gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5 #gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
- os: linux - os: linux
addons: addons:
apt: apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:stjr/srb2'
packages: packages:
- libsdl2-mixer-dev - libsdl2-mixer-dev
- libpng-dev - libpng-dev
- libgl1-mesa-dev - libgl1-mesa-dev
- libgme-dev - libgme-dev
- libopenmpt-dev
- p7zip-full - p7zip-full
- gcc-4.8 - gcc-4.8
compiler: gcc-4.8 compiler: gcc-4.8
@ -571,6 +564,33 @@ matrix:
- PACKAGE_DISTRO=xenial - PACKAGE_DISTRO=xenial
- PACKAGE_SUBVERSION=~16.04xenial - PACKAGE_SUBVERSION=~16.04xenial
#gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5 #gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:stjr/srb2'
packages:
- libsdl2-mixer-dev
- libpng-dev
- libgl1-mesa-dev
- libgme-dev
- libopenmpt-dev
- p7zip-full
- gcc-4.8
compiler: gcc-4.8
dist: trusty
if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1")
AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1"))
AND env(DPL_TERMINATE_MAIN) != "1"
env:
- _DPL_JOB_ENABLED=1
- _DPL_JOB_NAME=trusty
- _DPL_DPUT_TARGET=1
- _DPL_PACKAGE_SOURCE=1
- PACKAGE_DISTRO=trusty
- PACKAGE_SUBVERSION=~14.04trusty
#gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
allow_failures: allow_failures:
- compiler: clang-3.5 - compiler: clang-3.5
- compiler: clang-3.6 - compiler: clang-3.6

View file

@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0)
# DO NOT CHANGE THIS SRB2 STRING! Some variable names depend on this string. # DO NOT CHANGE THIS SRB2 STRING! Some variable names depend on this string.
# Version change is fine. # Version change is fine.
project(SRB2 project(SRB2
VERSION 2.1.25 VERSION 2.2.0
LANGUAGES C) LANGUAGES C)
if(${PROJECT_SOURCE_DIR} MATCHES ${PROJECT_BINARY_DIR}) if(${PROJECT_SOURCE_DIR} MATCHES ${PROJECT_BINARY_DIR})
@ -95,7 +95,6 @@ set(CMAKE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
# Set EXE names so the assets CMakeLists can refer to its target # Set EXE names so the assets CMakeLists can refer to its target
set(SRB2_SDL2_EXE_NAME srb2 CACHE STRING "Executable binary output name") set(SRB2_SDL2_EXE_NAME srb2 CACHE STRING "Executable binary output name")
set(SRB2_WIN_EXE_NAME srb2dd CACHE STRING "Executable binary output name for DirectDraw build")
include_directories(${CMAKE_CURRENT_BINARY_DIR}/src) include_directories(${CMAKE_CURRENT_BINARY_DIR}/src)

View file

@ -1,145 +1,136 @@
version: 2.1.25.{branch}-{build} version: 2.2.0.{branch}-{build}
os: MinGW os: MinGW
environment: environment:
CC: ccache CC: ccache
CCACHE_CC: i686-w64-mingw32-gcc CCACHE_CC: i686-w64-mingw32-gcc
CCACHE_CC_64: x86_64-w64-mingw32-gcc CCACHE_CC_64: x86_64-w64-mingw32-gcc
WINDRES: windres WINDRES: windres
# c:\mingw-w64 i686 has gcc 6.3.0, so use c:\msys64 7.3.0 instead # c:\mingw-w64 i686 has gcc 6.3.0, so use c:\msys64 7.3.0 instead
MINGW_SDK: c:\msys64\mingw32 MINGW_SDK: c:\msys64\mingw32
# c:\msys64 x86_64 has gcc 8.2.0, so use c:\mingw-w64 7.3.0 instead # c:\msys64 x86_64 has gcc 8.2.0, so use c:\mingw-w64 7.3.0 instead
MINGW_SDK_64: C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64 MINGW_SDK_64: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64
CFLAGS: -Wall -W -Werror -Wno-error=implicit-fallthrough -Wimplicit-fallthrough=3 -Wno-tautological-compare -Wno-error=suggest-attribute=noreturn CFLAGS: -Wall -W -Werror -Wno-error=implicit-fallthrough -Wimplicit-fallthrough=3 -Wno-tautological-compare -Wno-error=suggest-attribute=noreturn
NASM_ZIP: nasm-2.12.01 NASM_ZIP: nasm-2.12.01
NASM_URL: http://www.nasm.us/pub/nasm/releasebuilds/2.12.01/win64/nasm-2.12.01-win64.zip NASM_URL: http://www.nasm.us/pub/nasm/releasebuilds/2.12.01/win64/nasm-2.12.01-win64.zip
UPX_ZIP: upx391w UPX_ZIP: upx391w
UPX_URL: http://upx.sourceforge.net/download/upx391w.zip UPX_URL: http://upx.sourceforge.net/download/upx391w.zip
CCACHE_EXE: ccache.exe CCACHE_EXE: ccache.exe
CCACHE_URL: http://alam.srb2.org/ccache.exe CCACHE_URL: http://alam.srb2.org/ccache.exe
CCACHE_COMPRESS: true CCACHE_COMPRESS: true
CCACHE_DIR: C:\Users\appveyor\.ccache CCACHE_DIR: C:\Users\appveyor\.ccache
# Disable UPX by default. The user can override this in their Appveyor project settings # Disable UPX by default. The user can override this in their Appveyor project settings
NOUPX: 1 NOUPX: 1
############################## ##############################
# DEPLOYER VARIABLES # DEPLOYER VARIABLES
# DPL_ENABLED=1 builds installers for branch names starting with `deployer`. # DPL_ENABLED=1 builds installers for branch names starting with `deployer`.
# DPL_TAG_ENABLED=1 will also build installers for release tags. DPL_ENABLED=1 must also be set. # DPL_TAG_ENABLED=1 will also build installers for release tags. DPL_ENABLED=1 must also be set.
# Set these in the Appveyor project settings # Set these in the Appveyor project settings
############################## ##############################
DPL_ENABLED: 0 DPL_ENABLED: 0
DPL_TAG_ENABLED: 0 DPL_TAG_ENABLED: 0
DPL_INSTALLER_NAME: SRB2-v2123 DPL_INSTALLER_NAME: SRB2-v220
# Asset handling is barebones vs. Travis Deployer. We operate on 7z only. # Asset handling is barebones vs. Travis Deployer. We operate on 7z only.
# Include the README files and the OpenGL batch in the main and patch archives. # Include the README files and the OpenGL batch in the main and patch archives.
# The x86/x64 archives contain the DLL binaries. # The x86/x64 archives contain the DLL binaries.
ASSET_ARCHIVE_PATH: https://github.com/mazmazz/SRB2/releases/download/SRB2_assets/SRB2-v2122-assets.7z ASSET_ARCHIVE_PATH: https://github.com/mazmazz/SRB2/releases/download/SRB2_assets_220/SRB2-v220-assets.7z
ASSET_ARCHIVE_PATCH_PATH: https://github.com/mazmazz/SRB2/releases/download/SRB2_assets/SRB2-v2122-patch-assets.7z ASSET_ARCHIVE_PATCH_PATH: https://github.com/mazmazz/SRB2/releases/download/SRB2_assets_220/SRB2-v220-patch-assets.7z
ASSET_ARCHIVE_X86_PATH: https://github.com/mazmazz/SRB2/releases/download/SRB2_assets/SRB2-v2122-x86-assets.7z ASSET_ARCHIVE_X86_PATH: https://github.com/mazmazz/SRB2/releases/download/SRB2_assets_220/SRB2-v220-x86-assets.7z
ASSET_ARCHIVE_X64_PATH: https://github.com/mazmazz/SRB2/releases/download/SRB2_assets/SRB2-v2122-x64-assets.7z ASSET_ARCHIVE_X64_PATH: https://github.com/mazmazz/SRB2/releases/download/SRB2_assets_220/SRB2-v220-x64-assets.7z
ASSET_ARCHIVE_OPTIONAL_PATH: https://github.com/mazmazz/SRB2/releases/download/SRB2_assets/SRB2-v2122-optional-assets.7z ASSET_ARCHIVE_OPTIONAL_PATH: https://github.com/mazmazz/SRB2/releases/download/SRB2_assets_220/SRB2-v220-optional-assets.7z
# This is overridden to 1 for release tag builds # This is overridden to 1 for release tag builds
ASSET_FILES_OPTIONAL_GET: 0 ASSET_FILES_OPTIONAL_GET: 0
# For patches, also include the X86/X64 DLLs. # For patches, also include the X86/X64 DLLs.
PACKAGE_PATCH_DLL_GET: 0 PACKAGE_PATCH_DLL_GET: 0
# Delete all asset downloads so they can be redownloaded # Delete all asset downloads so they can be redownloaded
ASSET_CLEAN: 0 ASSET_CLEAN: 0
cache: cache:
- nasm-2.12.01.zip - nasm-2.12.01.zip
- upx391w.zip - upx391w.zip
- ccache.exe - ccache.exe
- C:\Users\appveyor\.ccache - C:\Users\appveyor\.ccache
- C:\Users\appveyor\srb2_cache - C:\Users\appveyor\srb2_cache
install: install:
- if [%CONFIGURATION%] == [SDL64] ( set "X86_64=1" ) - if [%CONFIGURATION%] == [SDL64] ( set "X86_64=1" )
- if [%CONFIGURATION%] == [SDL64] ( set "CONFIGURATION=SDL" ) - if [%CONFIGURATION%] == [SDL64] ( set "CONFIGURATION=SDL" )
- if [%CONFIGURATION%] == [DD64] ( set "X86_64=1" ) - if [%X86_64%] == [1] ( set "MINGW_SDK=%MINGW_SDK_64%" )
- if [%CONFIGURATION%] == [DD64] ( set "CONFIGURATION=DD" ) - if [%X86_64%] == [1] ( set "CCACHE_CC=%CCACHE_CC_64%" )
- if [%X86_64%] == [1] ( set "MINGW_SDK=%MINGW_SDK_64%" )
- if [%X86_64%] == [1] ( set "CCACHE_CC=%CCACHE_CC_64%" ) - if not exist "%NASM_ZIP%.zip" appveyor DownloadFile "%NASM_URL%" -FileName "%NASM_ZIP%.zip"
- 7z x -y "%NASM_ZIP%.zip" -o%TMP% >null
- if not exist "%NASM_ZIP%.zip" appveyor DownloadFile "%NASM_URL%" -FileName "%NASM_ZIP%.zip" - robocopy /S /xx /ns /nc /nfl /ndl /np /njh /njs "%TMP%\%NASM_ZIP%" "%MINGW_SDK%\bin" nasm.exe || exit 0
- 7z x -y "%NASM_ZIP%.zip" -o%TMP% >null
- robocopy /S /xx /ns /nc /nfl /ndl /np /njh /njs "%TMP%\%NASM_ZIP%" "%MINGW_SDK%\bin" nasm.exe || exit 0 - if not exist "%UPX_ZIP%.zip" appveyor DownloadFile "%UPX_URL%" -FileName "%UPX_ZIP%.zip"
- 7z x -y "%UPX_ZIP%.zip" -o%TMP% >null
- if not exist "%UPX_ZIP%.zip" appveyor DownloadFile "%UPX_URL%" -FileName "%UPX_ZIP%.zip" - robocopy /S /xx /ns /nc /nfl /ndl /np /njh /njs "%TMP%\%UPX_ZIP%" "%MINGW_SDK%\bin" upx.exe || exit 0
- 7z x -y "%UPX_ZIP%.zip" -o%TMP% >null
- robocopy /S /xx /ns /nc /nfl /ndl /np /njh /njs "%TMP%\%UPX_ZIP%" "%MINGW_SDK%\bin" upx.exe || exit 0 - if not exist "%CCACHE_EXE%" appveyor DownloadFile "%CCACHE_URL%" -FileName "%CCACHE_EXE%"
- ccache -M 99M
- if not exist "%CCACHE_EXE%" appveyor DownloadFile "%CCACHE_URL%" -FileName "%CCACHE_EXE%" - xcopy /Y /V /I ccache.exe "%MINGW_SDK%\bin"
- ccache -M 99M
- xcopy /Y /V /I ccache.exe "%MINGW_SDK%\bin" configuration:
- SDL
configuration: - SDL64
- SDL
- SDL64 before_build:
- DD - set "Path=%MINGW_SDK%\bin;%Path%"
- DD64 - if [%X86_64%] == [1] ( x86_64-w64-mingw32-gcc --version ) else ( i686-w64-mingw32-gcc --version )
- mingw32-make --version
matrix: - if not [%X86_64%] == [1] ( nasm -v )
allow_failures: - if not [%NOUPX%] == [1] ( upx -V )
- configuration: DD - ccache -V
- configuration: DD64 - ccache -s
- if [%NOUPX%] == [1] ( set "NOUPX=NOUPX=1" ) else ( set "NOUPX=" )
before_build: - set "SRB2_MFLAGS=-C src WARNINGMODE=1 CCACHE=1 NOOBJDUMP=1 %NOUPX%"
- set "Path=%MINGW_SDK%\bin;%Path%" - if [%X86_64%] == [1] ( set "MINGW_FLAGS=MINGW64=1 X86_64=1 GCC81=1" ) else ( set "MINGW_FLAGS=MINGW=1 GCC91=1" )
- if [%X86_64%] == [1] ( x86_64-w64-mingw32-gcc --version ) else ( i686-w64-mingw32-gcc --version ) - set "SRB2_MFLAGS=%SRB2_MFLAGS% %MINGW_FLAGS% %CONFIGURATION%=1"
- mingw32-make --version
- if not [%X86_64%] == [1] ( nasm -v ) build_script:
- if not [%NOUPX%] == [1] ( upx -V ) - cmd: mingw32-make.exe %SRB2_MFLAGS% clean
- ccache -V - cmd: mingw32-make.exe %SRB2_MFLAGS% ERRORMODE=1 -k
- ccache -s
- if [%NOUPX%] == [1] ( set "NOUPX=NOUPX=1" ) else ( set "NOUPX=" ) after_build:
- set "SRB2_MFLAGS=-C src WARNINGMODE=1 CCACHE=1 GCC73=1 NOOBJDUMP=1 %NOUPX%" - if [%X86_64%] == [1] (
- if [%X86_64%] == [1] ( set "MINGW_FLAGS=MINGW64=1 X86_64=1" ) else ( set "MINGW_FLAGS=MINGW=1 GCC91=1" ) set "BUILD_PATH=bin\Mingw64\Release"
- set "SRB2_MFLAGS=%SRB2_MFLAGS% %MINGW_FLAGS% %CONFIGURATION%=1" ) else (
set "BUILD_PATH=bin\Mingw\Release"
build_script: )
- cmd: mingw32-make.exe %SRB2_MFLAGS% clean - if [%X86_64%] == [1] ( set "CONFIGURATION=%CONFIGURATION%64" )
- cmd: mingw32-make.exe %SRB2_MFLAGS% ERRORMODE=1 -k - ccache -s
- cmd: git rev-parse --short %APPVEYOR_REPO_COMMIT%>%TMP%/gitshort.txt
after_build: - cmd: set /P GITSHORT=<%TMP%/gitshort.txt
- if [%X86_64%] == [1] ( - set BUILD_ARCHIVE=%APPVEYOR_REPO_BRANCH%-%GITSHORT%-%CONFIGURATION%.7z
set "BUILD_PATH=bin\Mingw64\Release" - set BUILDSARCHIVE=%APPVEYOR_REPO_BRANCH%-%CONFIGURATION%.7z
) else ( - cmd: 7z a %BUILD_ARCHIVE% %BUILD_PATH% -xr!.gitignore
set "BUILD_PATH=bin\Mingw\Release" - appveyor PushArtifact %BUILD_ARCHIVE%
) - cmd: copy %BUILD_ARCHIVE% %BUILDSARCHIVE%
- if [%X86_64%] == [1] ( set "CONFIGURATION=%CONFIGURATION%64" ) - appveyor PushArtifact %BUILDSARCHIVE%
- ccache -s ##############################
- cmd: git rev-parse --short %APPVEYOR_REPO_COMMIT%>%TMP%/gitshort.txt # DEPLOYER SCRIPT
- cmd: set /P GITSHORT=<%TMP%/gitshort.txt ##############################
- set BUILD_ARCHIVE=%APPVEYOR_REPO_BRANCH%-%GITSHORT%-%CONFIGURATION%.7z - if [%DPL_ENABLED%] == [1] ( call "deployer\appveyor\deployer.bat" )
- set BUILDSARCHIVE=%APPVEYOR_REPO_BRANCH%-%CONFIGURATION%.7z
- cmd: 7z a %BUILD_ARCHIVE% %BUILD_PATH% -xr!.gitignore test: off
- appveyor PushArtifact %BUILD_ARCHIVE%
- cmd: copy %BUILD_ARCHIVE% %BUILDSARCHIVE% #deploy:
- appveyor PushArtifact %BUILDSARCHIVE% # - provider: FTP
############################## # protocol: ftps
# DEPLOYER SCRIPT # host:
############################## # secure: NsLJEPIBvmwCOj8Tg8RoRQ==
- if [%DPL_ENABLED%] == [1] ( call "deployer\appveyor\deployer.bat" ) # username:
# secure: ejxi5mvk7oLYu7QtbYojajEPigMy0mokaKhuEVuDZcA=
test: off # password:
# secure: Hbn6Uy3lT0YZ88yFJ3aW4w==
#deploy: # folder: appveyor
# - provider: FTP # application:
# protocol: ftps # active_mode: false
# host: # on:
# secure: NsLJEPIBvmwCOj8Tg8RoRQ== # branch: master
# username: # appveyor_repo_tag: true
# secure: ejxi5mvk7oLYu7QtbYojajEPigMy0mokaKhuEVuDZcA=
# password:
# secure: Hbn6Uy3lT0YZ88yFJ3aW4w== on_finish:
# folder: appveyor #- cmd: echo xfreerdp /u:appveyor /cert-ignore +clipboard /v:<ip>:<port>
# application: #- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
# active_mode: false
# on:
# branch: master
# appveyor_repo_tag: true
on_finish:
#- cmd: echo xfreerdp /u:appveyor /cert-ignore +clipboard /v:<ip>:<port>
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

View file

@ -12,18 +12,22 @@ ENDFUNCTION(PREPEND)
set(SRB2_ASSET_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/installer" set(SRB2_ASSET_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/installer"
CACHE STRING "Path to directory that contains all asset files for the installer.") CACHE STRING "Path to directory that contains all asset files for the installer.")
####################
# POST-V2.2 NOTE: Do not forget to add patch.pk3 to the end of this list!
####################
set(SRB2_ASSET_HASHED set(SRB2_ASSET_HASHED
"srb2.pk3;\ "srb2.pk3;\
player.dta;\ player.dta;\
zones.pk3;\ zones.pk3"
patch.pk3"
CACHE STRING "Asset filenames to apply MD5 checks. No spaces between entries!" CACHE STRING "Asset filenames to apply MD5 checks. No spaces between entries!"
) )
set(SRB2_ASSET_DOCS set(SRB2_ASSET_DOCS
"README.txt;\ "README.txt;\
LICENSE.txt;\ LICENSE.txt;\
LICENSE-3RD-PARTY.txt" LICENSE-3RD-PARTY.txt;\
README-SDL.txt"
CACHE STRING "Documentation filenames. In OS X, these are packaged separately from other assets. No spaces between entries!" CACHE STRING "Documentation filenames. In OS X, these are packaged separately from other assets. No spaces between entries!"
) )

View file

@ -34,11 +34,11 @@ SRB2 Message Board:
https://mb.srb2.org https://mb.srb2.org
SRB2 Official Discord: SRB2 Official Discord:
https://discord.gg/pYDXzpX https://discord.gg/pYDXzpX (13+)
COPYRIGHT AND DISCLAIMER COPYRIGHT AND DISCLAIMER
Design and content on SRB2 is copyright 1998-2018 by Sonic Team Junior. Design and content on SRB2 is copyright 1998-2019 by Sonic Team Junior.
All non-original material on SRB2.ORG is copyrighted by their All non-original material on SRB2.ORG is copyrighted by their
respective owners, and no copyright infringement is intended. The owner respective owners, and no copyright infringement is intended. The owner
of the SRB2.ORG domain is only acting as an ISP, and is therefore not of the SRB2.ORG domain is only acting as an ISP, and is therefore not

View file

@ -10,6 +10,7 @@ Build-Depends: debhelper (>= 7.0.50~),
libpng-dev | libpng16-dev | libpng12-dev (>= 1.2.7), libpng-dev | libpng16-dev | libpng12-dev (>= 1.2.7),
zlib1g-dev, zlib1g-dev,
libgme-dev, libgme-dev,
libopenmpt-dev,
libglu1-dev | libglu-dev, libglu1-dev | libglu-dev,
libosmesa6-dev | libgl-dev, libosmesa6-dev | libgl-dev,
nasm [i386] nasm [i386]
@ -24,6 +25,7 @@ Depends: ${SHLIBS_DEPENDS}, ${MISC_DEPENDS},
libsdl2-mixer-2.0-0, libsdl2-mixer-2.0-0,
zlib1g, zlib1g,
libgme0, libgme0,
libopenmpt | libopenmpt0,
libpng | libpng16-16 | libpng12-0 libpng | libpng16-16 | libpng12-0
Description: A cross-platform 3D Sonic fangame Description: A cross-platform 3D Sonic fangame
Sonic Robo Blast 2 is a 3D open-source Sonic the Hedgehog Sonic Robo Blast 2 is a 3D open-source Sonic the Hedgehog

View file

@ -27,10 +27,10 @@
: ${_DPL_PACKAGE_ASSET} # Build asset installation package. Linux only. : ${_DPL_PACKAGE_ASSET} # Build asset installation package. Linux only.
# Asset File Parameters # Asset File Parameters
: ${ASSET_ARCHIVE_PATH:=https://github.com/mazmazz/SRB2/releases/download/SRB2_assets/SRB2-v2122-assets.7z} : ${ASSET_ARCHIVE_PATH:=https://github.com/mazmazz/SRB2/releases/download/SRB2_assets_220/SRB2-v220-assets.7z}
: ${ASSET_ARCHIVE_OPTIONAL_PATH:=https://github.com/mazmazz/SRB2/releases/download/SRB2_assets/SRB2-v2122-optional-assets.7z} : ${ASSET_ARCHIVE_OPTIONAL_PATH:=https://github.com/mazmazz/SRB2/releases/download/SRB2_assets_220/SRB2-v220-optional-assets.7z}
: ${ASSET_FILES_HASHED:=srb2.srb zones.dta player.dta rings.dta patch.dta} : ${ASSET_FILES_HASHED:=srb2.pk3 zones.pk3 player.dta} # POST v2.2 NOTE: Don't forget to add patch.pk3!
: ${ASSET_FILES_DOCS:=README.txt LICENSE.txt LICENSE-3RD-PARTY.txt} : ${ASSET_FILES_DOCS:=README.txt LICENSE.txt LICENSE-3RD-PARTY.txt README-SDL.txt}
: ${ASSET_FILES_OPTIONAL_GET:=0} : ${ASSET_FILES_OPTIONAL_GET:=0}
# FTP Parameters # FTP Parameters
@ -51,7 +51,7 @@
# Package Parameters # Package Parameters
: ${PACKAGE_NAME:=srb2} : ${PACKAGE_NAME:=srb2}
: ${PACKAGE_VERSION:=2.1.23} : ${PACKAGE_VERSION:=2.2.0}
: ${PACKAGE_SUBVERSION} # Highly recommended to set this to reflect the distro series target (e.g., ~18.04bionic) : ${PACKAGE_SUBVERSION} # Highly recommended to set this to reflect the distro series target (e.g., ~18.04bionic)
: ${PACKAGE_REVISION} # Defaults to UTC timestamp : ${PACKAGE_REVISION} # Defaults to UTC timestamp
: ${PACKAGE_INSTALL_PATH:=/usr/games/SRB2} : ${PACKAGE_INSTALL_PATH:=/usr/games/SRB2}
@ -62,12 +62,12 @@
: ${PACKAGE_GROUP_NAME_EMAIL:=Sonic Team Junior <stjr@srb2.org>} : ${PACKAGE_GROUP_NAME_EMAIL:=Sonic Team Junior <stjr@srb2.org>}
: ${PACKAGE_WEBSITE:=<http://www.srb2.org>} : ${PACKAGE_WEBSITE:=<http://www.srb2.org>}
: ${PACKAGE_ASSET_MINVERSION:=2.1.21} # Number this the version BEFORE the actual required version, because we do a > check : ${PACKAGE_ASSET_MINVERSION:=2.1.26} # Number this the version BEFORE the actual required version, because we do a > check
: ${PACKAGE_ASSET_MAXVERSION:=2.1.24} # Number this the version AFTER the actual required version, because we do a < check : ${PACKAGE_ASSET_MAXVERSION:=2.2.1} # Number this the version AFTER the actual required version, because we do a < check
: ${PROGRAM_NAME:=Sonic Robo Blast 2} : ${PROGRAM_NAME:=Sonic Robo Blast 2}
: ${PROGRAM_VENDOR:=Sonic Team Junior} : ${PROGRAM_VENDOR:=Sonic Team Junior}
: ${PROGRAM_VERSION:=2.1.23} : ${PROGRAM_VERSION:=2.2.0}
: ${PROGRAM_DESCRIPTION:=A free 3D Sonic the Hedgehog fangame closely inspired by the original Sonic games on the Sega Genesis.} : ${PROGRAM_DESCRIPTION:=A free 3D Sonic the Hedgehog fangame closely inspired by the original Sonic games on the Sega Genesis.}
: ${PROGRAM_FILENAME:=srb2} : ${PROGRAM_FILENAME:=srb2}

View file

@ -0,0 +1,77 @@
// Default lump name for new map
defaultlumpname = "MAP01";
//GZDB specific. Don't try to load lumps that don't exist.
basegame = 0;
//Sky textures for vanilla maps
defaultskytextures
{
SKY1 = "MAP01,MAP02,MAP03,MAP33,MAP50,MAP60,MAPF0,MAPM0";
SKY2 = "MAPM7,MAPMB";
SKY4 = "MAP04,MAP06,MAP61,MAPF6,MAPM1";
SKY6 = "MAP05,MAP51,MAPMA";
SKY7 = "MAPM2,MAPM5";
SKY8 = "MAP07,MAP08,MAP09,MAP52,MAP62,MAPF1";
SKY10 = "MAP10,MAP12,MAP53,MAP63,MAPM3";
SKY11 = "MAP11,MAPF7";
SKY13 = "MAP13,MAP64";
SKY14 = "MAP14";
SKY15 = "MAP15,MAP54";
SKY17 = "MAP70";
SKY20 = "MAP32,MAP55,MAP65,MAPF2,MAPF5";
SKY21 = "MAPM4";
SKY22 = "MAP22,MAP23,MAP25,MAP26,MAP27,MAP56,MAP66,MAPF4,MAPM6";
SKY30 = "MAP30";
SKY31 = "MAP31";
SKY35 = "MAP42";
SKY40 = "MAP41,MAP71,MAPM9";
SKY55 = "MAPF3,MAPM8";
SKY68 = "MAPF8";
SKY99 = "MAP57,MAPZ0";
SKY159 = "MAP16";
SKY172 = "MAP40";
SKY300 = "MAP72";
SKY301 = "MAP73";
}
// Skill levels
skills
{
1 = "Normal";
}
// Skins
skins
{
Sonic;
Tails;
Knuckles;
Amy;
Fang;
Metalsonic;
}
// Gametypes
gametypes
{
-1 = "Single Player";
0 = "Co-op";
1 = "Competition";
2 = "Race";
3 = "Match";
4 = "Team Match";
5 = "Tag";
6 = "Hide and Seek";
7 = "CTF";
}
// Texture loading options
defaultwalltexture = "GFZROCK";
defaultfloortexture = "GFZFLR01";
defaultceilingtexture = "F_SKY1";
// Default texture sets
// (these are not required, but useful for new users)
texturesets
{
}

View file

@ -0,0 +1,309 @@
common
{
// Some common settings
// Default testing parameters
testparameters = "-file \"%AP\" \"%F\" -warp %L";
testshortpaths = true;
// Action special help (mxd)
actionspecialhelp = "https://wiki.srb2.org/wiki/Linedef_type_%K";
// Default nodebuilder configurations
defaultsavecompiler = "zennode_normal";
defaulttestcompiler = "zennode_fast";
// Generalized actions
generalizedlinedefs = false;
generalizedsectors = true;
mixtexturesflats = true;
defaulttexturescale = 1.0f;
defaultflatscale = 1.0f;
scaledtextureoffsets = true;
// Thing number for start position in 3D Mode
start3dmode = 3328;
// Texture sources
textures
{
include("SRB222_misc.cfg", "textures");
}
// Patch sources
patches
{
include("SRB222_misc.cfg", "patches");
}
// Sprite sources
sprites
{
include("SRB222_misc.cfg", "sprites");
}
// Flat sources
flats
{
include("SRB222_misc.cfg", "flats");
}
}
mapformat_doom
{
// The format interface handles the map data format - DoomMapSetIO for SRB2DB2, SRB2MapSetIO for Zone Builder
formatinterface = "SRB2MapSetIO";
/*
GAME DETECT PATTERN
Used to guess the game for which a WAD file is made.
1 = One of these lumps must exist
2 = None of these lumps must exist
3 = All of these lumps must exist
*/
gamedetect
{
EXTENDED = 2;
BEHAVIOR = 2;
E#M# = 2;
MAP?? = 1;
}
/*
MAP LUMP NAMES
Map lumps are loaded with the map as long as they are right after each other. When the editor
meets a lump which is not defined in this list it will ignore the map if not satisfied.
The order of items defines the order in which lumps will be written to WAD file on save.
To indicate the map header lump, use ~MAP
Legenda:
required = Lump is required to exist.
blindcopy = Lump will be copied along with the map blindly. (usefull for lumps Doom Builder doesn't use)
nodebuild = The nodebuilder generates this lump.
allowempty = The nodebuilder is allowed to leave this lump empty.
script = This lump is a text-based script. Specify the filename of the script configuration to use.
*/
maplumpnames
{
include("SRB222_misc.cfg", "doommaplumpnames");
}
// When this is set to true, sectors with the same tag will light up when a line is highlighted
linetagindicatesectors = true;
// Special linedefs
include("SRB222_misc.cfg", "speciallinedefs");
// Default flags for first new thing (As far as 2.2 goes, they're empty just like in 2.1)
defaultthingflags
{
}
// DEFAULT SECTOR BRIGHTNESS LEVELS
sectorbrightness
{
include("SRB222_misc.cfg", "sectorbrightness");
}
// SECTOR TYPES-----------------------------------------------------------------
sectortypes
{
include("SRB222_sectors.cfg", "sectortypes");
}
// GENERALISED SECTOR TYPES-----------------------------------------------------------------
gen_sectortypes
{
include("SRB222_sectors.cfg", "gen_sectortypes");
}
// LINEDEF FLAGS
linedefflags
{
include("SRB222_misc.cfg", "linedefflags");
}
// Linedef flags UDMF translation table
// This is needed for copy/paste and prefabs to work properly
// When the UDMF field name is prefixed with ! it is inverted
linedefflagstranslation
{
include("SRB222_misc.cfg", "linedefflagstranslation");
}
// LINEDEF ACTIVATIONS
linedefactivations
{
}
// LINEDEF TYPES
linedeftypes
{
include("SRB222_linedefs.cfg", "doom");
}
// THING FLAGS
thingflags
{
include("SRB222_misc.cfg", "thingflags");
}
// Thing flags UDMF translation table
// This is needed for copy/paste and prefabs to work properly
// When the UDMF field name is prefixed with ! it is inverted
thingflagstranslation
{
include("SRB222_misc.cfg", "thingflagstranslation");
}
// THING FLAGS ERROR MASK
// Mask for the thing flags which indicates the options
// that make the same thing appear in the same modes
thingflagsmask1 = 7; // 1 + 2 + 4
thingflagsmask2 = 0;
}
mapformat_udmf
{
// The format interface handles the map data format
formatinterface = "UniversalMapSetIO";
// Enables support for long (> 8 chars) texture names
// WARNING: this should only be enabled for UDMF game configurations!
// WARNING: enabling this will make maps incompatible with Doom Builder 2 and can lead to problems in Slade 3!
longtexturenames = false;
// Default nodebuilder configurations
defaultsavecompiler = "zdbsp_udmf_normal";
defaulttestcompiler = "zdbsp_udmf_fast";
engine = "srb2"; // override that so that DB2 uses the correct namespace
maplumpnames
{
include("UDMF_misc.cfg", "udmfmaplumpnames_begin");
include("SRB222_misc.cfg", "udmfmaplumpnames");
include("UDMF_misc.cfg", "udmfmaplumpnames_end");
}
universalfields
{
// include("SRB222_misc.cfg", "universalfields");
}
// When this is set to true, sectors with the same tag will light up when a line is highlighted
linetagindicatesectors = false;
// Special linedefs
include("SRB222_misc.cfg", "speciallinedefs_udmf");
// Default flags for first new thing (As far as 2.2 goes, they're empty just like in 2.1)
defaultthingflags
{
}
// Generalized actions
generalizedlinedefs = false;
// SECTOR FLAGS
sectorflags
{
// include("SRB222_misc.cfg", "sectorflags");
}
// DEFAULT SECTOR BRIGHTNESS LEVELS
sectorbrightness
{
include("SRB222_misc.cfg", "sectorbrightness");
}
// SECTOR TYPES
sectortypes
{
include("SRB222_sectors.cfg", "sectortypes");
}
// SECTOR RENSERSTYLES
/* sectorrenderstyles
{
include("SRB222_misc.cfg", "sectorrenderstyles");
}*/
// LINEDEF FLAGS
linedefflags
{
include("SRB222_misc.cfg", "linedefflags_udmf");
}
// LINEDEF ACTIVATIONS
linedefactivations
{
include("SRB222_misc.cfg", "linedefactivations_udmf");
}
linedefflagstranslation
{
}
// LINEDEF RENSERSTYLES
linedefrenderstyles
{
include("SRB222_misc.cfg", "linedefrenderstyles");
}
//SIDEDEF FLAGS
/* sidedefflags
{
include("UDMF_misc.cfg", "sidedefflags");
}*/
// THING FLAGS
thingflags
{
include("SRB222_misc.cfg", "thingflags_udmf");
}
// Thing flags UDMF translation table
// This is needed for copy/paste and prefabs to work properly
// When the UDMF field name is prefixed with ! it is inverted
thingflagstranslation
{
include("SRB222_misc.cfg", "thingflagstranslation");
}
// THING RENSERSTYLES
/* thingrenderstyles
{
include("SRB222_misc.cfg", "thingrenderstyles");
}*/
// How to compare thing flags (for the stuck things error checker)
/* thingflagscompare
{
include("UDMF_misc.cfg", "thingflagscompare");
}*/
//mxd. Thing flags UDMF translation table
// This is needed for copy/paste and prefabs to work properly
// When the UDMF field name is prefixed with ! it is inverted
thingflagstranslation
{
}
// LINEDEF TYPES
linedeftypes
{
include("SRB222_linedefs.cfg", "udmf");
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,726 @@
linedefflags
{
1 = "[0] Impassable";
2 = "[1] Block Enemies";
4 = "[2] Double-Sided";
8 = "[3] Upper Unpegged";
16 = "[4] Lower Unpegged";
32 = "[5] Slope Skew (E1)";
64 = "[6] Not Climbable";
128 = "[7] No Midtexture Skew (E2)";
256 = "[8] Peg Midtexture (E3)";
512 = "[9] Solid Midtexture (E4)";
1024 = "[10] Repeat Midtexture (E5)";
2048 = "[11] Netgame Only";
4096 = "[12] No Netgame";
8192 = "[13] Effect 6";
16384 = "[14] Bouncy Wall";
32768 = "[15] Transfer Line";
}
// LINEDEF ACTIVATIONS
// Make sure these are in order from lowest value to highest value
linedefactivations
{
}
// Linedef flags UDMF translation table
// This is needed for copy/paste and prefabs to work properly
// When the UDMF field name is prefixed with ! it is inverted
linedefflagstranslation
{
1 = "blocking";
2 = "blockmonsters";
4 = "twosided";
8 = "dontpegtop";
16 = "dontpegbottom";
32 = "skewtd";
64 = "noclimb";
128 = "noskew";
256 = "midpeg";
512 = "midsolid";
1024 = "wrapmidtex";
2048 = "netonly";
4096 = "nonet";
8192 = "effect6";
16384 = "bouncy";
32768 = "transfer";
}
linedefflags_udmf
{
blocking = "Impassable";
blockmonsters = "Block Enemies";
twosided = "Double-Sided";
dontpegtop = "Upper Unpegged";
dontpegbottom = "Lower Unpegged";
skewtd = "Slope Skew";
noclimb = "Not Climbable";
noskew = "No Midtexture Skew";
midpeg = "Peg Midtexture";
midsolid = "Solid Midtexture";
wrapmidtex = "Repeat Midtexture";
// netonly = "Netgame-Only special";
// nonet = "No netgame special";
// effect6 = "Effect 6";
bouncy = "Bouncy Wall";
// transfer = "Transfer Line";
}
linedefactivations_udmf
{
notriggerorder = "Out of Order";
netonly = "Netgame-Only";
nonet = "No netgame";
}
sidedefflags
{
clipmidtex = "Clip middle texture";
wrapmidtex = "Wrap middle texture";
smoothlighting = "Smooth lighting";
nofakecontrast = "Even lighting";
nodecals = "No decals";
lightfog = "Use sidedef brightness on fogged walls";
}
//RENDER STYLES
thingrenderstyles
{
}
linedefrenderstyles
{
translucent = "Translucent";
fog = "Fog";
}
sectorrenderstyles
{
}
thingflags
{
1 = "[1] Extra";
2 = "[2] Flip";
4 = "[4] Special";
8 = "[8] Ambush";
}
// THING FLAGS
thingflags_udmf
{
extra = "Extra";
flip = "Flip";
special = "Special";
ambush = "Ambush";
}
// Thing flags UDMF translation table
// This is needed for copy/paste and prefabs to work properly
// When the UDMF field name is prefixed with ! it is inverted
thingflagstranslation
{
1 = "extra";
2 = "flip";
4 = "special";
8 = "ambush";
}
// DEFAULT SECTOR BRIGHTNESS LEVELS
sectorbrightness
{
255;
248;
240;
232;
224;
216;
208;
200;
192;
184;
176;
168;
160;
152;
144;
136;
128;
120;
112;
104;
96;
88;
80;
72;
64;
56;
48;
40;
32;
24;
16;
8;
0;
}
/*
TEXTURES AND FLAT SOURCES
This tells Doom Builder where to find the information for textures
and flats in the IWAD file, Addition WAD file and Map WAD file.
Start and end lumps must be given in a structure (of which the
key name doesnt matter) and any textures or flats in between them
are loaded in either the textures category or flats category.
For textures: PNAMES, TEXTURE1 and TEXTURE2 are loaded by default.
*/
textures
{
zdoom1
{
start = "TX_START";
end = "TX_END";
}
}
/*
ADDITIONAL UNIVERSAL DOOM MAP FORMAT FIELD DEFINITIONS
Only add fields here that Doom Builder does not edit with its own user-interface!
The "default" field must match the UDMF specifications!
Field data types:
0 = integer *
1 = float
2 = string
3 = bool
4 = linedef action (integer) *
5 = sector effect (integer) *
6 = texture (string)
7 = flat (string)
8 = angle in degrees (integer)
9 = angle in radians (float)
10 = XXRRGGBB color (integer)
11 = enum option (integer) *
12 = enum bits (integer) *
13 = sector tag (integer) *
14 = thing tag (integer) *
15 = linedef tag (integer) *
16 = enum option (string)
17 = angle in degrees (float)
22 = byte angle (integer)
*/
universalfields
{
sector
{
friction
{
name = "Friction";
type = 1;
default = 1;
}
specialeffectplanes
{
type = 11;
enum = "floorceiling";
default = 0;
}
colormapbegin
{
type = 0;
default = 0;
}
colormapend
{
type = 0;
default = 33;
}
foglighting
{
type = 3;
default = false;
}
teambase
{
type = 11;
enum = "ctfteam";
default = 0;
}
triggersector
{
type = 3;
default = false;
}
triggerobject
{
type = 11;
enum = "triggerobjects";
default = 0;
}
triggersurface
{
type = 11;
enum = "triggersurfaces";
default = 0;
}
ringdrain
{
type = 1;
default = 0;
}
}
linedef
{
executordelay
{
type = 0;
default = 0;
}
midtexrepetitions
{
type = 0;
default = 0;
}
arg5
{
type = 0;
default = 0;
}
arg1str
{
type = 2;
default = "";
}
}
thing
{
}
}
/*
MAP LUMP NAMES
Map lumps are loaded with the map as long as they are right after each other. When the editor
meets a lump which is not defined in this list it will ignore the map if not satisfied.
The order of items defines the order in which lumps will be written to WAD file on save.
To indicate the map header lump, use ~MAP
Legenda:
required = Lump is required to exist.
blindcopy = Lump will be copied along with the map blindly. (useful for lumps Doom Builder doesn't use)
nodebuild = The nodebuilder generates this lump.
allowempty = The nodebuilder is allowed to leave this lump empty.
scriptbuild = This lump is a text-based script, which should be compiled using current script compiler;
script = This lump is a text-based script. Specify the filename of the script configuration to use.
*/
doommaplumpnames
{
~MAP
{
required = true;
blindcopy = true;
nodebuild = false;
}
THINGS
{
required = true;
nodebuild = true;
allowempty = true;
}
LINEDEFS
{
required = true;
nodebuild = true;
allowempty = false;
}
SIDEDEFS
{
required = true;
nodebuild = true;
allowempty = false;
}
VERTEXES
{
required = true;
nodebuild = true;
allowempty = false;
}
SEGS
{
required = false;
nodebuild = true;
allowempty = false;
}
SSECTORS
{
required = false;
nodebuild = true;
allowempty = false;
}
NODES
{
required = false;
nodebuild = true;
allowempty = false;
}
SECTORS
{
required = true;
nodebuild = true;
allowempty = false;
}
REJECT
{
required = false;
nodebuild = true;
allowempty = false;
}
BLOCKMAP
{
required = false;
nodebuild = true;
allowempty = true;
}
}
udmfmaplumpnames
{
ZNODES
{
required = false;
nodebuild = true;
allowempty = false;
}
REJECT
{
required = false;
nodebuild = true;
allowempty = false;
}
BLOCKMAP
{
required = false;
nodebuild = true;
allowempty = true;
}
}
// ENUMERATIONS
// These are enumerated lists for linedef types and UDMF fields.
// Reserved names are: angledeg, anglerad, color, texture, flat
enums
{
falsetrue
{
0 = "False";
1 = "True";
}
yesno
{
0 = "Yes";
1 = "No";
}
noyes
{
0 = "No";
1 = "Yes";
}
onoff
{
0 = "On";
1 = "Off";
}
offon
{
0 = "Off";
1 = "On";
}
updown
{
0 = "Up";
1 = "Down";
}
downup
{
0 = "Down";
1 = "Up";
}
addset
{
0 = "Add";
1 = "Set";
}
floorceiling
{
0 = "Floor";
1 = "Ceiling";
2 = "Floor and ceiling";
}
triggertype
{
0 = "Continuous";
1 = "Each Time (Enter)";
2 = "Each Time (Enter and leave)";
3 = "Once";
}
frontback
{
0 = "None";
1 = "Front";
2 = "Back";
}
ctfteam
{
0 = "None";
1 = "Red";
2 = "Blue";
}
triggerobjects
{
0 = "Any player";
1 = "All players";
2 = "Pushable object";
3 = "Any object with thinker";
}
triggersurfaces
{
0 = "Floor touch";
1 = "Ceiling touch";
2 = "Floor or ceiling touch";
3 = "Anywhere in sector";
}
tangibility
{
1 = "Intangible from top";
2 = "Intangible from bottom";
4 = "Don't block players";
8 = "Don't block non-players";
}
}
//Default things filters
thingsfilters
{
filter0
{
name = "Player starts";
category = "starts";
type = -1;
}
filter1
{
name = "Enemies";
category = "enemies";
type = -1;
}
filter2
{
name = "NiGHTS Track";
category = "nightstrk";
type = -1;
}
filter3
{
name = "Normal Gravity";
category = "";
type = -1;
fields
{
2 = false;
}
}
filter4
{
name = "Reverse Gravity";
category = "";
type = -1;
fields
{
2 = true;
}
}
}
thingsfilters_udmf
{
}
// Special linedefs
speciallinedefs
{
soundlinedefflag = 64; // See linedefflags
singlesidedflag = 1; // See linedefflags
doublesidedflag = 4; // See linedefflags
impassableflag = 1;
upperunpeggedflag = 8;
lowerunpeggedflag = 16;
repeatmidtextureflag = 1024;
pegmidtextureflag = 256;
}
speciallinedefs_udmf
{
soundlinedefflag = "noclimb";
singlesidedflag = "blocking";
doublesidedflag = "twosided";
impassableflag = "blocking";
upperunpeggedflag = "dontpegtop";
lowerunpeggedflag = "dontpegbottom";
repeatmidtextureflag = "wrapmidtex";
pegmidtextureflag = "midpeg";
}
scriptlumpnames
{
MAINCFG
{
script = "SOC.cfg";
}
OBJCTCFG
{
script = "SOC.cfg";
}
SOC_
{
script = "SOC.cfg";
isprefix = true;
}
LUA_
{
script = "Lua.cfg";
isprefix = true;
}
}
// Texture sources
textures
{
zdoom1
{
start = "TX_START";
end = "TX_END";
}
}
// Patch sources
patches
{
standard1
{
start = "P_START";
end = "P_END";
}
standard2
{
start = "PP_START";
end = "PP_END";
}
}
// Sprite sources
sprites
{
standard1
{
start = "S_START";
end = "S_END";
}
standard2
{
start = "SS_START";
end = "SS_END";
}
}
// Flat sources
flats
{
standard1
{
start = "F_START";
end = "F_END";
}
standard2
{
start = "FF_START";
end = "FF_END";
}
standard3
{
start = "FF_START";
end = "F_END";
}
standard4
{
start = "F_START";
end = "FF_END";
}
}

View file

@ -0,0 +1,109 @@
sectortypes
{
0 = "Normal";
1 = "Damage";
2 = "Damage (Water)";
3 = "Damage (Fire)";
4 = "Damage (Electrical)";
5 = "Spikes";
6 = "Death Pit (Camera Tilt)";
7 = "Death Pit (No Camera Tilt)";
8 = "Instant Kill";
9 = "Ring Drainer (Floor Touch)";
10 = "Ring Drainer (Anywhere in Sector)";
11 = "Special Stage Damage";
12 = "Space Countdown";
13 = "Ramp Sector (double step-up/down)";
14 = "Non-Ramp Sector (no step-down)";
15 = "Bouncy FOF";
16 = "Trigger Line Ex. (Pushable Objects)";
32 = "Trigger Line Ex. (Anywhere, All Players)";
48 = "Trigger Line Ex. (Floor Touch, All Players)";
64 = "Trigger Line Ex. (Anywhere in Sector)";
80 = "Trigger Line Ex. (Floor Touch)";
96 = "Trigger Line Ex. (Emerald Check)";
112 = "Trigger Line Ex. (NiGHTS Mare)";
128 = "Check for Linedef Executor on FOFs";
144 = "Egg Capsule";
160 = "Special Stage Time/Rings Parameters";
176 = "Custom Global Gravity";
512 = "Wind/Current";
1024 = "Conveyor Belt";
1280 = "Speed Pad";
4096 = "Star Post Activator";
8192 = "Exit/Special Stage Pit/Return Flag";
12288 = "CTF Red Team Base";
16384 = "CTF Blue Team Base";
20480 = "Fan Sector";
24576 = "Super Sonic Transform";
28672 = "Force Spin";
32768 = "Zoom Tube Start";
36864 = "Zoom Tube End";
40960 = "Circuit Finish Line";
45056 = "Rope Hang";
49152 = "Intangible to the Camera";
}
gen_sectortypes
{
first
{
0 = "Normal";
1 = "Damage";
2 = "Damage (Water)";
3 = "Damage (Fire)";
4 = "Damage (Electrical)";
5 = "Spikes";
6 = "Death Pit (Camera Tilt)";
7 = "Death Pit (No Camera Tilt)";
8 = "Instant Kill";
9 = "Ring Drainer (Floor Touch)";
10 = "Ring Drainer (Anywhere in Sector)";
11 = "Special Stage Damage";
12 = "Space Countdown";
13 = "Ramp Sector (double step-up/down)";
14 = "Non-Ramp Sector (no step-down)";
15 = "Bouncy FOF";
}
second
{
0 = "Normal";
16 = "Trigger Line Ex. (Pushable Objects)";
32 = "Trigger Line Ex. (Anywhere, All Players)";
48 = "Trigger Line Ex. (Floor Touch, All Players)";
64 = "Trigger Line Ex. (Anywhere in Sector)";
80 = "Trigger Line Ex. (Floor Touch)";
96 = "Trigger Line Ex. (Emerald Check)";
112 = "Trigger Line Ex. (NiGHTS Mare)";
128 = "Check for Linedef Executor on FOFs";
144 = "Egg Capsule";
160 = "Special Stage Time/Rings Parameters";
176 = "Custom Global Gravity";
}
third
{
0 = "Normal";
512 = "Wind/Current";
1024 = "Conveyor Belt";
1280 = "Speed Pad";
}
fourth
{
0 = "Normal";
4096 = "Star Post Activator";
8192 = "Exit/Special Stage Pit/Return Flag";
12288 = "CTF Red Team Base";
16384 = "CTF Blue Team Base";
20480 = "Fan Sector";
24576 = "Super Sonic Transform";
28672 = "Force Spin";
32768 = "Zoom Tube Start";
36864 = "Zoom Tube End";
40960 = "Circuit Finish Line";
45056 = "Rope Hang";
49152 = "Intangible to the Camera";
}
}

File diff suppressed because it is too large Load diff

View file

@ -690,9 +690,9 @@ linedeftypes
title = "Chain Parameters"; title = "Chain Parameters";
prefix = "(9)"; prefix = "(9)";
flags32text = "[5] Swing instead of spin"; flags32text = "[5] Swing instead of spin";
flags128text = "[7] Make chain from end item";
flags64text = "[6] Player-turnable chain"; flags64text = "[6] Player-turnable chain";
flags128text = "[7] Make chain from maces"; flags256text = "[8] Spawn link at origin";
flags256text = "[8] Spawn mace at origin";
flags512text = "[9] Don't clip inside ground"; flags512text = "[9] Don't clip inside ground";
flags1024text = "[10] No distance check"; flags1024text = "[10] No distance check";
} }
@ -3389,14 +3389,14 @@ thingtypes
} }
118 118
{ {
title = "CastleBot FaceStabber"; title = "Lance-a-Bot";
sprite = "CBFSA1"; sprite = "CBFSA1";
width = 32; width = 32;
height = 72; height = 72;
} }
1113 1113
{ {
title = "Suspicious FaceStabber Statue"; title = "Suspicious Lance-a-Bot Statue";
sprite = "CBBSA1"; sprite = "CBBSA1";
width = 32; width = 32;
height = 72; height = 72;
@ -5006,7 +5006,7 @@ thingtypes
{ {
arrow = 1; arrow = 1;
blocking = 2; blocking = 2;
title = "FaceStabber Statue"; title = "Lance-a-Bot Statue";
sprite = "CBBSA1"; sprite = "CBBSA1";
width = 32; width = 32;
height = 72; height = 72;

View file

@ -0,0 +1,38 @@
/************************************************************************\
Zone Builder Game Configuration for Sonic Robo Blast 2 Version 2.2
\************************************************************************/
// This is required to prevent accidental use of a different configuration
type = "Doom Builder 2 Game Configuration";
// This is the title to show for this game
game = "Sonic Robo Blast 2 - 2.2 (Doom format)";
// This is the simplified game engine/sourceport name
engine = "zdoom";
// Settings common to all games and all map formats
include("Includes\\SRB222_common.cfg", "common");
// Settings common to Doom map format
include("Includes\\SRB222_common.cfg", "mapformat_doom");
include("Includes\\Game_SRB222.cfg");
// Script lumps detection
scriptlumpnames
{
include("Includes\\SRB222_misc.cfg", "scriptlumpnames");
}
// THING TYPES
thingtypes
{
include("Includes\\SRB222_things.cfg");
}
//Default things filters
thingsfilters
{
include("Includes\\SRB222_misc.cfg", "thingsfilters");
}

View file

@ -0,0 +1,47 @@
/************************************************************************\
Zone Builder Game Configuration for Sonic Robo Blast 2 Version 2.2
\************************************************************************/
// This is required to prevent accidental use of a different configuration
type = "Doom Builder 2 Game Configuration";
// This is the title to show for this game
game = "Sonic Robo Blast 2 - 2.2 (UDMF)";
// This is the simplified game engine/sourceport name
engine = "zdoom";
// Settings common to all games and all map formats
include("Includes\\SRB222_common.cfg", "common");
// Settings common to Doom map format
include("Includes\\SRB222_common.cfg", "mapformat_udmf");
include("Includes\\Game_SRB222.cfg");
// Script lumps detection
scriptlumpnames
{
include("Includes\\SRB222_misc.cfg", "scriptlumpnames");
}
// THING TYPES
thingtypes
{
include("Includes\\SRB222_things.cfg");
}
//Default things filters
thingsfilters
{
include("Includes\\SRB222_misc.cfg", "thingsfilters");
}
// ENUMERATIONS
// Each engine has its own additional thing types
// These are enumerated lists for linedef types and UDMF fields.
enums
{
// Basic game enums
include("Includes\\SRB222_misc.cfg", "enums");
}

View file

@ -1,12 +1,12 @@
# SRB2 - Which DLLs do I need to bundle? # SRB2 - Which DLLs do I need to bundle?
Updated 12/4/2018 (v2.1.21) Updated 12/6/2019 (v2.2)
Here are the required DLLs, per build. For each architecture, copy all the binaries from these folders: Here are the required DLLs, per build. For each architecture, copy all the binaries from these folders:
* libs\dll-binaries\[i686/x86_64] * libs\dll-binaries\[i686/x86_64]
* libs\SDL2\[i686/x86_64]...\bin * libs\SDL2\[i686/x86_64]...\bin
* libs\SDL2_mixer\[i686/x86_64]...\bin * libs\SDL2mixerX\[i686/x86_64]...\bin
* libs\libopenmpt\[x86/x86_64]...\bin\mingw * libs\libopenmpt\[x86/x86_64]...\bin\mingw
and don't forget to build r_opengl.dll for srb2dd. and don't forget to build r_opengl.dll for srb2dd.
@ -17,7 +17,7 @@ and don't forget to build r_opengl.dll for srb2dd.
* libs\dll-binaries\i686\libgme.dll * libs\dll-binaries\i686\libgme.dll
* libs\dll-binaries\i686\mgwhelp.dll (depend for exchndl.dll) * libs\dll-binaries\i686\mgwhelp.dll (depend for exchndl.dll)
* libs\SDL2\i686-w64-mingw32\bin\SDL2.dll * libs\SDL2\i686-w64-mingw32\bin\SDL2.dll
* libs\SDL2_mixer\i686-w64-mingw32\bin\*.dll (get everything) * libs\SDL2mixerX\i686-w64-mingw32\bin\*.dll (get everything)
* libs\libopenmpt\x86\bin\mingw\libopenmpt.dll * libs\libopenmpt\x86\bin\mingw\libopenmpt.dll
## srb2win, 64-bit ## srb2win, 64-bit
@ -26,21 +26,5 @@ and don't forget to build r_opengl.dll for srb2dd.
* libs\dll-binaries\x86_64\libgme.dll * libs\dll-binaries\x86_64\libgme.dll
* libs\dll-binaries\x86_64\mgwhelp.dll (depend for exchndl.dll) * libs\dll-binaries\x86_64\mgwhelp.dll (depend for exchndl.dll)
* libs\SDL2\x86_64-w64-mingw32\bin\SDL2.dll * libs\SDL2\x86_64-w64-mingw32\bin\SDL2.dll
* libs\SDL2_mixer\x86_64-w64-mingw32\bin\*.dll (get everything) * libs\SDL2mixerX\x86_64-w64-mingw32\bin\*.dll (get everything)
* libs\libopenmpt\x86_64\bin\mingw\libopenmpt.dll * libs\libopenmpt\x86_64\bin\mingw\libopenmpt.dll
## srb2dd, 32-bit
* libs\dll-binaries\i686\exchndl.dll
* libs\dll-binaries\i686\fmodex.dll
* libs\dll-binaries\i686\libgme.dll
* libs\dll-binaries\i686\mgwhelp.dll (depend for exchndl.dll)
* r_opengl.dll (build this from make)
## srb2dd, 64-bit
* libs\dll-binaries\x86_64\exchndl.dll
* libs\dll-binaries\x86_64\fmodex.dll
* libs\dll-binaries\x86_64\libgme.dll
* libs\dll-binaries\x86_64\mgwhelp.dll (depend for exchndl.dll)
* r_opengl.dll (build this from make)

View file

@ -327,7 +327,7 @@
/* If pnglibconf.h is missing, you can /* If pnglibconf.h is missing, you can
* copy scripts/pnglibconf.h.prebuilt to pnglibconf.h * copy scripts/pnglibconf.h.prebuilt to pnglibconf.h
*/ */
# include "pnglibconf.h" # include "projects/pnglibconf.h"
#endif #endif
#define PNG_APNG_SUPPORTED #define PNG_APNG_SUPPORTED
@ -336,7 +336,7 @@
#ifndef PNG_VERSION_INFO_ONLY #ifndef PNG_VERSION_INFO_ONLY
/* Machine specific configuration. */ /* Machine specific configuration. */
# include "pngconf.h" # include "projects/pngconf.h"
#endif #endif
/* /*

View file

@ -69,7 +69,7 @@
* before png.h is included, but load the configuration now if it is available. * before png.h is included, but load the configuration now if it is available.
*/ */
#ifndef PNGLCONF_H #ifndef PNGLCONF_H
# include "pnglibconf.h" # include "projects/pnglibconf.h"
#endif #endif
/* Local renames may change non-exported API functions from png.h */ /* Local renames may change non-exported API functions from png.h */

View file

@ -0,0 +1,5 @@
/Win32
/x64
/libpng.vcproj.*.*.user
/ARM
/ARM64

View file

@ -0,0 +1,730 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{72B01ACA-7A1A-4F7B-ACEF-2607299CF052}</ProjectGuid>
<RootNamespace>libpng</RootNamespace>
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v141</PlatformToolset>
<WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v141</PlatformToolset>
<WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v141</PlatformToolset>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v141</PlatformToolset>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">$(ProjectDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Platform)\$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">$(ProjectDir)$(Platform)\$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">$(ProjectDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)$(Platform)\$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">$(ProjectDir)$(Platform)\$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">$(ProjectDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Platform)\$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">$(ProjectDir)$(Platform)\$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">$(ProjectDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)$(Platform)\$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">$(ProjectDir)$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>..\..;..\..\..\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;PNG_USE_PNGVCRD;PNG_LIBPNG_SPECIALBUILD;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<AssemblerListingLocation>$(ProjectDir)$(Platform)\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>$(ProjectDir)$(Platform)\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(ProjectDir)$(Platform)\$(Configuration)\</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<CompileAs>CompileAsC</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
<AdditionalIncludeDirectories>..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Lib>
<OutputFile>$(ProjectDir)$(Platform)\$(Configuration)\libpng.lib</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetMachine>MachineX86</TargetMachine>
</Lib>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>$(ProjectDir)$(PlatformName)\$(ConfigurationName)\libpng.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>..\..;..\..\..\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;PNG_USE_PNGVCRD;PNG_LIBPNG_SPECIALBUILD;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<AssemblerListingLocation>$(ProjectDir)$(Platform)\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>$(ProjectDir)$(Platform)\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(ProjectDir)$(Platform)\$(Configuration)\</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<CompileAs>CompileAsC</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
<AdditionalIncludeDirectories>..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Lib>
<OutputFile>$(ProjectDir)$(Platform)\$(Configuration)\libpng.lib</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetMachine>MachineARM</TargetMachine>
</Lib>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>$(ProjectDir)$(PlatformName)\$(ConfigurationName)\libpng.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>..\..;..\..\..\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;PNG_USE_PNGVCRD;PNG_LIBPNG_SPECIALBUILD;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<AssemblerListingLocation>$(ProjectDir)$(Platform)\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>$(ProjectDir)$(Platform)\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(ProjectDir)$(Platform)\$(Configuration)\</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<CompileAs>CompileAsC</CompileAs>
<DisableSpecificWarnings>4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
<AdditionalIncludeDirectories>..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Lib>
<OutputFile>$(ProjectDir)$(Platform)\$(Configuration)\libpng.lib</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetMachine>MachineX64</TargetMachine>
</Lib>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>$(ProjectDir)$(PlatformName)\$(ConfigurationName)\libpng.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<Midl />
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>..\..;..\..\..\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;PNG_USE_PNGVCRD;PNG_LIBPNG_SPECIALBUILD;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<AssemblerListingLocation>$(ProjectDir)$(Platform)\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>$(ProjectDir)$(Platform)\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(ProjectDir)$(Platform)\$(Configuration)\</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<CompileAs>CompileAsC</CompileAs>
<DisableSpecificWarnings>4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
<AdditionalIncludeDirectories>..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Lib>
<OutputFile>$(ProjectDir)$(Platform)\$(Configuration)\libpng.lib</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetMachine>MachineARM64</TargetMachine>
</Lib>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>$(ProjectDir)$(PlatformName)\$(ConfigurationName)\libpng.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..;..\..\..\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;DEBUG;PNG_DEBUG=1;PNG_USE_PNGVCRD;PNG_LIBPNG_SPECIALBUILD;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AssemblerListingLocation>$(ProjectDir)$(Platform)\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>$(ProjectDir)$(Platform)\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(ProjectDir)$(Platform)\$(Configuration)\</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<CompileAs>CompileAsC</CompileAs>
<MultiProcessorCompilation>false</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Lib>
<OutputFile>$(ProjectDir)$(Platform)\$(Configuration)\libpng.lib</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetMachine>MachineX86</TargetMachine>
</Lib>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>$(ProjectDir)$(PlatformName)\$(ConfigurationName)\libpng.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..;..\..\..\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;DEBUG;PNG_DEBUG=1;PNG_USE_PNGVCRD;PNG_LIBPNG_SPECIALBUILD;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AssemblerListingLocation>$(ProjectDir)$(Platform)\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>$(ProjectDir)$(Platform)\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(ProjectDir)$(Platform)\$(Configuration)\</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>CompileAsC</CompileAs>
<MultiProcessorCompilation>false</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Lib>
<OutputFile>$(ProjectDir)$(Platform)\$(Configuration)\libpng.lib</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetMachine>MachineARM</TargetMachine>
</Lib>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>$(ProjectDir)$(PlatformName)\$(ConfigurationName)\libpng.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..;..\..\..\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;DEBUG;PNG_DEBUG=1;PNG_USE_PNGVCRD;PNG_LIBPNG_SPECIALBUILD;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AssemblerListingLocation>$(ProjectDir)$(Platform)\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>$(ProjectDir)$(Platform)\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(ProjectDir)$(Platform)\$(Configuration)\</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>CompileAsC</CompileAs>
<DisableSpecificWarnings>4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<MultiProcessorCompilation>false</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Lib>
<OutputFile>$(ProjectDir)$(Platform)\$(Configuration)\libpng.lib</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetMachine>MachineX64</TargetMachine>
</Lib>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>$(ProjectDir)$(PlatformName)\$(ConfigurationName)\libpng.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<Midl />
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..;..\..\..\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;DEBUG;PNG_DEBUG=1;PNG_USE_PNGVCRD;PNG_LIBPNG_SPECIALBUILD;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AssemblerListingLocation>$(ProjectDir)$(Platform)\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>$(ProjectDir)$(Platform)\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(ProjectDir)$(Platform)\$(Configuration)\</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>CompileAsC</CompileAs>
<DisableSpecificWarnings>4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<MultiProcessorCompilation>false</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Lib>
<OutputFile>$(ProjectDir)$(Platform)\$(Configuration)\libpng.lib</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetMachine>MachineARM64</TargetMachine>
</Lib>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>$(ProjectDir)$(PlatformName)\$(ConfigurationName)\libpng.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\png.c">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="..\..\pngerror.c">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="..\..\pngget.c">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="..\..\pngmem.c">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="..\..\pngpread.c">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="..\..\pngread.c">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="..\..\pngrio.c">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="..\..\pngrtran.c">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="..\..\pngrutil.c">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="..\..\pngset.c">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="..\..\pngtrans.c">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="..\..\pngwio.c">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="..\..\pngwrite.c">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="..\..\pngwtran.c">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="..\..\pngwutil.c">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemGroup>
<ItemGroup>
<CustomBuildStep Include="..\..\scripts\pngw32.def">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
</CustomBuildStep>
<None Include="README.txt" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\png.h" />
<ClInclude Include="..\..\pngconf.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\scripts\pngw32.rc">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</ExcludedFromBuild>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\Oogaland\Projects\orospakr.ca\srb2\tools\libpng-src\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">\Oogaland\Projects\orospakr.ca\srb2\tools\libpng-src\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\Oogaland\Projects\orospakr.ca\srb2\tools\libpng-src\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">\Oogaland\Projects\orospakr.ca\srb2\tools\libpng-src\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</ExcludedFromBuild>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\Oogaland\Projects\orospakr.ca\srb2\tools\libpng-src\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">\Oogaland\Projects\orospakr.ca\srb2\tools\libpng-src\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\Oogaland\Projects\orospakr.ca\srb2\tools\libpng-src\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">\Oogaland\Projects\orospakr.ca\srb2\tools\libpng-src\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\zlib\projects\visualc10\zlib.vcxproj">
<Project>{73a5729c-7323-41d4-ab48-8a03c9f81603}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -143,7 +143,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile> <ClCompile>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;ASMV;ASMINF;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild> <MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>Default</BasicRuntimeChecks> <BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@ -267,7 +267,7 @@
<ClCompile> <ClCompile>
<Optimization>MaxSpeed</Optimization> <Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>WIN32;NDEBUG;ASMV;ASMINF;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling> <StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
@ -570,6 +570,8 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</MASM> </MASM>
<MASM Include="..\..\contrib\masmx86\match686.asm"> <MASM Include="..\..\contrib\masmx86\match686.asm">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@ -578,6 +580,8 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</MASM> </MASM>
<MASM Include="..\..\contrib\masmx64\gvmat64.asm"> <MASM Include="..\..\contrib\masmx64\gvmat64.asm">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>

View file

@ -472,7 +472,9 @@ typedef uLong FAR uLongf;
#endif #endif
#ifndef Z_SOLO #ifndef Z_SOLO
# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) # if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
#ifndef _MSC_VER
# include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ # include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
#endif
# ifdef VMS # ifdef VMS
# include <unixio.h> /* for off_t */ # include <unixio.h> /* for off_t */
# endif # endif

View file

@ -518,10 +518,6 @@ add_definitions(-DCMAKECONFIG)
add_subdirectory(sdl) add_subdirectory(sdl)
if(${CMAKE_SYSTEM} MATCHES Windows) if(NOT ${SRB2_SDL2_AVAILABLE})
add_subdirectory(win32)
endif()
if(NOT ${SRB2_SDL2_AVAILABLE} AND NOT ${SRB2_WIN32_AVAILABLE})
message(FATAL_ERROR "There are no targets available to build an SRB2 executable. :(") message(FATAL_ERROR "There are no targets available to build an SRB2 executable. :(")
endif() endif()

View file

@ -2,7 +2,7 @@
# GNU Make makefile for SRB2 # GNU Make makefile for SRB2
############################################################################# #############################################################################
# Copyright (C) 1998-2000 by DooM Legacy Team. # Copyright (C) 1998-2000 by DooM Legacy Team.
# Copyright (C) 2003-2018 by Sonic Team Junior. # Copyright (C) 2003-2019 by Sonic Team Junior.
# #
# This program is free software distributed under the # This program is free software distributed under the
# terms of the GNU General Public License, version 2. # terms of the GNU General Public License, version 2.

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -245,6 +245,8 @@ void I_GetJoystick2Events(void){}
void I_GetMouseEvents(void){} void I_GetMouseEvents(void){}
void I_UpdateMouseGrab(void){}
char *I_GetEnv(const char *name) char *I_GetEnv(const char *name)
{ {
LOGW("I_GetEnv() called?!"); LOGW("I_GetEnv() called?!");

View file

@ -19,6 +19,7 @@ boolean allow_fullscreen = false;
consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
void I_StartupGraphics(void){} void I_StartupGraphics(void){}
void I_StartupHardwareGraphics(void){}
void I_ShutdownGraphics(void){} void I_ShutdownGraphics(void){}
@ -51,6 +52,11 @@ INT32 VID_SetMode(INT32 modenum)
return 0; return 0;
} }
void VID_CheckRenderer(void)
{
// ..............
}
const char *VID_GetModeName(INT32 modenum) const char *VID_GetModeName(INT32 modenum)
{ {
return "A320x240"; return "A320x240";

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 2007-2016 by John "JTE" Muniz. // Copyright (C) 2007-2016 by John "JTE" Muniz.
// Copyright (C) 2011-2018 by Sonic Team Junior. // Copyright (C) 2011-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -181,7 +181,7 @@ static void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd)
spin = true; spin = true;
else if (!jump_last) else if (!jump_last)
jump = true; jump = true;
// Abort if the player moves away or spins // Abort if the player moves away or spins
if (dist > followthres || player->dashspeed) if (dist > followthres || player->dashspeed)
flymode = 0; flymode = 0;
@ -296,7 +296,7 @@ static void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd)
cmd->sidemove = 8 * pcmd->sidemove / 10; cmd->sidemove = 8 * pcmd->sidemove / 10;
} }
} }
// ******** // ********
// JUMP // JUMP
if (!(flymode || spinmode)) if (!(flymode || spinmode))
@ -335,26 +335,6 @@ static void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd)
jump_last = jump; jump_last = jump;
spin_last = spin; spin_last = spin;
// ********
// Thinkfly overlay
if (thinkfly)
{
if (!tails->target)
{
P_SetTarget(&tails->target, P_SpawnMobjFromMobj(tails, 0, 0, 0, MT_OVERLAY));
if (tails->target)
{
P_SetTarget(&tails->target->target, tails);
P_SetMobjState(tails->target, S_FLIGHTINDICATOR);
}
}
}
else if (tails->target && tails->target->type == MT_OVERLAY && tails->target->state == states+S_FLIGHTINDICATOR)
{
P_RemoveMobj(tails->target);
P_SetTarget(&tails->target, NULL);
}
// Turn the virtual keypresses into ticcmd_t. // Turn the virtual keypresses into ticcmd_t.
B_KeysToTiccmd(tails, cmd, forward, backward, left, right, false, false, jump, spin); B_KeysToTiccmd(tails, cmd, forward, backward, left, right, false, false, jump, spin);
@ -448,7 +428,7 @@ void B_KeysToTiccmd(mobj_t *mo, ticcmd_t *cmd, boolean forward, boolean backward
cmd->sidemove -= MAXPLMOVE<<FRACBITS>>16; cmd->sidemove -= MAXPLMOVE<<FRACBITS>>16;
if (straferight) if (straferight)
cmd->sidemove += MAXPLMOVE<<FRACBITS>>16; cmd->sidemove += MAXPLMOVE<<FRACBITS>>16;
// cap inputs so the bot can't accelerate faster diagonally // cap inputs so the bot can't accelerate faster diagonally
angle = R_PointToAngle2(0, 0, cmd->sidemove << FRACBITS, cmd->forwardmove << FRACBITS); angle = R_PointToAngle2(0, 0, cmd->sidemove << FRACBITS, cmd->forwardmove << FRACBITS);
{ {
@ -564,3 +544,30 @@ void B_RespawnBot(INT32 playernum)
P_SetScale(tails, sonic->scale); P_SetScale(tails, sonic->scale);
tails->destscale = sonic->destscale; tails->destscale = sonic->destscale;
} }
void B_HandleFlightIndicator(player_t *player)
{
mobj_t *tails = player->mo;
if (!tails)
return;
if (thinkfly && player->bot == 1 && tails->health)
{
if (!tails->hnext)
{
P_SetTarget(&tails->hnext, P_SpawnMobjFromMobj(tails, 0, 0, 0, MT_OVERLAY));
if (tails->hnext)
{
P_SetTarget(&tails->hnext->target, tails);
P_SetTarget(&tails->hnext->hprev, tails);
P_SetMobjState(tails->hnext, S_FLIGHTINDICATOR);
}
}
}
else if (tails->hnext && tails->hnext->type == MT_OVERLAY && tails->hnext->state == states+S_FLIGHTINDICATOR)
{
P_RemoveMobj(tails->hnext);
P_SetTarget(&tails->hnext, NULL);
}
}

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 2007-2016 by John "JTE" Muniz. // Copyright (C) 2007-2016 by John "JTE" Muniz.
// Copyright (C) 2012-2018 by Sonic Team Junior. // Copyright (C) 2012-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -15,3 +15,4 @@ void B_KeysToTiccmd(mobj_t *mo, ticcmd_t *cmd, boolean forward, boolean backward
boolean B_CheckRespawn(player_t *player); boolean B_CheckRespawn(player_t *player);
void B_MoveBlocked(player_t *player); void B_MoveBlocked(player_t *player);
void B_RespawnBot(INT32 playernum); void B_RespawnBot(INT32 playernum);
void B_HandleFlightIndicator(player_t *player);

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -54,13 +54,15 @@ static void COM_Add_f(void);
static void CV_EnforceExecVersion(void); static void CV_EnforceExecVersion(void);
static boolean CV_FilterVarByVersion(consvar_t *v, const char *valstr); static boolean CV_FilterVarByVersion(consvar_t *v, const char *valstr);
static boolean CV_Command(void); static boolean CV_Command(void);
static consvar_t *CV_FindVar(const char *name); consvar_t *CV_FindVar(const char *name);
static const char *CV_StringValue(const char *var_name); static const char *CV_StringValue(const char *var_name);
static consvar_t *consvar_vars; // list of registered console variables static consvar_t *consvar_vars; // list of registered console variables
static char com_token[1024]; static char com_token[1024];
static char *COM_Parse(char *data); static char *COM_Parse(char *data);
static char * COM_Purge (char *text, int *lenp);
CV_PossibleValue_t CV_OnOff[] = {{0, "Off"}, {1, "On"}, {0, NULL}}; CV_PossibleValue_t CV_OnOff[] = {{0, "Off"}, {1, "On"}, {0, NULL}};
CV_PossibleValue_t CV_YesNo[] = {{0, "No"}, {1, "Yes"}, {0, NULL}}; CV_PossibleValue_t CV_YesNo[] = {{0, "No"}, {1, "Yes"}, {0, NULL}};
CV_PossibleValue_t CV_Unsigned[] = {{0, "MIN"}, {999999999, "MAX"}, {0, NULL}}; CV_PossibleValue_t CV_Unsigned[] = {{0, "MIN"}, {999999999, "MAX"}, {0, NULL}};
@ -100,31 +102,61 @@ static cmdalias_t *com_alias; // aliases list
static vsbuf_t com_text; // variable sized buffer static vsbuf_t com_text; // variable sized buffer
/** Purges control characters out of some text.
*
* \param s The text.
* \param np Optionally a pointer to fill with the new string length.
* \return The text.
* \sa COM_ExecuteString
*/
static char *
COM_Purge (char *s, int *np)
{
char *t;
char *p;
int n;
n = strlen(s);
t = s + n + 1;
p = s;
while (( p = strchr(p, '\033') ))
{
memmove(p, &p[1], t - p - 1);
n--;
}
if (np)
(*np) = n;
return s;
}
/** Adds text into the command buffer for later execution. /** Adds text into the command buffer for later execution.
* *
* \param ptext The text to add. * \param ptext The text to add.
* \sa COM_BufInsertText * \sa COM_BufInsertTextEx
*/ */
void COM_BufAddText(const char *ptext) void COM_BufAddTextEx(const char *ptext, int flags)
{ {
size_t l; int l;
char *text;
l = strlen(ptext); text = COM_Purge(Z_StrDup(ptext), &l);
if (com_text.cursize + l >= com_text.maxsize) if (com_text.cursize + 2 + l >= com_text.maxsize)
{ {
CONS_Alert(CONS_WARNING, M_GetText("Command buffer full!\n")); CONS_Alert(CONS_WARNING, M_GetText("Command buffer full!\n"));
return; return;
} }
VS_Write(&com_text, ptext, l);
VS_WriteEx(&com_text, text, l, flags);
Z_Free(text);
} }
/** Adds command text and executes it immediately. /** Adds command text and executes it immediately.
* *
* \param ptext The text to execute. A newline is automatically added. * \param ptext The text to execute. A newline is automatically added.
* \sa COM_BufAddText * \sa COM_BufAddTextEx
*/ */
void COM_BufInsertText(const char *ptext) void COM_BufInsertTextEx(const char *ptext, int flags)
{ {
char *temp = NULL; char *temp = NULL;
size_t templen; size_t templen;
@ -138,7 +170,7 @@ void COM_BufInsertText(const char *ptext)
} }
// add the entire text of the file (or alias) // add the entire text of the file (or alias)
COM_BufAddText(ptext); COM_BufAddTextEx(ptext, flags);
COM_BufExecute(); // do it right away COM_BufExecute(); // do it right away
// add the copied off data // add the copied off data
@ -272,6 +304,7 @@ static size_t com_argc;
static char *com_argv[MAX_ARGS]; static char *com_argv[MAX_ARGS];
static const char *com_null_string = ""; static const char *com_null_string = "";
static char *com_args = NULL; // current command args or NULL static char *com_args = NULL; // current command args or NULL
static int com_flags;
static void Got_NetVar(UINT8 **p, INT32 playernum); static void Got_NetVar(UINT8 **p, INT32 playernum);
@ -394,12 +427,21 @@ static void COM_TokenizeString(char *ptext)
com_argc = 0; com_argc = 0;
com_args = NULL; com_args = NULL;
com_flags = 0;
while (com_argc < MAX_ARGS) while (com_argc < MAX_ARGS)
{ {
// Skip whitespace up to a newline. // Skip whitespace up to a newline.
while (*ptext != '\0' && *ptext <= ' ' && *ptext != '\n') while (*ptext != '\0' && *ptext <= ' ' && *ptext != '\n')
ptext++; {
if (ptext[0] == '\033')
{
com_flags = (unsigned)ptext[1];
ptext += 2;
}
else
ptext++;
}
// A newline means end of command in buffer, // A newline means end of command in buffer,
// thus end of this command's args too. // thus end of this command's args too.
@ -1016,6 +1058,15 @@ void VS_Write(vsbuf_t *buf, const void *data, size_t length)
M_Memcpy(VS_GetSpace(buf, length), data, length); M_Memcpy(VS_GetSpace(buf, length), data, length);
} }
void VS_WriteEx(vsbuf_t *buf, const void *data, size_t length, int flags)
{
char *p;
p = VS_GetSpace(buf, 2 + length);
p[0] = '\033';
p[1] = flags;
M_Memcpy(&p[2], data, length);
}
/** Prints text in a variable buffer. Like VS_Write() plus a /** Prints text in a variable buffer. Like VS_Write() plus a
* trailing NUL. * trailing NUL.
* *
@ -1055,7 +1106,7 @@ static const char *cv_null_string = "";
* \return Pointer to the variable if found, or NULL. * \return Pointer to the variable if found, or NULL.
* \sa CV_FindNetVar * \sa CV_FindNetVar
*/ */
static consvar_t *CV_FindVar(const char *name) consvar_t *CV_FindVar(const char *name)
{ {
consvar_t *cvar; consvar_t *cvar;
@ -1586,14 +1637,16 @@ void CV_StealthSet(consvar_t *var, const char *value)
*/ */
static void CV_SetValueMaybeStealth(consvar_t *var, INT32 value, boolean stealth) static void CV_SetValueMaybeStealth(consvar_t *var, INT32 value, boolean stealth)
{ {
char val[32]; char val[SKINNAMESIZE+1];
if (var == &cv_forceskin) // Special handling. if (var == &cv_forceskin) // Special handling.
{ {
const char *tmpskin = NULL;
if ((value < 0) || (value >= numskins)) if ((value < 0) || (value >= numskins))
sprintf(val, "None"); tmpskin = "None";
else else
sprintf(val, "%s", skins[value].name); tmpskin = skins[value].name;
strncpy(val, tmpskin, SKINNAMESIZE);
} }
else else
sprintf(val, "%d", value); sprintf(val, "%d", value);
@ -2013,6 +2066,9 @@ static boolean CV_Command(void)
if (!v) if (!v)
return false; return false;
if (( com_flags & COM_SAFE ) && ( v->flags & CV_NOLUA ))
return false;
// perform a variable print or set // perform a variable print or set
if (COM_Argc() == 1) if (COM_Argc() == 1)
{ {
@ -2114,8 +2170,13 @@ skipwhite:
com_token[len] = 0; com_token[len] = 0;
return data; return data;
} }
com_token[len] = c; if (c == '\033')
len++; data++;
else
{
com_token[len] = c;
len++;
}
} }
} }
@ -2131,10 +2192,22 @@ skipwhite:
// parse a regular word // parse a regular word
do do
{ {
com_token[len] = c; if (c == '\033')
data++; {
len++; do
c = *data; {
data += 2;
c = *data;
}
while (c == '\033') ;
}
else
{
com_token[len] = c;
data++;
len++;
c = *data;
}
if (c == '{' || c == '}' || c == ')'|| c == '(' || c == '\'') if (c == '{' || c == '}' || c == ')'|| c == '(' || c == '\'')
break; break;
} while (c > 32); } while (c > 32);

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -20,6 +20,11 @@
// Command buffer & command execution // Command buffer & command execution
//=================================== //===================================
enum
{
COM_SAFE = 1,
};
typedef void (*com_func_t)(void); typedef void (*com_func_t)(void);
void COM_AddCommand(const char *name, com_func_t func); void COM_AddCommand(const char *name, com_func_t func);
@ -36,10 +41,12 @@ size_t COM_FirstOption(void);
const char *COM_CompleteCommand(const char *partial, INT32 skips); const char *COM_CompleteCommand(const char *partial, INT32 skips);
// insert at queu (at end of other command) // insert at queu (at end of other command)
void COM_BufAddText(const char *btext); #define COM_BufAddText(s) COM_BufAddTextEx(s, 0)
void COM_BufAddTextEx(const char *btext, int flags);
// insert in head (before other command) // insert in head (before other command)
void COM_BufInsertText(const char *btext); #define COM_BufInsertText(s) COM_BufInsertTextEx(s, 0)
void COM_BufInsertTextEx(const char *btext, int flags);
// don't bother inserting, just do immediately // don't bother inserting, just do immediately
void COM_ImmedExecute(const char *ptext); void COM_ImmedExecute(const char *ptext);
@ -71,6 +78,7 @@ void VS_Free(vsbuf_t *buf);
void VS_Clear(vsbuf_t *buf); void VS_Clear(vsbuf_t *buf);
void *VS_GetSpace(vsbuf_t *buf, size_t length); void *VS_GetSpace(vsbuf_t *buf, size_t length);
void VS_Write(vsbuf_t *buf, const void *data, size_t length); void VS_Write(vsbuf_t *buf, const void *data, size_t length);
void VS_WriteEx(vsbuf_t *buf, const void *data, size_t length, int flags);
void VS_Print(vsbuf_t *buf, const char *data); // strcats onto the sizebuf void VS_Print(vsbuf_t *buf, const char *data); // strcats onto the sizebuf
//================== //==================
@ -100,7 +108,8 @@ typedef enum
CV_HIDEN = 1024, // variable is not part of the cvar list so cannot be accessed by the console CV_HIDEN = 1024, // variable is not part of the cvar list so cannot be accessed by the console
// can only be set when we have the pointer to it // can only be set when we have the pointer to it
// used on menus // used on menus
CV_CHEAT = 2048 // Don't let this be used in multiplayer unless cheats are on. CV_CHEAT = 2048, // Don't let this be used in multiplayer unless cheats are on.
CV_NOLUA = 4096,/* don't let this be called from Lua */
} cvflags_t; } cvflags_t;
typedef struct CV_PossibleValue_s typedef struct CV_PossibleValue_s
@ -140,6 +149,9 @@ void CV_ToggleExecVersion(boolean enable);
// register a variable for use at the console // register a variable for use at the console
void CV_RegisterVar(consvar_t *variable); void CV_RegisterVar(consvar_t *variable);
// returns a console variable by name
consvar_t *CV_FindVar(const char *name);
// sets changed to 0 for every console variable // sets changed to 0 for every console variable
void CV_ClearChangedFlags(void); void CV_ClearChangedFlags(void);

View file

@ -26,14 +26,14 @@
#else #else
/* Manually defined asset hashes for non-CMake builds /* Manually defined asset hashes for non-CMake builds
* Last updated 2015 / 05 / 03 - v2.1.15 - main assets * Last updated 2019 / 12 / 06 - v2.2.0 - main assets
* Last updated 2018 / ?? / ?? - v2.2 - patch.pk3 * Last updated 20?? / ?? / ?? - v2.2.? - patch.pk3
*/ */
#define ASSET_HASH_SRB2_PK3 "c1b9577687f8a795104aef4600720ea7" #define ASSET_HASH_SRB2_PK3 "51419a33b4982d840c6772c159ba7c0a"
#define ASSET_HASH_ZONES_PK3 "303838c6c534d9540288360fa49cca60" #define ASSET_HASH_ZONES_PK3 "df74843919fd51af26a0baa8e21e4c19"
#define ASSET_HASH_PLAYER_DTA "cfca0f1c73023cbbd8f844f45480f799" #define ASSET_HASH_PLAYER_DTA "56a247e074dd0dc794b6617efef1e918"
#ifdef USE_PATCH_DTA #ifdef USE_PATCH_DTA
#define ASSET_HASH_PATCH_PK3 "dbbf8bc6121618ee3be2d5b14650429b" #define ASSET_HASH_PATCH_PK3 "there is no patch.pk3, only zuul"
#endif #endif
#endif #endif

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -20,6 +20,7 @@
#include "g_input.h" #include "g_input.h"
#include "hu_stuff.h" #include "hu_stuff.h"
#include "keys.h" #include "keys.h"
#include "r_main.h"
#include "r_defs.h" #include "r_defs.h"
#include "sounds.h" #include "sounds.h"
#include "st_stuff.h" #include "st_stuff.h"
@ -591,6 +592,8 @@ void CON_ToggleOff(void)
CON_ClearHUD(); CON_ClearHUD();
con_forcepic = 0; con_forcepic = 0;
con_clipviewtop = -1; // remove console clipping of view con_clipviewtop = -1; // remove console clipping of view
I_UpdateMouseGrab();
} }
boolean CON_Ready(void) boolean CON_Ready(void)
@ -615,6 +618,7 @@ void CON_Ticker(void)
consoletoggle = false; consoletoggle = false;
con_destlines = 0; con_destlines = 0;
CON_ClearHUD(); CON_ClearHUD();
I_UpdateMouseGrab();
} }
// console key was pushed // console key was pushed
@ -627,6 +631,7 @@ void CON_Ticker(void)
{ {
con_destlines = 0; con_destlines = 0;
CON_ClearHUD(); CON_ClearHUD();
I_UpdateMouseGrab();
} }
else else
CON_ChangeHeight(); CON_ChangeHeight();
@ -1285,10 +1290,10 @@ void CONS_Printf(const char *fmt, ...)
con_scrollup = 0; con_scrollup = 0;
// if not in display loop, force screen update // if not in display loop, force screen update
if (con_startup) if (con_startup && (!setrenderneeded))
{ {
#ifdef _WINDOWS #ifdef _WINDOWS
patch_t *con_backpic = W_CachePatchName("CONSBACK", PU_CACHE); patch_t *con_backpic = W_CachePatchName("CONSBACK", PU_PATCH);
// Jimita: CON_DrawBackpic just called V_DrawScaledPatch // Jimita: CON_DrawBackpic just called V_DrawScaledPatch
V_DrawScaledPatch(0, 0, 0, con_backpic); V_DrawScaledPatch(0, 0, 0, con_backpic);
@ -1545,7 +1550,7 @@ static void CON_DrawConsole(void)
// draw console background // draw console background
if (cons_backpic.value || con_forcepic) if (cons_backpic.value || con_forcepic)
{ {
patch_t *con_backpic = W_CachePatchName("CONSBACK", PU_CACHE); patch_t *con_backpic = W_CachePatchName("CONSBACK", PU_PATCH);
// Jimita: CON_DrawBackpic just called V_DrawScaledPatch // Jimita: CON_DrawBackpic just called V_DrawScaledPatch
V_DrawScaledPatch(0, 0, 0, con_backpic); V_DrawScaledPatch(0, 0, 0, con_backpic);
@ -1602,8 +1607,18 @@ void CON_Drawer(void)
if (!con_started || !graphics_started) if (!con_started || !graphics_started)
return; return;
if (needpatchrecache)
{
W_FlushCachedPatches();
HU_LoadGraphics();
}
if (con_recalc) if (con_recalc)
{
CON_RecalcSize(); CON_RecalcSize();
if (con_curlines <= 0)
CON_ClearHUD();
}
if (con_curlines > 0) if (con_curlines > 0)
CON_DrawConsole(); CON_DrawConsole();

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -70,7 +70,7 @@
boolean server = true; // true or false but !server == client boolean server = true; // true or false but !server == client
#define client (!server) #define client (!server)
boolean nodownload = false; boolean nodownload = false;
static boolean serverrunning = false; boolean serverrunning = false;
INT32 serverplayer = 0; INT32 serverplayer = 0;
char motd[254], server_context[8]; // Message of the Day, Unique Context (even without Mumble support) char motd[254], server_context[8]; // Message of the Day, Unique Context (even without Mumble support)
@ -611,11 +611,7 @@ static inline void resynch_write_player(resynch_pak *rsp, const size_t i)
rsp->health = LONG(players[i].mo->health); rsp->health = LONG(players[i].mo->health);
rsp->angle = (angle_t)LONG(players[i].mo->angle); rsp->angle = (angle_t)LONG(players[i].mo->angle);
#ifdef ROTSPRITE
rsp->rollangle = (angle_t)LONG(players[i].mo->rollangle); rsp->rollangle = (angle_t)LONG(players[i].mo->rollangle);
#else
rsp->rollangle = 0;
#endif
rsp->x = LONG(players[i].mo->x); rsp->x = LONG(players[i].mo->x);
rsp->y = LONG(players[i].mo->y); rsp->y = LONG(players[i].mo->y);
rsp->z = LONG(players[i].mo->z); rsp->z = LONG(players[i].mo->z);
@ -766,9 +762,7 @@ static void resynch_read_player(resynch_pak *rsp)
//At this point, the player should have a body, whether they were respawned or not. //At this point, the player should have a body, whether they were respawned or not.
P_UnsetThingPosition(players[i].mo); P_UnsetThingPosition(players[i].mo);
players[i].mo->angle = (angle_t)LONG(rsp->angle); players[i].mo->angle = (angle_t)LONG(rsp->angle);
#ifdef ROTSPRITE
players[i].mo->rollangle = (angle_t)LONG(rsp->rollangle); players[i].mo->rollangle = (angle_t)LONG(rsp->rollangle);
#endif
players[i].mo->eflags = (UINT16)SHORT(rsp->eflags); players[i].mo->eflags = (UINT16)SHORT(rsp->eflags);
players[i].mo->flags = LONG(rsp->flags); players[i].mo->flags = LONG(rsp->flags);
players[i].mo->flags2 = LONG(rsp->flags2); players[i].mo->flags2 = LONG(rsp->flags2);
@ -1025,7 +1019,7 @@ static void SV_SendResynch(INT32 node)
netbuffer->packettype = PT_RESYNCHEND; netbuffer->packettype = PT_RESYNCHEND;
netbuffer->u.resynchend.randomseed = P_GetRandSeed(); netbuffer->u.resynchend.randomseed = P_GetRandSeed();
if (gametype == GT_CTF) if (gametyperules & GTR_TEAMFLAGS)
resynch_write_ctf(&netbuffer->u.resynchend); resynch_write_ctf(&netbuffer->u.resynchend);
resynch_write_others(&netbuffer->u.resynchend); resynch_write_others(&netbuffer->u.resynchend);
@ -1271,8 +1265,12 @@ static boolean CL_SendJoin(void)
if (splitscreen || botingame) if (splitscreen || botingame)
localplayers++; localplayers++;
netbuffer->u.clientcfg.localplayers = localplayers; netbuffer->u.clientcfg.localplayers = localplayers;
netbuffer->u.clientcfg._255 = 255;
netbuffer->u.clientcfg.packetversion = PACKETVERSION;
netbuffer->u.clientcfg.version = VERSION; netbuffer->u.clientcfg.version = VERSION;
netbuffer->u.clientcfg.subversion = SUBVERSION; netbuffer->u.clientcfg.subversion = SUBVERSION;
strncpy(netbuffer->u.clientcfg.application, SRB2APPLICATION,
sizeof netbuffer->u.clientcfg.application);
strncpy(netbuffer->u.clientcfg.names[0], cv_playername.zstring, MAXPLAYERNAME); strncpy(netbuffer->u.clientcfg.names[0], cv_playername.zstring, MAXPLAYERNAME);
strncpy(netbuffer->u.clientcfg.names[1], cv_playername2.zstring, MAXPLAYERNAME); strncpy(netbuffer->u.clientcfg.names[1], cv_playername2.zstring, MAXPLAYERNAME);
return HSendPacket(servernode, true, 0, sizeof (clientconfig_pak)); return HSendPacket(servernode, true, 0, sizeof (clientconfig_pak));
@ -1283,15 +1281,20 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime)
UINT8 *p; UINT8 *p;
netbuffer->packettype = PT_SERVERINFO; netbuffer->packettype = PT_SERVERINFO;
netbuffer->u.serverinfo._255 = 255;
netbuffer->u.serverinfo.packetversion = PACKETVERSION;
netbuffer->u.serverinfo.version = VERSION; netbuffer->u.serverinfo.version = VERSION;
netbuffer->u.serverinfo.subversion = SUBVERSION; netbuffer->u.serverinfo.subversion = SUBVERSION;
strncpy(netbuffer->u.serverinfo.application, SRB2APPLICATION,
sizeof netbuffer->u.serverinfo.application);
// return back the time value so client can compute their ping // return back the time value so client can compute their ping
netbuffer->u.serverinfo.time = (tic_t)LONG(servertime); netbuffer->u.serverinfo.time = (tic_t)LONG(servertime);
netbuffer->u.serverinfo.leveltime = (tic_t)LONG(leveltime); netbuffer->u.serverinfo.leveltime = (tic_t)LONG(leveltime);
netbuffer->u.serverinfo.numberofplayer = (UINT8)D_NumPlayers(); netbuffer->u.serverinfo.numberofplayer = (UINT8)D_NumPlayers();
netbuffer->u.serverinfo.maxplayer = (UINT8)cv_maxplayers.value; netbuffer->u.serverinfo.maxplayer = (UINT8)cv_maxplayers.value;
netbuffer->u.serverinfo.gametype = (UINT8)gametype; strncpy(netbuffer->u.serverinfo.gametypename, Gametype_Names[gametype],
sizeof netbuffer->u.serverinfo.gametypename);
netbuffer->u.serverinfo.modifiedgame = (UINT8)modifiedgame; netbuffer->u.serverinfo.modifiedgame = (UINT8)modifiedgame;
netbuffer->u.serverinfo.cheatsenabled = CV_CheatsEnabled(); netbuffer->u.serverinfo.cheatsenabled = CV_CheatsEnabled();
netbuffer->u.serverinfo.isdedicated = (UINT8)dedicated; netbuffer->u.serverinfo.isdedicated = (UINT8)dedicated;
@ -1301,6 +1304,8 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime)
M_Memcpy(netbuffer->u.serverinfo.mapmd5, mapmd5, 16); M_Memcpy(netbuffer->u.serverinfo.mapmd5, mapmd5, 16);
memset(netbuffer->u.serverinfo.maptitle, 0, sizeof netbuffer->u.serverinfo.maptitle);
if (mapheaderinfo[gamemap-1] && *mapheaderinfo[gamemap-1]->lvlttl) if (mapheaderinfo[gamemap-1] && *mapheaderinfo[gamemap-1]->lvlttl)
{ {
char *read = mapheaderinfo[gamemap-1]->lvlttl, *writ = netbuffer->u.serverinfo.maptitle; char *read = mapheaderinfo[gamemap-1]->lvlttl, *writ = netbuffer->u.serverinfo.maptitle;
@ -1319,8 +1324,6 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime)
else else
strncpy(netbuffer->u.serverinfo.maptitle, "UNKNOWN", 32); strncpy(netbuffer->u.serverinfo.maptitle, "UNKNOWN", 32);
netbuffer->u.serverinfo.maptitle[32] = '\0';
if (mapheaderinfo[gamemap-1] && !(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE)) if (mapheaderinfo[gamemap-1] && !(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE))
netbuffer->u.serverinfo.iszone = 1; netbuffer->u.serverinfo.iszone = 1;
else else
@ -1718,12 +1721,21 @@ static void SL_InsertServer(serverinfo_pak* info, SINT8 node)
if (serverlistcount >= MAXSERVERLIST) if (serverlistcount >= MAXSERVERLIST)
return; // list full return; // list full
if (info->_255 != 255)
return;/* old packet format */
if (info->packetversion != PACKETVERSION)
return;/* old new packet format */
if (info->version != VERSION) if (info->version != VERSION)
return; // Not same version. return; // Not same version.
if (info->subversion != SUBVERSION) if (info->subversion != SUBVERSION)
return; // Close, but no cigar. return; // Close, but no cigar.
if (strcmp(info->application, SRB2APPLICATION))
return;/* that's a different mod */
i = serverlistcount++; i = serverlistcount++;
} }
@ -2111,13 +2123,10 @@ static void CL_ConnectToServer(boolean viams)
if (i != -1) if (i != -1)
{ {
UINT8 num = serverlist[i].info.gametype; char *gametypestr = serverlist[i].info.gametypename;
const char *gametypestr = NULL;
CONS_Printf(M_GetText("Connecting to: %s\n"), serverlist[i].info.servername); CONS_Printf(M_GetText("Connecting to: %s\n"), serverlist[i].info.servername);
if (num < NUMGAMETYPES) gametypestr[sizeof serverlist[i].info.gametypename - 1] = '\0';
gametypestr = Gametype_Names[num]; CONS_Printf(M_GetText("Gametype: %s\n"), gametypestr);
if (gametypestr)
CONS_Printf(M_GetText("Gametype: %s\n"), gametypestr);
CONS_Printf(M_GetText("Version: %d.%d.%u\n"), serverlist[i].info.version/100, CONS_Printf(M_GetText("Version: %d.%d.%u\n"), serverlist[i].info.version/100,
serverlist[i].info.version%100, serverlist[i].info.subversion); serverlist[i].info.version%100, serverlist[i].info.subversion);
} }
@ -2430,7 +2439,7 @@ static void CL_RemovePlayer(INT32 playernum, INT32 reason)
} }
} }
if (gametype == GT_CTF) if (gametyperules & GTR_TEAMFLAGS)
P_PlayerFlagBurst(&players[playernum], false); // Don't take the flag with you! P_PlayerFlagBurst(&players[playernum], false); // Don't take the flag with you!
// If in a special stage, redistribute the player's spheres across // If in a special stage, redistribute the player's spheres across
@ -2486,6 +2495,17 @@ static void CL_RemovePlayer(INT32 playernum, INT32 reason)
(void)reason; (void)reason;
#endif #endif
// don't look through someone's view who isn't there
if (playernum == displayplayer)
{
#ifdef HAVE_BLUA
// Call ViewpointSwitch hooks here.
// The viewpoint was forcibly changed.
LUAh_ViewpointSwitch(&players[consoleplayer], &players[displayplayer], true);
#endif
displayplayer = consoleplayer;
}
// Reset player data // Reset player data
CL_ClearPlayer(playernum); CL_ClearPlayer(playernum);
@ -2503,16 +2523,13 @@ static void CL_RemovePlayer(INT32 playernum, INT32 reason)
RemoveAdminPlayer(playernum); // don't stay admin after you're gone RemoveAdminPlayer(playernum); // don't stay admin after you're gone
} }
if (playernum == displayplayer)
displayplayer = consoleplayer; // don't look through someone's view who isn't there
#ifdef HAVE_BLUA #ifdef HAVE_BLUA
LUA_InvalidatePlayer(&players[playernum]); LUA_InvalidatePlayer(&players[playernum]);
#endif #endif
if (G_TagGametype()) //Check if you still have a game. Location flexible. =P if (G_TagGametype()) //Check if you still have a game. Location flexible. =P
P_CheckSurvivors(); P_CheckSurvivors();
else if (gametype == GT_RACE || gametype == GT_COMPETITION) else if (gametyperules & GTR_RACE)
P_CheckRacers(); P_CheckRacers();
} }
@ -2985,8 +3002,8 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
CL_RemovePlayer(pnum, kickreason); CL_RemovePlayer(pnum, kickreason);
} }
consvar_t cv_allownewplayer = {"allowjoin", "On", CV_SAVE|CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL }; consvar_t cv_allownewplayer = {"allowjoin", "On", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL };
consvar_t cv_joinnextround = {"joinnextround", "Off", CV_SAVE|CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; /// \todo not done consvar_t cv_joinnextround = {"joinnextround", "Off", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; /// \todo not done
static CV_PossibleValue_t maxplayers_cons_t[] = {{2, "MIN"}, {32, "MAX"}, {0, NULL}}; static CV_PossibleValue_t maxplayers_cons_t[] = {{2, "MIN"}, {32, "MAX"}, {0, NULL}};
consvar_t cv_maxplayers = {"maxplayers", "8", CV_SAVE, maxplayers_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_maxplayers = {"maxplayers", "8", CV_SAVE, maxplayers_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t resynchattempts_cons_t[] = {{1, "MIN"}, {20, "MAX"}, {0, "No"}, {0, NULL}}; static CV_PossibleValue_t resynchattempts_cons_t[] = {{1, "MIN"}, {20, "MAX"}, {0, "No"}, {0, NULL}};
@ -3461,7 +3478,7 @@ void SV_StartSinglePlayerServer(void)
server = true; server = true;
netgame = false; netgame = false;
multiplayer = false; multiplayer = false;
gametype = GT_COOP; G_SetGametype(GT_COOP);
// no more tic the game with this settings! // no more tic the game with this settings!
SV_StopServer(); SV_StopServer();
@ -3507,6 +3524,12 @@ static void HandleConnect(SINT8 node)
if (bannednode && bannednode[node]) if (bannednode && bannednode[node])
SV_SendRefuse(node, M_GetText("You have been banned\nfrom the server")); SV_SendRefuse(node, M_GetText("You have been banned\nfrom the server"));
else if (netbuffer->u.clientcfg._255 != 255 ||
netbuffer->u.clientcfg.packetversion != PACKETVERSION)
SV_SendRefuse(node, "Incompatible packet formats.");
else if (strncmp(netbuffer->u.clientcfg.application, SRB2APPLICATION,
sizeof netbuffer->u.clientcfg.application))
SV_SendRefuse(node, "Different SRB2 modifications\nare not compatible.");
else if (netbuffer->u.clientcfg.version != VERSION else if (netbuffer->u.clientcfg.version != VERSION
|| netbuffer->u.clientcfg.subversion != SUBVERSION) || netbuffer->u.clientcfg.subversion != SUBVERSION)
SV_SendRefuse(node, va(M_GetText("Different SRB2 versions cannot\nplay a netgame!\n(server version %d.%d.%d)"), VERSION/100, VERSION%100, SUBVERSION)); SV_SendRefuse(node, va(M_GetText("Different SRB2 versions cannot\nplay a netgame!\n(server version %d.%d.%d)"), VERSION/100, VERSION%100, SUBVERSION));
@ -3629,6 +3652,10 @@ static void HandleServerInfo(SINT8 node)
const tic_t ticdiff = (ticnow - ticthen)*1000/NEWTICRATE; const tic_t ticdiff = (ticnow - ticthen)*1000/NEWTICRATE;
netbuffer->u.serverinfo.time = (tic_t)LONG(ticdiff); netbuffer->u.serverinfo.time = (tic_t)LONG(ticdiff);
netbuffer->u.serverinfo.servername[MAXSERVERNAME-1] = 0; netbuffer->u.serverinfo.servername[MAXSERVERNAME-1] = 0;
netbuffer->u.serverinfo.application
[sizeof netbuffer->u.serverinfo.application - 1] = '\0';
netbuffer->u.serverinfo.gametypename
[sizeof netbuffer->u.serverinfo.gametypename - 1] = '\0';
SL_InsertServer(&netbuffer->u.serverinfo, node); SL_InsertServer(&netbuffer->u.serverinfo, node);
} }
@ -3740,7 +3767,7 @@ static void HandlePacketFromAwayNode(SINT8 node)
if (client) if (client)
{ {
maketic = gametic = neededtic = (tic_t)LONG(netbuffer->u.servercfg.gametic); maketic = gametic = neededtic = (tic_t)LONG(netbuffer->u.servercfg.gametic);
gametype = netbuffer->u.servercfg.gametype; G_SetGametype(netbuffer->u.servercfg.gametype);
modifiedgame = netbuffer->u.servercfg.modifiedgame; modifiedgame = netbuffer->u.servercfg.modifiedgame;
for (j = 0; j < MAXPLAYERS; j++) for (j = 0; j < MAXPLAYERS; j++)
adminplayers[j] = netbuffer->u.servercfg.adminplayers[j]; adminplayers[j] = netbuffer->u.servercfg.adminplayers[j];
@ -4124,7 +4151,7 @@ static void HandlePacketFromPlayer(SINT8 node)
P_SetRandSeed(netbuffer->u.resynchend.randomseed); P_SetRandSeed(netbuffer->u.resynchend.randomseed);
if (gametype == GT_CTF) if (gametyperules & GTR_TEAMFLAGS)
resynch_read_ctf(&netbuffer->u.resynchend); resynch_read_ctf(&netbuffer->u.resynchend);
resynch_read_others(&netbuffer->u.resynchend); resynch_read_others(&netbuffer->u.resynchend);

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -19,6 +19,16 @@
#include "tables.h" #include "tables.h"
#include "d_player.h" #include "d_player.h"
/*
The 'packet version' may be used with packets whose
format is expected to change between versions.
This version is independent of the mod name, and standard
version and subversion. It should only account for the
basic fields of the packet, and change infrequently.
*/
#define PACKETVERSION 1
// Network play related stuff. // Network play related stuff.
// There is a data struct that stores network // There is a data struct that stores network
// communication related stuff, and another // communication related stuff, and another
@ -320,8 +330,13 @@ typedef struct {
#pragma warning(default : 4200) #pragma warning(default : 4200)
#endif #endif
#define MAXAPPLICATION 16
typedef struct typedef struct
{ {
UINT8 _255;/* see serverinfo_pak */
UINT8 packetversion;
char application[MAXAPPLICATION];
UINT8 version; // Different versions don't work UINT8 version; // Different versions don't work
UINT8 subversion; // Contains build version UINT8 subversion; // Contains build version
UINT8 localplayers; UINT8 localplayers;
@ -334,11 +349,19 @@ typedef struct
// This packet is too large // This packet is too large
typedef struct typedef struct
{ {
/*
In the old packet, 'version' is the first field. Now that field is set
to 255 always, so older versions won't be confused with the new
versions or vice-versa.
*/
UINT8 _255;
UINT8 packetversion;
char application[MAXAPPLICATION];
UINT8 version; UINT8 version;
UINT8 subversion; UINT8 subversion;
UINT8 numberofplayer; UINT8 numberofplayer;
UINT8 maxplayer; UINT8 maxplayer;
UINT8 gametype; char gametypename[24];
UINT8 modifiedgame; UINT8 modifiedgame;
UINT8 cheatsenabled; UINT8 cheatsenabled;
UINT8 isdedicated; UINT8 isdedicated;

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -108,6 +108,8 @@ boolean devparm = false; // started game with -devparm
boolean singletics = false; // timedemo boolean singletics = false; // timedemo
boolean lastdraw = false; boolean lastdraw = false;
static void D_CheckRendererState(void);
postimg_t postimgtype = postimg_none; postimg_t postimgtype = postimg_none;
INT32 postimgparam; INT32 postimgparam;
postimg_t postimgtype2 = postimg_none; postimg_t postimgtype2 = postimg_none;
@ -212,6 +214,7 @@ INT16 wipetypepost = -1;
static void D_Display(void) static void D_Display(void)
{ {
INT32 setrenderstillneeded = 0;
boolean forcerefresh = false; boolean forcerefresh = false;
static boolean wipe = false; static boolean wipe = false;
INT32 wipedefindex = 0; INT32 wipedefindex = 0;
@ -222,11 +225,38 @@ static void D_Display(void)
if (nodrawers) if (nodrawers)
return; // for comparative timing/profiling return; // for comparative timing/profiling
// check for change of screen size (video mode) // Lactozilla: Switching renderers works by checking
if (setmodeneeded && !wipe) // if the game has to do it right when the frame
SCR_SetMode(); // change video mode // needs to render. If so, five things will happen:
// 1. Interface functions will be called so
// that switching to OpenGL creates a
// GL context, and switching to Software
// allocates screen buffers.
// 2. Software will set drawer functions,
// and OpenGL will load textures and
// create plane polygons, if necessary.
// 3. Functions related to switching video
// modes (resolution) are called.
// 4. Patch data is freed from memory,
// and recached if necessary.
// 5. The frame is ready to be drawn!
if (vid.recalc) // stop movie if needs to change renderer
if (setrenderneeded && (moviemode == MM_APNG))
M_StopMovie();
// check for change of renderer or screen size (video mode)
if ((setrenderneeded || setmodeneeded) && !wipe)
{
if (setrenderneeded)
{
CONS_Debug(DBG_RENDER, "setrenderneeded set (%d)\n", setrenderneeded);
setrenderstillneeded = setrenderneeded;
}
SCR_SetMode(); // change video mode
}
if (vid.recalc || setrenderstillneeded)
{ {
SCR_Recalc(); // NOTE! setsizeneeded is set by SCR_Recalc() SCR_Recalc(); // NOTE! setsizeneeded is set by SCR_Recalc()
#ifdef HWRENDER #ifdef HWRENDER
@ -237,12 +267,15 @@ static void D_Display(void)
} }
// change the view size if needed // change the view size if needed
if (setsizeneeded) if (setsizeneeded || setrenderstillneeded)
{ {
R_ExecuteSetViewSize(); R_ExecuteSetViewSize();
forcerefresh = true; // force background redraw forcerefresh = true; // force background redraw
} }
// Lactozilla: Renderer switching
D_CheckRendererState();
// draw buffered stuff to screen // draw buffered stuff to screen
// Used only by linux GGI version // Used only by linux GGI version
I_UpdateNoBlit(); I_UpdateNoBlit();
@ -274,7 +307,10 @@ static void D_Display(void)
&& wipetypepre != UINT8_MAX) && wipetypepre != UINT8_MAX)
{ {
F_WipeStartScreen(); F_WipeStartScreen();
F_WipeColorFill(31); // Check for Mega Genesis fade
wipestyleflags = WSF_FADEOUT;
if (F_TryColormapFade(31))
wipetypepost = -1; // Don't run the fade below this one
F_WipeEndScreen(); F_WipeEndScreen();
F_RunWipe(wipetypepre, gamestate != GS_TIMEATTACK && gamestate != GS_TITLESCREEN); F_RunWipe(wipetypepre, gamestate != GS_TIMEATTACK && gamestate != GS_TITLESCREEN);
} }
@ -454,7 +490,7 @@ static void D_Display(void)
py = 4; py = 4;
else else
py = viewwindowy + 4; py = viewwindowy + 4;
patch = W_CachePatchName("M_PAUSE", PU_CACHE); patch = W_CachePatchName("M_PAUSE", PU_PATCH);
V_DrawScaledPatch(viewwindowx + (BASEVIDWIDTH - SHORT(patch->width))/2, py, 0, patch); V_DrawScaledPatch(viewwindowx + (BASEVIDWIDTH - SHORT(patch->width))/2, py, 0, patch);
#else #else
INT32 y = ((automapactive) ? (32) : (BASEVIDHEIGHT/2)); INT32 y = ((automapactive) ? (32) : (BASEVIDHEIGHT/2));
@ -488,15 +524,24 @@ static void D_Display(void)
if (rendermode != render_none) if (rendermode != render_none)
{ {
F_WipeEndScreen(); F_WipeEndScreen();
// Funny. // Funny.
if (WipeStageTitle && st_overlay) if (WipeStageTitle && st_overlay)
{ {
lt_ticker--; lt_ticker--;
lt_lasttic = lt_ticker; lt_lasttic = lt_ticker;
ST_preLevelTitleCardDrawer(0, false); ST_preLevelTitleCardDrawer();
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol); V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol);
F_WipeStartScreen(); F_WipeStartScreen();
} }
// Check for Mega Genesis fade
if (F_ShouldColormapFade())
{
wipestyleflags |= WSF_FADEIN;
wipestyleflags &= ~WSF_FADEOUT;
}
F_RunWipe(wipetypepost, gamestate != GS_TIMEATTACK && gamestate != GS_TITLESCREEN); F_RunWipe(wipetypepost, gamestate != GS_TIMEATTACK && gamestate != GS_TITLESCREEN);
} }
@ -545,6 +590,25 @@ static void D_Display(void)
I_FinishUpdate(); // page flip or blit buffer I_FinishUpdate(); // page flip or blit buffer
} }
needpatchflush = false;
needpatchrecache = false;
}
// Lactozilla: Check the renderer's state
// after a possible renderer switch.
void D_CheckRendererState(void)
{
// flush all patches from memory
// (also frees memory tagged with PU_CACHE)
// (which are not necessarily patches but I don't care)
if (needpatchflush)
Z_FlushCachedPatches();
// some patches have been freed,
// so cache them again
if (needpatchrecache)
R_ReloadHUDGraphics();
} }
// ========================================================================= // =========================================================================
@ -562,9 +626,6 @@ void D_SRB2Loop(void)
// Pushing of + parameters is now done back in D_SRB2Main, not here. // Pushing of + parameters is now done back in D_SRB2Main, not here.
CONS_Printf("I_StartupKeyboard()...\n");
I_StartupKeyboard();
#ifdef _WINDOWS #ifdef _WINDOWS
CONS_Printf("I_StartupMouse()...\n"); CONS_Printf("I_StartupMouse()...\n");
I_DoStartupMouse(); I_DoStartupMouse();
@ -591,8 +652,7 @@ void D_SRB2Loop(void)
// hack to start on a nice clear console screen. // hack to start on a nice clear console screen.
COM_ImmedExecute("cls;version"); COM_ImmedExecute("cls;version");
if (rendermode == render_soft) V_DrawScaledPatch(0, 0, 0, W_CachePatchNum(W_GetNumForName("CONSBACK"), PU_CACHE));
V_DrawScaledPatch(0, 0, 0, (patch_t *)W_CacheLumpNum(W_GetNumForName("CONSBACK"), PU_CACHE));
I_FinishUpdate(); // page flip or blit buffer I_FinishUpdate(); // page flip or blit buffer
for (;;) for (;;)
@ -706,7 +766,7 @@ void D_StartTitle(void)
if (netgame) if (netgame)
{ {
if (gametype == GT_COOP) if (gametyperules & GTR_CAMPAIGN)
{ {
G_SetGamestate(GS_WAITINGPLAYERS); // hack to prevent a command repeat G_SetGamestate(GS_WAITINGPLAYERS); // hack to prevent a command repeat
@ -753,7 +813,7 @@ void D_StartTitle(void)
gameaction = ga_nothing; gameaction = ga_nothing;
displayplayer = consoleplayer = 0; displayplayer = consoleplayer = 0;
gametype = GT_COOP; G_SetGametype(GT_COOP);
paused = false; paused = false;
advancedemo = false; advancedemo = false;
F_InitMenuPresValues(); F_InitMenuPresValues();
@ -969,7 +1029,7 @@ void D_SRB2Main(void)
// Print GPL notice for our console users (Linux) // Print GPL notice for our console users (Linux)
CONS_Printf( CONS_Printf(
"\n\nSonic Robo Blast 2\n" "\n\nSonic Robo Blast 2\n"
"Copyright (C) 1998-2018 by Sonic Team Junior\n\n" "Copyright (C) 1998-2019 by Sonic Team Junior\n\n"
"This program comes with ABSOLUTELY NO WARRANTY.\n\n" "This program comes with ABSOLUTELY NO WARRANTY.\n\n"
"This is free software, and you are welcome to redistribute it\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" "and/or modify it under the terms of the GNU General Public License\n"
@ -1109,26 +1169,6 @@ void D_SRB2Main(void)
if (M_CheckParm("-server") || dedicated) if (M_CheckParm("-server") || dedicated)
netgame = server = true; netgame = server = true;
if (M_CheckParm("-warp") && M_IsNextParm())
{
const char *word = M_GetNextParm();
char ch; // use this with sscanf to catch non-digits with
if (fastncmp(word, "MAP", 3)) // MAPxx name
pstartmap = M_MapNumber(word[3], word[4]);
else if (sscanf(word, "%d%c", &pstartmap, &ch) != 1) // a plain number
I_Error("Cannot warp to map %s (invalid map name)\n", word);
// Don't check if lump exists just yet because the wads haven't been loaded!
// Just do a basic range check here.
if (pstartmap < 1 || pstartmap > NUMMAPS)
I_Error("Cannot warp to map %d (out of range)\n", pstartmap);
else
{
if (!M_CheckParm("-server"))
G_SetGameModified(true);
autostart = true;
}
}
CONS_Printf("Z_Init(): Init zone memory allocation daemon. \n"); CONS_Printf("Z_Init(): Init zone memory allocation daemon. \n");
Z_Init(); Z_Init();
@ -1155,31 +1195,10 @@ void D_SRB2Main(void)
// Have to be done here before files are loaded // Have to be done here before files are loaded
M_InitCharacterTables(); M_InitCharacterTables();
mainwads = 0; mainwads = 3; // doesn't include music.dta
#ifndef DEVELOP // md5s last updated 12/14/14
// Check MD5s of autoloaded files
W_VerifyFileMD5(mainwads++, ASSET_HASH_SRB2_PK3); // srb2.pk3
W_VerifyFileMD5(mainwads++, ASSET_HASH_ZONES_PK3); // zones.pk3
W_VerifyFileMD5(mainwads++, ASSET_HASH_PLAYER_DTA); // player.dta
#ifdef USE_PATCH_DTA #ifdef USE_PATCH_DTA
W_VerifyFileMD5(mainwads++, ASSET_HASH_PATCH_DTA); // patch.pk3 mainwads++;
#endif #endif
// don't check music.dta 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.
//mainwads++; // music.dta does not increment mainwads (see <= 2.1.21)
//mainwads++; // neither does music_new.dta
#else
mainwads++; // srb2.pk3
mainwads++; // zones.pk3
mainwads++; // player.dta
#ifdef USE_PATCH_DTA
mainwads++; // patch.dta
#endif
//mainwads++; // music.dta does not increment mainwads (see <= 2.1.21)
//mainwads++; // neither does music_new.dta
// load wad, including the main wad file // load wad, including the main wad file
CONS_Printf("W_InitMultipleFiles(): Adding IWAD and main PWADs.\n"); CONS_Printf("W_InitMultipleFiles(): Adding IWAD and main PWADs.\n");
@ -1191,11 +1210,34 @@ void D_SRB2Main(void)
#endif #endif
D_CleanFile(); D_CleanFile();
#ifndef DEVELOP // md5s last updated 06/12/19 (ddmmyy)
// 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
#ifdef USE_PATCH_DTA
W_VerifyFileMD5(3, ASSET_HASH_PATCH_DTA); // patch.pk3
#endif
// don't check music.dta 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 #endif //ifndef DEVELOP
mainwadstally = packetsizetally; mainwadstally = packetsizetally; // technically not accurate atm, remember to port the two-stage -file process from kart in 2.2.x
mainwadstally = packetsizetally; if (M_CheckParm("-warp") && M_IsNextParm())
{
const char *word = M_GetNextParm();
pstartmap = G_FindMapByNameOrCode(word, 0);
if (! pstartmap)
I_Error("Cannot find a map remotely named '%s'\n", word);
else
{
if (!M_CheckParm("-server"))
G_SetGameModified(true);
autostart = true;
}
}
cht_Init(); cht_Init();
@ -1205,6 +1247,13 @@ void D_SRB2Main(void)
CONS_Printf("I_StartupGraphics()...\n"); CONS_Printf("I_StartupGraphics()...\n");
I_StartupGraphics(); I_StartupGraphics();
#ifdef HWRENDER
// Lactozilla: Add every hardware mode CVAR and CCMD.
// Has to be done before the configuration file loads,
// but after the OpenGL library loads.
HWR_AddCommands();
#endif
//--------------------------------------------------------- CONSOLE //--------------------------------------------------------- CONSOLE
// setup loading screen // setup loading screen
SCR_Startup(); SCR_Startup();
@ -1235,6 +1284,16 @@ void D_SRB2Main(void)
// set user default mode or mode set at cmdline // set user default mode or mode set at cmdline
SCR_CheckDefaultMode(); SCR_CheckDefaultMode();
// Lactozilla: Does the render mode need to change?
if ((setrenderneeded != 0) && (setrenderneeded != rendermode))
{
needpatchflush = true;
needpatchrecache = true;
VID_CheckRenderer();
SCR_ChangeRendererCVars(setrenderneeded);
}
D_CheckRendererState();
wipegamestate = gamestate; wipegamestate = gamestate;
savedata.lives = 0; // flag this as not-used savedata.lives = 0; // flag this as not-used
@ -1293,9 +1352,10 @@ void D_SRB2Main(void)
I_StartupSound(); I_StartupSound();
I_InitMusic(); I_InitMusic();
S_InitSfxChannels(cv_soundvolume.value); S_InitSfxChannels(cv_soundvolume.value);
S_InitMusicDefs();
} }
S_InitMusicDefs();
CONS_Printf("ST_Init(): Init status bar.\n"); CONS_Printf("ST_Init(): Init status bar.\n");
ST_Init(); ST_Init();
@ -1414,14 +1474,14 @@ void D_SRB2Main(void)
if (newgametype == -1) // reached end of the list with no match if (newgametype == -1) // reached end of the list with no match
{ {
j = atoi(sgametype); // assume they gave us a gametype number, which is okay too j = atoi(sgametype); // assume they gave us a gametype number, which is okay too
if (j >= 0 && j < NUMGAMETYPES) if (j >= 0 && j < gametypecount)
newgametype = (INT16)j; newgametype = (INT16)j;
} }
if (newgametype != -1) if (newgametype != -1)
{ {
j = gametype; j = gametype;
gametype = newgametype; G_SetGametype(newgametype);
D_GameTypeChanged(j); D_GameTypeChanged(j);
} }
} }
@ -1457,7 +1517,7 @@ void D_SRB2Main(void)
{ {
levelstarttic = gametic; levelstarttic = gametic;
G_SetGamestate(GS_LEVEL); G_SetGamestate(GS_LEVEL);
if (!P_SetupLevel(false)) if (!P_LoadLevel(false))
I_Quit(); // fail so reset game stuff I_Quit(); // fail so reset game stuff
} }
} }

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -40,6 +40,8 @@ extern SINT8 nodetoplayer2[MAXNETNODES]; // Say the numplayer for this node if a
extern UINT8 playerpernode[MAXNETNODES]; // Used specially for splitscreen extern UINT8 playerpernode[MAXNETNODES]; // Used specially for splitscreen
extern boolean nodeingame[MAXNETNODES]; // Set false as nodes leave game extern boolean nodeingame[MAXNETNODES]; // Set false as nodes leave game
extern boolean serverrunning;
INT32 Net_GetFreeAcks(boolean urgent); INT32 Net_GetFreeAcks(boolean urgent);
void Net_AckTicker(void); void Net_AckTicker(void);

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -327,6 +327,10 @@ consvar_t cv_numlaps = {"numlaps", "4", CV_NETVAR|CV_CALL|CV_NOINIT, numlaps_con
static CV_PossibleValue_t basenumlaps_cons_t[] = {{1, "MIN"}, {50, "MAX"}, {0, "Map default"}, {0, NULL}}; static CV_PossibleValue_t basenumlaps_cons_t[] = {{1, "MIN"}, {50, "MAX"}, {0, "Map default"}, {0, NULL}};
consvar_t cv_basenumlaps = {"basenumlaps", "Map default", CV_NETVAR|CV_CALL|CV_CHEAT, basenumlaps_cons_t, BaseNumLaps_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_basenumlaps = {"basenumlaps", "Map default", CV_NETVAR|CV_CALL|CV_CHEAT, basenumlaps_cons_t, BaseNumLaps_OnChange, 0, NULL, NULL, 0, 0, NULL};
// Point and time limits for every gametype
INT32 pointlimits[NUMGAMETYPES];
INT32 timelimits[NUMGAMETYPES];
// log elemental hazards -- not a netvar, is local to current player // log elemental hazards -- not a netvar, is local to current player
consvar_t cv_hazardlog = {"hazardlog", "Yes", 0, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_hazardlog = {"hazardlog", "Yes", 0, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
@ -381,6 +385,9 @@ char timedemo_csv_id[256];
boolean timedemo_quit; boolean timedemo_quit;
INT16 gametype = GT_COOP; INT16 gametype = GT_COOP;
UINT32 gametyperules = 0;
INT16 gametypecount = (GT_CTF + 1);
boolean splitscreen = false; boolean splitscreen = false;
boolean circuitmap = false; boolean circuitmap = false;
INT32 adminplayers[MAXPLAYERS]; INT32 adminplayers[MAXPLAYERS];
@ -823,6 +830,10 @@ void D_RegisterClientCommands(void)
CV_RegisterVar(&cv_autobrake); CV_RegisterVar(&cv_autobrake);
CV_RegisterVar(&cv_autobrake2); CV_RegisterVar(&cv_autobrake2);
// Ported from kart
CV_RegisterVar(&cv_deadzone);
CV_RegisterVar(&cv_deadzone2);
// s_sound.c // s_sound.c
CV_RegisterVar(&cv_soundvolume); CV_RegisterVar(&cv_soundvolume);
CV_RegisterVar(&cv_closedcaptioning); CV_RegisterVar(&cv_closedcaptioning);
@ -837,6 +848,10 @@ void D_RegisterClientCommands(void)
// screen.c // screen.c
CV_RegisterVar(&cv_fullscreen); CV_RegisterVar(&cv_fullscreen);
CV_RegisterVar(&cv_renderview); CV_RegisterVar(&cv_renderview);
CV_RegisterVar(&cv_renderer);
#ifdef HWRENDER
CV_RegisterVar(&cv_newrenderer);
#endif
CV_RegisterVar(&cv_scr_depth); CV_RegisterVar(&cv_scr_depth);
CV_RegisterVar(&cv_scr_width); CV_RegisterVar(&cv_scr_width);
CV_RegisterVar(&cv_scr_height); CV_RegisterVar(&cv_scr_height);
@ -1122,7 +1137,7 @@ UINT8 CanChangeSkin(INT32 playernum)
return true; return true;
// Can change skin during initial countdown. // Can change skin during initial countdown.
if ((gametype == GT_RACE || gametype == GT_COMPETITION) && leveltime < 4*TICRATE) if ((gametyperules & GTR_RACE) && leveltime < 4*TICRATE)
return true; return true;
if (G_TagGametype()) if (G_TagGametype())
@ -1798,18 +1813,15 @@ static void Command_Map_f(void)
boolean newresetplayers; boolean newresetplayers;
boolean mustmodifygame; boolean mustmodifygame;
boolean usemapcode = false;
INT32 newmapnum; INT32 newmapnum;
char * mapname; char * mapname;
size_t mapnamelen;
char *realmapname = NULL; char *realmapname = NULL;
INT32 newgametype = gametype; INT32 newgametype = gametype;
INT32 d; INT32 d;
char *p;
if (client && !IsPlayerAdmin(consoleplayer)) if (client && !IsPlayerAdmin(consoleplayer))
{ {
@ -1869,56 +1881,16 @@ static void Command_Map_f(void)
} }
mapname = ConcatCommandArgv(1, first_option); mapname = ConcatCommandArgv(1, first_option);
mapnamelen = strlen(mapname);
if (mapnamelen == 2)/* maybe two digit code */ newmapnum = G_FindMapByNameOrCode(mapname, &realmapname);
{
if (( newmapnum = M_MapNumber(mapname[0], mapname[1]) ))
usemapcode = true;
}
else if (mapnamelen == 5 && strnicmp(mapname, "MAP", 3) == 0)
{
if (( newmapnum = M_MapNumber(mapname[3], mapname[4]) ) == 0)
{
CONS_Alert(CONS_ERROR, M_GetText("Invalid map code '%s'.\n"), mapname);
Z_Free(mapname);
return;
}
usemapcode = true;
}
if (!usemapcode) if (newmapnum == 0)
{
/* Now detect map number in base 10, which no one asked for. */
newmapnum = strtol(mapname, &p, 10);
if (*p == '\0')/* we got it */
{
if (newmapnum < 1 || newmapnum > NUMMAPS)
{
CONS_Alert(CONS_ERROR, M_GetText("Invalid map number %d.\n"), newmapnum);
Z_Free(mapname);
return;
}
usemapcode = true;
}
else
{
newmapnum = G_FindMap(mapname, &realmapname, NULL, NULL);
}
}
if (newmapnum == 0 || !mapheaderinfo[newmapnum-1])
{ {
CONS_Alert(CONS_ERROR, M_GetText("Could not find any map described as '%s'.\n"), mapname); CONS_Alert(CONS_ERROR, M_GetText("Could not find any map described as '%s'.\n"), mapname);
Z_Free(mapname); Z_Free(mapname);
return; return;
} }
if (usemapcode)
{
realmapname = G_BuildMapTitle(newmapnum);
}
if (mustmodifygame && option_force) if (mustmodifygame && option_force)
{ {
G_SetGameModified(false); G_SetGameModified(false);
@ -1938,7 +1910,7 @@ static void Command_Map_f(void)
if (isdigit(gametypename[0])) if (isdigit(gametypename[0]))
{ {
d = atoi(gametypename); d = atoi(gametypename);
if (d >= 0 && d < NUMGAMETYPES) if (d >= 0 && d < gametypecount)
newgametype = d; newgametype = d;
else else
{ {
@ -1946,7 +1918,7 @@ static void Command_Map_f(void)
"Gametype number %d is out of range. Use a number between" "Gametype number %d is out of range. Use a number between"
" 0 and %d inclusive. ...Or just use the name. :v\n", " 0 and %d inclusive. ...Or just use the name. :v\n",
d, d,
NUMGAMETYPES-1); gametypecount-1);
Z_Free(realmapname); Z_Free(realmapname);
Z_Free(mapname); Z_Free(mapname);
return; return;
@ -2065,8 +2037,9 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
lastgametype = gametype; lastgametype = gametype;
gametype = READUINT8(*cp); gametype = READUINT8(*cp);
G_SetGametype(gametype); // I fear putting that macro as an argument
if (gametype < 0 || gametype >= NUMGAMETYPES) if (gametype < 0 || gametype >= gametypecount)
gametype = lastgametype; gametype = lastgametype;
else if (gametype != lastgametype) else if (gametype != lastgametype)
D_GameTypeChanged(lastgametype); // emulate consvar_t behavior for gametype D_GameTypeChanged(lastgametype); // emulate consvar_t behavior for gametype
@ -2197,6 +2170,8 @@ static void Got_Pause(UINT8 **cp, INT32 playernum)
else else
S_ResumeAudio(); S_ResumeAudio();
} }
I_UpdateMouseGrab();
} }
// Command for stuck characters in netgames, griefing, etc. // Command for stuck characters in netgames, griefing, etc.
@ -2409,7 +2384,7 @@ static void Command_Teamchange_f(void)
} }
//additional check for hide and seek. Don't allow change of status after hidetime ends. //additional check for hide and seek. Don't allow change of status after hidetime ends.
if (gametype == GT_HIDEANDSEEK && leveltime >= (hidetime * TICRATE)) if ((gametyperules & GTR_HIDEFROZEN) && leveltime >= (hidetime * TICRATE))
{ {
CONS_Alert(CONS_NOTICE, M_GetText("Hiding time expired; no Hide and Seek status changes allowed!\n")); CONS_Alert(CONS_NOTICE, M_GetText("Hiding time expired; no Hide and Seek status changes allowed!\n"));
return; return;
@ -2506,7 +2481,7 @@ static void Command_Teamchange2_f(void)
} }
//additional check for hide and seek. Don't allow change of status after hidetime ends. //additional check for hide and seek. Don't allow change of status after hidetime ends.
if (gametype == GT_HIDEANDSEEK && leveltime >= (hidetime * TICRATE)) if ((gametyperules & GTR_HIDEFROZEN) && leveltime >= (hidetime * TICRATE))
{ {
CONS_Alert(CONS_NOTICE, M_GetText("Hiding time expired; no Hide and Seek status changes allowed!\n")); CONS_Alert(CONS_NOTICE, M_GetText("Hiding time expired; no Hide and Seek status changes allowed!\n"));
return; return;
@ -2635,7 +2610,7 @@ static void Command_ServerTeamChange_f(void)
} }
//additional check for hide and seek. Don't allow change of status after hidetime ends. //additional check for hide and seek. Don't allow change of status after hidetime ends.
if (gametype == GT_HIDEANDSEEK && leveltime >= (hidetime * TICRATE)) if ((gametyperules & GTR_HIDEFROZEN) && leveltime >= (hidetime * TICRATE))
{ {
CONS_Alert(CONS_NOTICE, M_GetText("Hiding time expired; no Hide and Seek status changes allowed!\n")); CONS_Alert(CONS_NOTICE, M_GetText("Hiding time expired; no Hide and Seek status changes allowed!\n"));
return; return;
@ -2724,6 +2699,16 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
return; return;
} }
#ifdef HAVE_BLUA
// Don't switch team, just go away, please, go awaayyyy, aaauuauugghhhghgh
if (!LUAh_TeamSwitch(&players[playernum], NetPacket.packet.newteam, players[playernum].spectator, NetPacket.packet.autobalance, NetPacket.packet.scrambled))
return;
#endif
//no status changes after hidetime
if ((gametyperules & GTR_HIDEFROZEN) && (leveltime >= (hidetime * TICRATE)))
error = true;
//Make sure that the right team number is sent. Keep in mind that normal clients cannot change to certain teams in certain gametypes. //Make sure that the right team number is sent. Keep in mind that normal clients cannot change to certain teams in certain gametypes.
switch (gametype) switch (gametype)
{ {
@ -2878,7 +2863,15 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
//reset view if you are changed, or viewing someone who was changed. //reset view if you are changed, or viewing someone who was changed.
if (playernum == consoleplayer || displayplayer == playernum) if (playernum == consoleplayer || displayplayer == playernum)
{
#ifdef HAVE_BLUA
// Call ViewpointSwitch hooks here.
// The viewpoint was forcibly changed.
if (displayplayer != consoleplayer) // You're already viewing yourself. No big deal.
LUAh_ViewpointSwitch(&players[playernum], &players[displayplayer], true);
#endif
displayplayer = consoleplayer; displayplayer = consoleplayer;
}
if (G_GametypeHasTeams()) if (G_GametypeHasTeams())
{ {
@ -3614,7 +3607,7 @@ static void Command_ShowGametype_f(void)
} }
// get name string for current gametype // get name string for current gametype
if (gametype >= 0 && gametype < NUMGAMETYPES) if (gametype >= 0 && gametype < gametypecount)
gametypestr = Gametype_Names[gametype]; gametypestr = Gametype_Names[gametype];
if (gametypestr) if (gametypestr)
@ -3676,7 +3669,7 @@ void ItemFinder_OnChange(void)
static void PointLimit_OnChange(void) static void PointLimit_OnChange(void)
{ {
// Don't allow pointlimit in Single Player/Co-Op/Race! // Don't allow pointlimit in Single Player/Co-Op/Race!
if (server && Playing() && G_PlatformGametype()) if (server && Playing() && !(gametyperules & GTR_POINTLIMIT))
{ {
if (cv_pointlimit.value) if (cv_pointlimit.value)
CV_StealthSetValue(&cv_pointlimit, 0); CV_StealthSetValue(&cv_pointlimit, 0);
@ -3715,7 +3708,7 @@ static void CoopStarposts_OnChange(void)
{ {
INT32 i; INT32 i;
if (!(netgame || multiplayer) || gametype != GT_COOP) if (!(netgame || multiplayer) || !G_GametypeUsesCoopStarposts())
return; return;
switch (cv_coopstarposts.value) switch (cv_coopstarposts.value)
@ -3770,7 +3763,7 @@ static void CoopLives_OnChange(void)
{ {
INT32 i; INT32 i;
if (!(netgame || multiplayer) || gametype != GT_COOP) if (!(netgame || multiplayer) || !G_GametypeUsesCoopLives())
return; return;
switch (cv_cooplives.value) switch (cv_cooplives.value)
@ -3809,11 +3802,19 @@ static void CoopLives_OnChange(void)
static void ExitMove_OnChange(void) static void ExitMove_OnChange(void)
{ {
UINT8 i;
if (!(netgame || multiplayer) || gametype != GT_COOP) if (!(netgame || multiplayer) || gametype != GT_COOP)
return; return;
if (cv_exitmove.value) if (cv_exitmove.value)
{
for (i = 0; i < MAXPLAYERS; ++i)
if (playeringame[i] && players[i].mo
&& players[i].mo->target && players[i].mo->target->type == MT_SIGN)
P_SetTarget(&players[i].mo->target, NULL);
CONS_Printf(M_GetText("Players can now move after completing the level.\n")); CONS_Printf(M_GetText("Players can now move after completing the level.\n"));
}
else else
CONS_Printf(M_GetText("Players can no longer move after completing the level.\n")); CONS_Printf(M_GetText("Players can no longer move after completing the level.\n"));
} }
@ -3831,7 +3832,7 @@ UINT32 timelimitintics = 0;
static void TimeLimit_OnChange(void) static void TimeLimit_OnChange(void)
{ {
// Don't allow timelimit in Single Player/Co-Op/Race! // Don't allow timelimit in Single Player/Co-Op/Race!
if (server && Playing() && cv_timelimit.value != 0 && G_PlatformGametype()) if (server && Playing() && cv_timelimit.value != 0 && !(gametyperules & GTR_TIMELIMIT))
{ {
CV_SetValue(&cv_timelimit, 0); CV_SetValue(&cv_timelimit, 0);
return; return;
@ -3867,9 +3868,9 @@ void D_GameTypeChanged(INT32 lastgametype)
{ {
const char *oldgt = NULL, *newgt = NULL; const char *oldgt = NULL, *newgt = NULL;
if (lastgametype >= 0 && lastgametype < NUMGAMETYPES) if (lastgametype >= 0 && lastgametype < gametypecount)
oldgt = Gametype_Names[lastgametype]; oldgt = Gametype_Names[lastgametype];
if (gametype >= 0 && lastgametype < NUMGAMETYPES) if (gametype >= 0 && lastgametype < gametypecount)
newgt = Gametype_Names[gametype]; newgt = Gametype_Names[gametype];
if (oldgt && newgt) if (oldgt && newgt)
@ -3923,11 +3924,20 @@ void D_GameTypeChanged(INT32 lastgametype)
if (!cv_itemrespawntime.changed) if (!cv_itemrespawntime.changed)
CV_Set(&cv_itemrespawntime, cv_itemrespawntime.defaultvalue); // respawn normally CV_Set(&cv_itemrespawntime, cv_itemrespawntime.defaultvalue); // respawn normally
break; break;
default:
if (!cv_timelimit.changed && !cv_pointlimit.changed) // user hasn't changed limits
{
CV_SetValue(&cv_timelimit, timelimits[gametype]);
CV_SetValue(&cv_pointlimit, pointlimits[gametype]);
}
if (!cv_itemrespawntime.changed)
CV_Set(&cv_itemrespawntime, cv_itemrespawntime.defaultvalue); // respawn normally
break;
} }
} }
else if (!multiplayer && !netgame) else if (!multiplayer && !netgame)
{ {
gametype = GT_COOP; G_SetGametype(GT_COOP);
// These shouldn't matter anymore // These shouldn't matter anymore
//CV_Set(&cv_itemrespawntime, cv_itemrespawntime.defaultvalue); //CV_Set(&cv_itemrespawntime, cv_itemrespawntime.defaultvalue);
//CV_SetValue(&cv_itemrespawn, 0); //CV_SetValue(&cv_itemrespawn, 0);
@ -3936,7 +3946,7 @@ void D_GameTypeChanged(INT32 lastgametype)
// reset timelimit and pointlimit in race/coop, prevent stupid cheats // reset timelimit and pointlimit in race/coop, prevent stupid cheats
if (server) if (server)
{ {
if (G_PlatformGametype()) if (!(gametyperules & GTR_POINTLIMIT))
{ {
if (cv_timelimit.value) if (cv_timelimit.value)
CV_SetValue(&cv_timelimit, 0); CV_SetValue(&cv_timelimit, 0);
@ -3954,6 +3964,7 @@ void D_GameTypeChanged(INT32 lastgametype)
// When swapping to a gametype that supports spectators, // When swapping to a gametype that supports spectators,
// make everyone a spectator initially. // make everyone a spectator initially.
// Averted with GTR_NOSPECTATORSPAWN.
if (!splitscreen && (G_GametypeHasSpectators())) if (!splitscreen && (G_GametypeHasSpectators()))
{ {
INT32 i; INT32 i;
@ -3961,7 +3972,7 @@ void D_GameTypeChanged(INT32 lastgametype)
if (playeringame[i]) if (playeringame[i])
{ {
players[i].ctfteam = 0; players[i].ctfteam = 0;
players[i].spectator = true; players[i].spectator = (gametyperules & GTR_NOSPECTATORSPAWN) ? false : true;
} }
} }

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -22,6 +22,7 @@
#include "m_menu.h" #include "m_menu.h"
#include "m_misc.h" #include "m_misc.h"
#include "f_finale.h" #include "f_finale.h"
#include "y_inter.h"
#include "dehacked.h" #include "dehacked.h"
#include "st_stuff.h" #include "st_stuff.h"
#include "i_system.h" #include "i_system.h"
@ -76,6 +77,7 @@ static UINT16 get_mus(const char *word, UINT8 dehacked_mode);
static hudnum_t get_huditem(const char *word); static hudnum_t get_huditem(const char *word);
static menutype_t get_menutype(const char *word); static menutype_t get_menutype(const char *word);
#ifndef HAVE_BLUA #ifndef HAVE_BLUA
static INT16 get_gametype(const char *word);
static powertype_t get_power(const char *word); static powertype_t get_power(const char *word);
#endif #endif
@ -242,6 +244,7 @@ INT32 flags; Bits = 3232 MF_SOLID|MF_SHOOTABLE|MF_DROPOFF|M
INT32 raisestate; Respawn frame = 32 S_NULL // raisestate INT32 raisestate; Respawn frame = 32 S_NULL // raisestate
}, */ }, */
#ifdef HWRENDER
static INT32 searchvalue(const char *s) static INT32 searchvalue(const char *s)
{ {
while (s[0] != '=' && s[0]) while (s[0] != '=' && s[0])
@ -255,7 +258,6 @@ static INT32 searchvalue(const char *s)
} }
} }
#ifdef HWRENDER
static float searchfvalue(const char *s) static float searchfvalue(const char *s)
{ {
while (s[0] != '=' && s[0]) while (s[0] != '=' && s[0])
@ -590,6 +592,16 @@ static void readfreeslots(MYFILE *f)
} else } else
CONS_Alert(CONS_WARNING, "Ran out of free SPR2 slots!\n"); CONS_Alert(CONS_WARNING, "Ran out of free SPR2 slots!\n");
} }
else if (fastcmp(type, "TOL"))
{
if (lastcustomtol > 31)
CONS_Alert(CONS_WARNING, "Ran out of free typeoflevel slots!\n");
else
{
G_AddTOL((1<<lastcustomtol), word);
lastcustomtol++;
}
}
else else
deh_warning("Freeslots: unknown enum class '%s' for '%s_%s'", type, type, word); deh_warning("Freeslots: unknown enum class '%s' for '%s_%s'", type, type, word);
} }
@ -863,14 +875,12 @@ static void readspriteframe(MYFILE *f, spriteinfo_t *sprinfo, UINT8 frame)
strupr(word); strupr(word);
value = atoi(word2); // used for numerical settings value = atoi(word2); // used for numerical settings
#ifdef ROTSPRITE
if (fastcmp(word, "XPIVOT")) if (fastcmp(word, "XPIVOT"))
sprinfo->pivot[frame].x = value; sprinfo->pivot[frame].x = value;
else if (fastcmp(word, "YPIVOT")) else if (fastcmp(word, "YPIVOT"))
sprinfo->pivot[frame].y = value; sprinfo->pivot[frame].y = value;
else if (fastcmp(word, "ROTAXIS")) else if (fastcmp(word, "ROTAXIS"))
sprinfo->pivot[frame].rotaxis = value; sprinfo->pivot[frame].rotaxis = value;
#endif
else else
{ {
f->curpos = lastline; f->curpos = lastline;
@ -886,7 +896,9 @@ static void readspriteinfo(MYFILE *f, INT32 num, boolean sprite2)
char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL); char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
char *word, *word2; char *word, *word2;
char *tmp; char *tmp;
#ifdef HWRENDER
INT32 value; INT32 value;
#endif
char *lastline; char *lastline;
INT32 skinnumbers[MAXSKINS]; INT32 skinnumbers[MAXSKINS];
INT32 foundskins = 0; INT32 foundskins = 0;
@ -947,9 +959,9 @@ static void readspriteinfo(MYFILE *f, INT32 num, boolean sprite2)
break; break;
} }
strupr(word); strupr(word);
#ifdef HWRENDER
value = atoi(word2); // used for numerical settings value = atoi(word2); // used for numerical settings
#ifdef HWRENDER
if (fastcmp(word, "LIGHTTYPE")) if (fastcmp(word, "LIGHTTYPE"))
{ {
if (sprite2) if (sprite2)
@ -1093,10 +1105,10 @@ static void readsprite2(MYFILE *f, INT32 num)
Z_Free(s); Z_Free(s);
} }
static const struct { INT32 numtolinfo = NUMBASETOL;
const char *name; UINT32 lastcustomtol = 13;
const UINT16 flag;
} TYPEOFLEVEL[] = { tolinfo_t TYPEOFLEVEL[NUMMAXTOL] = {
{"SOLO",TOL_SP}, {"SOLO",TOL_SP},
{"SP",TOL_SP}, {"SP",TOL_SP},
{"SINGLEPLAYER",TOL_SP}, {"SINGLEPLAYER",TOL_SP},
@ -1112,8 +1124,6 @@ static const struct {
{"TAG",TOL_TAG}, {"TAG",TOL_TAG},
{"CTF",TOL_CTF}, {"CTF",TOL_CTF},
{"CUSTOM",TOL_CUSTOM},
{"2D",TOL_2D}, {"2D",TOL_2D},
{"MARIO",TOL_MARIO}, {"MARIO",TOL_MARIO},
{"NIGHTS",TOL_NIGHTS}, {"NIGHTS",TOL_NIGHTS},
@ -1126,6 +1136,216 @@ static const struct {
{NULL, 0} {NULL, 0}
}; };
// copypasted from readPlayer :sleep:
static const char *const GAMETYPERULE_LIST[];
static void readgametype(MYFILE *f, char *gtname)
{
char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
char *word;
char *word2, *word2lwr = NULL;
char *tmp;
INT32 i, j;
INT16 newgtidx = 0;
UINT32 newgtrules = 0;
UINT32 newgttol = 0;
INT32 newgtpointlimit = 0;
INT32 newgttimelimit = 0;
UINT8 newgtleftcolor = 0;
UINT8 newgtrightcolor = 0;
INT16 newgtrankingstype = -1;
int newgtinttype = 0;
char gtdescription[441];
char gtconst[MAXLINELEN];
// Empty strings.
gtdescription[0] = '\0';
gtconst[0] = '\0';
do
{
if (myfgets(s, MAXLINELEN, f))
{
if (s[0] == '\n')
break;
word = strtok(s, " ");
if (word)
strupr(word);
else
break;
if (fastcmp(word, "DESCRIPTION"))
{
char *descr = NULL;
for (i = 0; i < MAXLINELEN-3; i++)
{
if (s[i] == '=')
{
descr = &s[i+2];
break;
}
}
if (descr)
{
strcpy(gtdescription, descr);
strcat(gtdescription, myhashfgets(descr, sizeof (gtdescription), f));
}
else
strcpy(gtdescription, "");
// For some reason, cutting the string did not work above. Most likely due to strcpy or strcat...
// It works down here, though.
{
INT32 numline = 0;
for (i = 0; i < MAXLINELEN-1; i++)
{
if (numline < 20 && gtdescription[i] == '\n')
numline++;
if (numline >= 20 || gtdescription[i] == '\0' || gtdescription[i] == '#')
break;
}
}
gtdescription[strlen(gtdescription)-1] = '\0';
gtdescription[i] = '\0';
continue;
}
word2 = strtok(NULL, " = ");
if (word2)
{
if (!word2lwr)
word2lwr = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
strcpy(word2lwr, word2);
strupr(word2);
}
else
break;
if (word2[strlen(word2)-1] == '\n')
word2[strlen(word2)-1] = '\0';
i = atoi(word2);
// Game type rules
if (fastcmp(word, "RULES"))
{
// GTR_
newgtrules = (UINT32)get_number(word2);
}
// Identifier
else if (fastcmp(word, "IDENTIFIER"))
{
// GT_
strncpy(gtconst, word2, MAXLINELEN);
}
// Point and time limits
else if (fastcmp(word, "DEFAULTPOINTLIMIT"))
newgtpointlimit = (INT32)i;
else if (fastcmp(word, "DEFAULTTIMELIMIT"))
newgttimelimit = (INT32)i;
// Level platter
else if (fastcmp(word, "HEADERCOLOR") || fastcmp(word, "HEADERCOLOUR"))
newgtleftcolor = newgtrightcolor = (UINT8)get_number(word2);
else if (fastcmp(word, "HEADERLEFTCOLOR") || fastcmp(word, "HEADERLEFTCOLOUR"))
newgtleftcolor = (UINT8)get_number(word2);
else if (fastcmp(word, "HEADERRIGHTCOLOR") || fastcmp(word, "HEADERRIGHTCOLOUR"))
newgtrightcolor = (UINT8)get_number(word2);
// Rankings type
else if (fastcmp(word, "RANKINGTYPE"))
{
// Case insensitive
newgtrankingstype = (int)get_number(word2);
}
// Intermission type
else if (fastcmp(word, "INTERMISSIONTYPE"))
{
// Case sensitive
newgtinttype = (int)get_number(word2lwr);
}
// Type of level
else if (fastcmp(word, "TYPEOFLEVEL"))
{
if (i) // it's just a number
newgttol = (UINT32)i;
else
{
UINT16 tol = 0;
tmp = strtok(word2,",");
do {
for (i = 0; TYPEOFLEVEL[i].name; i++)
if (fasticmp(tmp, TYPEOFLEVEL[i].name))
break;
if (!TYPEOFLEVEL[i].name)
deh_warning("readgametype %s: unknown typeoflevel flag %s\n", gtname, tmp);
tol |= TYPEOFLEVEL[i].flag;
} while((tmp = strtok(NULL,",")) != NULL);
newgttol = tol;
}
}
// The SOC probably provided gametype rules as words,
// instead of using the RULES keyword.
// Like for example "NOSPECTATORSPAWN = TRUE".
// This is completely valid, and looks better anyway.
else
{
UINT32 wordgt = 0;
for (j = 0; GAMETYPERULE_LIST[j]; j++)
if (fastcmp(word, GAMETYPERULE_LIST[j])) {
if (!j) // GTR_CAMPAIGN
wordgt |= 1;
else
wordgt |= (1<<j);
if (i || word2[0] == 'T' || word2[0] == 'Y')
newgtrules |= wordgt;
break;
}
if (!wordgt)
deh_warning("readgametype %s: unknown word '%s'", gtname, word);
}
}
} while (!myfeof(f)); // finish when the line is empty
// Free strings.
Z_Free(s);
if (word2lwr)
Z_Free(word2lwr);
// Ran out of gametype slots
if (gametypecount == NUMGAMETYPEFREESLOTS)
{
CONS_Alert(CONS_WARNING, "Ran out of free gametype slots!\n");
return;
}
// Add the new gametype
newgtidx = G_AddGametype(newgtrules);
G_AddGametypeTOL(newgtidx, newgttol);
G_SetGametypeDescription(newgtidx, gtdescription, newgtleftcolor, newgtrightcolor);
// Not covered by G_AddGametype alone.
if (newgtrankingstype == -1)
newgtrankingstype = newgtidx;
gametyperankings[newgtidx] = newgtrankingstype;
intermissiontypes[newgtidx] = newgtinttype;
pointlimits[newgtidx] = newgtpointlimit;
timelimits[newgtidx] = newgttimelimit;
// Write the new gametype name.
Gametype_Names[newgtidx] = Z_StrDup((const char *)gtname);
// Write the constant name.
if (gtconst[0] == '\0')
strncpy(gtconst, gtname, MAXLINELEN);
G_AddGametypeConstant(newgtidx, (const char *)gtconst);
// Update gametype_cons_t accordingly.
G_UpdateGametypeSelections();
CONS_Printf("Added gametype %s\n", Gametype_Names[newgtidx]);
}
static const struct { static const struct {
const char *name; const char *name;
const mobjtype_t type; const mobjtype_t type;
@ -1393,7 +1613,7 @@ static void readlevelheader(MYFILE *f, INT32 num)
else if (fastcmp(word, "TYPEOFLEVEL")) else if (fastcmp(word, "TYPEOFLEVEL"))
{ {
if (i) // it's just a number if (i) // it's just a number
mapheaderinfo[num-1]->typeoflevel = (UINT16)i; mapheaderinfo[num-1]->typeoflevel = (UINT32)i;
else else
{ {
UINT16 tol = 0; UINT16 tol = 0;
@ -1518,10 +1738,27 @@ static void readlevelheader(MYFILE *f, INT32 num)
deh_warning("Level header %d: invalid bonus type number %d", num, i); deh_warning("Level header %d: invalid bonus type number %d", num, i);
} }
// Title card
else if (fastcmp(word, "TITLECARDZIGZAG"))
{
deh_strlcpy(mapheaderinfo[num-1]->ltzzpatch, word2,
sizeof(mapheaderinfo[num-1]->ltzzpatch), va("Level header %d: title card zigzag patch name", num));
}
else if (fastcmp(word, "TITLECARDZIGZAGTEXT"))
{
deh_strlcpy(mapheaderinfo[num-1]->ltzztext, word2,
sizeof(mapheaderinfo[num-1]->ltzztext), va("Level header %d: title card zigzag text patch name", num));
}
else if (fastcmp(word, "TITLECARDACTDIAMOND"))
{
deh_strlcpy(mapheaderinfo[num-1]->ltactdiamond, word2,
sizeof(mapheaderinfo[num-1]->ltactdiamond), va("Level header %d: title card act diamond patch name", num));
}
else if (fastcmp(word, "MAXBONUSLIVES")) else if (fastcmp(word, "MAXBONUSLIVES"))
mapheaderinfo[num-1]->maxbonuslives = (SINT8)i; mapheaderinfo[num-1]->maxbonuslives = (SINT8)i;
else if (fastcmp(word, "LEVELFLAGS")) else if (fastcmp(word, "LEVELFLAGS"))
mapheaderinfo[num-1]->levelflags = (UINT8)i; mapheaderinfo[num-1]->levelflags = (UINT16)i;
else if (fastcmp(word, "MENUFLAGS")) else if (fastcmp(word, "MENUFLAGS"))
mapheaderinfo[num-1]->menuflags = (UINT8)i; mapheaderinfo[num-1]->menuflags = (UINT8)i;
@ -2671,11 +2908,9 @@ static actionpointer_t actionpointers[] =
{{A_SpawnObjectRelative}, "A_SPAWNOBJECTRELATIVE"}, {{A_SpawnObjectRelative}, "A_SPAWNOBJECTRELATIVE"},
{{A_ChangeAngleRelative}, "A_CHANGEANGLERELATIVE"}, {{A_ChangeAngleRelative}, "A_CHANGEANGLERELATIVE"},
{{A_ChangeAngleAbsolute}, "A_CHANGEANGLEABSOLUTE"}, {{A_ChangeAngleAbsolute}, "A_CHANGEANGLEABSOLUTE"},
#ifdef ROTSPRITE
{{A_RollAngle}, "A_ROLLANGLE"}, {{A_RollAngle}, "A_ROLLANGLE"},
{{A_ChangeRollAngleRelative},"A_CHANGEROLLANGLERELATIVE"}, {{A_ChangeRollAngleRelative},"A_CHANGEROLLANGLERELATIVE"},
{{A_ChangeRollAngleAbsolute},"A_CHANGEROLLANGLEABSOLUTE"}, {{A_ChangeRollAngleAbsolute},"A_CHANGEROLLANGLEABSOLUTE"},
#endif
{{A_PlaySound}, "A_PLAYSOUND"}, {{A_PlaySound}, "A_PLAYSOUND"},
{{A_FindTarget}, "A_FINDTARGET"}, {{A_FindTarget}, "A_FINDTARGET"},
{{A_FindTracer}, "A_FINDTRACER"}, {{A_FindTracer}, "A_FINDTRACER"},
@ -4153,6 +4388,7 @@ static void ignorelines(MYFILE *f)
static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile) static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
{ {
char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL); char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
char textline[MAXLINELEN];
char *word; char *word;
char *word2; char *word2;
INT32 i; INT32 i;
@ -4173,6 +4409,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
char *traverse; char *traverse;
myfgets(s, MAXLINELEN, f); myfgets(s, MAXLINELEN, f);
memcpy(textline, s, MAXLINELEN);
if (s[0] == '\n' || s[0] == '#') if (s[0] == '\n' || s[0] == '#')
continue; continue;
@ -4361,6 +4598,36 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
ignorelines(f); ignorelines(f);
} }
} }
else if (fastcmp(word, "GAMETYPE"))
{
// Get the gametype name from textline
// instead of word2, so that gametype names
// aren't allcaps
INT32 c;
for (c = 0; c < MAXLINELEN; c++)
{
if (textline[c] == '\0')
break;
if (textline[c] == ' ')
{
char *gtname = (textline+c+1);
if (gtname)
{
// remove funny characters
INT32 j;
for (j = 0; j < (MAXLINELEN - c); j++)
{
if (gtname[j] == '\0')
break;
if (gtname[j] < 32)
gtname[j] = '\0';
}
readgametype(f, gtname);
}
break;
}
}
}
else if (fastcmp(word, "CUTSCENE")) else if (fastcmp(word, "CUTSCENE"))
{ {
if (i > 0 && i < 129) if (i > 0 && i < 129)
@ -4460,20 +4727,34 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
ignorelines(f); ignorelines(f);
} }
} }
// Last I heard this crashes the game if you try to use it else if (fastcmp(word, "SRB2"))
// so this is disabled for now
// -- Monster Iestyn
/* else if (fastcmp(word, "SRB2"))
{ {
INT32 ver = searchvalue(strtok(NULL, "\n")); if (isdigit(word2[0]))
if (ver != PATCHVERSION) {
deh_warning("Patch is for SRB2 version %d,\nonly version %d is supported", ver, PATCHVERSION); i = atoi(word2);
if (i != PATCHVERSION)
{
deh_warning(
"Patch is for SRB2 version %d, "
"only version %d is supported",
i,
PATCHVERSION
);
}
}
else
{
deh_warning(
"SRB2 version definition has incorrect format, "
"use \"SRB2 %d\"",
PATCHVERSION
);
}
} }
// Clear all data in certain locations (mostly for unlocks) // Clear all data in certain locations (mostly for unlocks)
// Unless you REALLY want to piss people off, // Unless you REALLY want to piss people off,
// define a custom gamedata /before/ doing this!! // define a custom gamedata /before/ doing this!!
// (then again, modifiedgame will prevent game data saving anyway) // (then again, modifiedgame will prevent game data saving anyway)
*/
else if (fastcmp(word, "CLEAR")) else if (fastcmp(word, "CLEAR"))
{ {
boolean clearall = (fastcmp(word2, "ALL")); boolean clearall = (fastcmp(word2, "ALL"));
@ -4523,11 +4804,13 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
if (introchanged) if (introchanged)
{ {
menuactive = false; menuactive = false;
I_UpdateMouseGrab();
COM_BufAddText("playintro"); COM_BufAddText("playintro");
} }
else if (titlechanged) else if (titlechanged)
{ {
menuactive = false; menuactive = false;
I_UpdateMouseGrab();
COM_BufAddText("exitgame"); // Command_ExitGame_f() but delayed COM_BufAddText("exitgame"); // Command_ExitGame_f() but delayed
} }
} }
@ -8543,9 +8826,11 @@ static const char *const MOBJEFLAG_LIST[] = {
"JUSTSTEPPEDDOWN", // used for ramp sectors "JUSTSTEPPEDDOWN", // used for ramp sectors
"VERTICALFLIP", // Vertically flip sprite/allow upside-down physics "VERTICALFLIP", // Vertically flip sprite/allow upside-down physics
"GOOWATER", // Goo water "GOOWATER", // Goo water
"TOUCHLAVA", // The mobj is touching a lava block
"PUSHED", // Mobj was already pushed this tic "PUSHED", // Mobj was already pushed this tic
"SPRUNG", // Mobj was already sprung this tic "SPRUNG", // Mobj was already sprung this tic
"APPLYPMOMZ", // Platform movement "APPLYPMOMZ", // Platform movement
"TRACERANGLE", // Compute and trigger on mobj angle relative to tracer
NULL NULL
}; };
@ -8617,6 +8902,42 @@ static const char *const PLAYERFLAG_LIST[] = {
NULL // stop loop here. NULL // stop loop here.
}; };
static const char *const GAMETYPERULE_LIST[] = {
"CAMPAIGN",
"RINGSLINGER",
"SPECTATORS",
"LIVES",
"TEAMS",
"FIRSTPERSON",
"POWERSTONES",
"TEAMFLAGS",
"FRIENDLY",
"SPECIALSTAGES",
"EMERALDTOKENS",
"EMERALDHUNT",
"RACE",
"TAG",
"POINTLIMIT",
"TIMELIMIT",
"OVERTIME",
"HURTMESSAGES",
"FRIENDLYFIRE",
"STARTCOUNTDOWN",
"HIDEFROZEN",
"BLINDFOLDED",
"RESPAWNDELAY",
"PITYSHIELD",
"DEATHPENALTY",
"NOSPECTATORSPAWN",
"DEATHMATCHSTARTS",
"SPAWNINVUL",
"SPAWNENEMIES",
"ALLOWEXIT",
"NOTITLECARD",
"CUTSCENES",
NULL
};
#ifdef HAVE_BLUA #ifdef HAVE_BLUA
// Linedef flags // Linedef flags
static const char *const ML_LIST[16] = { static const char *const ML_LIST[16] = {
@ -9032,21 +9353,6 @@ struct {
{"tr_trans90",tr_trans90}, {"tr_trans90",tr_trans90},
{"NUMTRANSMAPS",NUMTRANSMAPS}, {"NUMTRANSMAPS",NUMTRANSMAPS},
// Type of levels
{"TOL_SP",TOL_SP},
{"TOL_COOP",TOL_COOP},
{"TOL_COMPETITION",TOL_COMPETITION},
{"TOL_RACE",TOL_RACE},
{"TOL_MATCH",TOL_MATCH},
{"TOL_TAG",TOL_TAG},
{"TOL_CTF",TOL_CTF},
{"TOL_CUSTOM",TOL_CUSTOM},
{"TOL_2D",TOL_2D},
{"TOL_MARIO",TOL_MARIO},
{"TOL_NIGHTS",TOL_NIGHTS},
{"TOL_ERZ3",TOL_ERZ3},
{"TOL_XMAS",TOL_XMAS},
// Level flags // Level flags
{"LF_SCRIPTISFILE",LF_SCRIPTISFILE}, {"LF_SCRIPTISFILE",LF_SCRIPTISFILE},
{"LF_SPEEDMUSIC",LF_SPEEDMUSIC}, {"LF_SPEEDMUSIC",LF_SPEEDMUSIC},
@ -9155,6 +9461,10 @@ struct {
{"SF_MULTIABILITY",SF_MULTIABILITY}, {"SF_MULTIABILITY",SF_MULTIABILITY},
{"SF_NONIGHTSROTATION",SF_NONIGHTSROTATION}, {"SF_NONIGHTSROTATION",SF_NONIGHTSROTATION},
// Dashmode constants
{"DASHMODE_THRESHOLD",DASHMODE_THRESHOLD},
{"DASHMODE_MAX",DASHMODE_MAX},
// Character abilities! // Character abilities!
// Primary // Primary
{"CA_NONE",CA_NONE}, // now slot 0! {"CA_NONE",CA_NONE}, // now slot 0!
@ -9229,15 +9539,16 @@ struct {
{"DMG_CANHURTSELF",DMG_CANHURTSELF}, {"DMG_CANHURTSELF",DMG_CANHURTSELF},
{"DMG_DEATHMASK",DMG_DEATHMASK}, {"DMG_DEATHMASK",DMG_DEATHMASK},
// Gametypes, for use with global var "gametype" // Intermission types
{"GT_COOP",GT_COOP}, {"int_none",int_none},
{"GT_COMPETITION",GT_COMPETITION}, {"int_coop",int_coop},
{"GT_RACE",GT_RACE}, {"int_match",int_match},
{"GT_MATCH",GT_MATCH}, {"int_teammatch",int_teammatch},
{"GT_TEAMMATCH",GT_TEAMMATCH}, //{"int_tag",int_tag},
{"GT_TAG",GT_TAG}, {"int_ctf",int_ctf},
{"GT_HIDEANDSEEK",GT_HIDEANDSEEK}, {"int_spec",int_spec},
{"GT_CTF",GT_CTF}, {"int_race",int_race},
{"int_comp",int_comp},
// Jingles (jingletype_t) // Jingles (jingletype_t)
{"JT_NONE",JT_NONE}, {"JT_NONE",JT_NONE},
@ -9410,12 +9721,10 @@ struct {
{"DI_SOUTHEAST",DI_SOUTHEAST}, {"DI_SOUTHEAST",DI_SOUTHEAST},
{"NUMDIRS",NUMDIRS}, {"NUMDIRS",NUMDIRS},
#ifdef ROTSPRITE
// Sprite rotation axis (rotaxis_t) // Sprite rotation axis (rotaxis_t)
{"ROTAXIS_X",ROTAXIS_X}, {"ROTAXIS_X",ROTAXIS_X},
{"ROTAXIS_Y",ROTAXIS_Y}, {"ROTAXIS_Y",ROTAXIS_Y},
{"ROTAXIS_Z",ROTAXIS_Z}, {"ROTAXIS_Z",ROTAXIS_Z},
#endif
// Buttons (ticcmd_t) // Buttons (ticcmd_t)
{"BT_WEAPONMASK",BT_WEAPONMASK}, //our first four bits. {"BT_WEAPONMASK",BT_WEAPONMASK}, //our first four bits.
@ -9446,6 +9755,7 @@ struct {
{"CV_HIDEN",CV_HIDEN}, {"CV_HIDEN",CV_HIDEN},
{"CV_HIDDEN",CV_HIDEN}, {"CV_HIDDEN",CV_HIDEN},
{"CV_CHEAT",CV_CHEAT}, {"CV_CHEAT",CV_CHEAT},
{"CV_NOLUA",CV_NOLUA},
// v_video flags // v_video flags
{"V_NOSCALEPATCH",V_NOSCALEPATCH}, {"V_NOSCALEPATCH",V_NOSCALEPATCH},
@ -9530,7 +9840,7 @@ struct {
}; };
static mobjtype_t get_mobjtype(const char *word) static mobjtype_t get_mobjtype(const char *word)
{ // Returns the vlaue of MT_ enumerations { // Returns the value of MT_ enumerations
mobjtype_t i; mobjtype_t i;
if (*word >= '0' && *word <= '9') if (*word >= '0' && *word <= '9')
return atoi(word); return atoi(word);
@ -9682,8 +9992,22 @@ static menutype_t get_menutype(const char *word)
} }
#ifndef HAVE_BLUA #ifndef HAVE_BLUA
static INT16 get_gametype(const char *word)
{ // Returns the value of GT_ enumerations
INT16 i;
if (*word >= '0' && *word <= '9')
return atoi(word);
if (fastncmp("GT_",word,3))
word += 3; // take off the GT_
for (i = 0; i < NUMGAMETYPES; i++)
if (fastcmp(word, Gametype_ConstantNames[i]+3))
return i;
deh_warning("Couldn't find gametype named 'GT_%s'",word);
return GT_COOP;
}
static powertype_t get_power(const char *word) static powertype_t get_power(const char *word)
{ // Returns the vlaue of pw_ enumerations { // Returns the value of pw_ enumerations
powertype_t i; powertype_t i;
if (*word >= '0' && *word <= '9') if (*word >= '0' && *word <= '9')
return atoi(word); return atoi(word);
@ -9877,11 +10201,42 @@ static fixed_t find_const(const char **rword)
free(word); free(word);
return r; return r;
} }
else if (fastncmp("MN_",word,4)) { else if (fastncmp("MN_",word,3)) {
r = get_menutype(word); r = get_menutype(word);
free(word); free(word);
return r; return r;
} }
else if (fastncmp("GT_",word,4)) {
r = get_gametype(word);
free(word);
return r;
}
else if (fastncmp("GTR_", word, 4)) {
char *p = word+4;
for (i = 0; GAMETYPERULE_LIST[i]; i++)
if (fastcmp(p, GAMETYPERULE_LIST[i])) {
free(word);
return (1<<i);
}
// Not found error
const_warning("game type rule",word);
free(word);
return 0;
}
else if (fastncmp("TOL_", word, 4)) {
char *p = word+4;
for (i = 0; TYPEOFLEVEL[i].name; i++)
if (fastcmp(p, TYPEOFLEVEL[i].name)) {
free(word);
return TYPEOFLEVEL[i].flag;
}
// Not found error
const_warning("typeoflevel",word);
free(word);
return 0;
}
else if (fastncmp("HUD_",word,4)) { else if (fastncmp("HUD_",word,4)) {
r = get_huditem(word); r = get_huditem(word);
free(word); free(word);
@ -10091,6 +10446,20 @@ static inline int lib_freeslot(lua_State *L)
} }
r++; r++;
} }
else if (fastcmp(type, "TOL"))
{
if (lastcustomtol > 31)
CONS_Alert(CONS_WARNING, "Ran out of free typeoflevel slots!\n");
else
{
UINT32 newtol = (1<<lastcustomtol);
CONS_Printf("TypeOfLevel TOL_%s allocated.\n",word);
G_AddTOL(newtol, word);
lua_pushinteger(L, newtol);
lastcustomtol++;
r++;
}
}
Z_Free(s); Z_Free(s);
lua_remove(L, 1); lua_remove(L, 1);
continue; continue;
@ -10195,6 +10564,36 @@ static inline int lib_getenum(lua_State *L)
if (mathlib) return luaL_error(L, "playerflag '%s' could not be found.\n", word); if (mathlib) return luaL_error(L, "playerflag '%s' could not be found.\n", word);
return 0; return 0;
} }
else if (fastncmp("GT_", word, 3)) {
p = word;
for (i = 0; Gametype_ConstantNames[i]; i++)
if (fastcmp(p, Gametype_ConstantNames[i])) {
lua_pushinteger(L, i);
return 1;
}
if (mathlib) return luaL_error(L, "gametype '%s' could not be found.\n", word);
return 0;
}
else if (fastncmp("GTR_", word, 4)) {
p = word+4;
for (i = 0; GAMETYPERULE_LIST[i]; i++)
if (fastcmp(p, GAMETYPERULE_LIST[i])) {
lua_pushinteger(L, ((lua_Integer)1<<i));
return 1;
}
if (mathlib) return luaL_error(L, "game type rule '%s' could not be found.\n", word);
return 0;
}
else if (fastncmp("TOL_", word, 4)) {
p = word+4;
for (i = 0; TYPEOFLEVEL[i].name; i++)
if (fastcmp(p, TYPEOFLEVEL[i].name)) {
lua_pushinteger(L, TYPEOFLEVEL[i].flag);
return 1;
}
if (mathlib) return luaL_error(L, "typeoflevel '%s' could not be found.\n", word);
return 0;
}
else if (fastncmp("ML_", word, 3)) { else if (fastncmp("ML_", word, 3)) {
p = word+3; p = word+3;
for (i = 0; i < 16; i++) for (i = 0; i < 16; i++)
@ -10432,126 +10831,7 @@ static inline int lib_getenum(lua_State *L)
// DYNAMIC variables too!! // DYNAMIC variables too!!
// Try not to add anything that would break netgames or timeattack replays here. // Try not to add anything that would break netgames or timeattack replays here.
// You know, like consoleplayer, displayplayer, secondarydisplayplayer, or gametime. // You know, like consoleplayer, displayplayer, secondarydisplayplayer, or gametime.
if (fastcmp(word,"gamemap")) { return LUA_PushGlobals(L, word);
lua_pushinteger(L, gamemap);
return 1;
} else if (fastcmp(word,"maptol")) {
lua_pushinteger(L, maptol);
return 1;
} else if (fastcmp(word,"ultimatemode")) {
lua_pushboolean(L, ultimatemode != 0);
return 1;
} else if (fastcmp(word,"mariomode")) {
lua_pushboolean(L, mariomode != 0);
return 1;
} else if (fastcmp(word,"twodlevel")) {
lua_pushboolean(L, twodlevel != 0);
return 1;
} else if (fastcmp(word,"circuitmap")) {
lua_pushboolean(L, circuitmap);
return 1;
} else if (fastcmp(word,"netgame")) {
lua_pushboolean(L, netgame);
return 1;
} else if (fastcmp(word,"multiplayer")) {
lua_pushboolean(L, multiplayer);
return 1;
} else if (fastcmp(word,"modeattacking")) {
lua_pushboolean(L, modeattacking);
return 1;
} else if (fastcmp(word,"splitscreen")) {
lua_pushboolean(L, splitscreen);
return 1;
} else if (fastcmp(word,"gamecomplete")) {
lua_pushboolean(L, gamecomplete);
return 1;
} else if (fastcmp(word,"devparm")) {
lua_pushboolean(L, devparm);
return 1;
} else if (fastcmp(word,"modifiedgame")) {
lua_pushboolean(L, modifiedgame && !savemoddata);
return 1;
} else if (fastcmp(word,"menuactive")) {
lua_pushboolean(L, menuactive);
return 1;
} else if (fastcmp(word,"paused")) {
lua_pushboolean(L, paused);
return 1;
} else if (fastcmp(word,"titlemap")) {
lua_pushinteger(L, titlemap);
return 1;
} else if (fastcmp(word,"titlemapinaction")) {
lua_pushboolean(L, (titlemapinaction != TITLEMAP_OFF));
return 1;
} else if (fastcmp(word,"gametype")) {
lua_pushinteger(L, gametype);
return 1;
} else if (fastcmp(word,"leveltime")) {
lua_pushinteger(L, leveltime);
return 1;
} else if (fastcmp(word,"curWeather")) {
lua_pushinteger(L, curWeather);
return 1;
} else if (fastcmp(word,"globalweather")) {
lua_pushinteger(L, globalweather);
return 1;
} else if (fastcmp(word,"levelskynum")) {
lua_pushinteger(L, levelskynum);
return 1;
} else if (fastcmp(word,"globallevelskynum")) {
lua_pushinteger(L, globallevelskynum);
return 1;
} else if (fastcmp(word,"mapmusname")) {
lua_pushstring(L, mapmusname);
return 1;
} else if (fastcmp(word,"mapmusflags")) {
lua_pushinteger(L, mapmusflags);
return 1;
} else if (fastcmp(word,"mapmusposition")) {
lua_pushinteger(L, mapmusposition);
return 1;
// local player variables, by popular request
} else if (fastcmp(word,"consoleplayer")) { // player controlling console (aka local player 1)
if (consoleplayer < 0 || !playeringame[consoleplayer])
return 0;
LUA_PushUserdata(L, &players[consoleplayer], META_PLAYER);
return 1;
} else if (fastcmp(word,"displayplayer")) { // player visible on screen (aka display player 1)
if (displayplayer < 0 || !playeringame[displayplayer])
return 0;
LUA_PushUserdata(L, &players[displayplayer], META_PLAYER);
return 1;
} else if (fastcmp(word,"secondarydisplayplayer")) { // local/display player 2, for splitscreen
if (!splitscreen || secondarydisplayplayer < 0 || !playeringame[secondarydisplayplayer])
return 0;
LUA_PushUserdata(L, &players[secondarydisplayplayer], META_PLAYER);
return 1;
// end local player variables
} else if (fastcmp(word,"server")) {
if ((!multiplayer || !netgame) && !playeringame[serverplayer])
return 0;
LUA_PushUserdata(L, &players[serverplayer], META_PLAYER);
return 1;
} else if (fastcmp(word,"admin")) { // BACKWARDS COMPATIBILITY HACK: This was replaced with IsPlayerAdmin(), but some 2.1 Lua scripts still use the admin variable. It now points to the first admin player in the array.
LUA_Deprecated(L, "admin", "IsPlayerAdmin(player)");
if (!playeringame[adminplayers[0]] || IsPlayerAdmin(serverplayer))
return 0;
LUA_PushUserdata(L, &players[adminplayers[0]], META_PLAYER);
return 1;
} else if (fastcmp(word,"emeralds")) {
lua_pushinteger(L, emeralds);
return 1;
} else if (fastcmp(word,"gravity")) {
lua_pushinteger(L, gravity);
return 1;
} else if (fastcmp(word,"VERSIONSTRING")) {
lua_pushstring(L, VERSIONSTRING);
return 1;
} else if (fastcmp(word, "token")) {
lua_pushinteger(L, token);
return 1;
}
return 0;
} }
int LUA_EnumLib(lua_State *L) int LUA_EnumLib(lua_State *L)
@ -10618,6 +10898,8 @@ static int lib_getActionName(lua_State *L)
return luaL_typerror(L, 1, "action userdata or Lua function"); return luaL_typerror(L, 1, "action userdata or Lua function");
} }
int LUA_SOCLib(lua_State *L) int LUA_SOCLib(lua_State *L)
{ {
lua_register(L,"freeslot",lib_freeslot); lua_register(L,"freeslot",lib_freeslot);

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -47,7 +47,7 @@ extern const char *superactions[MAXRECURSION];
extern UINT8 superstack; extern UINT8 superstack;
// If the dehacked patch does not match this version, we throw a warning // If the dehacked patch does not match this version, we throw a warning
#define PATCHVERSION 210 #define PATCHVERSION 220
#define MAXLINELEN 1024 #define MAXLINELEN 1024

View file

@ -338,3 +338,8 @@ void I_StartupGraphics(void)
graphics_started = true; graphics_started = true;
} }
void I_StartupHardwareGraphics(void)
{
// oh yeah woo yeah oh yeah woo yeah oh yeah woo yeah oh yeah woo yeah oh yeah woo yeah oh yeah woo yeah oh yeah woo y
}

View file

@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*- // Emacs style mode select -*- C++ -*-
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// Copyright (C) 2005-2018 by Sonic Team Jr. // Copyright (C) 2005-2019 by Sonic Team Junior.
// //
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License

View file

@ -378,6 +378,11 @@ INT32 VID_SetMode (INT32 modenum) //, UINT8 *palette)
return 1; return 1;
} }
void VID_CheckRenderer(void)
{
// ..............
}
// converts a segm:offs 32bit pair to a 32bit flat ptr // converts a segm:offs 32bit pair to a 32bit flat ptr

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -127,9 +127,13 @@
#ifdef LOGMESSAGES #ifdef LOGMESSAGES
extern FILE *logstream; extern FILE *logstream;
extern char logfilename[1024];
#endif #endif
#define DEVELOP // Disable this for release builds to remove excessive cheat commands and enable MD5 checking and stuff, all in one go. :3 /* A mod name to further distinguish versions. */
#define SRB2APPLICATION "SRB2"
//#define DEVELOP // Disable this for release builds to remove excessive cheat commands and enable MD5 checking and stuff, all in one go. :3
#ifdef DEVELOP #ifdef DEVELOP
#define VERSION 0 // Game version #define VERSION 0 // Game version
#define SUBVERSION 0 // more precise version number #define SUBVERSION 0 // more precise version number
@ -140,8 +144,8 @@ extern FILE *logstream;
#else #else
#define VERSION 202 // Game version #define VERSION 202 // Game version
#define SUBVERSION 0 // more precise version number #define SUBVERSION 0 // more precise version number
#define VERSIONSTRING "v2.2" #define VERSIONSTRING "v2.2.0"
#define VERSIONSTRINGW L"v2.2" #define VERSIONSTRINGW L"v2.2.0"
// Hey! If you change this, add 1 to the MODVERSION below! // Hey! If you change this, add 1 to the MODVERSION below!
// Otherwise we can't force updates! // Otherwise we can't force updates!
#endif #endif
@ -199,14 +203,14 @@ extern FILE *logstream;
// The Modification ID; must be obtained from Rob ( https://mb.srb2.org/private.php?do=newpm&u=546 ). // The Modification ID; must be obtained from Rob ( https://mb.srb2.org/private.php?do=newpm&u=546 ).
// DO NOT try to set this otherwise, or your modification will be unplayable through the Master Server. // DO NOT try to set this otherwise, or your modification will be unplayable through the Master Server.
// "12" is the default mod ID for version 2.1 // "18" is the default mod ID for version 2.2
#define MODID 12 #define MODID 18
// The Modification Version, starting from 1. Do not follow your version string for this, // The Modification Version, starting from 1. Do not follow your version string for this,
// it's only for detection of the version the player is using so the MS can alert them of an update. // it's only for detection of the version the player is using so the MS can alert them of an update.
// Only set it higher, not lower, obviously. // Only set it higher, not lower, obviously.
// Note that we use this to help keep internal testing in check; this is why v2.1.0 is not version "1". // Note that we use this to help keep internal testing in check; this is why v2.2.0 is not version "1".
#define MODVERSION 30 #define MODVERSION 40
// To version config.cfg, MAJOREXECVERSION is set equal to MODVERSION automatically. // To version config.cfg, MAJOREXECVERSION is set equal to MODVERSION automatically.
// Increment MINOREXECVERSION whenever a config change is needed that does not correspond // Increment MINOREXECVERSION whenever a config change is needed that does not correspond
@ -460,6 +464,8 @@ extern void *(*M_Memcpy)(void* dest, const void* src, size_t n) FUNCNONNULL;
char *va(const char *format, ...) FUNCPRINTF; char *va(const char *format, ...) FUNCPRINTF;
char *M_GetToken(const char *inputString); char *M_GetToken(const char *inputString);
void M_UnGetToken(void); void M_UnGetToken(void);
UINT32 M_GetTokenPos(void);
void M_SetTokenPos(UINT32 newPos);
char *sizeu1(size_t num); char *sizeu1(size_t num);
char *sizeu2(size_t num); char *sizeu2(size_t num);
char *sizeu3(size_t num); char *sizeu3(size_t num);
@ -623,13 +629,20 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
/// SRB2CB itself ported this from PrBoom+ /// SRB2CB itself ported this from PrBoom+
#define NEWCLIP #define NEWCLIP
/// Cache patches in Lua in a way that renderer switching will work flawlessly.
//#define LUA_PATCH_SAFETY
/// Sprite rotation /// Sprite rotation
#define ROTSPRITE #define ROTSPRITE
#define ROTANGLES 24 // Needs to be a divisor of 360 (45, 60, 90, 120...) #define ROTANGLES 72 // Needs to be a divisor of 360 (45, 60, 90, 120...)
#define ROTANGDIFF (360 / ROTANGLES) #define ROTANGDIFF (360 / ROTANGLES)
/// PNG support
#ifndef HAVE_PNG #ifndef HAVE_PNG
#define NO_PNG_LUMPS #define NO_PNG_LUMPS
#endif #endif
/// Render flats on walls
#define WALLFLATS
#endif // __DOOMDEF__ #endif // __DOOMDEF__

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -39,7 +39,7 @@ extern UINT32 mapmusposition;
#define MUSIC_FORCERESET 0x4000 // -*-------------- #define MUSIC_FORCERESET 0x4000 // -*--------------
// Use other bits if necessary. // Use other bits if necessary.
extern INT16 maptol; extern UINT32 maptol;
extern UINT8 globalweather; extern UINT8 globalweather;
extern INT32 curWeather; extern INT32 curWeather;
extern INT32 cursaveslot; extern INT32 cursaveslot;
@ -84,6 +84,9 @@ extern boolean addedtogame; // true after the server has added you
extern boolean multiplayer; extern boolean multiplayer;
extern INT16 gametype; extern INT16 gametype;
extern UINT32 gametyperules;
extern INT16 gametypecount;
extern boolean splitscreen; extern boolean splitscreen;
extern boolean circuitmap; // Does this level have 'circuit mode'? extern boolean circuitmap; // Does this level have 'circuit mode'?
extern boolean fromlevelselect; extern boolean fromlevelselect;
@ -284,7 +287,7 @@ typedef struct
char lvlttl[22]; ///< Level name without "Zone". (21 character limit instead of 32, 21 characters can display on screen max anyway) char lvlttl[22]; ///< Level name without "Zone". (21 character limit instead of 32, 21 characters can display on screen max anyway)
char subttl[33]; ///< Subtitle for level char subttl[33]; ///< Subtitle for level
UINT8 actnum; ///< Act number or 0 for none. UINT8 actnum; ///< Act number or 0 for none.
UINT16 typeoflevel; ///< Combination of typeoflevel flags. UINT32 typeoflevel; ///< Combination of typeoflevel flags.
INT16 nextlevel; ///< Map number of next level, or 1100-1102 to end. INT16 nextlevel; ///< Map number of next level, or 1100-1102 to end.
char musname[7]; ///< Music track to play. "" for no music. char musname[7]; ///< 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. UINT16 mustrack; ///< Subsong to play. Only really relevant for music modules and specific formats supported by GME. 0 to ignore.
@ -310,12 +313,17 @@ typedef struct
SINT8 bonustype; ///< What type of bonus does this level have? (-1 for null.) SINT8 bonustype; ///< What type of bonus does this level have? (-1 for null.)
SINT8 maxbonuslives; ///< How many bonus lives to award at Intermission? (-1 for unlimited.) SINT8 maxbonuslives; ///< How many bonus lives to award at Intermission? (-1 for unlimited.)
UINT8 levelflags; ///< LF_flags: merged booleans into one UINT8 for space, see below 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 UINT8 menuflags; ///< LF2_flags: options that affect record attack / nights mode menus
char selectheading[22]; ///< Level select heading. Allows for controllable grouping. char selectheading[22]; ///< Level select heading. Allows for controllable grouping.
UINT16 startrings; ///< Number of rings players start with. UINT16 startrings; ///< Number of rings players start with.
// Title card.
char ltzzpatch[8]; ///< Zig zag patch.
char ltzztext[8]; ///< Zig zag text.
char ltactdiamond[8]; ///< Act diamond.
// Freed animals stuff. // Freed animals stuff.
UINT8 numFlickies; ///< Internal. For freed flicky support. UINT8 numFlickies; ///< Internal. For freed flicky support.
mobjtype_t *flickies; ///< List of freeable flickies in this level. Allocated dynamically for space reasons. Be careful. mobjtype_t *flickies; ///< List of freeable flickies in this level. Allocated dynamically for space reasons. Be careful.
@ -361,6 +369,73 @@ typedef struct
extern mapheader_t* mapheaderinfo[NUMMAPS]; extern mapheader_t* mapheaderinfo[NUMMAPS];
// Gametypes
#define NUMGAMETYPEFREESLOTS 128
enum GameType
{
GT_COOP = 0, // also used in single player
GT_COMPETITION, // Classic "Race"
GT_RACE,
GT_MATCH,
GT_TEAMMATCH,
GT_TAG,
GT_HIDEANDSEEK,
GT_CTF, // capture the flag
GT_FIRSTFREESLOT,
GT_LASTFREESLOT = GT_FIRSTFREESLOT + NUMGAMETYPEFREESLOTS - 1,
NUMGAMETYPES
};
// If you alter this list, update dehacked.c, MISC_ChangeGameTypeMenu in m_menu.c, and Gametype_Names in g_game.c
// Gametype rules
enum GameTypeRules
{
GTR_CAMPAIGN = 1, // Linear Co-op map progression, don't allow random maps
GTR_RINGSLINGER = 1<<1, // Outside of Co-op, Competition, and Race (overriden by cv_ringslinger)
GTR_SPECTATORS = 1<<2, // Outside of Co-op, Competition, and Race
GTR_LIVES = 1<<3, // Co-op and Competition
GTR_TEAMS = 1<<4, // Team Match, CTF
GTR_FIRSTPERSON = 1<<5, // First person camera
GTR_POWERSTONES = 1<<6, // Power stones (Match and CTF)
GTR_TEAMFLAGS = 1<<7, // Gametype has team flags (CTF)
GTR_FRIENDLY = 1<<8, // Co-op
GTR_SPECIALSTAGES = 1<<9, // Allow special stages
GTR_EMERALDTOKENS = 1<<10, // Spawn emerald tokens
GTR_EMERALDHUNT = 1<<11, // Emerald Hunt
GTR_RACE = 1<<12, // Race and Competition
GTR_TAG = 1<<13, // Tag and Hide and Seek
GTR_POINTLIMIT = 1<<14, // Ringslinger point limit
GTR_TIMELIMIT = 1<<15, // Ringslinger time limit
GTR_OVERTIME = 1<<16, // Allow overtime
GTR_HURTMESSAGES = 1<<17, // Hit and death messages
GTR_FRIENDLYFIRE = 1<<18, // Always allow friendly fire
GTR_STARTCOUNTDOWN = 1<<19, // Hide time countdown (Tag and Hide and Seek)
GTR_HIDEFROZEN = 1<<20, // Frozen after hide time (Hide and Seek, but not Tag)
GTR_BLINDFOLDED = 1<<21, // Blindfolded view (Tag and Hide and Seek)
GTR_RESPAWNDELAY = 1<<22, // Respawn delay
GTR_PITYSHIELD = 1<<23, // Award pity shield
GTR_DEATHPENALTY = 1<<24, // Death score penalty
GTR_NOSPECTATORSPAWN = 1<<25, // Use with GTR_SPECTATORS, spawn in the map instead of with the spectators
GTR_DEATHMATCHSTARTS = 1<<26, // Use deathmatch starts
GTR_SPAWNINVUL = 1<<27, // Babysitting deterrent
GTR_SPAWNENEMIES = 1<<28, // Spawn enemies
GTR_ALLOWEXIT = 1<<29, // Allow exit sectors
GTR_NOTITLECARD = 1<<30, // Don't show the title card
GTR_CUTSCENES = 1<<31, // Play cutscenes, ending, credits, and evaluation
};
// String names for gametypes
extern const char *Gametype_Names[NUMGAMETYPES];
extern const char *Gametype_ConstantNames[NUMGAMETYPES];
// Point and time limits for every gametype
extern INT32 pointlimits[NUMGAMETYPES];
extern INT32 timelimits[NUMGAMETYPES];
enum TypeOfLevel enum TypeOfLevel
{ {
TOL_SP = 0x01, ///< Single Player TOL_SP = 0x01, ///< Single Player
@ -376,36 +451,26 @@ enum TypeOfLevel
TOL_CTF = 0x40, ///< Capture the Flag TOL_CTF = 0x40, ///< Capture the Flag
// CTF default = 64 // CTF default = 64
TOL_CUSTOM = 0x80, ///< Custom (Lua-scripted, etc.) // 0x80 was here
TOL_2D = 0x0100, ///< 2D TOL_2D = 0x0100, ///< 2D
TOL_MARIO = 0x0200, ///< Mario TOL_MARIO = 0x0200, ///< Mario
TOL_NIGHTS = 0x0400, ///< NiGHTS TOL_NIGHTS = 0x0400, ///< NiGHTS
TOL_ERZ3 = 0x0800, ///< ERZ3 TOL_ERZ3 = 0x0800, ///< ERZ3
TOL_XMAS = 0x1000 ///< Christmas NiGHTS TOL_XMAS = 0x1000, ///< Christmas NiGHTS
}; };
// Gametypes #define NUMBASETOL 18
enum GameType #define NUMMAXTOL (18 + NUMGAMETYPEFREESLOTS)
typedef struct
{ {
GT_COOP = 0, // also used in single player const char *name;
GT_COMPETITION, // Classic "Race" UINT32 flag;
GT_RACE, } tolinfo_t;
extern tolinfo_t TYPEOFLEVEL[NUMMAXTOL];
GT_MATCH, extern INT32 numtolinfo;
GT_TEAMMATCH, extern UINT32 lastcustomtol;
GT_TAG,
GT_HIDEANDSEEK,
GT_CTF, // capture the flag
NUMGAMETYPES
};
// If you alter this list, update dehacked.c, MISC_ChangeGameTypeMenu in m_menu.c, and Gametype_Names in g_game.c
// String names for gametypes
extern const char *Gametype_Names[NUMGAMETYPES];
extern tic_t totalplaytime; extern tic_t totalplaytime;
@ -466,7 +531,8 @@ extern recorddata_t *mainrecords[NUMMAPS];
#define MV_ALLEMERALDS 4 #define MV_ALLEMERALDS 4
#define MV_ULTIMATE 8 #define MV_ULTIMATE 8
#define MV_PERFECT 16 #define MV_PERFECT 16
#define MV_MAX 31 // used in gamedata check #define MV_PERFECTRA 32
#define MV_MAX 63 // used in gamedata check, update whenever MV's are added
#define MV_MP 128 #define MV_MP 128
extern UINT8 mapvisited[NUMMAPS]; extern UINT8 mapvisited[NUMMAPS];

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -150,6 +150,8 @@ void I_GetJoystick2Events(void){}
void I_GetMouseEvents(void){} void I_GetMouseEvents(void){}
void I_UpdateMouseGrab(void){}
char *I_GetEnv(const char *name) char *I_GetEnv(const char *name)
{ {
(void)name; (void)name;

View file

@ -11,6 +11,7 @@ boolean allow_fullscreen = false;
consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
void I_StartupGraphics(void){} void I_StartupGraphics(void){}
void I_StartupHardwareGraphics(void){}
void I_ShutdownGraphics(void){} void I_ShutdownGraphics(void){}
@ -39,6 +40,11 @@ INT32 VID_SetMode(INT32 modenum)
return 0; return 0;
} }
void VID_CheckRenderer(void)
{
// ..............
}
const char *VID_GetModeName(INT32 modenum) const char *VID_GetModeName(INT32 modenum)
{ {
(void)modenum; (void)modenum;

View file

@ -1,6 +1,6 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 2014-2018 by Sonic Team Junior. // Copyright (C) 2014-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -530,78 +530,78 @@ static void F_IntroDrawScene(void)
case 0: case 0:
break; break;
case 1: case 1:
background = W_CachePatchName("INTRO1", PU_CACHE); background = W_CachePatchName("INTRO1", PU_PATCH);
break; break;
case 2: case 2:
background = W_CachePatchName("INTRO2", PU_CACHE); background = W_CachePatchName("INTRO2", PU_PATCH);
break; break;
case 3: case 3:
background = W_CachePatchName("INTRO3", PU_CACHE); background = W_CachePatchName("INTRO3", PU_PATCH);
break; break;
case 4: case 4:
background = W_CachePatchName("INTRO4", PU_CACHE); background = W_CachePatchName("INTRO4", PU_PATCH);
break; break;
case 5: case 5:
if (intro_curtime >= 5*TICRATE) if (intro_curtime >= 5*TICRATE)
background = W_CachePatchName("RADAR", PU_CACHE); background = W_CachePatchName("RADAR", PU_PATCH);
else else
background = W_CachePatchName("DRAT", PU_CACHE); background = W_CachePatchName("DRAT", PU_PATCH);
break; break;
case 6: case 6:
background = W_CachePatchName("INTRO6", PU_CACHE); background = W_CachePatchName("INTRO6", PU_PATCH);
cx = 180; cx = 180;
cy = 8; cy = 8;
break; break;
case 7: case 7:
{ {
if (intro_curtime >= 7*TICRATE + ((TICRATE/7)*2)) if (intro_curtime >= 7*TICRATE + ((TICRATE/7)*2))
background = W_CachePatchName("SGRASS5", PU_CACHE); background = W_CachePatchName("SGRASS5", PU_PATCH);
else if (intro_curtime >= 7*TICRATE + (TICRATE/7)) else if (intro_curtime >= 7*TICRATE + (TICRATE/7))
background = W_CachePatchName("SGRASS4", PU_CACHE); background = W_CachePatchName("SGRASS4", PU_PATCH);
else if (intro_curtime >= 7*TICRATE) else if (intro_curtime >= 7*TICRATE)
background = W_CachePatchName("SGRASS3", PU_CACHE); background = W_CachePatchName("SGRASS3", PU_PATCH);
else if (intro_curtime >= 6*TICRATE) else if (intro_curtime >= 6*TICRATE)
background = W_CachePatchName("SGRASS2", PU_CACHE); background = W_CachePatchName("SGRASS2", PU_PATCH);
else else
background = W_CachePatchName("SGRASS1", PU_CACHE); background = W_CachePatchName("SGRASS1", PU_PATCH);
break; break;
} }
case 8: case 8:
background = W_CachePatchName("WATCHING", PU_CACHE); background = W_CachePatchName("WATCHING", PU_PATCH);
break; break;
case 9: case 9:
background = W_CachePatchName("ZOOMING", PU_CACHE); background = W_CachePatchName("ZOOMING", PU_PATCH);
break; break;
case 10: case 10:
break; break;
case 11: case 11:
background = W_CachePatchName("INTRO5", PU_CACHE); background = W_CachePatchName("INTRO5", PU_PATCH);
break; break;
case 12: case 12:
background = W_CachePatchName("REVENGE", PU_CACHE); background = W_CachePatchName("REVENGE", PU_PATCH);
cx = 208; cx = 208;
cy = 8; cy = 8;
break; break;
case 13: case 13:
background = W_CachePatchName("CONFRONT", PU_CACHE); background = W_CachePatchName("CONFRONT", PU_PATCH);
cy += 48; cy += 48;
break; break;
case 14: case 14:
background = W_CachePatchName("TAILSSAD", PU_CACHE); background = W_CachePatchName("TAILSSAD", PU_PATCH);
bgxoffs = 144; bgxoffs = 144;
cx = 8; cx = 8;
cy = 8; cy = 8;
break; break;
case 15: case 15:
if (intro_curtime >= 7*TICRATE) if (intro_curtime >= 7*TICRATE)
background = W_CachePatchName("SONICDO2", PU_CACHE); background = W_CachePatchName("SONICDO2", PU_PATCH);
else else
background = W_CachePatchName("SONICDO1", PU_CACHE); background = W_CachePatchName("SONICDO1", PU_PATCH);
cx = 224; cx = 224;
cy = 8; cy = 8;
break; break;
case 16: case 16:
background = W_CachePatchName("INTRO7", PU_CACHE); background = W_CachePatchName("INTRO7", PU_PATCH);
break; break;
default: default:
break; break;
@ -631,30 +631,30 @@ static void F_IntroDrawScene(void)
S_ChangeMusicInternal("_stjr", false); S_ChangeMusicInternal("_stjr", false);
x = (BASEVIDWIDTH<<FRACBITS)/2 - FixedMul(334<<FRACBITS, aspect)/2; x = (BASEVIDWIDTH<<FRACBITS)/2 - FixedMul(334<<FRACBITS, aspect)/2;
y = (BASEVIDHEIGHT<<FRACBITS)/2 - FixedMul(358<<FRACBITS, aspect)/2; y = (BASEVIDHEIGHT<<FRACBITS)/2 - FixedMul(358<<FRACBITS, aspect)/2;
V_DrawSciencePatch(x, y, 0, (patch = W_CachePatchName("WAHH1", PU_CACHE)), aspect); V_DrawSciencePatch(x, y, 0, (patch = W_CachePatchName("WAHH1", PU_PATCH)), aspect);
W_UnlockCachedPatch(patch); W_UnlockCachedPatch(patch);
if (finalecount > 6) { if (finalecount > 6) {
V_DrawSciencePatch(x, y, 0, (patch = W_CachePatchName("WAHH2", PU_CACHE)), aspect); V_DrawSciencePatch(x, y, 0, (patch = W_CachePatchName("WAHH2", PU_PATCH)), aspect);
W_UnlockCachedPatch(patch); W_UnlockCachedPatch(patch);
} }
if (finalecount > 10) { if (finalecount > 10) {
V_DrawSciencePatch(x, y, 0, (patch = W_CachePatchName("WAHH3", PU_CACHE)), aspect); V_DrawSciencePatch(x, y, 0, (patch = W_CachePatchName("WAHH3", PU_PATCH)), aspect);
W_UnlockCachedPatch(patch); W_UnlockCachedPatch(patch);
} }
if (finalecount > 14) { if (finalecount > 14) {
V_DrawSciencePatch(x, y, 0, (patch = W_CachePatchName("WAHH4", PU_CACHE)), aspect); V_DrawSciencePatch(x, y, 0, (patch = W_CachePatchName("WAHH4", PU_PATCH)), aspect);
W_UnlockCachedPatch(patch); W_UnlockCachedPatch(patch);
} }
} }
else if (finalecount-30 < 20) { // Big eggy else if (finalecount-30 < 20) { // Big eggy
background = W_CachePatchName("FEEDIN", PU_CACHE); background = W_CachePatchName("FEEDIN", PU_PATCH);
x = (BASEVIDWIDTH<<FRACBITS)/2 - FixedMul(560<<FRACBITS, aspect)/2; x = (BASEVIDWIDTH<<FRACBITS)/2 - FixedMul(560<<FRACBITS, aspect)/2;
y = (BASEVIDHEIGHT<<FRACBITS) - FixedMul(477<<FRACBITS, aspect); y = (BASEVIDHEIGHT<<FRACBITS) - FixedMul(477<<FRACBITS, aspect);
V_DrawSciencePatch(x, y, V_SNAPTOBOTTOM, background, aspect); V_DrawSciencePatch(x, y, V_SNAPTOBOTTOM, background, aspect);
} }
else if (finalecount-50 < 30) { // Zoom out else if (finalecount-50 < 30) { // Zoom out
fixed_t scale = FixedDiv(aspect, FixedDiv((finalecount-50)<<FRACBITS, (15<<FRACBITS))+FRACUNIT); fixed_t scale = FixedDiv(aspect, FixedDiv((finalecount-50)<<FRACBITS, (15<<FRACBITS))+FRACUNIT);
background = W_CachePatchName("FEEDIN", PU_CACHE); background = W_CachePatchName("FEEDIN", PU_PATCH);
x = (BASEVIDWIDTH<<FRACBITS)/2 - FixedMul(560<<FRACBITS, aspect)/2 + (FixedMul(560<<FRACBITS, aspect) - FixedMul(560<<FRACBITS, scale)); x = (BASEVIDWIDTH<<FRACBITS)/2 - FixedMul(560<<FRACBITS, aspect)/2 + (FixedMul(560<<FRACBITS, aspect) - FixedMul(560<<FRACBITS, scale));
y = (BASEVIDHEIGHT<<FRACBITS) - FixedMul(477<<FRACBITS, scale); y = (BASEVIDHEIGHT<<FRACBITS) - FixedMul(477<<FRACBITS, scale);
V_DrawSciencePatch(x, y, V_SNAPTOBOTTOM, background, scale); V_DrawSciencePatch(x, y, V_SNAPTOBOTTOM, background, scale);
@ -664,7 +664,7 @@ static void F_IntroDrawScene(void)
{ {
// Draw tiny eggy // Draw tiny eggy
fixed_t scale = FixedMul(FRACUNIT/3, aspect); fixed_t scale = FixedMul(FRACUNIT/3, aspect);
background = W_CachePatchName("FEEDIN", PU_CACHE); background = W_CachePatchName("FEEDIN", PU_PATCH);
x = (BASEVIDWIDTH<<FRACBITS)/2 - FixedMul(560<<FRACBITS, aspect)/2 + (FixedMul(560<<FRACBITS, aspect) - FixedMul(560<<FRACBITS, scale)); x = (BASEVIDWIDTH<<FRACBITS)/2 - FixedMul(560<<FRACBITS, aspect)/2 + (FixedMul(560<<FRACBITS, aspect) - FixedMul(560<<FRACBITS, scale));
y = (BASEVIDHEIGHT<<FRACBITS) - FixedMul(477<<FRACBITS, scale); y = (BASEVIDHEIGHT<<FRACBITS) - FixedMul(477<<FRACBITS, scale);
V_DrawSciencePatch(x, y, V_SNAPTOBOTTOM, background, scale); V_DrawSciencePatch(x, y, V_SNAPTOBOTTOM, background, scale);
@ -675,34 +675,34 @@ static void F_IntroDrawScene(void)
x = (-189*FRACUNIT) + (FixedMul((6<<FRACBITS)+FRACUNIT/3, ftime<<FRACBITS) - FixedMul((6<<FRACBITS)+FRACUNIT/3, FixedDiv(FixedMul(ftime<<FRACBITS, ftime<<FRACBITS), 120<<FRACBITS))); x = (-189*FRACUNIT) + (FixedMul((6<<FRACBITS)+FRACUNIT/3, ftime<<FRACBITS) - FixedMul((6<<FRACBITS)+FRACUNIT/3, FixedDiv(FixedMul(ftime<<FRACBITS, ftime<<FRACBITS), 120<<FRACBITS)));
y = (BASEVIDHEIGHT<<FRACBITS) - FixedMul(417<<FRACBITS, aspect); y = (BASEVIDHEIGHT<<FRACBITS) - FixedMul(417<<FRACBITS, aspect);
// Draw the body // Draw the body
V_DrawSciencePatch(x, y, V_SNAPTOLEFT|V_SNAPTOBOTTOM, (patch = W_CachePatchName("PUREFAT1", PU_CACHE)), aspect); V_DrawSciencePatch(x, y, V_SNAPTOLEFT|V_SNAPTOBOTTOM, (patch = W_CachePatchName("PUREFAT1", PU_PATCH)), aspect);
W_UnlockCachedPatch(patch); W_UnlockCachedPatch(patch);
// Draw the door // Draw the door
V_DrawSciencePatch(x+FixedMul(344<<FRACBITS, aspect), y+FixedMul(292<<FRACBITS, aspect), V_SNAPTOLEFT|V_SNAPTOBOTTOM, (patch = W_CachePatchName("PUREFAT2", PU_CACHE)), aspect); V_DrawSciencePatch(x+FixedMul(344<<FRACBITS, aspect), y+FixedMul(292<<FRACBITS, aspect), V_SNAPTOLEFT|V_SNAPTOBOTTOM, (patch = W_CachePatchName("PUREFAT2", PU_PATCH)), aspect);
W_UnlockCachedPatch(patch); W_UnlockCachedPatch(patch);
// Draw the wheel // Draw the wheel
V_DrawSciencePatch(x+FixedMul(178<<FRACBITS, aspect), y+FixedMul(344<<FRACBITS, aspect), V_SNAPTOLEFT|V_SNAPTOBOTTOM, (patch = W_CachePatchName(va("TYRE%02u",(abs(finalecount-144)/3)%16), PU_CACHE)), aspect); V_DrawSciencePatch(x+FixedMul(178<<FRACBITS, aspect), y+FixedMul(344<<FRACBITS, aspect), V_SNAPTOLEFT|V_SNAPTOBOTTOM, (patch = W_CachePatchName(va("TYRE%02u",(abs(finalecount-144)/3)%16), PU_PATCH)), aspect);
W_UnlockCachedPatch(patch); W_UnlockCachedPatch(patch);
// Draw the wheel cover // Draw the wheel cover
V_DrawSciencePatch(x+FixedMul(88<<FRACBITS, aspect), y+FixedMul(238<<FRACBITS, aspect), V_SNAPTOLEFT|V_SNAPTOBOTTOM, (patch = W_CachePatchName("PUREFAT3", PU_CACHE)), aspect); V_DrawSciencePatch(x+FixedMul(88<<FRACBITS, aspect), y+FixedMul(238<<FRACBITS, aspect), V_SNAPTOLEFT|V_SNAPTOBOTTOM, (patch = W_CachePatchName("PUREFAT3", PU_PATCH)), aspect);
W_UnlockCachedPatch(patch); W_UnlockCachedPatch(patch);
} else { // Pure Fat has stopped! } else { // Pure Fat has stopped!
y = (BASEVIDHEIGHT<<FRACBITS) - FixedMul(417<<FRACBITS, aspect); y = (BASEVIDHEIGHT<<FRACBITS) - FixedMul(417<<FRACBITS, aspect);
// Draw the body // Draw the body
V_DrawSciencePatch(0, y, V_SNAPTOLEFT|V_SNAPTOBOTTOM, (patch = W_CachePatchName("PUREFAT1", PU_CACHE)), aspect); V_DrawSciencePatch(0, y, V_SNAPTOLEFT|V_SNAPTOBOTTOM, (patch = W_CachePatchName("PUREFAT1", PU_PATCH)), aspect);
W_UnlockCachedPatch(patch); W_UnlockCachedPatch(patch);
// Draw the wheel // Draw the wheel
V_DrawSciencePatch(FixedMul(178<<FRACBITS, aspect), y+FixedMul(344<<FRACBITS, aspect), V_SNAPTOLEFT|V_SNAPTOBOTTOM, (patch = W_CachePatchName("TYRE00", PU_CACHE)), aspect); V_DrawSciencePatch(FixedMul(178<<FRACBITS, aspect), y+FixedMul(344<<FRACBITS, aspect), V_SNAPTOLEFT|V_SNAPTOBOTTOM, (patch = W_CachePatchName("TYRE00", PU_PATCH)), aspect);
W_UnlockCachedPatch(patch); W_UnlockCachedPatch(patch);
// Draw the wheel cover // Draw the wheel cover
V_DrawSciencePatch(FixedMul(88<<FRACBITS, aspect), y+FixedMul(238<<FRACBITS, aspect), V_SNAPTOLEFT|V_SNAPTOBOTTOM, (patch = W_CachePatchName("PUREFAT3", PU_CACHE)), aspect); V_DrawSciencePatch(FixedMul(88<<FRACBITS, aspect), y+FixedMul(238<<FRACBITS, aspect), V_SNAPTOLEFT|V_SNAPTOBOTTOM, (patch = W_CachePatchName("PUREFAT3", PU_PATCH)), aspect);
W_UnlockCachedPatch(patch); W_UnlockCachedPatch(patch);
// Draw the door // Draw the door
if (finalecount-TICRATE/2 > 4*TICRATE) { // Door is being raised! if (finalecount-TICRATE/2 > 4*TICRATE) { // Door is being raised!
int ftime = (finalecount-TICRATE/2-4*TICRATE); int ftime = (finalecount-TICRATE/2-4*TICRATE);
y -= FixedDiv((ftime*ftime)<<FRACBITS, 23<<FRACBITS); y -= FixedDiv((ftime*ftime)<<FRACBITS, 23<<FRACBITS);
} }
V_DrawSciencePatch(FixedMul(344<<FRACBITS, aspect), y+FixedMul(292<<FRACBITS, aspect), V_SNAPTOLEFT|V_SNAPTOBOTTOM, (patch = W_CachePatchName("PUREFAT2", PU_CACHE)), aspect); V_DrawSciencePatch(FixedMul(344<<FRACBITS, aspect), y+FixedMul(292<<FRACBITS, aspect), V_SNAPTOLEFT|V_SNAPTOBOTTOM, (patch = W_CachePatchName("PUREFAT2", PU_PATCH)), aspect);
W_UnlockCachedPatch(patch); W_UnlockCachedPatch(patch);
} }
} }
@ -716,27 +716,27 @@ static void F_IntroDrawScene(void)
if (timetonext > 5*TICRATE && timetonext < 6*TICRATE) if (timetonext > 5*TICRATE && timetonext < 6*TICRATE)
{ {
if (!(finalecount & 3)) if (!(finalecount & 3))
background = W_CachePatchName("BRITEGG1", PU_CACHE); background = W_CachePatchName("BRITEGG1", PU_PATCH);
else else
background = W_CachePatchName("DARKEGG1", PU_CACHE); background = W_CachePatchName("DARKEGG1", PU_PATCH);
V_DrawSmallScaledPatch(0, 0, 0, background); V_DrawSmallScaledPatch(0, 0, 0, background);
} }
else if (timetonext > 3*TICRATE && timetonext < 4*TICRATE) else if (timetonext > 3*TICRATE && timetonext < 4*TICRATE)
{ {
if (!(finalecount & 3)) if (!(finalecount & 3))
background = W_CachePatchName("BRITEGG2", PU_CACHE); background = W_CachePatchName("BRITEGG2", PU_PATCH);
else else
background = W_CachePatchName("DARKEGG2", PU_CACHE); background = W_CachePatchName("DARKEGG2", PU_PATCH);
V_DrawSmallScaledPatch(0, 0, 0, background); V_DrawSmallScaledPatch(0, 0, 0, background);
} }
else if (timetonext > 1*TICRATE && timetonext < 2*TICRATE) else if (timetonext > 1*TICRATE && timetonext < 2*TICRATE)
{ {
if (!(finalecount & 3)) if (!(finalecount & 3))
background = W_CachePatchName("BRITEGG3", PU_CACHE); background = W_CachePatchName("BRITEGG3", PU_PATCH);
else else
background = W_CachePatchName("DARKEGG3", PU_CACHE); background = W_CachePatchName("DARKEGG3", PU_PATCH);
V_DrawSmallScaledPatch(0, 0, 0, background); V_DrawSmallScaledPatch(0, 0, 0, background);
} }
@ -768,79 +768,79 @@ static void F_IntroDrawScene(void)
knucklesx += sonicx; knucklesx += sonicx;
sonicx += P_ReturnThrustX(NULL, finalecount * ANG10, 3); sonicx += P_ReturnThrustX(NULL, finalecount * ANG10, 3);
V_DrawSmallScaledPatch(skyx, 0, 0, (patch = W_CachePatchName("INTROSKY", PU_CACHE))); V_DrawSmallScaledPatch(skyx, 0, 0, (patch = W_CachePatchName("INTROSKY", PU_PATCH)));
V_DrawSmallScaledPatch(skyx - 320, 0, 0, patch); V_DrawSmallScaledPatch(skyx - 320, 0, 0, patch);
W_UnlockCachedPatch(patch); W_UnlockCachedPatch(patch);
V_DrawSmallScaledPatch(grassx, 0, 0, (patch = W_CachePatchName("INTROGRS", PU_CACHE))); V_DrawSmallScaledPatch(grassx, 0, 0, (patch = W_CachePatchName("INTROGRS", PU_PATCH)));
V_DrawSmallScaledPatch(grassx - 320, 0, 0, patch); V_DrawSmallScaledPatch(grassx - 320, 0, 0, patch);
W_UnlockCachedPatch(patch); W_UnlockCachedPatch(patch);
if (finalecount & 1) if (finalecount & 1)
{ {
// Sonic // Sonic
V_DrawSmallScaledPatch(sonicx, 54, 0, (patch = W_CachePatchName("RUN2", PU_CACHE))); V_DrawSmallScaledPatch(sonicx, 54, 0, (patch = W_CachePatchName("RUN2", PU_PATCH)));
W_UnlockCachedPatch(patch); W_UnlockCachedPatch(patch);
// Appendages // Appendages
if (finalecount & 2) if (finalecount & 2)
{ {
// Sonic's feet // Sonic's feet
V_DrawSmallScaledPatch(sonicx - 8, 92, 0, (patch = W_CachePatchName("PEELOUT4", PU_CACHE))); V_DrawSmallScaledPatch(sonicx - 8, 92, 0, (patch = W_CachePatchName("PEELOUT4", PU_PATCH)));
W_UnlockCachedPatch(patch); W_UnlockCachedPatch(patch);
// Tails' tails // Tails' tails
V_DrawSmallScaledPatch(tailsx, tailsy, 0, (patch = W_CachePatchName("HELICOP2", PU_CACHE))); V_DrawSmallScaledPatch(tailsx, tailsy, 0, (patch = W_CachePatchName("HELICOP2", PU_PATCH)));
W_UnlockCachedPatch(patch); W_UnlockCachedPatch(patch);
} }
else else
{ {
// Sonic's feet // Sonic's feet
V_DrawSmallScaledPatch(sonicx - 8, 92, 0, (patch = W_CachePatchName("PEELOUT2", PU_CACHE))); V_DrawSmallScaledPatch(sonicx - 8, 92, 0, (patch = W_CachePatchName("PEELOUT2", PU_PATCH)));
W_UnlockCachedPatch(patch); W_UnlockCachedPatch(patch);
// Tails' tails // Tails' tails
V_DrawSmallScaledPatch(tailsx, tailsy, 0, (patch = W_CachePatchName("HELICOP1", PU_CACHE))); V_DrawSmallScaledPatch(tailsx, tailsy, 0, (patch = W_CachePatchName("HELICOP1", PU_PATCH)));
W_UnlockCachedPatch(patch); W_UnlockCachedPatch(patch);
} }
// Tails // Tails
V_DrawSmallScaledPatch(tailsx, tailsy, 0, (patch = W_CachePatchName("FLY2", PU_CACHE))); V_DrawSmallScaledPatch(tailsx, tailsy, 0, (patch = W_CachePatchName("FLY2", PU_PATCH)));
W_UnlockCachedPatch(patch); W_UnlockCachedPatch(patch);
// Knuckles // Knuckles
V_DrawSmallScaledPatch(knucklesx, knucklesy, 0, (patch = W_CachePatchName("GLIDE2", PU_CACHE))); V_DrawSmallScaledPatch(knucklesx, knucklesy, 0, (patch = W_CachePatchName("GLIDE2", PU_PATCH)));
W_UnlockCachedPatch(patch); W_UnlockCachedPatch(patch);
} }
else else
{ {
// Sonic // Sonic
V_DrawSmallScaledPatch(sonicx, 54, 0, (patch = W_CachePatchName("RUN1", PU_CACHE))); V_DrawSmallScaledPatch(sonicx, 54, 0, (patch = W_CachePatchName("RUN1", PU_PATCH)));
W_UnlockCachedPatch(patch); W_UnlockCachedPatch(patch);
// Appendages // Appendages
if (finalecount & 2) if (finalecount & 2)
{ {
// Sonic's feet // Sonic's feet
V_DrawSmallScaledPatch(sonicx - 8, 92, 0, (patch = W_CachePatchName("PEELOUT3", PU_CACHE))); V_DrawSmallScaledPatch(sonicx - 8, 92, 0, (patch = W_CachePatchName("PEELOUT3", PU_PATCH)));
W_UnlockCachedPatch(patch); W_UnlockCachedPatch(patch);
// Tails' tails // Tails' tails
V_DrawSmallScaledPatch(tailsx, tailsy, 0, (patch = W_CachePatchName("HELICOP2", PU_CACHE))); V_DrawSmallScaledPatch(tailsx, tailsy, 0, (patch = W_CachePatchName("HELICOP2", PU_PATCH)));
W_UnlockCachedPatch(patch); W_UnlockCachedPatch(patch);
} }
else else
{ {
// Sonic's feet // Sonic's feet
V_DrawSmallScaledPatch(sonicx - 8, 92, 0, (patch = W_CachePatchName("PEELOUT1", PU_CACHE))); V_DrawSmallScaledPatch(sonicx - 8, 92, 0, (patch = W_CachePatchName("PEELOUT1", PU_PATCH)));
W_UnlockCachedPatch(patch); W_UnlockCachedPatch(patch);
// Tails' tails // Tails' tails
V_DrawSmallScaledPatch(tailsx, tailsy, 0, (patch = W_CachePatchName("HELICOP1", PU_CACHE))); V_DrawSmallScaledPatch(tailsx, tailsy, 0, (patch = W_CachePatchName("HELICOP1", PU_PATCH)));
W_UnlockCachedPatch(patch); W_UnlockCachedPatch(patch);
} }
// Tails // Tails
V_DrawSmallScaledPatch(tailsx, tailsy, 0, (patch = W_CachePatchName("FLY1", PU_CACHE))); V_DrawSmallScaledPatch(tailsx, tailsy, 0, (patch = W_CachePatchName("FLY1", PU_PATCH)));
W_UnlockCachedPatch(patch); W_UnlockCachedPatch(patch);
// Knuckles // Knuckles
V_DrawSmallScaledPatch(knucklesx, knucklesy, 0, (patch = W_CachePatchName("GLIDE1", PU_CACHE))); V_DrawSmallScaledPatch(knucklesx, knucklesy, 0, (patch = W_CachePatchName("GLIDE1", PU_PATCH)));
W_UnlockCachedPatch(patch); W_UnlockCachedPatch(patch);
} }
@ -873,8 +873,8 @@ static void F_IntroDrawScene(void)
y += (30*(FRACUNIT-scale)); y += (30*(FRACUNIT-scale));
} }
rockpat = W_CachePatchName(va("ROID00%.2d", 34 - (worktics % 35)), PU_LEVEL); rockpat = W_CachePatchName(va("ROID00%.2d", 34 - (worktics % 35)), PU_PATCH);
glow = W_CachePatchName(va("ENDGLOW%.1d", 2+(worktics & 1)), PU_LEVEL); glow = W_CachePatchName(va("ENDGLOW%.1d", 2+(worktics & 1)), PU_PATCH);
if (worktics >= 5) if (worktics >= 5)
trans = (worktics-5)>>1; trans = (worktics-5)>>1;
@ -892,6 +892,13 @@ static void F_IntroDrawScene(void)
V_DrawFixedPatch(x, y, scale, trans<<V_ALPHASHIFT, rockpat, R_GetTranslationColormap(TC_BLINK, SKINCOLOR_AQUA, GTC_CACHE)); V_DrawFixedPatch(x, y, scale, trans<<V_ALPHASHIFT, rockpat, R_GetTranslationColormap(TC_BLINK, SKINCOLOR_AQUA, GTC_CACHE));
} }
} }
else if (intro_scenenum == 1 && intro_curtime < 5*TICRATE)
{
INT32 trans = intro_curtime + 10 - (5*TICRATE);
if (trans < 0)
trans = 0;
V_DrawRightAlignedString(BASEVIDWIDTH-4, BASEVIDHEIGHT-12, V_ALLOWLOWERCASE|(trans<<V_ALPHASHIFT), "\x86""Press ""\x82""ENTER""\x86"" to skip...");
}
if (animtimer) if (animtimer)
animtimer--; animtimer--;
@ -910,8 +917,9 @@ void F_IntroDrawer(void)
{ {
if (rendermode != render_none) if (rendermode != render_none)
{ {
wipestyleflags = WSF_FADEOUT;
F_WipeStartScreen(); F_WipeStartScreen();
F_WipeColorFill(31); F_TryColormapFade(31);
F_WipeEndScreen(); F_WipeEndScreen();
F_RunWipe(99,true); F_RunWipe(99,true);
} }
@ -920,12 +928,11 @@ void F_IntroDrawer(void)
} }
else if (intro_scenenum == 10) else if (intro_scenenum == 10)
{ {
// The only fade to white in the entire damn game.
// (not true)
if (rendermode != render_none) if (rendermode != render_none)
{ {
wipestyleflags = (WSF_FADEOUT|WSF_TOWHITE);
F_WipeStartScreen(); F_WipeStartScreen();
F_WipeColorFill(0); F_TryColormapFade(0);
F_WipeEndScreen(); F_WipeEndScreen();
F_RunWipe(99,true); F_RunWipe(99,true);
} }
@ -934,8 +941,9 @@ void F_IntroDrawer(void)
{ {
if (rendermode != render_none) if (rendermode != render_none)
{ {
wipestyleflags = WSF_FADEOUT;
F_WipeStartScreen(); F_WipeStartScreen();
F_WipeColorFill(31); F_TryColormapFade(31);
F_WipeEndScreen(); F_WipeEndScreen();
F_RunWipe(99,true); F_RunWipe(99,true);
} }
@ -970,6 +978,7 @@ void F_IntroDrawer(void)
F_WipeStartScreen(); F_WipeStartScreen();
wipegamestate = -1; wipegamestate = -1;
wipestyleflags = WSF_CROSSFADE;
animtimer = stoptimer = 0; animtimer = stoptimer = 0;
} }
@ -979,7 +988,7 @@ void F_IntroDrawer(void)
{ {
if (intro_scenenum == 5 && intro_curtime == 5*TICRATE) if (intro_scenenum == 5 && intro_curtime == 5*TICRATE)
{ {
patch_t *radar = W_CachePatchName("RADAR", PU_CACHE); patch_t *radar = W_CachePatchName("RADAR", PU_PATCH);
F_WipeStartScreen(); F_WipeStartScreen();
F_WipeColorFill(31); F_WipeColorFill(31);
@ -992,7 +1001,7 @@ void F_IntroDrawer(void)
} }
else if (intro_scenenum == 7 && intro_curtime == 6*TICRATE) // Force a wipe here else if (intro_scenenum == 7 && intro_curtime == 6*TICRATE) // Force a wipe here
{ {
patch_t *grass = W_CachePatchName("SGRASS2", PU_CACHE); patch_t *grass = W_CachePatchName("SGRASS2", PU_PATCH);
F_WipeStartScreen(); F_WipeStartScreen();
F_WipeColorFill(31); F_WipeColorFill(31);
@ -1005,7 +1014,7 @@ void F_IntroDrawer(void)
} }
/*else if (intro_scenenum == 12 && intro_curtime == 7*TICRATE) /*else if (intro_scenenum == 12 && intro_curtime == 7*TICRATE)
{ {
patch_t *confront = W_CachePatchName("CONFRONT", PU_CACHE); patch_t *confront = W_CachePatchName("CONFRONT", PU_PATCH);
F_WipeStartScreen(); F_WipeStartScreen();
F_WipeColorFill(31); F_WipeColorFill(31);
@ -1018,7 +1027,7 @@ void F_IntroDrawer(void)
}*/ }*/
if (intro_scenenum == 15 && intro_curtime == 7*TICRATE) if (intro_scenenum == 15 && intro_curtime == 7*TICRATE)
{ {
patch_t *sdo = W_CachePatchName("SONICDO2", PU_CACHE); patch_t *sdo = W_CachePatchName("SONICDO2", PU_PATCH);
F_WipeStartScreen(); F_WipeStartScreen();
F_WipeColorFill(31); F_WipeColorFill(31);
@ -1267,6 +1276,7 @@ static const char *credits[] = {
// Creators of small quantities of sprite/texture assets // Creators of small quantities of sprite/texture assets
// - Arietty - New Green Hill-styled textures // - Arietty - New Green Hill-styled textures
// - Scizor300 - the only other contributor to the 2.0 SRB2 Asset Pack // - Scizor300 - the only other contributor to the 2.0 SRB2 Asset Pack
// - Revan/Icefox - the new Nimbus Ruins skybox
"SRB2 Community Contributors", "SRB2 Community Contributors",
"", "",
"\1Produced By", "\1Produced By",
@ -1333,7 +1343,7 @@ void F_StartCredits(void)
S_StopMusic(); S_StopMusic();
S_StopSounds(); S_StopSounds();
S_ChangeMusicInternal("_creds", false); S_ChangeMusicInternal("_creds", true);
finalecount = 0; finalecount = 0;
animtimer = 0; animtimer = 0;
@ -1344,19 +1354,19 @@ void F_CreditDrawer(void)
{ {
UINT16 i; UINT16 i;
INT16 zagpos = (timetonext - finalecount - animtimer) % 32; INT16 zagpos = (timetonext - finalecount - animtimer) % 32;
fixed_t y = (80<<FRACBITS) - 5*(animtimer<<FRACBITS)/8; fixed_t y = (80<<FRACBITS) - (animtimer<<FRACBITS>>1);
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
// Zig Zagz // Zig Zagz
V_DrawScaledPatch(-16, zagpos, V_SNAPTOLEFT, W_CachePatchName("LTZIGZAG", PU_CACHE)); V_DrawScaledPatch(-16, zagpos, V_SNAPTOLEFT, W_CachePatchName("LTZIGZAG", PU_PATCH));
V_DrawScaledPatch(-16, zagpos - 320, V_SNAPTOLEFT, W_CachePatchName("LTZIGZAG", PU_CACHE)); V_DrawScaledPatch(-16, zagpos - 320, V_SNAPTOLEFT, W_CachePatchName("LTZIGZAG", PU_PATCH));
V_DrawScaledPatch(BASEVIDWIDTH + 16, zagpos, V_SNAPTORIGHT|V_FLIP, W_CachePatchName("LTZIGZAG", PU_CACHE)); V_DrawScaledPatch(BASEVIDWIDTH + 16, zagpos, V_SNAPTORIGHT|V_FLIP, W_CachePatchName("LTZIGZAG", PU_PATCH));
V_DrawScaledPatch(BASEVIDWIDTH + 16, zagpos - 320, V_SNAPTORIGHT|V_FLIP, W_CachePatchName("LTZIGZAG", PU_CACHE)); V_DrawScaledPatch(BASEVIDWIDTH + 16, zagpos - 320, V_SNAPTORIGHT|V_FLIP, W_CachePatchName("LTZIGZAG", PU_PATCH));
// Draw background pictures first // Draw background pictures first
for (i = 0; credits_pics[i].patch; i++) for (i = 0; credits_pics[i].patch; i++)
V_DrawSciencePatch(credits_pics[i].x<<FRACBITS, (280<<FRACBITS) + (((i*credits_height)<<FRACBITS)/(credits_numpics)) - 4*(animtimer<<FRACBITS)/5, 0, W_CachePatchName(credits_pics[i].patch, PU_CACHE), FRACUNIT>>1); V_DrawSciencePatch(credits_pics[i].x<<FRACBITS, (280<<FRACBITS) + (((i*credits_height)<<FRACBITS)/(credits_numpics)) - 4*(animtimer<<FRACBITS)/5, 0, W_CachePatchName(credits_pics[i].patch, PU_PATCH), FRACUNIT>>1);
// Dim the background // Dim the background
V_DrawFadeScreen(0xFF00, 16); V_DrawFadeScreen(0xFF00, 16);
@ -1394,7 +1404,7 @@ void F_CreditTicker(void)
{ {
// "Simulate" the drawing of the credits so that dedicated mode doesn't get stuck // "Simulate" the drawing of the credits so that dedicated mode doesn't get stuck
UINT16 i; UINT16 i;
fixed_t y = (80<<FRACBITS) - 5*(animtimer<<FRACBITS)/8; fixed_t y = (80<<FRACBITS) - (animtimer<<FRACBITS>>1);
// Calculate credits height to display art properly // Calculate credits height to display art properly
if (credits_height == 0) if (credits_height == 0)
@ -1408,8 +1418,7 @@ void F_CreditTicker(void)
default: credits_height += 12; break; default: credits_height += 12; break;
} }
} }
credits_height = 4*8*credits_height/5/5; // account for scroll speed (4/5 accounts for patch drawing, inverse 5/8 accounts for text scroll) credits_height = 131*credits_height/80; // account for scroll speeds. This is a guess now, so you may need to update this if you change the credits length.
//credits_height += 280; // account for starting offset
} }
// Draw credits text on top // Draw credits text on top
@ -1565,14 +1574,14 @@ void F_GameEvaluationDrawer(void)
if (goodending) if (goodending)
{ {
rockpat = W_CachePatchName(va("ROID00%.2d", 34 - (finalecount % 35)), PU_LEVEL); rockpat = W_CachePatchName(va("ROID00%.2d", 34 - (finalecount % 35)), PU_PATCH);
glow = W_CachePatchName(va("ENDGLOW%.1d", 2+(finalecount & 1)), PU_LEVEL); glow = W_CachePatchName(va("ENDGLOW%.1d", 2+(finalecount & 1)), PU_PATCH);
x -= FRACUNIT; x -= FRACUNIT;
} }
else else
{ {
rockpat = W_CachePatchName("ROID0000", PU_LEVEL); rockpat = W_CachePatchName("ROID0000", PU_LEVEL);
glow = W_CachePatchName(va("ENDGLOW%.1d", (finalecount & 1)), PU_LEVEL); glow = W_CachePatchName(va("ENDGLOW%.1d", (finalecount & 1)), PU_PATCH);
} }
if (finalecount >= 5) if (finalecount >= 5)
@ -1604,20 +1613,20 @@ void F_GameEvaluationDrawer(void)
// if j == 0 - alternate between 0 and 1 // if j == 0 - alternate between 0 and 1
// 1 - 1 and 2 // 1 - 1 and 2
// 2 - 2 and not rendered // 2 - 2 and not rendered
V_DrawFixedPatch(x+sparkloffs[j-1][0], y+sparkloffs[j-1][1], FRACUNIT, 0, W_CachePatchName(va("ENDSPKL%.1d", (j - ((sparklloop & 1) ? 0 : 1))), PU_LEVEL), R_GetTranslationColormap(TC_DEFAULT, SKINCOLOR_AQUA, GTC_CACHE)); V_DrawFixedPatch(x+sparkloffs[j-1][0], y+sparkloffs[j-1][1], FRACUNIT, 0, W_CachePatchName(va("ENDSPKL%.1d", (j - ((sparklloop & 1) ? 0 : 1))), PU_PATCH), R_GetTranslationColormap(TC_DEFAULT, SKINCOLOR_AQUA, GTC_CACHE));
} }
j--; j--;
} }
} }
else else
{ {
patch_t *eggrock = W_CachePatchName("ENDEGRK5", PU_LEVEL); patch_t *eggrock = W_CachePatchName("ENDEGRK5", PU_PATCH);
V_DrawFixedPatch(x, y, scale, 0, eggrock, colormap[0]); V_DrawFixedPatch(x, y, scale, 0, eggrock, colormap[0]);
if (trans < 10) if (trans < 10)
V_DrawFixedPatch(x, y, scale, trans<<V_ALPHASHIFT, eggrock, colormap[1]); V_DrawFixedPatch(x, y, scale, trans<<V_ALPHASHIFT, eggrock, colormap[1]);
else if (sparklloop) else if (sparklloop)
V_DrawFixedPatch(x, y, scale, (10-sparklloop)<<V_ALPHASHIFT, V_DrawFixedPatch(x, y, scale, (10-sparklloop)<<V_ALPHASHIFT,
W_CachePatchName("ENDEGRK0", PU_LEVEL), colormap[1]); W_CachePatchName("ENDEGRK0", PU_PATCH), colormap[1]);
} }
} }
@ -1631,7 +1640,7 @@ void F_GameEvaluationDrawer(void)
eemeralds_cur += (360<<FRACBITS)/7; eemeralds_cur += (360<<FRACBITS)/7;
patchname[4] = 'A'+(char)i; patchname[4] = 'A'+(char)i;
V_DrawFixedPatch(x, y, FRACUNIT, ((emeralds & (1<<i)) ? 0 : V_80TRANS), W_CachePatchName(patchname, PU_LEVEL), NULL); V_DrawFixedPatch(x, y, FRACUNIT, ((emeralds & (1<<i)) ? 0 : V_80TRANS), W_CachePatchName(patchname, PU_PATCH), NULL);
} }
V_DrawCreditString((BASEVIDWIDTH - V_CreditStringWidth(endingtext))<<(FRACBITS-1), (BASEVIDHEIGHT-100)<<(FRACBITS-1), 0, endingtext); V_DrawCreditString((BASEVIDWIDTH - V_CreditStringWidth(endingtext))<<(FRACBITS-1), (BASEVIDHEIGHT-100)<<(FRACBITS-1), 0, endingtext);
@ -1744,6 +1753,83 @@ void F_GameEvaluationTicker(void)
#define STOPPINGPOINT (14*TICRATE) #define STOPPINGPOINT (14*TICRATE)
#define SPARKLLOOPTIME 15 // must be odd #define SPARKLLOOPTIME 15 // must be odd
static void F_CacheEnding(void)
{
endbrdr[1] = W_CachePatchName("ENDBRDR1", PU_PATCH);
endegrk[0] = W_CachePatchName("ENDEGRK0", PU_PATCH);
endegrk[1] = W_CachePatchName("ENDEGRK1", PU_PATCH);
endglow[0] = W_CachePatchName("ENDGLOW0", PU_PATCH);
endglow[1] = W_CachePatchName("ENDGLOW1", PU_PATCH);
endbgsp[0] = W_CachePatchName("ENDBGSP0", PU_PATCH);
endbgsp[1] = W_CachePatchName("ENDBGSP1", PU_PATCH);
endbgsp[2] = W_CachePatchName("ENDBGSP2", PU_PATCH);
endspkl[0] = W_CachePatchName("ENDSPKL0", PU_PATCH);
endspkl[1] = W_CachePatchName("ENDSPKL1", PU_PATCH);
endspkl[2] = W_CachePatchName("ENDSPKL2", PU_PATCH);
endxpld[0] = W_CachePatchName("ENDXPLD0", PU_PATCH);
endxpld[1] = W_CachePatchName("ENDXPLD1", PU_PATCH);
endxpld[2] = W_CachePatchName("ENDXPLD2", PU_PATCH);
endxpld[3] = W_CachePatchName("ENDXPLD3", PU_PATCH);
endescp[0] = W_CachePatchName("ENDESCP0", PU_PATCH);
endescp[1] = W_CachePatchName("ENDESCP1", PU_PATCH);
endescp[2] = W_CachePatchName("ENDESCP2", PU_PATCH);
endescp[3] = W_CachePatchName("ENDESCP3", PU_PATCH);
endescp[4] = W_CachePatchName("ENDESCP4", PU_PATCH);
// so we only need to check once
if ((goodending = ALL7EMERALDS(emeralds)))
{
UINT8 skinnum = players[consoleplayer].skin;
spritedef_t *sprdef;
spriteframe_t *sprframe;
if (skins[skinnum].sprites[SPR2_XTRA].numframes > (XTRA_ENDING+2))
{
sprdef = &skins[skinnum].sprites[SPR2_XTRA];
// character head, skin specific
sprframe = &sprdef->spriteframes[XTRA_ENDING];
endfwrk[0] = W_CachePatchNum(sprframe->lumppat[0], PU_PATCH);
sprframe = &sprdef->spriteframes[XTRA_ENDING+1];
endfwrk[1] = W_CachePatchNum(sprframe->lumppat[0], PU_PATCH);
sprframe = &sprdef->spriteframes[XTRA_ENDING+2];
endfwrk[2] = W_CachePatchNum(sprframe->lumppat[0], PU_PATCH);
}
else // Show a star if your character doesn't have an ending firework display. (Basically the MISSINGs for this)
{
endfwrk[0] = W_CachePatchName("ENDFWRK3", PU_PATCH);
endfwrk[1] = W_CachePatchName("ENDFWRK4", PU_PATCH);
endfwrk[2] = W_CachePatchName("ENDFWRK5", PU_PATCH);
}
endbrdr[0] = W_CachePatchName("ENDBRDR2", PU_PATCH);
}
else
{
// eggman, skin nonspecific
endfwrk[0] = W_CachePatchName("ENDFWRK0", PU_PATCH);
endfwrk[1] = W_CachePatchName("ENDFWRK1", PU_PATCH);
endfwrk[2] = W_CachePatchName("ENDFWRK2", PU_PATCH);
endbrdr[0] = W_CachePatchName("ENDBRDR0", PU_LEVEL);
}
}
static void F_CacheGoodEnding(void)
{
endegrk[0] = W_CachePatchName("ENDEGRK2", PU_PATCH);
endegrk[1] = W_CachePatchName("ENDEGRK3", PU_PATCH);
endglow[0] = W_CachePatchName("ENDGLOW2", PU_PATCH);
endglow[1] = W_CachePatchName("ENDGLOW3", PU_PATCH);
endxpld[0] = W_CachePatchName("ENDEGRK4", PU_PATCH);
}
void F_StartEnding(void) void F_StartEnding(void)
{ {
G_SetGamestate(GS_ENDING); G_SetGamestate(GS_ENDING);
@ -1759,7 +1845,7 @@ void F_StartEnding(void)
gameaction = ga_nothing; gameaction = ga_nothing;
paused = false; paused = false;
CON_ToggleOff(); CON_ToggleOff();
S_StopMusic(); S_StopMusic(); // todo: placeholder
S_StopSounds(); S_StopSounds();
finalecount = -10; // what? this totally isn't a hack. why are you asking? finalecount = -10; // what? this totally isn't a hack. why are you asking?
@ -1767,68 +1853,7 @@ void F_StartEnding(void)
memset(sparkloffs, 0, sizeof(INT32)*3*2); memset(sparkloffs, 0, sizeof(INT32)*3*2);
sparklloop = 0; sparklloop = 0;
endbrdr[1] = W_CachePatchName("ENDBRDR1", PU_LEVEL); F_CacheEnding();
endegrk[0] = W_CachePatchName("ENDEGRK0", PU_LEVEL);
endegrk[1] = W_CachePatchName("ENDEGRK1", PU_LEVEL);
endglow[0] = W_CachePatchName("ENDGLOW0", PU_LEVEL);
endglow[1] = W_CachePatchName("ENDGLOW1", PU_LEVEL);
endbgsp[0] = W_CachePatchName("ENDBGSP0", PU_LEVEL);
endbgsp[1] = W_CachePatchName("ENDBGSP1", PU_LEVEL);
endbgsp[2] = W_CachePatchName("ENDBGSP2", PU_LEVEL);
endspkl[0] = W_CachePatchName("ENDSPKL0", PU_LEVEL);
endspkl[1] = W_CachePatchName("ENDSPKL1", PU_LEVEL);
endspkl[2] = W_CachePatchName("ENDSPKL2", PU_LEVEL);
endxpld[0] = W_CachePatchName("ENDXPLD0", PU_LEVEL);
endxpld[1] = W_CachePatchName("ENDXPLD1", PU_LEVEL);
endxpld[2] = W_CachePatchName("ENDXPLD2", PU_LEVEL);
endxpld[3] = W_CachePatchName("ENDXPLD3", PU_LEVEL);
endescp[0] = W_CachePatchName("ENDESCP0", PU_LEVEL);
endescp[1] = W_CachePatchName("ENDESCP1", PU_LEVEL);
endescp[2] = W_CachePatchName("ENDESCP2", PU_LEVEL);
endescp[3] = W_CachePatchName("ENDESCP3", PU_LEVEL);
endescp[4] = W_CachePatchName("ENDESCP4", PU_LEVEL);
// so we only need to check once
if ((goodending = ALL7EMERALDS(emeralds)))
{
UINT8 skinnum = players[consoleplayer].skin;
spritedef_t *sprdef;
spriteframe_t *sprframe;
if (skins[skinnum].sprites[SPR2_XTRA].numframes > (XTRA_ENDING+2))
{
sprdef = &skins[skinnum].sprites[SPR2_XTRA];
// character head, skin specific
sprframe = &sprdef->spriteframes[XTRA_ENDING];
endfwrk[0] = W_CachePatchNum(sprframe->lumppat[0], PU_LEVEL);
sprframe = &sprdef->spriteframes[XTRA_ENDING+1];
endfwrk[1] = W_CachePatchNum(sprframe->lumppat[0], PU_LEVEL);
sprframe = &sprdef->spriteframes[XTRA_ENDING+2];
endfwrk[2] = W_CachePatchNum(sprframe->lumppat[0], PU_LEVEL);
}
else // Show a star if your character doesn't have an ending firework display. (Basically the MISSINGs for this)
{
endfwrk[0] = W_CachePatchName("ENDFWRK3", PU_LEVEL);
endfwrk[1] = W_CachePatchName("ENDFWRK4", PU_LEVEL);
endfwrk[2] = W_CachePatchName("ENDFWRK5", PU_LEVEL);
}
endbrdr[0] = W_CachePatchName("ENDBRDR2", PU_LEVEL);
}
else
{
// eggman, skin nonspecific
endfwrk[0] = W_CachePatchName("ENDFWRK0", PU_LEVEL);
endfwrk[1] = W_CachePatchName("ENDFWRK1", PU_LEVEL);
endfwrk[2] = W_CachePatchName("ENDFWRK2", PU_LEVEL);
endbrdr[0] = W_CachePatchName("ENDBRDR0", PU_LEVEL);
}
} }
void F_EndingTicker(void) void F_EndingTicker(void)
@ -1844,15 +1869,7 @@ void F_EndingTicker(void)
S_ChangeMusicInternal((goodending ? "_endg" : "_endb"), false); S_ChangeMusicInternal((goodending ? "_endg" : "_endb"), false);
if (goodending && finalecount == INFLECTIONPOINT) // time to swap some assets if (goodending && finalecount == INFLECTIONPOINT) // time to swap some assets
{ F_CacheGoodEnding();
endegrk[0] = W_CachePatchName("ENDEGRK2", PU_LEVEL);
endegrk[1] = W_CachePatchName("ENDEGRK3", PU_LEVEL);
endglow[0] = W_CachePatchName("ENDGLOW2", PU_LEVEL);
endglow[1] = W_CachePatchName("ENDGLOW3", PU_LEVEL);
endxpld[0] = W_CachePatchName("ENDEGRK4", PU_LEVEL);
}
if (++sparklloop == SPARKLLOOPTIME) // time to roll the randomisation again if (++sparklloop == SPARKLLOOPTIME) // time to roll the randomisation again
{ {
@ -1871,10 +1888,17 @@ void F_EndingDrawer(void)
INT32 x, y, i, j, parallaxticker; INT32 x, y, i, j, parallaxticker;
patch_t *rockpat; patch_t *rockpat;
if (needpatchrecache)
{
F_CacheEnding();
if (goodending && finalecount >= INFLECTIONPOINT) // time to swap some assets
F_CacheGoodEnding();
}
if (!goodending || finalecount < INFLECTIONPOINT) if (!goodending || finalecount < INFLECTIONPOINT)
rockpat = W_CachePatchName("ROID0000", PU_LEVEL); rockpat = W_CachePatchName("ROID0000", PU_PATCH);
else else
rockpat = W_CachePatchName(va("ROID00%.2d", 34 - ((finalecount - INFLECTIONPOINT) % 35)), PU_LEVEL); rockpat = W_CachePatchName(va("ROID00%.2d", 34 - ((finalecount - INFLECTIONPOINT) % 35)), PU_PATCH);
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
@ -2358,11 +2382,11 @@ void F_SkyScroll(INT32 scrollxspeed, INT32 scrollyspeed, const char *patchname)
if (!scrollxspeed && !scrollyspeed) if (!scrollxspeed && !scrollyspeed)
{ {
V_DrawPatchFill(W_CachePatchName(patchname, PU_CACHE)); V_DrawPatchFill(W_CachePatchName(patchname, PU_PATCH));
return; return;
} }
pat = W_CachePatchName(patchname, PU_CACHE); pat = W_CachePatchName(patchname, PU_PATCH);
patwidth = SHORT(pat->width); patwidth = SHORT(pat->width);
patheight = SHORT(pat->height); patheight = SHORT(pat->height);
@ -2423,6 +2447,45 @@ else if (strlen(name) <= 6) \
else \ else \
arr[0] = 0; arr[0] = 0;
static void F_CacheTitleScreen(void)
{
switch(curttmode)
{
case TTMODE_OLD:
case TTMODE_NONE:
ttbanner = W_CachePatchName("TTBANNER", PU_LEVEL);
ttwing = W_CachePatchName("TTWING", PU_LEVEL);
ttsonic = W_CachePatchName("TTSONIC", PU_LEVEL);
ttswave1 = W_CachePatchName("TTSWAVE1", PU_LEVEL);
ttswave2 = W_CachePatchName("TTSWAVE2", PU_LEVEL);
ttswip1 = W_CachePatchName("TTSWIP1", PU_LEVEL);
ttsprep1 = W_CachePatchName("TTSPREP1", PU_LEVEL);
ttsprep2 = W_CachePatchName("TTSPREP2", PU_LEVEL);
ttspop1 = W_CachePatchName("TTSPOP1", PU_LEVEL);
ttspop2 = W_CachePatchName("TTSPOP2", PU_LEVEL);
ttspop3 = W_CachePatchName("TTSPOP3", PU_LEVEL);
ttspop4 = W_CachePatchName("TTSPOP4", PU_LEVEL);
ttspop5 = W_CachePatchName("TTSPOP5", PU_LEVEL);
ttspop6 = W_CachePatchName("TTSPOP6", PU_LEVEL);
ttspop7 = W_CachePatchName("TTSPOP7", PU_LEVEL);
break;
// don't load alacroix gfx yet; we do that upon first draw.
case TTMODE_ALACROIX:
break;
case TTMODE_USER:
{
UINT16 i;
lumpnum_t lumpnum;
char lumpname[9];
LOADTTGFX(ttuser, curttname, TTMAX_USER)
break;
}
}
}
void F_StartTitleScreen(void) void F_StartTitleScreen(void)
{ {
if (menupres[MN_MAIN].musname[0]) if (menupres[MN_MAIN].musname[0])
@ -2484,7 +2547,7 @@ void F_StartTitleScreen(void)
camera.x = startpos->x << FRACBITS; camera.x = startpos->x << FRACBITS;
camera.y = startpos->y << FRACBITS; camera.y = startpos->y << FRACBITS;
camera.subsector = R_PointInSubsector(camera.x, camera.y); camera.subsector = R_PointInSubsector(camera.x, camera.y);
camera.z = camera.subsector->sector->floorheight + ((startpos->options >> ZSHIFT) << FRACBITS); camera.z = camera.subsector->sector->floorheight + (startpos->z << FRACBITS);
camera.angle = (startpos->angle % 360)*ANG1; camera.angle = (startpos->angle % 360)*ANG1;
camera.aiming = 0; camera.aiming = 0;
} }
@ -2519,41 +2582,7 @@ void F_StartTitleScreen(void)
demoDelayLeft = demoDelayTime; demoDelayLeft = demoDelayTime;
demoIdleLeft = demoIdleTime; demoIdleLeft = demoIdleTime;
switch(curttmode) F_CacheTitleScreen();
{
case TTMODE_OLD:
case TTMODE_NONE:
ttbanner = W_CachePatchName("TTBANNER", PU_LEVEL);
ttwing = W_CachePatchName("TTWING", PU_LEVEL);
ttsonic = W_CachePatchName("TTSONIC", PU_LEVEL);
ttswave1 = W_CachePatchName("TTSWAVE1", PU_LEVEL);
ttswave2 = W_CachePatchName("TTSWAVE2", PU_LEVEL);
ttswip1 = W_CachePatchName("TTSWIP1", PU_LEVEL);
ttsprep1 = W_CachePatchName("TTSPREP1", PU_LEVEL);
ttsprep2 = W_CachePatchName("TTSPREP2", PU_LEVEL);
ttspop1 = W_CachePatchName("TTSPOP1", PU_LEVEL);
ttspop2 = W_CachePatchName("TTSPOP2", PU_LEVEL);
ttspop3 = W_CachePatchName("TTSPOP3", PU_LEVEL);
ttspop4 = W_CachePatchName("TTSPOP4", PU_LEVEL);
ttspop5 = W_CachePatchName("TTSPOP5", PU_LEVEL);
ttspop6 = W_CachePatchName("TTSPOP6", PU_LEVEL);
ttspop7 = W_CachePatchName("TTSPOP7", PU_LEVEL);
break;
// don't load alacroix gfx yet; we do that upon first draw.
case TTMODE_ALACROIX:
break;
case TTMODE_USER:
{
UINT16 i;
lumpnum_t lumpnum;
char lumpname[9];
LOADTTGFX(ttuser, curttname, TTMAX_USER)
break;
}
}
} }
static void F_UnloadAlacroixGraphics(SINT8 oldttscale) static void F_UnloadAlacroixGraphics(SINT8 oldttscale)
@ -2702,6 +2731,9 @@ void F_TitleScreenDrawer(void)
if (modeattacking) if (modeattacking)
return; // We likely came here from retrying. Don't do a damn thing. return; // We likely came here from retrying. Don't do a damn thing.
if (needpatchrecache && (curttmode != TTMODE_ALACROIX))
F_CacheTitleScreen();
// Draw that sky! // Draw that sky!
if (curbgcolor >= 0) if (curbgcolor >= 0)
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, curbgcolor); V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, curbgcolor);
@ -2725,6 +2757,12 @@ void F_TitleScreenDrawer(void)
return; return;
#endif #endif
if (needpatchrecache && (curttmode == TTMODE_ALACROIX))
{
ttloaded[0] = ttloaded[1] = ttloaded[2] = ttloaded[3] = ttloaded[4] = ttloaded[5] = 0;
F_LoadAlacroixGraphics(activettscale);
}
switch(curttmode) switch(curttmode)
{ {
case TTMODE_OLD: case TTMODE_OLD:
@ -3589,6 +3627,8 @@ void F_StartContinue(void)
return; return;
} }
wipestyleflags = WSF_FADEOUT;
F_TryColormapFade(31);
G_SetGamestate(GS_CONTINUING); G_SetGamestate(GS_CONTINUING);
gameaction = ga_nothing; gameaction = ga_nothing;
@ -3670,7 +3710,7 @@ void F_ContinueDrawer(void)
V_DrawLevelTitle(x - (V_LevelNameWidth("Continue?")>>1), 16, 0, "Continue?"); V_DrawLevelTitle(x - (V_LevelNameWidth("Continue?")>>1), 16, 0, "Continue?");
// Two stars... // Two stars...
patch = W_CachePatchName("CONTSTAR", PU_CACHE); patch = W_CachePatchName("CONTSTAR", PU_PATCH);
V_DrawScaledPatch(x-32, 160, 0, patch); V_DrawScaledPatch(x-32, 160, 0, patch);
V_DrawScaledPatch(x+32, 160, 0, patch); V_DrawScaledPatch(x+32, 160, 0, patch);
@ -3678,14 +3718,14 @@ void F_ContinueDrawer(void)
if (timeleft > 9) if (timeleft > 9)
{ {
numbuf[7] = '1'; numbuf[7] = '1';
V_DrawScaledPatch(x - 10, 160, 0, W_CachePatchName(numbuf, PU_CACHE)); V_DrawScaledPatch(x - 10, 160, 0, W_CachePatchName(numbuf, PU_PATCH));
numbuf[7] = '0'; numbuf[7] = '0';
V_DrawScaledPatch(x + 10, 160, 0, W_CachePatchName(numbuf, PU_CACHE)); V_DrawScaledPatch(x + 10, 160, 0, W_CachePatchName(numbuf, PU_PATCH));
} }
else else
{ {
numbuf[7] = '0'+timeleft; numbuf[7] = '0'+timeleft;
V_DrawScaledPatch(x, 160, 0, W_CachePatchName(numbuf, PU_CACHE)); V_DrawScaledPatch(x, 160, 0, W_CachePatchName(numbuf, PU_PATCH));
} }
// Draw the continue markers! Show continues. // Draw the continue markers! Show continues.
@ -3712,7 +3752,7 @@ void F_ContinueDrawer(void)
} }
// Spotlight // Spotlight
V_DrawScaledPatch(x, 140, 0, W_CachePatchName("CONTSPOT", PU_CACHE)); V_DrawScaledPatch(x, 140, 0, W_CachePatchName("CONTSPOT", PU_PATCH));
// warping laser // warping laser
if (continuetime) if (continuetime)
@ -3749,7 +3789,7 @@ void F_ContinueDrawer(void)
#define drawchar(dx, dy, n) {\ #define drawchar(dx, dy, n) {\
sprdef = &contskins[n]->sprites[cont_spr2[n][0]];\ sprdef = &contskins[n]->sprites[cont_spr2[n][0]];\
sprframe = &sprdef->spriteframes[cont_spr2[n][1]];\ sprframe = &sprdef->spriteframes[cont_spr2[n][1]];\
patch = W_CachePatchNum(sprframe->lumppat[cont_spr2[n][2]], PU_CACHE);\ patch = W_CachePatchNum(sprframe->lumppat[cont_spr2[n][2]], PU_PATCH);\
V_DrawFixedPatch((dx), (dy), FRACUNIT, (sprframe->flip & (1<<cont_spr2[n][2])) ? V_FLIP : 0, patch, contcolormaps[n]);\ V_DrawFixedPatch((dx), (dy), FRACUNIT, (sprframe->flip & (1<<cont_spr2[n][2])) ? V_FLIP : 0, patch, contcolormaps[n]);\
} }
@ -4013,10 +4053,10 @@ void F_CutsceneDrawer(void)
{ {
if (cutscenes[cutnum]->scene[scenenum].pichires[picnum]) if (cutscenes[cutnum]->scene[scenenum].pichires[picnum])
V_DrawSmallScaledPatch(picxpos, picypos, 0, V_DrawSmallScaledPatch(picxpos, picypos, 0,
W_CachePatchName(cutscenes[cutnum]->scene[scenenum].picname[picnum], PU_CACHE)); W_CachePatchName(cutscenes[cutnum]->scene[scenenum].picname[picnum], PU_PATCH));
else else
V_DrawScaledPatch(picxpos,picypos, 0, V_DrawScaledPatch(picxpos,picypos, 0,
W_CachePatchName(cutscenes[cutnum]->scene[scenenum].picname[picnum], PU_CACHE)); W_CachePatchName(cutscenes[cutnum]->scene[scenenum].picname[picnum], PU_PATCH));
} }
if (dofadenow && rendermode != render_none) if (dofadenow && rendermode != render_none)
@ -4502,10 +4542,10 @@ void F_TextPromptDrawer(void)
{ {
if (textprompts[cutnum]->page[scenenum].pichires[picnum]) if (textprompts[cutnum]->page[scenenum].pichires[picnum])
V_DrawSmallScaledPatch(picxpos, picypos, 0, V_DrawSmallScaledPatch(picxpos, picypos, 0,
W_CachePatchName(textprompts[cutnum]->page[scenenum].picname[picnum], PU_CACHE)); W_CachePatchName(textprompts[cutnum]->page[scenenum].picname[picnum], PU_PATCH));
else else
V_DrawScaledPatch(picxpos,picypos, 0, V_DrawScaledPatch(picxpos,picypos, 0,
W_CachePatchName(textprompts[cutnum]->page[scenenum].picname[picnum], PU_CACHE)); W_CachePatchName(textprompts[cutnum]->page[scenenum].picname[picnum], PU_PATCH));
} }
// Draw background // Draw background
@ -4515,7 +4555,7 @@ void F_TextPromptDrawer(void)
if (iconlump != LUMPERROR) if (iconlump != LUMPERROR)
{ {
INT32 iconx, icony, scale, scaledsize; INT32 iconx, icony, scale, scaledsize;
patch = W_CachePatchName(textprompts[cutnum]->page[scenenum].iconname, PU_CACHE); patch = W_CachePatchName(textprompts[cutnum]->page[scenenum].iconname, PU_PATCH);
// scale and center // scale and center
if (patch->width > patch->height) if (patch->width > patch->height)

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -146,7 +146,7 @@ extern boolean WipeStageTitle;
typedef enum typedef enum
{ {
WIPESTYLE_NORMAL, WIPESTYLE_NORMAL,
WIPESTYLE_LEVEL WIPESTYLE_COLORMAP
} wipestyle_t; } wipestyle_t;
extern wipestyle_t wipestyle; extern wipestyle_t wipestyle;
@ -159,6 +159,11 @@ typedef enum
} wipestyleflags_t; } wipestyleflags_t;
extern wipestyleflags_t wipestyleflags; extern wipestyleflags_t wipestyleflags;
// Even my function names are borderline
boolean F_ShouldColormapFade(void);
boolean F_TryColormapFade(UINT8 wipecolor);
void F_DecideWipeStyle(void);
#define FADECOLORMAPDIV 8 #define FADECOLORMAPDIV 8
#define FADECOLORMAPROWS (256/FADECOLORMAPDIV) #define FADECOLORMAPROWS (256/FADECOLORMAPDIV)

View file

@ -3,7 +3,7 @@
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 2013-2016 by Matthew "Inuyasha" Walsh. // Copyright (C) 2013-2016 by Matthew "Inuyasha" Walsh.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -56,7 +56,7 @@ UINT8 wipedefs[NUMWIPEDEFS] = {
0, // wipe_level_toblack 0, // wipe_level_toblack
UINT8_MAX, // wipe_intermission_toblack UINT8_MAX, // wipe_intermission_toblack
UINT8_MAX, // wipe_continuing_toblack 0, // wipe_continuing_toblack
0, // wipe_titlescreen_toblack 0, // wipe_titlescreen_toblack
0, // wipe_timeattack_toblack 0, // wipe_timeattack_toblack
99, // wipe_credits_toblack 99, // wipe_credits_toblack
@ -161,7 +161,7 @@ static fademask_t *F_GetFadeMask(UINT8 masknum, UINT8 scrnnum) {
{ {
// Determine pixel to use from fademask // Determine pixel to use from fademask
pcolor = &pMasterPalette[*lump++]; pcolor = &pMasterPalette[*lump++];
if (wipestyle == WIPESTYLE_LEVEL) if (wipestyle == WIPESTYLE_COLORMAP)
*mask++ = pcolor->s.red / FADECOLORMAPDIV; *mask++ = pcolor->s.red / FADECOLORMAPDIV;
else else
*mask++ = FixedDiv((pcolor->s.red+1)<<FRACBITS, paldiv)>>FRACBITS; *mask++ = FixedDiv((pcolor->s.red+1)<<FRACBITS, paldiv)>>FRACBITS;
@ -191,7 +191,7 @@ void F_WipeStageTitle(void)
{ {
// draw level title // draw level title
if ((WipeStageTitle && st_overlay) if ((WipeStageTitle && st_overlay)
&& (wipestyle == WIPESTYLE_LEVEL) && (wipestyle == WIPESTYLE_COLORMAP)
&& !(mapheaderinfo[gamemap-1]->levelflags & LF_NOTITLECARD) && !(mapheaderinfo[gamemap-1]->levelflags & LF_NOTITLECARD)
&& *mapheaderinfo[gamemap-1]->lvlttl != '\0') && *mapheaderinfo[gamemap-1]->lvlttl != '\0')
{ {
@ -282,7 +282,7 @@ static void F_DoWipe(fademask_t *fademask)
relativepos += vid.width; relativepos += vid.width;
} }
} }
else if (*mask >= ((wipestyle == WIPESTYLE_LEVEL) ? FADECOLORMAPROWS : 10)) else if (*mask >= 10)
{ {
// shortcut - memcpy target to work // shortcut - memcpy target to work
while (draw_linestogo--) while (draw_linestogo--)
@ -293,25 +293,8 @@ static void F_DoWipe(fademask_t *fademask)
} }
else else
{ {
if (wipestyle == WIPESTYLE_LEVEL) // pointer to transtable that this mask would use
{ transtbl = transtables + ((9 - *mask)<<FF_TRANSSHIFT);
int nmask;
UINT8 *fade = fadecolormap;
if (wipestyleflags & WSF_TOWHITE)
fade = fadecolormap + (FADECOLORMAPROWS * 256);
nmask = *mask;
if (wipestyleflags & WSF_FADEIN)
nmask = (FADECOLORMAPROWS-1) - nmask;
transtbl = fade + (nmask * 256);
}
else
{
// pointer to transtable that this mask would use
transtbl = transtables + ((9 - *mask)<<FF_TRANSSHIFT);
}
// DRAWING LOOP // DRAWING LOOP
while (draw_linestogo--) while (draw_linestogo--)
@ -321,16 +304,113 @@ static void F_DoWipe(fademask_t *fademask)
e = e_base + relativepos; e = e_base + relativepos;
draw_rowstogo = draw_rowend - draw_rowstart; draw_rowstogo = draw_rowend - draw_rowstart;
if (wipestyle == WIPESTYLE_LEVEL) while (draw_rowstogo--)
{ *w++ = transtbl[ ( *e++ << 8 ) + *s++ ];
while (draw_rowstogo--)
*w++ = transtbl[*e++]; relativepos += vid.width;
} }
else // END DRAWING LOOP
{ }
while (draw_rowstogo--)
*w++ = transtbl[ ( *e++ << 8 ) + *s++ ]; if (++maskx >= fademask->width)
} ++masky, maskx = 0;
} while (++mask < maskend);
free(scrxpos);
free(scrypos);
}
}
static void F_DoColormapWipe(fademask_t *fademask, UINT8 *colormap)
{
// Lactozilla: F_DoWipe for WIPESTYLE_COLORMAP
{
// wipe screen, start, end
UINT8 *w = wipe_scr;
const UINT8 *s = wipe_scr_start;
const UINT8 *e = wipe_scr_end;
// first pixel for each screen
UINT8 *w_base = w;
const UINT8 *s_base = s;
const UINT8 *e_base = e;
// mask data, end
UINT8 *transtbl;
const UINT8 *mask = fademask->mask;
const UINT8 *maskend = mask + fademask->size;
// rectangle draw hints
UINT32 draw_linestart, draw_rowstart;
UINT32 draw_lineend, draw_rowend;
UINT32 draw_linestogo, draw_rowstogo;
// rectangle coordinates, etc.
UINT16* scrxpos = (UINT16*)malloc((fademask->width + 1) * sizeof(UINT16));
UINT16* scrypos = (UINT16*)malloc((fademask->height + 1) * sizeof(UINT16));
UINT16 maskx, masky;
UINT32 relativepos;
// ---
// Screw it, we do the fixed point math ourselves up front.
scrxpos[0] = 0;
for (relativepos = 0, maskx = 1; maskx < fademask->width; ++maskx)
scrxpos[maskx] = (relativepos += fademask->xscale)>>FRACBITS;
scrxpos[fademask->width] = vid.width;
scrypos[0] = 0;
for (relativepos = 0, masky = 1; masky < fademask->height; ++masky)
scrypos[masky] = (relativepos += fademask->yscale)>>FRACBITS;
scrypos[fademask->height] = vid.height;
// ---
maskx = masky = 0;
do
{
draw_rowstart = scrxpos[maskx];
draw_rowend = scrxpos[maskx + 1];
draw_linestart = scrypos[masky];
draw_lineend = scrypos[masky + 1];
relativepos = (draw_linestart * vid.width) + draw_rowstart;
draw_linestogo = draw_lineend - draw_linestart;
if (*mask == 0)
{
// shortcut - memcpy source to work
while (draw_linestogo--)
{
M_Memcpy(w_base+relativepos, s_base+relativepos, draw_rowend-draw_rowstart);
relativepos += vid.width;
}
}
else if (*mask >= FADECOLORMAPROWS)
{
// shortcut - memcpy target to work
while (draw_linestogo--)
{
M_Memcpy(w_base+relativepos, e_base+relativepos, draw_rowend-draw_rowstart);
relativepos += vid.width;
}
}
else
{
int nmask = *mask;
if (wipestyleflags & WSF_FADEIN)
nmask = (FADECOLORMAPROWS-1) - nmask;
transtbl = colormap + (nmask * 256);
// DRAWING LOOP
while (draw_linestogo--)
{
w = w_base + relativepos;
s = s_base + relativepos;
e = e_base + relativepos;
draw_rowstogo = draw_rowend - draw_rowstart;
while (draw_rowstogo--)
*w++ = transtbl[*e++];
relativepos += vid.width; relativepos += vid.width;
} }
@ -382,6 +462,62 @@ void F_WipeEndScreen(void)
#endif #endif
} }
/** Verifies every condition for a colormapped fade.
*/
boolean F_ShouldColormapFade(void)
{
if ((wipestyleflags & (WSF_FADEIN|WSF_FADEOUT)) // only if one of those wipestyleflags are actually set
&& !(wipestyleflags & WSF_CROSSFADE)) // and if not crossfading
{
// World
return (gamestate == GS_LEVEL
|| gamestate == GS_TITLESCREEN
// Finales
|| gamestate == GS_CONTINUING
|| gamestate == GS_CREDITS
|| gamestate == GS_EVALUATION
|| gamestate == GS_INTRO
|| gamestate == GS_ENDING
// Menus
|| gamestate == GS_TIMEATTACK);
}
return false;
}
/** Decides what wipe style to use.
*/
void F_DecideWipeStyle(void)
{
// Set default wipe style
wipestyle = WIPESTYLE_NORMAL;
// Check for colormap wipe style
if (F_ShouldColormapFade())
wipestyle = WIPESTYLE_COLORMAP;
}
/** Attempt to run a colormap fade,
provided all the conditionals were properly met.
Returns true if so.
I demand you call F_RunWipe after this function.
*/
boolean F_TryColormapFade(UINT8 wipecolor)
{
if (F_ShouldColormapFade())
{
#ifdef HWRENDER
if (rendermode == render_opengl)
F_WipeColorFill(wipecolor);
#endif
return true;
}
else
{
F_WipeColorFill(wipecolor);
return false;
}
}
/** After setting up the screens you want to wipe, /** After setting up the screens you want to wipe,
* calling this will do a 'typical' wipe. * calling this will do a 'typical' wipe.
*/ */
@ -399,18 +535,10 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu)
paldiv = FixedDiv(257<<FRACBITS, 11<<FRACBITS); paldiv = FixedDiv(257<<FRACBITS, 11<<FRACBITS);
// Init the wipe // Init the wipe
F_DecideWipeStyle();
WipeInAction = true; WipeInAction = true;
wipe_scr = screens[0]; wipe_scr = screens[0];
// don't know where else to put this.
// this any good?
if ((gamestate == GS_LEVEL || gamestate == GS_TITLESCREEN)
&& (wipestyleflags & (WSF_FADEIN|WSF_FADEOUT)) // only if one of those wipestyleflags are actually set
&& !(wipestyleflags & WSF_CROSSFADE)) // and if not crossfading
wipestyle = WIPESTYLE_LEVEL;
else
wipestyle = WIPESTYLE_NORMAL;
// lastwipetic should either be 0 or the tic we last wiped // lastwipetic should either be 0 or the tic we last wiped
// on for fade-to-black // on for fade-to-black
for (;;) for (;;)
@ -425,21 +553,39 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu)
I_Sleep(); I_Sleep();
lastwipetic = nowtime; lastwipetic = nowtime;
#ifdef HWRENDER // Wipe styles
if (rendermode == render_opengl) if (wipestyle == WIPESTYLE_COLORMAP)
{ {
// send in the wipe type and wipe frame because we need to cache the graphic #ifdef HWRENDER
if (wipestyle == WIPESTYLE_LEVEL) if (rendermode == render_opengl)
{
// send in the wipe type and wipe frame because we need to cache the graphic
HWR_DoTintedWipe(wipetype, wipeframe-1); HWR_DoTintedWipe(wipetype, wipeframe-1);
}
else else
HWR_DoWipe(wipetype, wipeframe-1); #endif
{
UINT8 *colormap = fadecolormap;
if (wipestyleflags & WSF_TOWHITE)
colormap += (FADECOLORMAPROWS * 256);
F_DoColormapWipe(fmask, colormap);
}
// Draw the title card above the wipe
F_WipeStageTitle();
} }
else else
{
#ifdef HWRENDER
if (rendermode == render_opengl)
{
// send in the wipe type and wipe frame because we need to cache the graphic
HWR_DoWipe(wipetype, wipeframe-1);
}
else
#endif #endif
F_DoWipe(fmask); F_DoWipe(fmask);
}
if (wipestyle == WIPESTYLE_LEVEL)
F_WipeStageTitle();
I_OsPolling(); I_OsPolling();
I_UpdateNoBlit(); I_UpdateNoBlit();

File diff suppressed because it is too large Load diff

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -72,6 +72,7 @@ extern consvar_t cv_useranalog, cv_useranalog2;
extern consvar_t cv_analog, cv_analog2; extern consvar_t cv_analog, cv_analog2;
extern consvar_t cv_directionchar, cv_directionchar2; extern consvar_t cv_directionchar, cv_directionchar2;
extern consvar_t cv_autobrake, cv_autobrake2; extern consvar_t cv_autobrake, cv_autobrake2;
extern consvar_t cv_deadzone, cv_deadzone2;
extern consvar_t cv_sideaxis,cv_turnaxis,cv_moveaxis,cv_lookaxis,cv_jumpaxis,cv_spinaxis,cv_fireaxis,cv_firenaxis; extern consvar_t cv_sideaxis,cv_turnaxis,cv_moveaxis,cv_lookaxis,cv_jumpaxis,cv_spinaxis,cv_fireaxis,cv_firenaxis;
extern consvar_t cv_sideaxis2,cv_turnaxis2,cv_moveaxis2,cv_lookaxis2,cv_jumpaxis2,cv_spinaxis2,cv_fireaxis2,cv_firenaxis2; extern consvar_t cv_sideaxis2,cv_turnaxis2,cv_moveaxis2,cv_lookaxis2,cv_jumpaxis2,cv_spinaxis2,cv_fireaxis2,cv_firenaxis2;
extern consvar_t cv_ghost_bestscore, cv_ghost_besttime, cv_ghost_bestrings, cv_ghost_last, cv_ghost_guest; extern consvar_t cv_ghost_bestscore, cv_ghost_besttime, cv_ghost_bestrings, cv_ghost_last, cv_ghost_guest;
@ -129,6 +130,9 @@ INT32 G_FindMap(const char *query, char **foundmapnamep,
mapsearchfreq_t **freqp, INT32 *freqc); mapsearchfreq_t **freqp, INT32 *freqc);
void G_FreeMapSearch(mapsearchfreq_t *freq, INT32 freqc); void G_FreeMapSearch(mapsearchfreq_t *freq, INT32 freqc);
/* Match map name by search + 2 digit map code or map number. */
INT32 G_FindMapByNameOrCode(const char *query, char **foundmapnamep);
// XMOD spawning // XMOD spawning
mapthing_t *G_FindCTFStart(INT32 playernum); mapthing_t *G_FindCTFStart(INT32 playernum);
mapthing_t *G_FindMatchStart(INT32 playernum); mapthing_t *G_FindMatchStart(INT32 playernum);
@ -141,7 +145,8 @@ void G_DeferedInitNew(boolean pultmode, const char *mapname, INT32 pickedchar,
boolean SSSG, boolean FLS); boolean SSSG, boolean FLS);
void G_DoLoadLevel(boolean resetplayer); void G_DoLoadLevel(boolean resetplayer);
void G_StartTitleCard(void); void G_StartTitleCard(void);
void G_PreLevelTitleCard(tic_t ticker, boolean update); void G_PreLevelTitleCard(void);
boolean G_IsTitleCardAvailable(void);
void G_DeferedPlayDemo(const char *demo); void G_DeferedPlayDemo(const char *demo);
// Can be called by the startup code or M_Responder, calls P_SetupLevel. // Can be called by the startup code or M_Responder, calls P_SetupLevel.
@ -201,14 +206,29 @@ ATTRNORETURN void FUNCNORETURN G_StopMetalRecording(boolean kill);
void G_StopDemo(void); void G_StopDemo(void);
boolean G_CheckDemoStatus(void); boolean G_CheckDemoStatus(void);
extern UINT32 gametypedefaultrules[NUMGAMETYPES];
extern UINT32 gametypetol[NUMGAMETYPES];
extern INT16 gametyperankings[NUMGAMETYPES];
void G_SetGametype(INT16 gametype);
INT16 G_AddGametype(UINT32 rules);
void G_AddGametypeConstant(INT16 gtype, const char *newgtconst);
void G_UpdateGametypeSelections(void);
void G_AddTOL(UINT32 newtol, const char *tolname);
void G_AddGametypeTOL(INT16 gtype, UINT32 newtol);
void G_SetGametypeDescription(INT16 gtype, char *descriptiontext, UINT8 leftcolor, UINT8 rightcolor);
INT32 G_GetGametypeByName(const char *gametypestr); INT32 G_GetGametypeByName(const char *gametypestr);
boolean G_IsSpecialStage(INT32 mapnum); boolean G_IsSpecialStage(INT32 mapnum);
boolean G_GametypeUsesLives(void); boolean G_GametypeUsesLives(void);
boolean G_GametypeUsesCoopLives(void);
boolean G_GametypeUsesCoopStarposts(void);
boolean G_GametypeHasTeams(void); boolean G_GametypeHasTeams(void);
boolean G_GametypeHasSpectators(void); boolean G_GametypeHasSpectators(void);
boolean G_RingSlingerGametype(void); boolean G_RingSlingerGametype(void);
boolean G_PlatformGametype(void); boolean G_PlatformGametype(void);
boolean G_TagGametype(void); boolean G_TagGametype(void);
boolean G_CompetitionGametype(void);
boolean G_EnoughPlayersFinished(void); boolean G_EnoughPlayersFinished(void);
void G_ExitLevel(void); void G_ExitLevel(void);
void G_NextLevel(void); void G_NextLevel(void);

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -449,8 +449,12 @@ static poly_t *CutOutSubsecPoly(seg_t *lseg, INT32 count, poly_t *poly)
// for each seg of the subsector // for each seg of the subsector
for (; count--; lseg++) for (; count--; lseg++)
{ {
//x,y,dx,dy (like a divline)
line_t *line = lseg->linedef; line_t *line = lseg->linedef;
if (lseg->glseg)
continue;
//x,y,dx,dy (like a divline)
p1.x = FIXED_TO_FLOAT(lseg->side ? line->v2->x : line->v1->x); p1.x = FIXED_TO_FLOAT(lseg->side ? line->v2->x : line->v1->x);
p1.y = FIXED_TO_FLOAT(lseg->side ? line->v2->y : line->v1->y); p1.y = FIXED_TO_FLOAT(lseg->side ? line->v2->y : line->v1->y);
p2.x = FIXED_TO_FLOAT(lseg->side ? line->v1->x : line->v2->x); p2.x = FIXED_TO_FLOAT(lseg->side ? line->v1->x : line->v2->x);
@ -836,8 +840,10 @@ static INT32 SolveTProblem(void)
return 0; return 0;
CONS_Debug(DBG_RENDER, "Solving T-joins. This may take a while. Please wait...\n"); CONS_Debug(DBG_RENDER, "Solving T-joins. This may take a while. Please wait...\n");
#ifdef HWR_LOADING_SCREEN
CON_Drawer(); //let the user know what we are doing CON_Drawer(); //let the user know what we are doing
I_FinishUpdate(); // page flip or blit buffer I_FinishUpdate(); // page flip or blit buffer
#endif
numsplitpoly = 0; numsplitpoly = 0;
@ -964,9 +970,9 @@ void HWR_CreatePlanePolygons(INT32 bspnum)
CONS_Debug(DBG_RENDER, "Creating polygons, please wait...\n"); CONS_Debug(DBG_RENDER, "Creating polygons, please wait...\n");
#ifdef HWR_LOADING_SCREEN #ifdef HWR_LOADING_SCREEN
ls_count = ls_percent = 0; // reset the loading status ls_count = ls_percent = 0; // reset the loading status
#endif
CON_Drawer(); //let the user know what we are doing CON_Drawer(); //let the user know what we are doing
I_FinishUpdate(); // page flip or blit buffer I_FinishUpdate(); // page flip or blit buffer
#endif
HWR_ClearPolys(); HWR_ClearPolys();

View file

@ -33,10 +33,6 @@
#include "../r_patch.h" #include "../r_patch.h"
#include "../p_setup.h" #include "../p_setup.h"
//Hurdler: 25/04/2000: used for new colormap code in hardware mode
//static UINT8 *gr_colormap = NULL; // by default it must be NULL ! (because colormap tables are not initialized)
boolean firetranslucent = false;
// Values set after a call to HWR_ResizeBlock() // Values set after a call to HWR_ResizeBlock()
static INT32 blocksize, blockwidth, blockheight; static INT32 blocksize, blockwidth, blockheight;
@ -122,18 +118,16 @@ static void HWR_DrawColumnInCache(const column_t *patchcol, UINT8 *block, GLMipm
texel = source[yfrac>>FRACBITS]; texel = source[yfrac>>FRACBITS];
if (firetranslucent && (transtables[(texel<<8)+0x40000]!=texel)) //Hurdler: 25/04/2000: now support colormap in hardware mode
alpha = 0x80; if (mipmap->colormap)
texel = mipmap->colormap[texel];
// transparent pixel
if (texel == HWR_PATCHES_CHROMAKEY_COLORINDEX)
alpha = 0x00;
else else
alpha = 0xff; alpha = 0xff;
//Hurdler: not perfect, but better than holes
if (texel == HWR_PATCHES_CHROMAKEY_COLORINDEX && (mipmap->flags & TF_CHROMAKEYED))
texel = HWR_CHROMAKEY_EQUIVALENTCOLORINDEX;
//Hurdler: 25/04/2000: now support colormap in hardware mode
else if (mipmap->colormap)
texel = mipmap->colormap[texel];
// hope compiler will get this switch out of the loops (dreams...) // hope compiler will get this switch out of the loops (dreams...)
// gcc do it ! but vcc not ! (why don't use cygwin gcc for win32 ?) // gcc do it ! but vcc not ! (why don't use cygwin gcc for win32 ?)
// Alam: SRB2 uses Mingw, HUGS // Alam: SRB2 uses Mingw, HUGS
@ -236,18 +230,16 @@ static void HWR_DrawFlippedColumnInCache(const column_t *patchcol, UINT8 *block,
texel = source[yfrac>>FRACBITS]; texel = source[yfrac>>FRACBITS];
if (firetranslucent && (transtables[(texel<<8)+0x40000]!=texel)) //Hurdler: 25/04/2000: now support colormap in hardware mode
alpha = 0x80; if (mipmap->colormap)
texel = mipmap->colormap[texel];
// transparent pixel
if (texel == HWR_PATCHES_CHROMAKEY_COLORINDEX)
alpha = 0x00;
else else
alpha = 0xff; alpha = 0xff;
//Hurdler: not perfect, but better than holes
if (texel == HWR_PATCHES_CHROMAKEY_COLORINDEX && (mipmap->flags & TF_CHROMAKEYED))
texel = HWR_CHROMAKEY_EQUIVALENTCOLORINDEX;
//Hurdler: 25/04/2000: now support colormap in hardware mode
else if (mipmap->colormap)
texel = mipmap->colormap[texel];
// hope compiler will get this switch out of the loops (dreams...) // hope compiler will get this switch out of the loops (dreams...)
// gcc do it ! but vcc not ! (why don't use cygwin gcc for win32 ?) // gcc do it ! but vcc not ! (why don't use cygwin gcc for win32 ?)
// Alam: SRB2 uses Mingw, HUGS // Alam: SRB2 uses Mingw, HUGS
@ -576,7 +568,7 @@ static UINT8 *MakeBlock(GLMipmap_t *grMipmap)
{ {
UINT8 *block; UINT8 *block;
INT32 bpp, i; INT32 bpp, i;
UINT16 bu16 = ((0x00 <<8) | HWR_CHROMAKEY_EQUIVALENTCOLORINDEX); UINT16 bu16 = ((0x00 <<8) | HWR_PATCHES_CHROMAKEY_COLORINDEX);
bpp = format2bpp[grMipmap->grInfo.format]; bpp = format2bpp[grMipmap->grInfo.format];
block = Z_Malloc(blocksize*bpp, PU_HWRCACHE, &(grMipmap->grInfo.data)); block = Z_Malloc(blocksize*bpp, PU_HWRCACHE, &(grMipmap->grInfo.data));
@ -606,6 +598,7 @@ static void HWR_GenerateTexture(INT32 texnum, GLTexture_t *grtex)
texture_t *texture; texture_t *texture;
texpatch_t *patch; texpatch_t *patch;
patch_t *realpatch; patch_t *realpatch;
UINT8 *pdata;
INT32 i; INT32 i;
boolean skyspecial = false; //poor hack for Legacy large skies.. boolean skyspecial = false; //poor hack for Legacy large skies..
@ -638,7 +631,7 @@ static void HWR_GenerateTexture(INT32 texnum, GLTexture_t *grtex)
INT32 j; INT32 j;
RGBA_t col; RGBA_t col;
col = V_GetColor(HWR_CHROMAKEY_EQUIVALENTCOLORINDEX); col = V_GetColor(HWR_PATCHES_CHROMAKEY_COLORINDEX);
for (j = 0; j < blockheight; j++) for (j = 0; j < blockheight; j++)
{ {
for (i = 0; i < blockwidth; i++) for (i = 0; i < blockwidth; i++)
@ -654,19 +647,30 @@ static void HWR_GenerateTexture(INT32 texnum, GLTexture_t *grtex)
// Composite the columns together. // Composite the columns together.
for (i = 0, patch = texture->patches; i < texture->patchcount; i++, patch++) for (i = 0, patch = texture->patches; i < texture->patchcount; i++, patch++)
{ {
#ifndef NO_PNG_LUMPS boolean dealloc = true;
size_t lumplength = W_LumpLengthPwad(patch->wad, patch->lump); size_t lumplength = W_LumpLengthPwad(patch->wad, patch->lump);
#endif pdata = W_CacheLumpNumPwad(patch->wad, patch->lump, PU_CACHE);
realpatch = W_CacheLumpNumPwad(patch->wad, patch->lump, PU_CACHE); realpatch = (patch_t *)pdata;
#ifndef NO_PNG_LUMPS #ifndef NO_PNG_LUMPS
if (R_IsLumpPNG((UINT8 *)realpatch, lumplength)) if (R_IsLumpPNG((UINT8 *)realpatch, lumplength))
realpatch = R_PNGToPatch((UINT8 *)realpatch, lumplength, NULL, false); realpatch = R_PNGToPatch((UINT8 *)realpatch, lumplength, NULL, false);
else
#endif #endif
HWR_DrawTexturePatchInCache(&grtex->mipmap, #ifdef WALLFLATS
blockwidth, blockheight, if (texture->type == TEXTURETYPE_FLAT)
texture, patch, realpatch = R_FlatToPatch(pdata, texture->width, texture->height, 0, 0, NULL, false);
realpatch); else
Z_Unlock(realpatch); #endif
{
(void)lumplength;
dealloc = false;
}
HWR_DrawTexturePatchInCache(&grtex->mipmap, blockwidth, blockheight, texture, patch, realpatch);
if (dealloc)
Z_Unlock(realpatch);
} }
//Hurdler: not efficient at all but I don't remember exactly how HWR_DrawPatchInCache works :( //Hurdler: not efficient at all but I don't remember exactly how HWR_DrawPatchInCache works :(
if (format2bpp[grtex->mipmap.grInfo.format]==4) if (format2bpp[grtex->mipmap.grInfo.format]==4)
@ -760,15 +764,14 @@ void HWR_MakePatch (const patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipm
// CACHING HANDLING // CACHING HANDLING
// ================================================= // =================================================
static size_t gr_numtextures; static size_t gr_numtextures = 0; // Texture count
static GLTexture_t *gr_textures; // for ALL Doom textures static GLTexture_t *gr_textures; // For all textures
static GLTexture_t *gr_textures2; static GLTexture_t *gr_flats; // For all (texture) flats, as normal flats don't need to be cached
void HWR_InitTextureCache(void) void HWR_InitTextureCache(void)
{ {
gr_numtextures = 0;
gr_textures = NULL; gr_textures = NULL;
gr_textures2 = NULL; gr_flats = NULL;
} }
// Callback function for HWR_FreeTextureCache. // Callback function for HWR_FreeTextureCache.
@ -776,29 +779,45 @@ static void FreeMipmapColormap(INT32 patchnum, void *patch)
{ {
GLPatch_t* const pat = patch; GLPatch_t* const pat = patch;
(void)patchnum; //unused (void)patchnum; //unused
while (pat->mipmap && pat->mipmap->nextcolormap) // The mipmap must be valid, obviously
// The patch must be valid, obviously
if (!pat)
return;
// The mipmap must be valid, obviously
while (pat->mipmap)
{ {
// Confusing at first, but pat->mipmap->nextcolormap // Confusing at first, but pat->mipmap->nextcolormap
// at the beginning of the loop is the first colormap // at the beginning of the loop is the first colormap
// from the linked list of colormaps // from the linked list of colormaps.
GLMipmap_t *next = pat->mipmap; GLMipmap_t *next = NULL;
if (!next) // No mipmap in this patch, break out of loop.
// No mipmap in this patch, break out of the loop.
if (!pat->mipmap)
break; break;
// Set the first colormap
// to the one that comes after it // No colormap mipmap either.
next = next->nextcolormap; if (!pat->mipmap->nextcolormap)
break;
// Set the first colormap to the one that comes after it.
next = pat->mipmap->nextcolormap;
pat->mipmap->nextcolormap = next->nextcolormap; pat->mipmap->nextcolormap = next->nextcolormap;
// Free image data from memory
// Free image data from memory.
if (next->grInfo.data) if (next->grInfo.data)
Z_Free(next->grInfo.data); Z_Free(next->grInfo.data);
// Free the old colormap from memory next->grInfo.data = NULL;
// Free the old colormap mipmap from memory.
free(next); free(next);
} }
} }
void HWR_FreeTextureCache(void) void HWR_FreeMipmapCache(void)
{ {
INT32 i; INT32 i;
// free references to the textures // free references to the textures
HWD.pfnClearMipMapCache(); HWD.pfnClearMipMapCache();
@ -808,51 +827,46 @@ void HWR_FreeTextureCache(void)
Z_FreeTag(PU_HWRCACHE_UNLOCKED); Z_FreeTag(PU_HWRCACHE_UNLOCKED);
// Alam: free the Z_Blocks before freeing it's users // Alam: free the Z_Blocks before freeing it's users
// free all patch colormaps after each level: must be done after ClearMipMapCache! // free all patch colormaps after each level: must be done after ClearMipMapCache!
for (i = 0; i < numwadfiles; i++) for (i = 0; i < numwadfiles; i++)
M_AATreeIterate(wadfiles[i]->hwrcache, FreeMipmapColormap); M_AATreeIterate(wadfiles[i]->hwrcache, FreeMipmapColormap);
}
void HWR_FreeTextureCache(void)
{
// free references to the textures
HWR_FreeMipmapCache();
// now the heap don't have any 'user' pointing to our // now the heap don't have any 'user' pointing to our
// texturecache info, we can free it // texturecache info, we can free it
if (gr_textures) if (gr_textures)
free(gr_textures); free(gr_textures);
if (gr_textures2) if (gr_flats)
free(gr_textures2); free(gr_flats);
gr_textures = NULL; gr_textures = NULL;
gr_textures2 = NULL; gr_flats = NULL;
gr_numtextures = 0; gr_numtextures = 0;
} }
void HWR_PrepLevelCache(size_t pnumtextures) void HWR_LoadTextures(size_t pnumtextures)
{ {
// problem: the mipmap cache management hold a list of mipmaps.. but they are
// reallocated on each level..
//sub-optimal, but 1) just need re-download stuff in hardware cache VERY fast
// 2) sprite/menu stuff mixed with level textures so can't do anything else
// we must free it since numtextures changed // we must free it since numtextures changed
HWR_FreeTextureCache(); HWR_FreeTextureCache();
// Why not Z_Malloc?
gr_numtextures = pnumtextures; gr_numtextures = pnumtextures;
gr_textures = calloc(pnumtextures, sizeof (*gr_textures)); gr_textures = calloc(gr_numtextures, sizeof(*gr_textures));
if (gr_textures == NULL) gr_flats = calloc(gr_numtextures, sizeof(*gr_flats));
I_Error("3D can't alloc gr_textures");
gr_textures2 = calloc(pnumtextures, sizeof (*gr_textures2)); // Doesn't tell you which it _is_, but hopefully
if (gr_textures2 == NULL) // should never ever happen (right?!)
I_Error("3D can't alloc gr_textures2"); if ((gr_textures == NULL) || (gr_flats == NULL))
I_Error("HWR_LoadTextures: ran out of memory for OpenGL textures. Sad!");
} }
void HWR_SetPalette(RGBA_t *palette) void HWR_SetPalette(RGBA_t *palette)
{ {
//Hudler: 16/10/99: added for OpenGL gamma correction HWD.pfnSetPalette(palette);
RGBA_t gamma_correction = {0x7F7F7F7F};
//Hurdler 16/10/99: added for OpenGL gamma correction
gamma_correction.s.red = (UINT8)cv_grgammared.value;
gamma_correction.s.green = (UINT8)cv_grgammagreen.value;
gamma_correction.s.blue = (UINT8)cv_grgammablue.value;
HWD.pfnSetPalette(palette, &gamma_correction);
// hardware driver will flush there own cache if cache is non paletized // hardware driver will flush there own cache if cache is non paletized
// now flush data texture cache so 32 bit texture are recomputed // now flush data texture cache so 32 bit texture are recomputed
@ -873,11 +887,16 @@ GLTexture_t *HWR_GetTexture(INT32 tex)
if ((unsigned)tex >= gr_numtextures) if ((unsigned)tex >= gr_numtextures)
I_Error("HWR_GetTexture: tex >= numtextures\n"); I_Error("HWR_GetTexture: tex >= numtextures\n");
#endif #endif
// Every texture in memory, stored in the
// hardware renderer's bit depth format. Wow!
grtex = &gr_textures[tex]; grtex = &gr_textures[tex];
// Generate texture if missing from the cache
if (!grtex->mipmap.grInfo.data && !grtex->mipmap.downloaded) if (!grtex->mipmap.grInfo.data && !grtex->mipmap.downloaded)
HWR_GenerateTexture(tex, grtex); HWR_GenerateTexture(tex, grtex);
// Tell the hardware driver to bind the current texture to the flat's mipmap
HWD.pfnSetTexture(&grtex->mipmap); HWD.pfnSetTexture(&grtex->mipmap);
// The system-memory data can be purged now. // The system-memory data can be purged now.
@ -938,6 +957,9 @@ static void HWR_CacheTextureAsFlat(GLMipmap_t *grMipmap, INT32 texturenum)
{ {
UINT8 *flat; UINT8 *flat;
if (needpatchflush)
W_FlushCachedPatches();
// setup the texture info // setup the texture info
#ifdef GLIDE_API_COMPATIBILITY #ifdef GLIDE_API_COMPATIBILITY
grMipmap->grInfo.smallLodLog2 = GR_LOD_LOG2_64; grMipmap->grInfo.smallLodLog2 = GR_LOD_LOG2_64;
@ -963,6 +985,9 @@ void HWR_LiterallyGetFlat(lumpnum_t flatlumpnum)
if (flatlumpnum == LUMPERROR) if (flatlumpnum == LUMPERROR)
return; return;
if (needpatchflush)
W_FlushCachedPatches();
grmip = HWR_GetCachedGLPatch(flatlumpnum)->mipmap; grmip = HWR_GetCachedGLPatch(flatlumpnum)->mipmap;
if (!grmip->downloaded && !grmip->grInfo.data) if (!grmip->downloaded && !grmip->grInfo.data)
HWR_CacheFlat(grmip, flatlumpnum); HWR_CacheFlat(grmip, flatlumpnum);
@ -989,13 +1014,19 @@ void HWR_GetLevelFlat(levelflat_t *levelflat)
if ((unsigned)texturenum >= gr_numtextures) if ((unsigned)texturenum >= gr_numtextures)
I_Error("HWR_GetLevelFlat: texturenum >= numtextures\n"); I_Error("HWR_GetLevelFlat: texturenum >= numtextures\n");
#endif #endif
// Who knows?
if (texturenum == 0 || texturenum == -1) if (texturenum == 0 || texturenum == -1)
return; return;
grtex = &gr_textures2[texturenum];
// Every texture in memory, stored as a 8-bit flat. Wow!
grtex = &gr_flats[texturenum];
// Generate flat if missing from the cache
if (!grtex->mipmap.grInfo.data && !grtex->mipmap.downloaded) if (!grtex->mipmap.grInfo.data && !grtex->mipmap.downloaded)
HWR_CacheTextureAsFlat(&grtex->mipmap, texturenum); HWR_CacheTextureAsFlat(&grtex->mipmap, texturenum);
// Tell the hardware driver to bind the current texture to the flat's mipmap
HWD.pfnSetTexture(&grtex->mipmap); HWD.pfnSetTexture(&grtex->mipmap);
// The system-memory data can be purged now. // The system-memory data can be purged now.
@ -1019,6 +1050,7 @@ static void HWR_LoadMappedPatch(GLMipmap_t *grmip, GLPatch_t *gpatch)
HWR_MakePatch(patch, gpatch, grmip, true); HWR_MakePatch(patch, gpatch, grmip, true);
// You can't free rawpatch for some reason? // You can't free rawpatch for some reason?
// (Obviously I can't, sprite rotation needs that...)
if (!gpatch->rawpatch) if (!gpatch->rawpatch)
Z_Free(patch); Z_Free(patch);
} }
@ -1034,6 +1066,9 @@ static void HWR_LoadMappedPatch(GLMipmap_t *grmip, GLPatch_t *gpatch)
// -----------------+ // -----------------+
void HWR_GetPatch(GLPatch_t *gpatch) void HWR_GetPatch(GLPatch_t *gpatch)
{ {
if (needpatchflush)
W_FlushCachedPatches();
// is it in hardware cache // is it in hardware cache
if (!gpatch->mipmap->downloaded && !gpatch->mipmap->grInfo.data) if (!gpatch->mipmap->downloaded && !gpatch->mipmap->grInfo.data)
{ {
@ -1046,7 +1081,6 @@ void HWR_GetPatch(GLPatch_t *gpatch)
// this is inefficient.. but the hardware patch in heap is purgeable so it should // this is inefficient.. but the hardware patch in heap is purgeable so it should
// not fragment memory, and besides the REAL cache here is the hardware memory // not fragment memory, and besides the REAL cache here is the hardware memory
// You can't free rawpatch for some reason?
if (!gpatch->rawpatch) if (!gpatch->rawpatch)
Z_Free(ptr); Z_Free(ptr);
} }
@ -1065,6 +1099,9 @@ void HWR_GetMappedPatch(GLPatch_t *gpatch, const UINT8 *colormap)
{ {
GLMipmap_t *grmip, *newmip; GLMipmap_t *grmip, *newmip;
if (needpatchflush)
W_FlushCachedPatches();
if (colormap == colormaps || colormap == NULL) if (colormap == colormaps || colormap == NULL)
{ {
// Load the default (green) color in doom cache (temporary?) AND hardware cache // Load the default (green) color in doom cache (temporary?) AND hardware cache
@ -1190,6 +1227,9 @@ GLPatch_t *HWR_GetPic(lumpnum_t lumpnum)
{ {
GLPatch_t *grpatch; GLPatch_t *grpatch;
if (needpatchflush)
W_FlushCachedPatches();
grpatch = HWR_GetCachedGLPatch(lumpnum); grpatch = HWR_GetCachedGLPatch(lumpnum);
if (!grpatch->mipmap->downloaded && !grpatch->mipmap->grInfo.data) if (!grpatch->mipmap->downloaded && !grpatch->mipmap->grInfo.data)
@ -1393,6 +1433,9 @@ void HWR_GetFadeMask(lumpnum_t fademasklumpnum)
{ {
GLMipmap_t *grmip; GLMipmap_t *grmip;
if (needpatchflush)
W_FlushCachedPatches();
grmip = HWR_GetCachedGLPatch(fademasklumpnum)->mipmap; grmip = HWR_GetCachedGLPatch(fademasklumpnum)->mipmap;
if (!grmip->downloaded && !grmip->grInfo.data) if (!grmip->downloaded && !grmip->grInfo.data)

View file

@ -48,6 +48,7 @@ struct GLMipmap_s
struct GLMipmap_s *nextcolormap; struct GLMipmap_s *nextcolormap;
const UINT8 *colormap; const UINT8 *colormap;
INT32 tcindex;
// opengl // opengl
struct GLMipmap_s *nextmipmap; // opengl : liste of all texture in opengl driver struct GLMipmap_s *nextmipmap; // opengl : liste of all texture in opengl driver

View file

@ -42,7 +42,7 @@ typedef unsigned char FBOOLEAN;
// byte value for paletted graphics, which represent the transparent color // byte value for paletted graphics, which represent the transparent color
#define HWR_PATCHES_CHROMAKEY_COLORINDEX 255 #define HWR_PATCHES_CHROMAKEY_COLORINDEX 255
#define HWR_CHROMAKEY_EQUIVALENTCOLORINDEX 130 //#define HWR_CHROMAKEY_EQUIVALENTCOLORINDEX 130
// the chroma key color shows on border sprites, set it to black // the chroma key color shows on border sprites, set it to black
#define HWR_PATCHES_CHROMAKEY_COLORVALUE (0x00000000) //RGBA format as in grSstWinOpen() #define HWR_PATCHES_CHROMAKEY_COLORVALUE (0x00000000) //RGBA format as in grSstWinOpen()
@ -115,13 +115,11 @@ typedef struct
FLOAT fovxangle, fovyangle; FLOAT fovxangle, fovyangle;
UINT8 splitscreen; UINT8 splitscreen;
boolean flip; // screenflip boolean flip; // screenflip
#ifdef ROTSPRITE
boolean roll; boolean roll;
SINT8 rollflip; SINT8 rollflip;
FLOAT rollangle; // done to not override USE_FTRANSFORM_ANGLEZ FLOAT rollangle; // done to not override USE_FTRANSFORM_ANGLEZ
UINT8 rotaxis; UINT8 rotaxis;
FLOAT centerx, centery; FLOAT centerx, centery;
#endif
#ifdef USE_FTRANSFORM_MIRROR #ifdef USE_FTRANSFORM_MIRROR
boolean mirror; // SRB2Kart: Encore Mode boolean mirror; // SRB2Kart: Encore Mode
#endif #endif
@ -220,11 +218,10 @@ typedef struct FSurfaceInfo FSurfaceInfo;
//Hurdler: added for backward compatibility //Hurdler: added for backward compatibility
enum hwdsetspecialstate enum hwdsetspecialstate
{ {
HWD_SET_FOG_TABLE = 1, HWD_SET_MODEL_LIGHTING = 1,
HWD_SET_FOG_MODE, HWD_SET_FOG_MODE,
HWD_SET_FOG_COLOR, HWD_SET_FOG_COLOR,
HWD_SET_FOG_DENSITY, HWD_SET_FOG_DENSITY,
HWD_SET_FOV,
HWD_SET_TEXTUREFILTERMODE, HWD_SET_TEXTUREFILTERMODE,
HWD_SET_TEXTUREANISOTROPICMODE, HWD_SET_TEXTUREANISOTROPICMODE,
HWD_NUMSTATE HWD_NUMSTATE

View file

@ -992,7 +992,7 @@ void HWR_DrawViewBorder(INT32 clearlines)
// top edge // top edge
if (clearlines > basewindowy - 8) if (clearlines > basewindowy - 8)
{ {
patch = W_CachePatchNum(viewborderlump[BRDR_T], PU_CACHE); patch = W_CachePatchNum(viewborderlump[BRDR_T], PU_PATCH);
for (x = 0; x < baseviewwidth; x += 8) for (x = 0; x < baseviewwidth; x += 8)
HWR_DrawPatch(patch, basewindowx + x, basewindowy - 8, HWR_DrawPatch(patch, basewindowx + x, basewindowy - 8,
0); 0);
@ -1001,7 +1001,7 @@ void HWR_DrawViewBorder(INT32 clearlines)
// bottom edge // bottom edge
if (clearlines > basewindowy + baseviewheight) if (clearlines > basewindowy + baseviewheight)
{ {
patch = W_CachePatchNum(viewborderlump[BRDR_B], PU_CACHE); patch = W_CachePatchNum(viewborderlump[BRDR_B], PU_PATCH);
for (x = 0; x < baseviewwidth; x += 8) for (x = 0; x < baseviewwidth; x += 8)
HWR_DrawPatch(patch, basewindowx + x, HWR_DrawPatch(patch, basewindowx + x,
basewindowy + baseviewheight, 0); basewindowy + baseviewheight, 0);
@ -1010,7 +1010,7 @@ void HWR_DrawViewBorder(INT32 clearlines)
// left edge // left edge
if (clearlines > basewindowy) if (clearlines > basewindowy)
{ {
patch = W_CachePatchNum(viewborderlump[BRDR_L], PU_CACHE); patch = W_CachePatchNum(viewborderlump[BRDR_L], PU_PATCH);
for (y = 0; y < baseviewheight && basewindowy + y < clearlines; for (y = 0; y < baseviewheight && basewindowy + y < clearlines;
y += 8) y += 8)
{ {
@ -1022,7 +1022,7 @@ void HWR_DrawViewBorder(INT32 clearlines)
// right edge // right edge
if (clearlines > basewindowy) if (clearlines > basewindowy)
{ {
patch = W_CachePatchNum(viewborderlump[BRDR_R], PU_CACHE); patch = W_CachePatchNum(viewborderlump[BRDR_R], PU_PATCH);
for (y = 0; y < baseviewheight && basewindowy+y < clearlines; for (y = 0; y < baseviewheight && basewindowy+y < clearlines;
y += 8) y += 8)
{ {
@ -1034,22 +1034,22 @@ void HWR_DrawViewBorder(INT32 clearlines)
// Draw beveled corners. // Draw beveled corners.
if (clearlines > basewindowy - 8) if (clearlines > basewindowy - 8)
HWR_DrawPatch(W_CachePatchNum(viewborderlump[BRDR_TL], HWR_DrawPatch(W_CachePatchNum(viewborderlump[BRDR_TL],
PU_CACHE), PU_PATCH),
basewindowx - 8, basewindowy - 8, 0); basewindowx - 8, basewindowy - 8, 0);
if (clearlines > basewindowy - 8) if (clearlines > basewindowy - 8)
HWR_DrawPatch(W_CachePatchNum(viewborderlump[BRDR_TR], HWR_DrawPatch(W_CachePatchNum(viewborderlump[BRDR_TR],
PU_CACHE), PU_PATCH),
basewindowx + baseviewwidth, basewindowy - 8, 0); basewindowx + baseviewwidth, basewindowy - 8, 0);
if (clearlines > basewindowy+baseviewheight) if (clearlines > basewindowy+baseviewheight)
HWR_DrawPatch(W_CachePatchNum(viewborderlump[BRDR_BL], HWR_DrawPatch(W_CachePatchNum(viewborderlump[BRDR_BL],
PU_CACHE), PU_PATCH),
basewindowx - 8, basewindowy + baseviewheight, 0); basewindowx - 8, basewindowy + baseviewheight, 0);
if (clearlines > basewindowy + baseviewheight) if (clearlines > basewindowy + baseviewheight)
HWR_DrawPatch(W_CachePatchNum(viewborderlump[BRDR_BR], HWR_DrawPatch(W_CachePatchNum(viewborderlump[BRDR_BR],
PU_CACHE), PU_PATCH),
basewindowx + baseviewwidth, basewindowx + baseviewwidth,
basewindowy + baseviewheight, 0); basewindowy + baseviewheight, 0);
} }

View file

@ -39,11 +39,7 @@ EXPORT void HWRAPI(Shutdown) (void);
#ifdef _WINDOWS #ifdef _WINDOWS
EXPORT void HWRAPI(GetModeList) (vmode_t **pvidmodes, INT32 *numvidmodes); EXPORT void HWRAPI(GetModeList) (vmode_t **pvidmodes, INT32 *numvidmodes);
#endif #endif
#if defined (PURESDL) || defined (macintosh) EXPORT void HWRAPI(SetPalette) (RGBA_t *ppal);
EXPORT void HWRAPI(SetPalette) (INT32 *, RGBA_t *gamma);
#else
EXPORT void HWRAPI(SetPalette) (RGBA_t *ppal, RGBA_t *pgamma);
#endif
EXPORT void HWRAPI(FinishUpdate) (INT32 waitvbl); EXPORT void HWRAPI(FinishUpdate) (INT32 waitvbl);
EXPORT void HWRAPI(Draw2DLine) (F2DCoord *v1, F2DCoord *v2, RGBA_t Color); EXPORT void HWRAPI(Draw2DLine) (F2DCoord *v1, F2DCoord *v2, RGBA_t Color);
EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPts, FBITFIELD PolyFlags); EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPts, FBITFIELD PolyFlags);

View file

@ -100,6 +100,7 @@ void HWR_FreePolyPool(void);
// -------- // --------
void HWR_InitTextureCache(void); void HWR_InitTextureCache(void);
void HWR_FreeTextureCache(void); void HWR_FreeTextureCache(void);
void HWR_FreeMipmapCache(void);
void HWR_FreeExtraSubsectors(void); void HWR_FreeExtraSubsectors(void);
void HWR_GetLevelFlat(levelflat_t *levelflat); void HWR_GetLevelFlat(levelflat_t *levelflat);
@ -127,6 +128,5 @@ extern consvar_t cv_grrounddown; // on/off
extern INT32 patchformat; extern INT32 patchformat;
extern INT32 textureformat; extern INT32 textureformat;
extern boolean firetranslucent;
#endif //_HW_GLOB_ #endif //_HW_GLOB_

View file

@ -374,7 +374,6 @@ light_t *t_lspr[NUMSPRITES] =
&lspr[NOLIGHT], // SPR_ADST &lspr[NOLIGHT], // SPR_ADST
&lspr[NOLIGHT], // SPR_MCRT &lspr[NOLIGHT], // SPR_MCRT
&lspr[NOLIGHT], // SPR_MCSP &lspr[NOLIGHT], // SPR_MCSP
&lspr[NOLIGHT], // SPR_NON2
&lspr[NOLIGHT], // SPR_SALD &lspr[NOLIGHT], // SPR_SALD
&lspr[NOLIGHT], // SPR_TRAE &lspr[NOLIGHT], // SPR_TRAE
&lspr[NOLIGHT], // SPR_TRAI &lspr[NOLIGHT], // SPR_TRAI

View file

@ -85,62 +85,8 @@ static void HWR_RenderTransparentWalls(void);
static void HWR_FoggingOn(void); static void HWR_FoggingOn(void);
static UINT32 atohex(const char *s); static UINT32 atohex(const char *s);
static void CV_filtermode_ONChange(void);
static void CV_anisotropic_ONChange(void);
static void CV_FogDensity_ONChange(void);
static void CV_grFov_OnChange(void);
// ==========================================================================
// 3D ENGINE COMMANDS & CONSOLE VARS
// ==========================================================================
static CV_PossibleValue_t grfov_cons_t[] = {{0, "MIN"}, {179*FRACUNIT, "MAX"}, {0, NULL}};
static CV_PossibleValue_t grfiltermode_cons_t[]= {{HWD_SET_TEXTUREFILTER_POINTSAMPLED, "Nearest"},
{HWD_SET_TEXTUREFILTER_BILINEAR, "Bilinear"}, {HWD_SET_TEXTUREFILTER_TRILINEAR, "Trilinear"},
{HWD_SET_TEXTUREFILTER_MIXED1, "Linear_Nearest"},
{HWD_SET_TEXTUREFILTER_MIXED2, "Nearest_Linear"},
{HWD_SET_TEXTUREFILTER_MIXED3, "Nearest_Mipmap"},
{0, NULL}};
CV_PossibleValue_t granisotropicmode_cons_t[] = {{1, "MIN"}, {16, "MAX"}, {0, NULL}};
boolean drawsky = true; boolean drawsky = true;
// needs fix: walls are incorrectly clipped one column less
#ifndef NEWCLIP
static consvar_t cv_grclipwalls = {"gr_clipwalls", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
#endif
//development variables for diverse uses
static consvar_t cv_gralpha = {"gr_alpha", "160", 0, CV_Unsigned, NULL, 0, NULL, NULL, 0, 0, NULL};
static consvar_t cv_grbeta = {"gr_beta", "0", 0, CV_Unsigned, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grrounddown = {"gr_rounddown", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grfov = {"gr_fov", "90", CV_FLOAT|CV_CALL, grfov_cons_t, CV_grFov_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grfogdensity = {"gr_fogdensity", "150", CV_CALL|CV_NOINIT, CV_Unsigned,
CV_FogDensity_ONChange, 0, NULL, NULL, 0, 0, NULL};
// Unfortunately, this can no longer be saved..
consvar_t cv_grfiltermode = {"gr_filtermode", "Nearest", CV_CALL, grfiltermode_cons_t,
CV_filtermode_ONChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_granisotropicmode = {"gr_anisotropicmode", "1", CV_CALL, granisotropicmode_cons_t,
CV_anisotropic_ONChange, 0, NULL, NULL, 0, 0, NULL};
//static consvar_t cv_grzbuffer = {"gr_zbuffer", "On", 0, CV_OnOff};
consvar_t cv_grcorrecttricks = {"gr_correcttricks", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grsolvetjoin = {"gr_solvetjoin", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
static void CV_FogDensity_ONChange(void)
{
HWD.pfnSetSpecialState(HWD_SET_FOG_DENSITY, cv_grfogdensity.value);
}
static void CV_filtermode_ONChange(void)
{
HWD.pfnSetSpecialState(HWD_SET_TEXTUREFILTERMODE, cv_grfiltermode.value);
}
static void CV_anisotropic_ONChange(void)
{
HWD.pfnSetSpecialState(HWD_SET_TEXTUREANISOTROPICMODE, cv_granisotropicmode.value);
}
/* /*
* lookuptable for lightvalues * lookuptable for lightvalues
* calculated as follow: * calculated as follow:
@ -886,7 +832,7 @@ static void HWR_DrawSegsSplats(FSurfaceInfo * pSurf)
if (!M_PointInBox(segbbox,splat->v1.x,splat->v1.y) && !M_PointInBox(segbbox,splat->v2.x,splat->v2.y)) if (!M_PointInBox(segbbox,splat->v1.x,splat->v1.y) && !M_PointInBox(segbbox,splat->v2.x,splat->v2.y))
continue; continue;
gpatch = W_CachePatchNum(splat->patch, PU_CACHE); gpatch = W_CachePatchNum(splat->patch, PU_PATCH);
HWR_GetPatch(gpatch); HWR_GetPatch(gpatch);
wallVerts[0].x = wallVerts[3].x = FIXED_TO_FLOAT(splat->v1.x); wallVerts[0].x = wallVerts[3].x = FIXED_TO_FLOAT(splat->v1.x);
@ -2473,11 +2419,13 @@ static boolean CheckClip(seg_t * seg, sector_t * afrontsector, sector_t * abacks
static cliprange_t * hw_newend; static cliprange_t * hw_newend;
static cliprange_t gr_solidsegs[MAXSEGS]; static cliprange_t gr_solidsegs[MAXSEGS];
// needs fix: walls are incorrectly clipped one column less
static consvar_t cv_grclipwalls = {"gr_clipwalls", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
static void printsolidsegs(void) static void printsolidsegs(void)
{ {
cliprange_t * start; cliprange_t * start;
if (!hw_newend || cv_grbeta.value != 2) if (!hw_newend)
return; return;
for (start = gr_solidsegs;start != hw_newend;start++) for (start = gr_solidsegs;start != hw_newend;start++)
{ {
@ -3431,7 +3379,7 @@ static void HWR_AddPolyObjectPlanes(void)
{ {
HWR_GetLevelFlat(&levelflats[polyobjsector->ceilingpic]); HWR_GetLevelFlat(&levelflats[polyobjsector->ceilingpic]);
HWR_RenderPolyObjectPlane(po_ptrs[i], true, polyobjsector->ceilingheight, PF_Occlude, HWR_RenderPolyObjectPlane(po_ptrs[i], true, polyobjsector->ceilingheight, PF_Occlude,
(light == -1 ? gr_frontsector->lightlevel : *gr_frontsector->lightlist[light].lightlevel), &levelflats[polyobjsector->floorpic], (light == -1 ? gr_frontsector->lightlevel : *gr_frontsector->lightlist[light].lightlevel), &levelflats[polyobjsector->ceilingpic],
polyobjsector, 255, (light == -1 ? gr_frontsector->extra_colormap : *gr_frontsector->lightlist[light].extra_colormap)); polyobjsector, 255, (light == -1 ? gr_frontsector->extra_colormap : *gr_frontsector->lightlist[light].extra_colormap));
} }
} }
@ -3823,11 +3771,16 @@ static void HWR_Subsector(size_t num)
while (count--) while (count--)
{ {
if (!line->glseg
#ifdef POLYOBJECTS #ifdef POLYOBJECTS
if (!line->polyseg) // ignore segs that belong to polyobjects && !line->polyseg // ignore segs that belong to polyobjects
#endif #endif
)
{
HWR_AddLine(line); HWR_AddLine(line);
line++; }
line++;
} }
} }
@ -5420,14 +5373,20 @@ static void HWR_DrawSprites(void)
if (!cv_grmodels.value || md2_playermodels[(skin_t*)spr->mobj->skin-skins].notfound || md2_playermodels[(skin_t*)spr->mobj->skin-skins].scale < 0.0f) if (!cv_grmodels.value || md2_playermodels[(skin_t*)spr->mobj->skin-skins].notfound || md2_playermodels[(skin_t*)spr->mobj->skin-skins].scale < 0.0f)
HWR_DrawSprite(spr); HWR_DrawSprite(spr);
else else
HWR_DrawModel(spr); {
if (!HWR_DrawModel(spr))
HWR_DrawSprite(spr);
}
} }
else else
{ {
if (!cv_grmodels.value || md2_models[spr->mobj->sprite].notfound || md2_models[spr->mobj->sprite].scale < 0.0f) if (!cv_grmodels.value || md2_models[spr->mobj->sprite].notfound || md2_models[spr->mobj->sprite].scale < 0.0f)
HWR_DrawSprite(spr); HWR_DrawSprite(spr);
else else
HWR_DrawModel(spr); {
if (!HWR_DrawModel(spr))
HWR_DrawSprite(spr);
}
} }
} }
} }
@ -5547,17 +5506,12 @@ static void HWR_ProjectSprite(mobj_t *thing)
fixed_t spr_offset, spr_topoffset; fixed_t spr_offset, spr_topoffset;
#ifdef ROTSPRITE #ifdef ROTSPRITE
patch_t *rotsprite = NULL; patch_t *rotsprite = NULL;
angle_t arollangle; INT32 rollangle = 0;
UINT32 rollangle;
#endif #endif
if (!thing) if (!thing)
return; return;
#ifdef ROTSPRITE
arollangle = thing->rollangle;
rollangle = AngleFixed(arollangle)>>FRACBITS;
#endif
this_scale = FIXED_TO_FLOAT(thing->scale); this_scale = FIXED_TO_FLOAT(thing->scale);
// transform the origin point // transform the origin point
@ -5664,11 +5618,11 @@ static void HWR_ProjectSprite(mobj_t *thing)
spr_topoffset = spritecachedinfo[lumpoff].topoffset; spr_topoffset = spritecachedinfo[lumpoff].topoffset;
#ifdef ROTSPRITE #ifdef ROTSPRITE
if (rollangle > 0) if (thing->rollangle)
{ {
rollangle = R_GetRollAngle(thing->rollangle);
if (!sprframe->rotsprite.cached[rot]) if (!sprframe->rotsprite.cached[rot])
R_CacheRotSprite(thing->sprite, (thing->frame & FF_FRAMEMASK), sprinfo, sprframe, rot, flip); R_CacheRotSprite(thing->sprite, (thing->frame & FF_FRAMEMASK), sprinfo, sprframe, rot, flip);
rollangle /= ROTANGDIFF;
rotsprite = sprframe->rotsprite.patch[rot][rollangle]; rotsprite = sprframe->rotsprite.patch[rot][rollangle];
if (rotsprite != NULL) if (rotsprite != NULL)
{ {
@ -5941,7 +5895,7 @@ static void HWR_DrawSkyBackground(player_t *player)
{ {
if (cv_grskydome.value) if (cv_grskydome.value)
{ {
FTransform transform; FTransform dometransform;
const float fpov = FIXED_TO_FLOAT(cv_grfov.value+player->fovadd); const float fpov = FIXED_TO_FLOAT(cv_grfov.value+player->fovadd);
postimg_t *type; postimg_t *type;
@ -5950,27 +5904,27 @@ static void HWR_DrawSkyBackground(player_t *player)
else else
type = &postimgtype; type = &postimgtype;
memset(&transform, 0x00, sizeof(FTransform)); memset(&dometransform, 0x00, sizeof(FTransform));
//04/01/2000: Hurdler: added for T&L //04/01/2000: Hurdler: added for T&L
// It should replace all other gr_viewxxx when finished // It should replace all other gr_viewxxx when finished
transform.anglex = (float)(aimingangle>>ANGLETOFINESHIFT)*(360.0f/(float)FINEANGLES); dometransform.anglex = (float)(aimingangle>>ANGLETOFINESHIFT)*(360.0f/(float)FINEANGLES);
transform.angley = (float)((viewangle-ANGLE_270)>>ANGLETOFINESHIFT)*(360.0f/(float)FINEANGLES); dometransform.angley = (float)((viewangle-ANGLE_270)>>ANGLETOFINESHIFT)*(360.0f/(float)FINEANGLES);
if (*type == postimg_flip) if (*type == postimg_flip)
transform.flip = true; dometransform.flip = true;
else else
transform.flip = false; dometransform.flip = false;
transform.scalex = 1; dometransform.scalex = 1;
transform.scaley = (float)vid.width/vid.height; dometransform.scaley = (float)vid.width/vid.height;
transform.scalez = 1; dometransform.scalez = 1;
transform.fovxangle = fpov; // Tails dometransform.fovxangle = fpov; // Tails
transform.fovyangle = fpov; // Tails dometransform.fovyangle = fpov; // Tails
transform.splitscreen = splitscreen; dometransform.splitscreen = splitscreen;
HWR_GetTexture(texturetranslation[skytexture]); HWR_GetTexture(texturetranslation[skytexture]);
HWD.pfnRenderSkyDome(skytexture, textures[skytexture]->width, textures[skytexture]->height, transform); HWD.pfnRenderSkyDome(skytexture, textures[skytexture]->width, textures[skytexture]->height, dometransform);
} }
else else
{ {
@ -6172,6 +6126,8 @@ void HWR_RenderSkyboxView(INT32 viewnumber, player_t *player)
//04/01/2000: Hurdler: added for T&L //04/01/2000: Hurdler: added for T&L
// It should replace all other gr_viewxxx when finished // It should replace all other gr_viewxxx when finished
memset(&atransform, 0x00, sizeof(FTransform));
atransform.anglex = (float)(aimingangle>>ANGLETOFINESHIFT)*(360.0f/(float)FINEANGLES); atransform.anglex = (float)(aimingangle>>ANGLETOFINESHIFT)*(360.0f/(float)FINEANGLES);
atransform.angley = (float)(viewangle>>ANGLETOFINESHIFT)*(360.0f/(float)FINEANGLES); atransform.angley = (float)(viewangle>>ANGLETOFINESHIFT)*(360.0f/(float)FINEANGLES);
@ -6390,6 +6346,8 @@ void HWR_RenderPlayerView(INT32 viewnumber, player_t *player)
//04/01/2000: Hurdler: added for T&L //04/01/2000: Hurdler: added for T&L
// It should replace all other gr_viewxxx when finished // It should replace all other gr_viewxxx when finished
memset(&atransform, 0x00, sizeof(FTransform));
atransform.anglex = (float)(aimingangle>>ANGLETOFINESHIFT)*(360.0f/(float)FINEANGLES); atransform.anglex = (float)(aimingangle>>ANGLETOFINESHIFT)*(360.0f/(float)FINEANGLES);
atransform.angley = (float)(viewangle>>ANGLETOFINESHIFT)*(360.0f/(float)FINEANGLES); atransform.angley = (float)(viewangle>>ANGLETOFINESHIFT)*(360.0f/(float)FINEANGLES);
@ -6584,59 +6542,131 @@ static void HWR_FoggingOn(void)
// 3D ENGINE COMMANDS // 3D ENGINE COMMANDS
// ========================================================================== // ==========================================================================
static CV_PossibleValue_t grsoftwarefog_cons_t[] = {{0, "Off"}, {1, "On"}, {2, "LightPlanes"}, {0, NULL}};
static CV_PossibleValue_t grmodelinterpolation_cons_t[] = {{0, "Off"}, {1, "Sometimes"}, {2, "Always"}, {0, NULL}};
static void CV_grFov_OnChange(void) static void CV_grmodellighting_OnChange(void);
static void CV_grfiltermode_OnChange(void);
static void CV_granisotropic_OnChange(void);
static void CV_grfogdensity_OnChange(void);
static void CV_grfov_OnChange(void);
static CV_PossibleValue_t grfov_cons_t[] = {{0, "MIN"}, {179*FRACUNIT, "MAX"}, {0, NULL}};
static CV_PossibleValue_t grfiltermode_cons_t[]= {{HWD_SET_TEXTUREFILTER_POINTSAMPLED, "Nearest"},
{HWD_SET_TEXTUREFILTER_BILINEAR, "Bilinear"}, {HWD_SET_TEXTUREFILTER_TRILINEAR, "Trilinear"},
{HWD_SET_TEXTUREFILTER_MIXED1, "Linear_Nearest"},
{HWD_SET_TEXTUREFILTER_MIXED2, "Nearest_Linear"},
{HWD_SET_TEXTUREFILTER_MIXED3, "Nearest_Mipmap"},
{0, NULL}};
CV_PossibleValue_t granisotropicmode_cons_t[] = {{1, "MIN"}, {16, "MAX"}, {0, NULL}};
consvar_t cv_grfovchange = {"gr_fovchange", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grfog = {"gr_fog", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grfogcolor = {"gr_fogcolor", "AAAAAA", CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grsoftwarefog = {"gr_softwarefog", "Off", CV_SAVE, grsoftwarefog_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
#ifdef ALAM_LIGHTING
consvar_t cv_grdynamiclighting = {"gr_dynamiclighting", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grstaticlighting = {"gr_staticlighting", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grcoronas = {"gr_coronas", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grcoronasize = {"gr_coronasize", "1", CV_SAVE|CV_FLOAT, 0, NULL, 0, NULL, NULL, 0, 0, NULL};
#endif
consvar_t cv_grmodels = {"gr_models", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grmodelinterpolation = {"gr_modelinterpolation", "Sometimes", CV_SAVE, grmodelinterpolation_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grmodellighting = {"gr_modellighting", "Off", CV_SAVE|CV_CALL, CV_OnOff, CV_grmodellighting_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grspritebillboarding = {"gr_spritebillboarding", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grskydome = {"gr_skydome", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grrounddown = {"gr_rounddown", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grfov = {"gr_fov", "90", CV_FLOAT|CV_CALL, grfov_cons_t, CV_grfov_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grfogdensity = {"gr_fogdensity", "150", CV_CALL|CV_NOINIT, CV_Unsigned,
CV_grfogdensity_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grfiltermode = {"gr_filtermode", "Nearest", CV_SAVE|CV_CALL, grfiltermode_cons_t,
CV_grfiltermode_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_granisotropicmode = {"gr_anisotropicmode", "1", CV_CALL, granisotropicmode_cons_t,
CV_granisotropic_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grcorrecttricks = {"gr_correcttricks", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grsolvetjoin = {"gr_solvetjoin", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
static void CV_grmodellighting_OnChange(void)
{
if (rendermode == render_opengl)
HWD.pfnSetSpecialState(HWD_SET_MODEL_LIGHTING, cv_grmodellighting.value);
}
static void CV_grfogdensity_OnChange(void)
{
if (rendermode == render_opengl)
HWD.pfnSetSpecialState(HWD_SET_FOG_DENSITY, cv_grfogdensity.value);
}
static void CV_grfiltermode_OnChange(void)
{
if (rendermode == render_opengl)
HWD.pfnSetSpecialState(HWD_SET_TEXTUREFILTERMODE, cv_grfiltermode.value);
}
static void CV_granisotropic_OnChange(void)
{
if (rendermode == render_opengl)
HWD.pfnSetSpecialState(HWD_SET_TEXTUREANISOTROPICMODE, cv_granisotropicmode.value);
}
static void CV_grfov_OnChange(void)
{ {
if ((netgame || multiplayer) && !cv_debug && cv_grfov.value != 90*FRACUNIT) if ((netgame || multiplayer) && !cv_debug && cv_grfov.value != 90*FRACUNIT)
CV_Set(&cv_grfov, cv_grfov.defaultvalue); CV_Set(&cv_grfov, cv_grfov.defaultvalue);
} }
static void Command_GrStats_f(void)
{
Z_CheckHeap(9875); // debug
CONS_Printf(M_GetText("Patch info headers: %7s kb\n"), sizeu1(Z_TagUsage(PU_HWRPATCHINFO)>>10));
CONS_Printf(M_GetText("3D Texture cache : %7s kb\n"), sizeu1(Z_TagUsage(PU_HWRCACHE)>>10));
CONS_Printf(M_GetText("Plane polygon : %7s kb\n"), sizeu1(Z_TagUsage(PU_HWRPLANE)>>10));
}
// **************************************************************************
// 3D ENGINE SETUP
// **************************************************************************
// --------------------------------------------------------------------------
// Add hardware engine commands & consvars
// --------------------------------------------------------------------------
//added by Hurdler: console varibale that are saved //added by Hurdler: console varibale that are saved
void HWR_AddCommands(void) void HWR_AddCommands(void)
{ {
CV_RegisterVar(&cv_grrounddown); CV_RegisterVar(&cv_grfovchange);
CV_RegisterVar(&cv_grfov); CV_RegisterVar(&cv_grfov);
CV_RegisterVar(&cv_grfogdensity); CV_RegisterVar(&cv_grfogdensity);
CV_RegisterVar(&cv_grfogcolor);
CV_RegisterVar(&cv_grfog);
CV_RegisterVar(&cv_grsoftwarefog);
#ifdef ALAM_LIGHTING
CV_RegisterVar(&cv_grstaticlighting);
CV_RegisterVar(&cv_grdynamiclighting);
CV_RegisterVar(&cv_grcoronasize);
CV_RegisterVar(&cv_grcoronas);
#endif
CV_RegisterVar(&cv_grmodellighting);
CV_RegisterVar(&cv_grmodelinterpolation);
CV_RegisterVar(&cv_grmodels);
CV_RegisterVar(&cv_grskydome);
CV_RegisterVar(&cv_grspritebillboarding);
CV_RegisterVar(&cv_grfiltermode); CV_RegisterVar(&cv_grfiltermode);
CV_RegisterVar(&cv_granisotropicmode); CV_RegisterVar(&cv_grrounddown);
CV_RegisterVar(&cv_grcorrecttricks); CV_RegisterVar(&cv_grcorrecttricks);
CV_RegisterVar(&cv_grsolvetjoin); CV_RegisterVar(&cv_grsolvetjoin);
}
static inline void HWR_AddEngineCommands(void)
{
// engine state variables
//CV_RegisterVar(&cv_grzbuffer);
#ifndef NEWCLIP #ifndef NEWCLIP
CV_RegisterVar(&cv_grclipwalls); CV_RegisterVar(&cv_grclipwalls);
#endif #endif
// engine development mode variables
// - usage may vary from version to version..
CV_RegisterVar(&cv_gralpha);
CV_RegisterVar(&cv_grbeta);
// engine commands
COM_AddCommand("gr_stats", Command_GrStats_f);
} }
void HWR_AddSessionCommands(void)
{
static boolean alreadycalled = false;
if (alreadycalled)
return;
CV_RegisterVar(&cv_granisotropicmode);
alreadycalled = true;
}
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
// Setup the hardware renderer // Setup the hardware renderer
@ -6657,12 +6687,9 @@ void HWR_Startup(void)
{ {
CONS_Printf("HWR_Startup()...\n"); CONS_Printf("HWR_Startup()...\n");
HWR_InitPolyPool(); HWR_InitPolyPool();
// add console cmds & vars HWR_AddSessionCommands();
HWR_AddEngineCommands();
HWR_InitTextureCache(); HWR_InitTextureCache();
HWR_InitModels(); HWR_InitModels();
#ifdef ALAM_LIGHTING #ifdef ALAM_LIGHTING
HWR_InitLight(); HWR_InitLight();
#endif #endif
@ -6674,6 +6701,17 @@ void HWR_Startup(void)
startupdone = true; startupdone = true;
} }
// --------------------------------------------------------------------------
// Called after switching to the hardware renderer
// --------------------------------------------------------------------------
void HWR_Switch(void)
{
// Set special states from CVARs
HWD.pfnSetSpecialState(HWD_SET_MODEL_LIGHTING, cv_grmodellighting.value);
HWD.pfnSetSpecialState(HWD_SET_FOG_DENSITY, cv_grfogdensity.value);
HWD.pfnSetSpecialState(HWD_SET_TEXTUREFILTERMODE, cv_grfiltermode.value);
HWD.pfnSetSpecialState(HWD_SET_TEXTUREANISOTROPICMODE, cv_granisotropicmode.value);
}
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
// Free resources allocated by the hardware renderer // Free resources allocated by the hardware renderer
@ -6683,6 +6721,7 @@ void HWR_Shutdown(void)
CONS_Printf("HWR_Shutdown()\n"); CONS_Printf("HWR_Shutdown()\n");
HWR_FreeExtraSubsectors(); HWR_FreeExtraSubsectors();
HWR_FreePolyPool(); HWR_FreePolyPool();
HWR_FreeMipmapCache();
HWR_FreeTextureCache(); HWR_FreeTextureCache();
HWD.pfnFlushScreenTextures(); HWD.pfnFlushScreenTextures();
} }

View file

@ -29,6 +29,7 @@
// Startup & Shutdown the hardware mode renderer // Startup & Shutdown the hardware mode renderer
void HWR_Startup(void); void HWR_Startup(void);
void HWR_Switch(void);
void HWR_Shutdown(void); void HWR_Shutdown(void);
void HWR_drawAMline(const fline_t *fl, INT32 color); void HWR_drawAMline(const fline_t *fl, INT32 color);
@ -47,7 +48,7 @@ void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t scale
void HWR_MakePatch(const patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipmap, boolean makebitmap); void HWR_MakePatch(const patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipmap, boolean makebitmap);
void HWR_CreatePlanePolygons(INT32 bspnum); void HWR_CreatePlanePolygons(INT32 bspnum);
void HWR_CreateStaticLightmaps(INT32 bspnum); void HWR_CreateStaticLightmaps(INT32 bspnum);
void HWR_PrepLevelCache(size_t pnumtextures); void HWR_LoadTextures(size_t pnumtextures);
void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color); void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color);
void HWR_DrawFadeFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color, UINT16 actualcolor, UINT8 strength); void HWR_DrawFadeFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color, UINT16 actualcolor, UINT8 strength);
void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color, UINT32 actualcolor); // Lat: separate flags from color since color needs to be an uint to work right. void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color, UINT32 actualcolor); // Lat: separate flags from color since color needs to be an uint to work right.
@ -57,6 +58,7 @@ UINT8 *HWR_GetScreenshot(void);
boolean HWR_Screenshot(const char *pathname); boolean HWR_Screenshot(const char *pathname);
void HWR_AddCommands(void); void HWR_AddCommands(void);
void HWR_AddSessionCommands(void);
void HWR_CorrectSWTricks(void); void HWR_CorrectSWTricks(void);
void transform(float *cx, float *cy, float *cz); void transform(float *cx, float *cy, float *cz);
FBITFIELD HWR_TranstableToAlpha(INT32 transtablenum, FSurfaceInfo *pSurf); FBITFIELD HWR_TranstableToAlpha(INT32 transtablenum, FSurfaceInfo *pSurf);
@ -85,13 +87,11 @@ extern consvar_t cv_grcoronasize;
extern consvar_t cv_grfov; extern consvar_t cv_grfov;
extern consvar_t cv_grmodels; extern consvar_t cv_grmodels;
extern consvar_t cv_grmodelinterpolation; extern consvar_t cv_grmodelinterpolation;
extern consvar_t cv_grmodellighting;
extern consvar_t cv_grfog; extern consvar_t cv_grfog;
extern consvar_t cv_grfogcolor; extern consvar_t cv_grfogcolor;
extern consvar_t cv_grfogdensity; extern consvar_t cv_grfogdensity;
extern consvar_t cv_grsoftwarefog; extern consvar_t cv_grsoftwarefog;
extern consvar_t cv_grgammared;
extern consvar_t cv_grgammagreen;
extern consvar_t cv_grgammablue;
extern consvar_t cv_grfiltermode; extern consvar_t cv_grfiltermode;
extern consvar_t cv_granisotropicmode; extern consvar_t cv_granisotropicmode;
extern consvar_t cv_grcorrecttricks; extern consvar_t cv_grcorrecttricks;

View file

@ -239,7 +239,7 @@ static GrTextureFormat_t PNG_Load(const char *filename, int *w, int *h, GLPatch_
{ {
png_uint_32 i, pitch = png_get_rowbytes(png_ptr, png_info_ptr); png_uint_32 i, pitch = png_get_rowbytes(png_ptr, png_info_ptr);
png_bytep PNG_image = Z_Malloc(pitch*height, PU_HWRCACHE, &grpatch->mipmap->grInfo.data); png_bytep PNG_image = Z_Malloc(pitch*height, PU_HWRMODELTEXTURE, &grpatch->mipmap->grInfo.data);
png_bytepp row_pointers = png_malloc(png_ptr, height * sizeof (png_bytep)); png_bytepp row_pointers = png_malloc(png_ptr, height * sizeof (png_bytep));
for (i = 0; i < height; i++) for (i = 0; i < height; i++)
row_pointers[i] = PNG_image + i*pitch; row_pointers[i] = PNG_image + i*pitch;
@ -313,7 +313,7 @@ static GrTextureFormat_t PCX_Load(const char *filename, int *w, int *h,
pw = *w = header.xmax - header.xmin + 1; pw = *w = header.xmax - header.xmin + 1;
ph = *h = header.ymax - header.ymin + 1; ph = *h = header.ymax - header.ymin + 1;
image = Z_Malloc(pw*ph*4, PU_HWRCACHE, &grpatch->mipmap->grInfo.data); image = Z_Malloc(pw*ph*4, PU_HWRMODELTEXTURE, &grpatch->mipmap->grInfo.data);
if (fread(palette, sizeof (UINT8), PALSIZE, file) != PALSIZE) if (fread(palette, sizeof (UINT8), PALSIZE, file) != PALSIZE)
{ {
@ -373,6 +373,9 @@ static void md2_loadTexture(md2_t *model)
if (!grpatch->mipmap->downloaded && !grpatch->mipmap->grInfo.data) if (!grpatch->mipmap->downloaded && !grpatch->mipmap->grInfo.data)
{ {
int w = 0, h = 0; int w = 0, h = 0;
UINT32 size;
RGBA_t *image;
#ifdef HAVE_PNG #ifdef HAVE_PNG
grpatch->mipmap->grInfo.format = PNG_Load(filename, &w, &h, grpatch); grpatch->mipmap->grInfo.format = PNG_Load(filename, &w, &h, grpatch);
if (grpatch->mipmap->grInfo.format == 0) if (grpatch->mipmap->grInfo.format == 0)
@ -389,6 +392,15 @@ static void md2_loadTexture(md2_t *model)
grpatch->mipmap->width = (UINT16)w; grpatch->mipmap->width = (UINT16)w;
grpatch->mipmap->height = (UINT16)h; grpatch->mipmap->height = (UINT16)h;
// Lactozilla: Apply colour cube
image = grpatch->mipmap->grInfo.data;
size = w*h;
while (size--)
{
V_CubeApply(&image->s.red, &image->s.green, &image->s.blue);
image++;
}
#ifdef GLIDE_API_COMPATIBILITY #ifdef GLIDE_API_COMPATIBILITY
// not correct! // not correct!
grpatch->mipmap->grInfo.smallLodLog2 = GR_LOD_LOG2_256; grpatch->mipmap->grInfo.smallLodLog2 = GR_LOD_LOG2_256;
@ -397,7 +409,6 @@ static void md2_loadTexture(md2_t *model)
#endif #endif
} }
HWD.pfnSetTexture(grpatch->mipmap); HWD.pfnSetTexture(grpatch->mipmap);
HWR_UnlockCachedPatch(grpatch);
} }
// -----------------+ // -----------------+
@ -453,7 +464,6 @@ static void md2_loadBlendTexture(md2_t *model)
#endif #endif
} }
HWD.pfnSetTexture(grpatch->mipmap); // We do need to do this so that it can be cleared and knows to recreate it when necessary HWD.pfnSetTexture(grpatch->mipmap); // We do need to do this so that it can be cleared and knows to recreate it when necessary
HWR_UnlockCachedPatch(grpatch);
Z_Free(filename); Z_Free(filename);
} }
@ -637,18 +647,20 @@ spritemd2found:
// 0.7152 to green // 0.7152 to green
// 0.0722 to blue // 0.0722 to blue
#define SETBRIGHTNESS(brightness,r,g,b) \ #define SETBRIGHTNESS(brightness,r,g,b) \
brightness = (UINT8)(((1063*((UINT16)r)/5000) + (3576*((UINT16)g)/5000) + (361*((UINT16)b)/5000)) / 3) brightness = (UINT8)(((1063*(UINT16)(r))/5000) + ((3576*(UINT16)(g))/5000) + ((361*(UINT16)(b))/5000))
static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, GLMipmap_t *grmip, INT32 skinnum, skincolors_t color) static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, GLMipmap_t *grmip, INT32 skinnum, skincolors_t color)
{ {
UINT8 i;
UINT16 w = gpatch->width, h = gpatch->height; UINT16 w = gpatch->width, h = gpatch->height;
UINT32 size = w*h; UINT32 size = w*h;
RGBA_t *image, *blendimage, *cur, blendcolor; RGBA_t *image, *blendimage, *cur, blendcolor;
// vanilla port
UINT8 translation[16];
memset(translation, 0, sizeof(translation));
if (grmip->width == 0) if (grmip->width == 0)
{ {
grmip->width = gpatch->width; grmip->width = gpatch->width;
grmip->height = gpatch->height; grmip->height = gpatch->height;
@ -658,46 +670,58 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch,
grmip->grInfo.format = GR_RGBA; grmip->grInfo.format = GR_RGBA;
} }
Z_Free(grmip->grInfo.data); if (grmip->grInfo.data)
grmip->grInfo.data = NULL; {
Z_Free(grmip->grInfo.data);
grmip->grInfo.data = NULL;
}
cur = Z_Malloc(size*4, PU_HWRCACHE, &grmip->grInfo.data); cur = Z_Malloc(size*4, PU_HWRMODELTEXTURE, &grmip->grInfo.data);
memset(cur, 0x00, size*4); memset(cur, 0x00, size*4);
image = gpatch->mipmap->grInfo.data; image = gpatch->mipmap->grInfo.data;
blendimage = blendgpatch->mipmap->grInfo.data; blendimage = blendgpatch->mipmap->grInfo.data;
blendcolor = V_GetColor(0); // initialize
// Average all of the translation's colors if (color != SKINCOLOR_NONE)
if (color == SKINCOLOR_NONE || color >= MAXTRANSLATIONS) memcpy(&translation, &Color_Index[color - 1], 16);
blendcolor = V_GetColor(0xff);
else while (size--)
{ {
const UINT8 div = 6; if (skinnum == TC_BOSS)
const UINT8 start = 4;
UINT32 r, g, b;
blendcolor = V_GetColor(Color_Index[color-1][start]);
r = (UINT32)(blendcolor.s.red*blendcolor.s.red);
g = (UINT32)(blendcolor.s.green*blendcolor.s.green);
b = (UINT32)(blendcolor.s.blue*blendcolor.s.blue);
for (i = 1; i < div; i++)
{ {
RGBA_t nextcolor = V_GetColor(Color_Index[color-1][start+i]); // Turn everything below a certain threshold white
r += (UINT32)(nextcolor.s.red*nextcolor.s.red); if ((image->s.red == image->s.green) && (image->s.green == image->s.blue) && image->s.blue <= 82)
g += (UINT32)(nextcolor.s.green*nextcolor.s.green); {
b += (UINT32)(nextcolor.s.blue*nextcolor.s.blue); // Lactozilla: Invert the colors
cur->s.red = cur->s.green = cur->s.blue = (255 - image->s.blue);
}
else
{
cur->s.red = image->s.red;
cur->s.green = image->s.green;
cur->s.blue = image->s.blue;
}
cur->s.alpha = image->s.alpha;
} }
else if (skinnum == TC_METALSONIC)
{
// Turn everything below a certain blue threshold white
if (image->s.red == 0 && image->s.green == 0 && image->s.blue <= 82)
{
cur->s.red = cur->s.green = cur->s.blue = 255;
}
else
{
cur->s.red = image->s.red;
cur->s.green = image->s.green;
cur->s.blue = image->s.blue;
}
blendcolor.s.red = (UINT8)(FixedSqrt((r/div)<<FRACBITS)>>FRACBITS); cur->s.alpha = image->s.alpha;
blendcolor.s.green = (UINT8)(FixedSqrt((g/div)<<FRACBITS)>>FRACBITS); }
blendcolor.s.blue = (UINT8)(FixedSqrt((b/div)<<FRACBITS)>>FRACBITS); else if (skinnum == TC_DASHMODE)
}
// rainbow support, could theoretically support boss ones too
if (skinnum == TC_RAINBOW)
{
while (size--)
{ {
if (image->s.alpha == 0 && blendimage->s.alpha == 0) if (image->s.alpha == 0 && blendimage->s.alpha == 0)
{ {
@ -706,65 +730,215 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch,
} }
else else
{ {
UINT32 tempcolor; UINT8 ialpha = 255 - blendimage->s.alpha, balpha = blendimage->s.alpha;
UINT16 imagebright, blendbright, finalbright, colorbright; RGBA_t icolor = *image, bcolor;
SETBRIGHTNESS(imagebright,image->s.red,image->s.green,image->s.blue);
SETBRIGHTNESS(blendbright,blendimage->s.red,blendimage->s.green,blendimage->s.blue);
// slightly dumb average between the blend image color and base image colour, usually one or the other will be fully opaque anyway
finalbright = (imagebright*(255-blendimage->s.alpha))/255 + (blendbright*blendimage->s.alpha)/255;
SETBRIGHTNESS(colorbright,blendcolor.s.red,blendcolor.s.green,blendcolor.s.blue);
tempcolor = (finalbright*blendcolor.s.red)/colorbright; memset(&bcolor, 0x00, sizeof(RGBA_t));
tempcolor = min(255, tempcolor);
cur->s.red = (UINT8)tempcolor; if (blendimage->s.alpha)
tempcolor = (finalbright*blendcolor.s.green)/colorbright; {
tempcolor = min(255, tempcolor); bcolor.s.blue = 0;
cur->s.green = (UINT8)tempcolor; bcolor.s.red = 255;
tempcolor = (finalbright*blendcolor.s.blue)/colorbright; bcolor.s.green = (blendimage->s.red + blendimage->s.green + blendimage->s.blue) / 3;
tempcolor = min(255, tempcolor); }
cur->s.blue = (UINT8)tempcolor; if (image->s.alpha && image->s.red > image->s.green << 1) // this is pretty arbitrary, but it works well for Metal Sonic
{
icolor.s.red = image->s.blue;
icolor.s.blue = image->s.red;
}
cur->s.red = (ialpha * icolor.s.red + balpha * bcolor.s.red)/255;
cur->s.green = (ialpha * icolor.s.green + balpha * bcolor.s.green)/255;
cur->s.blue = (ialpha * icolor.s.blue + balpha * bcolor.s.blue)/255;
cur->s.alpha = image->s.alpha; cur->s.alpha = image->s.alpha;
} }
cur++; image++; blendimage++;
} }
} else if (skinnum == TC_ALLWHITE)
else
{
while (size--)
{ {
if (blendimage->s.alpha == 0) // Turn everything white
cur->s.red = cur->s.green = cur->s.blue = 255;
cur->s.alpha = image->s.alpha;
}
else
{
UINT16 brightness;
// Don't bother with blending the pixel if the alpha of the blend pixel is 0
if (skinnum == TC_RAINBOW)
{ {
// Don't bother with blending the pixel if the alpha of the blend pixel is 0 if (image->s.alpha == 0 && blendimage->s.alpha == 0)
cur->rgba = image->rgba; {
cur->rgba = image->rgba;
cur++; image++; blendimage++;
continue;
}
else
{
UINT16 imagebright, blendbright;
SETBRIGHTNESS(imagebright,image->s.red,image->s.green,image->s.blue);
SETBRIGHTNESS(blendbright,blendimage->s.red,blendimage->s.green,blendimage->s.blue);
// slightly dumb average between the blend image color and base image colour, usually one or the other will be fully opaque anyway
brightness = (imagebright*(255-blendimage->s.alpha))/255 + (blendbright*blendimage->s.alpha)/255;
}
} }
else else
{ {
INT32 tempcolor; if (blendimage->s.alpha == 0)
INT16 tempmult, tempalpha; {
tempalpha = -(abs(blendimage->s.red-127)-127)*2; cur->rgba = image->rgba;
if (tempalpha > 255) cur++; image++; blendimage++;
tempalpha = 255; continue;
else if (tempalpha < 0) }
tempalpha = 0; else
{
SETBRIGHTNESS(brightness,blendimage->s.red,blendimage->s.green,blendimage->s.blue);
}
}
tempmult = (blendimage->s.red-127)*2; // Calculate a sort of "gradient" for the skincolor
if (tempmult > 255) // (Me splitting this into a function didn't work, so I had to ruin this entire function's groove...)
tempmult = 255; {
else if (tempmult < 0) RGBA_t nextcolor;
tempmult = 0; UINT8 firsti, secondi, mul;
UINT32 r, g, b;
tempcolor = (image->s.red*(255-blendimage->s.alpha))/255 + ((tempmult + ((tempalpha*blendcolor.s.red)/255)) * blendimage->s.alpha)/255; // Rainbow needs to find the closest match to the textures themselves, instead of matching brightnesses to other colors.
// Ensue horrible mess.
if (skinnum == TC_RAINBOW)
{
UINT16 brightdif = 256;
UINT8 colorbrightnesses[16];
INT32 compare, m, d;
UINT8 i;
// Ignore pure white & pitch black
if (brightness > 253 || brightness < 2)
{
cur->rgba = image->rgba;
cur++; image++; blendimage++;
continue;
}
firsti = 0;
mul = 0;
for (i = 0; i < 16; i++)
{
RGBA_t tempc = V_GetColor(translation[i]);
SETBRIGHTNESS(colorbrightnesses[i], tempc.s.red, tempc.s.green, tempc.s.blue); // store brightnesses for comparison
}
for (i = 0; i < 16; i++)
{
if (brightness > colorbrightnesses[i]) // don't allow greater matches (because calculating a makeshift gradient for this is already a huge mess as is)
continue;
compare = abs((INT16)(colorbrightnesses[i]) - (INT16)(brightness));
if (compare < brightdif)
{
brightdif = (UINT16)compare;
firsti = i; // best matching color that's equal brightness or darker
}
}
secondi = firsti+1; // next color in line
if (secondi == 16)
{
m = (INT16)brightness; // - 0;
d = (INT16)colorbrightnesses[firsti]; // - 0;
}
else
{
m = (INT16)brightness - (INT16)colorbrightnesses[secondi];
d = (INT16)colorbrightnesses[firsti] - (INT16)colorbrightnesses[secondi];
}
if (m >= d)
m = d-1;
// calculate the "gradient" multiplier based on how close this color is to the one next in line
if (m <= 0 || d <= 0)
mul = 0;
else
mul = 15 - ((m * 16) / d);
}
else
{
// Thankfully, it's normally way more simple.
// Just convert brightness to a skincolor value, use remainder to find the gradient multipler
firsti = ((UINT8)(255-brightness) / 16);
secondi = firsti+1;
mul = ((UINT8)(255-brightness) % 16);
}
blendcolor = V_GetColor(translation[firsti]);
if (mul > 0 // If it's 0, then we only need the first color.
&& translation[firsti] != translation[secondi]) // Some colors have duplicate colors in a row, so let's just save the process
{
if (secondi == 16) // blend to black
nextcolor = V_GetColor(31);
else
nextcolor = V_GetColor(translation[secondi]);
// Find difference between points
r = (UINT32)(nextcolor.s.red - blendcolor.s.red);
g = (UINT32)(nextcolor.s.green - blendcolor.s.green);
b = (UINT32)(nextcolor.s.blue - blendcolor.s.blue);
// Find the gradient of the two points
r = ((mul * r) / 16);
g = ((mul * g) / 16);
b = ((mul * b) / 16);
// Add gradient value to color
blendcolor.s.red += r;
blendcolor.s.green += g;
blendcolor.s.blue += b;
}
}
if (skinnum == TC_RAINBOW)
{
UINT32 tempcolor;
UINT16 colorbright;
SETBRIGHTNESS(colorbright,blendcolor.s.red,blendcolor.s.green,blendcolor.s.blue);
if (colorbright == 0)
colorbright = 1; // no dividing by 0 please
tempcolor = (brightness * blendcolor.s.red) / colorbright;
tempcolor = min(255, tempcolor);
cur->s.red = (UINT8)tempcolor; cur->s.red = (UINT8)tempcolor;
tempcolor = (image->s.green*(255-blendimage->s.alpha))/255 + ((tempmult + ((tempalpha*blendcolor.s.green)/255)) * blendimage->s.alpha)/255;
tempcolor = (brightness * blendcolor.s.green) / colorbright;
tempcolor = min(255, tempcolor);
cur->s.green = (UINT8)tempcolor; cur->s.green = (UINT8)tempcolor;
tempcolor = (image->s.blue*(255-blendimage->s.alpha))/255 + ((tempmult + ((tempalpha*blendcolor.s.blue)/255)) * blendimage->s.alpha)/255;
tempcolor = (brightness * blendcolor.s.blue) / colorbright;
tempcolor = min(255, tempcolor);
cur->s.blue = (UINT8)tempcolor; cur->s.blue = (UINT8)tempcolor;
cur->s.alpha = image->s.alpha; cur->s.alpha = image->s.alpha;
} }
else
{
// Color strength depends on image alpha
INT32 tempcolor;
cur++; image++; blendimage++; tempcolor = ((image->s.red * (255-blendimage->s.alpha)) / 255) + ((blendcolor.s.red * blendimage->s.alpha) / 255);
tempcolor = min(255, tempcolor);
cur->s.red = (UINT8)tempcolor;
tempcolor = ((image->s.green * (255-blendimage->s.alpha)) / 255) + ((blendcolor.s.green * blendimage->s.alpha) / 255);
tempcolor = min(255, tempcolor);
cur->s.green = (UINT8)tempcolor;
tempcolor = ((image->s.blue * (255-blendimage->s.alpha)) / 255) + ((blendcolor.s.blue * blendimage->s.alpha) / 255);
tempcolor = min(255, tempcolor);
cur->s.blue = (UINT8)tempcolor;
cur->s.alpha = image->s.alpha;
}
} }
cur++; image++; blendimage++;
} }
return; return;
@ -777,24 +951,24 @@ static void HWR_GetBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, INT
// mostly copied from HWR_GetMappedPatch, hence the similarities and comment // mostly copied from HWR_GetMappedPatch, hence the similarities and comment
GLMipmap_t *grmip, *newmip; GLMipmap_t *grmip, *newmip;
if (colormap == colormaps || colormap == NULL) if ((colormap == colormaps || colormap == NULL) && (skinnum > TC_DEFAULT))
{ {
// Don't do any blending // Don't do any blending
HWD.pfnSetTexture(gpatch->mipmap); HWD.pfnSetTexture(gpatch->mipmap);
return; return;
} }
// search for the mimmap // search for the mipmap
// skip the first (no colormap translated) // skip the first (no colormap translated)
for (grmip = gpatch->mipmap; grmip->nextcolormap; ) for (grmip = gpatch->mipmap; grmip->nextcolormap; )
{ {
grmip = grmip->nextcolormap; grmip = grmip->nextcolormap;
if (grmip->colormap == colormap) if (grmip->colormap == colormap || (skinnum < TC_DEFAULT && grmip->tcindex == skinnum))
{ {
if (grmip->downloaded && grmip->grInfo.data) if (grmip->downloaded && grmip->grInfo.data)
{ {
HWD.pfnSetTexture(grmip); // found the colormap, set it to the correct texture HWD.pfnSetTexture(grmip); // found the colormap, set it to the correct texture
Z_ChangeTag(grmip->grInfo.data, PU_HWRCACHE_UNLOCKED); Z_ChangeTag(grmip->grInfo.data, PU_HWRMODELTEXTURE);
return; return;
} }
} }
@ -812,16 +986,27 @@ static void HWR_GetBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, INT
I_Error("%s: Out of memory", "HWR_GetMappedPatch"); I_Error("%s: Out of memory", "HWR_GetMappedPatch");
grmip->nextcolormap = newmip; grmip->nextcolormap = newmip;
newmip->colormap = colormap; newmip->colormap = colormap;
newmip->tcindex = skinnum;
HWR_CreateBlendedTexture(gpatch, blendgpatch, newmip, skinnum, color); HWR_CreateBlendedTexture(gpatch, blendgpatch, newmip, skinnum, color);
HWD.pfnSetTexture(newmip); HWD.pfnSetTexture(newmip);
Z_ChangeTag(newmip->grInfo.data, PU_HWRCACHE_UNLOCKED); Z_ChangeTag(newmip->grInfo.data, PU_HWRMODELTEXTURE);
} }
#define NORMALFOG 0x00000000 #define NORMALFOG 0x00000000
#define FADEFOG 0x19000000 #define FADEFOG 0x19000000
static boolean HWR_AllowModel(mobj_t *mobj)
{
// Signpost overlay. Not needed.
if (mobj->state-states == S_PLAY_SIGN)
return false;
// Otherwise, render the model.
return true;
}
static boolean HWR_CanInterpolateModel(mobj_t *mobj, model_t *model) static boolean HWR_CanInterpolateModel(mobj_t *mobj, model_t *model)
{ {
if (cv_grmodelinterpolation.value == 2) // Always interpolate if (cv_grmodelinterpolation.value == 2) // Always interpolate
@ -897,7 +1082,7 @@ static UINT8 HWR_GetModelSprite2(md2_t *md2, skin_t *skin, UINT8 spr2, player_t
// HWR_DrawModel // HWR_DrawModel
// //
void HWR_DrawModel(gr_vissprite_t *spr) boolean HWR_DrawModel(gr_vissprite_t *spr)
{ {
FSurfaceInfo Surf; FSurfaceInfo Surf;
@ -910,10 +1095,12 @@ void HWR_DrawModel(gr_vissprite_t *spr)
UINT8 color[4]; UINT8 color[4];
if (!cv_grmodels.value) if (!cv_grmodels.value)
return; return false;
if (spr->precip) if (spr->precip)
return; return false;
memset(&p, 0x00, sizeof(FTransform));
// MD2 colormap fix // MD2 colormap fix
// colormap test // colormap test
@ -961,10 +1148,8 @@ void HWR_DrawModel(gr_vissprite_t *spr)
const UINT8 flip = (UINT8)(!(spr->mobj->eflags & MFE_VERTICALFLIP) != !(spr->mobj->frame & FF_VERTICALFLIP)); const UINT8 flip = (UINT8)(!(spr->mobj->eflags & MFE_VERTICALFLIP) != !(spr->mobj->frame & FF_VERTICALFLIP));
spritedef_t *sprdef; spritedef_t *sprdef;
spriteframe_t *sprframe; spriteframe_t *sprframe;
#ifdef ROTSPRITE
spriteinfo_t *sprinfo; spriteinfo_t *sprinfo;
angle_t ang; angle_t ang;
#endif
INT32 mod; INT32 mod;
float finalscale; float finalscale;
@ -988,20 +1173,16 @@ void HWR_DrawModel(gr_vissprite_t *spr)
{ {
md2 = &md2_playermodels[(skin_t*)spr->mobj->skin-skins]; md2 = &md2_playermodels[(skin_t*)spr->mobj->skin-skins];
md2->skin = (skin_t*)spr->mobj->skin-skins; md2->skin = (skin_t*)spr->mobj->skin-skins;
#ifdef ROTSPRITE
sprinfo = &((skin_t *)spr->mobj->skin)->sprinfo[spr->mobj->sprite2]; sprinfo = &((skin_t *)spr->mobj->skin)->sprinfo[spr->mobj->sprite2];
#endif
} }
else else
{ {
md2 = &md2_models[spr->mobj->sprite]; md2 = &md2_models[spr->mobj->sprite];
#ifdef ROTSPRITE
sprinfo = &spriteinfo[spr->mobj->sprite]; sprinfo = &spriteinfo[spr->mobj->sprite];
#endif
} }
if (md2->error) if (md2->error)
return; // we already failed loading this before :( return false; // we already failed loading this before :(
if (!md2->model) if (!md2->model)
{ {
//CONS_Debug(DBG_RENDER, "Loading model... (%s)", sprnames[spr->mobj->sprite]); //CONS_Debug(DBG_RENDER, "Loading model... (%s)", sprnames[spr->mobj->sprite]);
@ -1017,9 +1198,14 @@ void HWR_DrawModel(gr_vissprite_t *spr)
{ {
//CONS_Debug(DBG_RENDER, " FAILED\n"); //CONS_Debug(DBG_RENDER, " FAILED\n");
md2->error = true; // prevent endless fail md2->error = true; // prevent endless fail
return; return false;
} }
} }
// Lactozilla: Disallow certain models from rendering
if (!HWR_AllowModel(spr->mobj))
return false;
//HWD.pfnSetBlend(blend); // This seems to actually break translucency? //HWD.pfnSetBlend(blend); // This seems to actually break translucency?
finalscale = md2->scale; finalscale = md2->scale;
//Hurdler: arf, I don't like that implementation at all... too much crappy //Hurdler: arf, I don't like that implementation at all... too much crappy
@ -1034,11 +1220,10 @@ void HWR_DrawModel(gr_vissprite_t *spr)
if (gpatch && gpatch->mipmap->grInfo.format) // else if meant that if a texture couldn't be loaded, it would just end up using something else's texture if (gpatch && gpatch->mipmap->grInfo.format) // else if meant that if a texture couldn't be loaded, it would just end up using something else's texture
{ {
if ((skincolors_t)spr->mobj->color != SKINCOLOR_NONE && if (md2->blendgrpatch && ((GLPatch_t *)md2->blendgrpatch)->mipmap->grInfo.format
md2->blendgrpatch && ((GLPatch_t *)md2->blendgrpatch)->mipmap->grInfo.format
&& gpatch->width == ((GLPatch_t *)md2->blendgrpatch)->width && gpatch->height == ((GLPatch_t *)md2->blendgrpatch)->height) && gpatch->width == ((GLPatch_t *)md2->blendgrpatch)->width && gpatch->height == ((GLPatch_t *)md2->blendgrpatch)->height)
{ {
INT32 skinnum = TC_DEFAULT; INT32 skinnum = INT32_MAX;
if ((spr->mobj->flags & (MF_ENEMY|MF_BOSS)) && (spr->mobj->flags2 & MF2_FRET) && !(spr->mobj->flags & MF_GRENADEBOUNCE) && (leveltime & 1)) // Bosses "flash" if ((spr->mobj->flags & (MF_ENEMY|MF_BOSS)) && (spr->mobj->flags2 & MF2_FRET) && !(spr->mobj->flags & MF_GRENADEBOUNCE) && (leveltime & 1)) // Bosses "flash"
{ {
if (spr->mobj->type == MT_CYBRAKDEMON || spr->mobj->colorized) if (spr->mobj->type == MT_CYBRAKDEMON || spr->mobj->colorized)
@ -1048,7 +1233,7 @@ void HWR_DrawModel(gr_vissprite_t *spr)
else else
skinnum = TC_BOSS; skinnum = TC_BOSS;
} }
else if (spr->mobj->color) else if ((skincolors_t)spr->mobj->color != SKINCOLOR_NONE)
{ {
if (spr->mobj->colorized) if (spr->mobj->colorized)
skinnum = TC_RAINBOW; skinnum = TC_RAINBOW;
@ -1066,7 +1251,15 @@ void HWR_DrawModel(gr_vissprite_t *spr)
else else
skinnum = TC_DEFAULT; skinnum = TC_DEFAULT;
} }
HWR_GetBlendedTexture(gpatch, (GLPatch_t *)md2->blendgrpatch, skinnum, spr->colormap, (skincolors_t)spr->mobj->color);
// Translation or skin number found
if (skinnum != INT32_MAX)
HWR_GetBlendedTexture(gpatch, (GLPatch_t *)md2->blendgrpatch, skinnum, spr->colormap, (skincolors_t)spr->mobj->color);
else
{
// Sorry nothing
HWD.pfnSetTexture(gpatch->mipmap);
}
} }
else else
{ {
@ -1185,9 +1378,8 @@ void HWR_DrawModel(gr_vissprite_t *spr)
p.angley = FIXED_TO_FLOAT(anglef); p.angley = FIXED_TO_FLOAT(anglef);
} }
#ifdef ROTSPRITE
p.rollangle = 0.0f; p.rollangle = 0.0f;
p.rollflip = 0; p.rollflip = 1;
p.rotaxis = 0; p.rotaxis = 0;
if (spr->mobj->rollangle) if (spr->mobj->rollangle)
{ {
@ -1210,7 +1402,6 @@ void HWR_DrawModel(gr_vissprite_t *spr)
else if ((sprframe->rotate & SRF_LEFT) && (ang >= ANGLE_180)) // See from left else if ((sprframe->rotate & SRF_LEFT) && (ang >= ANGLE_180)) // See from left
p.rollflip = -1; p.rollflip = -1;
} }
#endif
p.anglex = 0.0f; p.anglex = 0.0f;
@ -1244,6 +1435,8 @@ void HWR_DrawModel(gr_vissprite_t *spr)
HWD.pfnDrawModel(md2->model, frame, durs, tics, nextFrame, &p, finalscale, flip, color); HWD.pfnDrawModel(md2->model, frame, durs, tics, nextFrame, &p, finalscale, flip, color);
} }
return true;
} }
#endif //HWRENDER #endif //HWRENDER

View file

@ -45,8 +45,8 @@ extern md2_t md2_models[NUMSPRITES];
extern md2_t md2_playermodels[MAXSKINS]; extern md2_t md2_playermodels[MAXSKINS];
void HWR_InitModels(void); void HWR_InitModels(void);
void HWR_DrawModel(gr_vissprite_t *spr);
void HWR_AddPlayerModel(INT32 skin); void HWR_AddPlayerModel(INT32 skin);
void HWR_AddSpriteModel(size_t spritenum); void HWR_AddSpriteModel(size_t spritenum);
boolean HWR_DrawModel(gr_vissprite_t *spr);
#endif // _HW_MD2_H_ #endif // _HW_MD2_H_

View file

@ -564,20 +564,15 @@ EXPORT void HWRAPI(FinishUpdate) (INT32 waitvbl)
// : in OpenGL, we store values for conversion of paletted graphics when // : in OpenGL, we store values for conversion of paletted graphics when
// : they are downloaded to the 3D card. // : they are downloaded to the 3D card.
// -----------------+ // -----------------+
EXPORT void HWRAPI(SetPalette) (RGBA_t *pal, RGBA_t *gamma) EXPORT void HWRAPI(SetPalette) (RGBA_t *pal)
{ {
INT32 i; size_t palsize = (sizeof(RGBA_t) * 256);
for (i = 0; i < 256; i++)
{
myPaletteData[i].s.red = (UINT8)MIN((pal[i].s.red*gamma->s.red)/127, 255);
myPaletteData[i].s.green = (UINT8)MIN((pal[i].s.green*gamma->s.green)/127, 255);
myPaletteData[i].s.blue = (UINT8)MIN((pal[i].s.blue*gamma->s.blue)/127, 255);
myPaletteData[i].s.alpha = pal[i].s.alpha;
}
// on a palette change, you have to reload all of the textures // on a palette change, you have to reload all of the textures
Flush(); if (memcmp(&myPaletteData, pal, palsize))
{
memcpy(&myPaletteData, pal, palsize);
Flush();
}
} }
#endif #endif

View file

@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*- // Emacs style mode select -*- C++ -*-
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// Copyright (C) 1998-2018 by Sonic Team Junior. // Copyright (C) 1998-2019 by Sonic Team Junior.
// //
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
@ -85,7 +85,7 @@ static GLboolean MipMap = GL_FALSE;
static GLint min_filter = GL_LINEAR; static GLint min_filter = GL_LINEAR;
static GLint mag_filter = GL_LINEAR; static GLint mag_filter = GL_LINEAR;
static GLint anisotropic_filter = 0; static GLint anisotropic_filter = 0;
static FTransform md2_transform; static boolean model_lighting = true;
const GLubyte *gl_extensions = NULL; const GLubyte *gl_extensions = NULL;
@ -221,11 +221,6 @@ FUNCPRINTF void DBG_Printf(const char *lpFmt, ...)
#define pglDrawElements glDrawElements #define pglDrawElements glDrawElements
#define pglEnableClientState glEnableClientState #define pglEnableClientState glEnableClientState
#define pglDisableClientState glDisableClientState #define pglDisableClientState glDisableClientState
#define pglClientActiveTexture glClientActiveTexture
#define pglGenBuffers glGenBuffers
#define pglBindBuffer glBindBuffer
#define pglBufferData glBufferData
#define pglDeleteBuffers glDeleteBuffers
/* Lighting */ /* Lighting */
#define pglShadeModel glShadeModel #define pglShadeModel glShadeModel
@ -331,15 +326,6 @@ typedef void (APIENTRY * PFNglEnableClientState) (GLenum cap);
static PFNglEnableClientState pglEnableClientState; static PFNglEnableClientState pglEnableClientState;
typedef void (APIENTRY * PFNglDisableClientState) (GLenum cap); typedef void (APIENTRY * PFNglDisableClientState) (GLenum cap);
static PFNglDisableClientState pglDisableClientState; static PFNglDisableClientState pglDisableClientState;
typedef void (APIENTRY * PFNglGenBuffers) (GLsizei n, GLuint *buffers);
static PFNglGenBuffers pglGenBuffers;
typedef void (APIENTRY * PFNglBindBuffer) (GLenum target, GLuint buffer);
static PFNglBindBuffer pglBindBuffer;
typedef void (APIENTRY * PFNglBufferData) (GLenum target, GLsizei size, const GLvoid *data, GLenum usage);
static PFNglBufferData pglBufferData;
typedef void (APIENTRY * PFNglDeleteBuffers) (GLsizei n, const GLuint *buffers);
static PFNglDeleteBuffers pglDeleteBuffers;
/* Lighting */ /* Lighting */
typedef void (APIENTRY * PFNglShadeModel) (GLenum mode); typedef void (APIENTRY * PFNglShadeModel) (GLenum mode);
@ -397,6 +383,17 @@ static PFNglMultiTexCoord2fv pglMultiTexCoord2fv;
typedef void (APIENTRY *PFNglClientActiveTexture) (GLenum); typedef void (APIENTRY *PFNglClientActiveTexture) (GLenum);
static PFNglClientActiveTexture pglClientActiveTexture; static PFNglClientActiveTexture pglClientActiveTexture;
/* 1.5 functions for buffers */
typedef void (APIENTRY * PFNglGenBuffers) (GLsizei n, GLuint *buffers);
static PFNglGenBuffers pglGenBuffers;
typedef void (APIENTRY * PFNglBindBuffer) (GLenum target, GLuint buffer);
static PFNglBindBuffer pglBindBuffer;
typedef void (APIENTRY * PFNglBufferData) (GLenum target, GLsizei size, const GLvoid *data, GLenum usage);
static PFNglBufferData pglBufferData;
typedef void (APIENTRY * PFNglDeleteBuffers) (GLsizei n, const GLuint *buffers);
static PFNglDeleteBuffers pglDeleteBuffers;
/* 1.2 Parms */ /* 1.2 Parms */
/* GL_CLAMP_TO_EDGE_EXT */ /* GL_CLAMP_TO_EDGE_EXT */
#ifndef GL_CLAMP_TO_EDGE #ifndef GL_CLAMP_TO_EDGE
@ -512,6 +509,8 @@ boolean SetupGLFunc13(void)
pglMultiTexCoord2f = GetGLFunc("glMultiTexCoord2f"); pglMultiTexCoord2f = GetGLFunc("glMultiTexCoord2f");
pglClientActiveTexture = GetGLFunc("glClientActiveTexture"); pglClientActiveTexture = GetGLFunc("glClientActiveTexture");
pglMultiTexCoord2fv = GetGLFunc("glMultiTexCoord2fv"); pglMultiTexCoord2fv = GetGLFunc("glMultiTexCoord2fv");
/* 1.5 funcs */
pglGenBuffers = GetGLFunc("glGenBuffers"); pglGenBuffers = GetGLFunc("glGenBuffers");
pglBindBuffer = GetGLFunc("glBindBuffer"); pglBindBuffer = GetGLFunc("glBindBuffer");
pglBufferData = GetGLFunc("glBufferData"); pglBufferData = GetGLFunc("glBufferData");
@ -724,8 +723,8 @@ void Flush(void)
while (gr_cachehead) while (gr_cachehead)
{ {
// ceci n'est pas du tout necessaire vu que tu les a charger normalement et // this is not necessary at all, because you have loaded them normally,
// donc il sont dans ta liste ! // and so they already are in your list!
#if 0 #if 0
//Hurdler: 25/04/2000: now support colormap in hardware mode //Hurdler: 25/04/2000: now support colormap in hardware mode
FTextureInfo *tmp = gr_cachehead->nextskin; FTextureInfo *tmp = gr_cachehead->nextskin;
@ -1297,11 +1296,11 @@ EXPORT void HWRAPI(SetTexture) (FTextureInfo *pTexInfo)
pTexInfo->nextmipmap = NULL; pTexInfo->nextmipmap = NULL;
if (gr_cachetail) if (gr_cachetail)
{ // insertion en fin de liste { // insertion at the tail
gr_cachetail->nextmipmap = pTexInfo; gr_cachetail->nextmipmap = pTexInfo;
gr_cachetail = pTexInfo; gr_cachetail = pTexInfo;
} }
else // initialisation de la liste else // initialization of the linked list
gr_cachetail = gr_cachehead = pTexInfo; gr_cachetail = gr_cachehead = pTexInfo;
} }
} }
@ -1435,7 +1434,7 @@ static const boolean gl_ext_arb_vertex_buffer_object = true;
// The texture offset to be applied to the texture coordinates in SkyVertex(). // The texture offset to be applied to the texture coordinates in SkyVertex().
static int rows, columns; static int rows, columns;
static boolean yflip; static signed char yflip;
static int texw, texh; static int texw, texh;
static boolean foglayer; static boolean foglayer;
static float delta = 0.0f; static float delta = 0.0f;
@ -1448,17 +1447,17 @@ static INT32 lasttex = -1;
static void SkyVertex(vbo_vertex_t *vbo, int r, int c) static void SkyVertex(vbo_vertex_t *vbo, int r, int c)
{ {
const float radians = (M_PIl / 180.0f); const float radians = (float)(M_PIl / 180.0f);
const float scale = 10000.0f; const float scale = 10000.0f;
const float maxSideAngle = 60.0f; const float maxSideAngle = 60.0f;
float topAngle = (c / (float)columns * 360.0f); float topAngle = (c / (float)columns * 360.0f);
float sideAngle = (maxSideAngle * (rows - r) / rows); float sideAngle = (maxSideAngle * (rows - r) / rows);
float height = sin(sideAngle * radians); float height = (float)(sin(sideAngle * radians));
float realRadius = scale * cos(sideAngle * radians); float realRadius = (float)(scale * cos(sideAngle * radians));
float x = realRadius * cos(topAngle * radians); float x = (float)(realRadius * cos(topAngle * radians));
float y = (!yflip) ? scale * height : -scale * height; float y = (!yflip) ? scale * height : -scale * height;
float z = realRadius * sin(topAngle * radians); float z = (float)(realRadius * sin(topAngle * radians));
float timesRepeat = (4 * (256.0f / texw)); float timesRepeat = (4 * (256.0f / texw));
if (fpclassify(timesRepeat) == FP_ZERO) if (fpclassify(timesRepeat) == FP_ZERO)
timesRepeat = 1.0f; timesRepeat = 1.0f;
@ -1660,16 +1659,9 @@ EXPORT void HWRAPI(SetSpecialState) (hwdspecialstate_t IdState, INT32 Value)
{ {
switch (IdState) switch (IdState)
{ {
case HWD_SET_MODEL_LIGHTING:
#if 0 model_lighting = Value;
case 77:
{
//08/01/00: Hurdler this is a test for mirror
if (!Value)
ClearBuffer(false, true, 0); // clear depth buffer
break; break;
}
#endif
case HWD_SET_FOG_COLOR: case HWD_SET_FOG_COLOR:
{ {
@ -1682,6 +1674,7 @@ EXPORT void HWRAPI(SetSpecialState) (hwdspecialstate_t IdState, INT32 Value)
pglFogfv(GL_FOG_COLOR, fogcolor); pglFogfv(GL_FOG_COLOR, fogcolor);
break; break;
} }
case HWD_SET_FOG_DENSITY: case HWD_SET_FOG_DENSITY:
pglFogf(GL_FOG_DENSITY, Value*1200/(500*1000000.0f)); pglFogf(GL_FOG_DENSITY, Value*1200/(500*1000000.0f));
break; break;
@ -2046,16 +2039,25 @@ static void DrawModelEx(model_t *model, INT32 frameIndex, INT32 duration, INT32
} }
#endif #endif
pglLightfv(GL_LIGHT0, GL_POSITION, LightPos); if (model_lighting)
{
pglLightfv(GL_LIGHT0, GL_POSITION, LightPos);
pglShadeModel(GL_SMOOTH);
}
pglShadeModel(GL_SMOOTH);
if (color) if (color)
{ {
#ifdef GL_LIGHT_MODEL_AMBIENT #ifdef GL_LIGHT_MODEL_AMBIENT
pglEnable(GL_LIGHTING); if (model_lighting)
pglMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, ambient); {
pglMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, diffuse); pglEnable(GL_LIGHTING);
pglMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, ambient);
pglMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, diffuse);
}
else
#endif #endif
pglColor4ubv((GLubyte*)color);
if (color[3] < 255) if (color[3] < 255)
SetBlend(PF_Translucent|PF_Modulated|PF_Clip); SetBlend(PF_Translucent|PF_Modulated|PF_Clip);
else else
@ -2074,7 +2076,6 @@ static void DrawModelEx(model_t *model, INT32 frameIndex, INT32 duration, INT32
pglRotatef(pos->angley, 0.0f, -1.0f, 0.0f); pglRotatef(pos->angley, 0.0f, -1.0f, 0.0f);
pglRotatef(pos->anglex, 1.0f, 0.0f, 0.0f); pglRotatef(pos->anglex, 1.0f, 0.0f, 0.0f);
#ifdef ROTSPRITE
if (pos->roll) if (pos->roll)
{ {
float roll = (1.0f * pos->rollflip); float roll = (1.0f * pos->rollflip);
@ -2087,7 +2088,6 @@ static void DrawModelEx(model_t *model, INT32 frameIndex, INT32 duration, INT32
pglRotatef(pos->rollangle, roll, 0.0f, 0.0f); pglRotatef(pos->rollangle, roll, 0.0f, 0.0f);
pglTranslatef(-pos->centerx, -pos->centery, 0); pglTranslatef(-pos->centerx, -pos->centery, 0);
} }
#endif
pglScalef(scalex, scaley, scalez); pglScalef(scalex, scaley, scalez);
@ -2226,8 +2226,6 @@ EXPORT void HWRAPI(SetTransform) (FTransform *stransform)
if (stransform) if (stransform)
{ {
boolean fovx90; boolean fovx90;
// keep a trace of the transformation for md2
memcpy(&md2_transform, stransform, sizeof (md2_transform));
#ifdef USE_FTRANSFORM_MIRROR #ifdef USE_FTRANSFORM_MIRROR
// mirroring from Kart // mirroring from Kart

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -1173,6 +1173,8 @@ void HU_clearChatChars(void)
w_chat[i] = 0; // reset this. w_chat[i] = 0; // reset this.
chat_on = false; chat_on = false;
c_input = 0; c_input = 0;
I_UpdateMouseGrab();
} }
#ifndef NONET #ifndef NONET
@ -1323,6 +1325,7 @@ boolean HU_Responder(event_t *ev)
chat_on = false; chat_on = false;
c_input = 0; // reset input cursor c_input = 0; // reset input cursor
chat_scrollmedown = true; // you hit enter, so you might wanna autoscroll to see what you just sent. :) chat_scrollmedown = true; // you hit enter, so you might wanna autoscroll to see what you just sent. :)
I_UpdateMouseGrab();
} }
else if (c == KEY_ESCAPE else if (c == KEY_ESCAPE
|| ((c == gamecontrol[gc_talkkey][0] || c == gamecontrol[gc_talkkey][1] || ((c == gamecontrol[gc_talkkey][0] || c == gamecontrol[gc_talkkey][1]
@ -1331,6 +1334,7 @@ boolean HU_Responder(event_t *ev)
{ {
chat_on = false; chat_on = false;
c_input = 0; // reset input cursor c_input = 0; // reset input cursor
I_UpdateMouseGrab();
} }
else if ((c == KEY_UPARROW || c == KEY_MOUSEWHEELUP) && chat_scroll > 0 && !OLDCHAT) // CHAT SCROLLING YAYS! else if ((c == KEY_UPARROW || c == KEY_MOUSEWHEELUP) && chat_scroll > 0 && !OLDCHAT) // CHAT SCROLLING YAYS!
{ {
@ -2066,7 +2070,7 @@ static void HU_drawGametype(void)
{ {
const char *strvalue = NULL; const char *strvalue = NULL;
if (gametype < 0 || gametype >= NUMGAMETYPES) if (gametype < 0 || gametype >= gametypecount)
return; // not a valid gametype??? return; // not a valid gametype???
strvalue = Gametype_Names[gametype]; strvalue = Gametype_Names[gametype];
@ -2117,6 +2121,9 @@ static void HU_DrawDemoInfo(void)
// //
void HU_Drawer(void) void HU_Drawer(void)
{ {
if (needpatchrecache)
R_ReloadHUDGraphics();
#ifndef NONET #ifndef NONET
// draw chat string plus cursor // draw chat string plus cursor
if (chat_on) if (chat_on)
@ -2371,7 +2378,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
for (i = 0; i < scorelines; i++) for (i = 0; i < scorelines; i++)
{ {
if (players[tab[i].num].spectator && gametype != GT_COOP) if (players[tab[i].num].spectator && gametyperankings[gametype] != GT_COOP)
continue; //ignore them. continue; //ignore them.
greycheck = greycheckdef; greycheck = greycheckdef;
@ -2434,7 +2441,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
} }
} }
if (G_GametypeUsesLives() && !(gametype == GT_COOP && (cv_cooplives.value == 0 || cv_cooplives.value == 3)) && (players[tab[i].num].lives != INFLIVES)) //show lives if (G_GametypeUsesLives() && !(G_GametypeUsesCoopLives() && (cv_cooplives.value == 0 || cv_cooplives.value == 3)) && (players[tab[i].num].lives != INFLIVES)) //show lives
V_DrawRightAlignedString(x, y+4, V_ALLOWLOWERCASE|(greycheck ? V_60TRANS : 0), va("%dx", players[tab[i].num].lives)); V_DrawRightAlignedString(x, y+4, V_ALLOWLOWERCASE|(greycheck ? V_60TRANS : 0), va("%dx", players[tab[i].num].lives));
else if (G_TagGametype() && players[tab[i].num].pflags & PF_TAGIT) else if (G_TagGametype() && players[tab[i].num].pflags & PF_TAGIT)
{ {
@ -2447,7 +2454,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
if (players[tab[i].num].exiting || (players[tab[i].num].pflags & PF_FINISHED)) if (players[tab[i].num].exiting || (players[tab[i].num].pflags & PF_FINISHED))
V_DrawSmallScaledPatch(x - SHORT(exiticon->width)/2 - 1, y-3, 0, exiticon); V_DrawSmallScaledPatch(x - SHORT(exiticon->width)/2 - 1, y-3, 0, exiticon);
if (gametype == GT_RACE) if (gametyperankings[gametype] == GT_RACE)
{ {
if (circuitmap) if (circuitmap)
{ {
@ -2541,7 +2548,7 @@ static void HU_Draw32TeamTabRankings(playersort_t *tab, INT32 whiteplayer)
| (greycheck ? 0 : V_TRANSLUCENT) | (greycheck ? 0 : V_TRANSLUCENT)
| V_ALLOWLOWERCASE, name); | V_ALLOWLOWERCASE, name);
if (gametype == GT_CTF) if (gametyperules & GTR_TEAMFLAGS)
{ {
if (players[tab[i].num].gotflag & GF_REDFLAG) // Red if (players[tab[i].num].gotflag & GF_REDFLAG) // Red
V_DrawFixedPatch((x-10)*FRACUNIT, (y)*FRACUNIT, FRACUNIT/4, 0, rflagico, 0); V_DrawFixedPatch((x-10)*FRACUNIT, (y)*FRACUNIT, FRACUNIT/4, 0, rflagico, 0);
@ -2669,7 +2676,7 @@ void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer)
| (greycheck ? V_TRANSLUCENT : 0) | (greycheck ? V_TRANSLUCENT : 0)
| V_ALLOWLOWERCASE, name); | V_ALLOWLOWERCASE, name);
if (gametype == GT_CTF) if (gametyperules & GTR_TEAMFLAGS)
{ {
if (players[tab[i].num].gotflag & GF_REDFLAG) // Red if (players[tab[i].num].gotflag & GF_REDFLAG) // Red
V_DrawSmallScaledPatch(x-28, y-4, 0, rflagico); V_DrawSmallScaledPatch(x-28, y-4, 0, rflagico);
@ -2726,7 +2733,7 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline
for (i = 0; i < scorelines; i++) for (i = 0; i < scorelines; i++)
{ {
if (players[tab[i].num].spectator && gametype != GT_COOP) if (players[tab[i].num].spectator && gametyperankings[gametype] != GT_COOP)
continue; //ignore them. continue; //ignore them.
greycheck = greycheckdef; greycheck = greycheckdef;
@ -2743,7 +2750,7 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline
| (greycheck ? V_TRANSLUCENT : 0) | (greycheck ? V_TRANSLUCENT : 0)
| V_ALLOWLOWERCASE, name); | V_ALLOWLOWERCASE, name);
if (G_GametypeUsesLives() && !(gametype == GT_COOP && (cv_cooplives.value == 0 || cv_cooplives.value == 3)) && (players[tab[i].num].lives != INFLIVES)) //show lives if (G_GametypeUsesLives() && !(G_GametypeUsesCoopLives() && (cv_cooplives.value == 0 || cv_cooplives.value == 3)) && (players[tab[i].num].lives != INFLIVES)) //show lives
V_DrawRightAlignedString(x, y+4, V_ALLOWLOWERCASE, va("%dx", players[tab[i].num].lives)); V_DrawRightAlignedString(x, y+4, V_ALLOWLOWERCASE, va("%dx", players[tab[i].num].lives));
else if (G_TagGametype() && players[tab[i].num].pflags & PF_TAGIT) else if (G_TagGametype() && players[tab[i].num].pflags & PF_TAGIT)
V_DrawSmallScaledPatch(x-28, y-4, 0, tagico); V_DrawSmallScaledPatch(x-28, y-4, 0, tagico);
@ -2792,7 +2799,7 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline
} }
// All data drawn with thin string for space. // All data drawn with thin string for space.
if (gametype == GT_RACE) if (gametyperankings[gametype] == GT_RACE)
{ {
if (circuitmap) if (circuitmap)
{ {
@ -2832,7 +2839,7 @@ static void HU_Draw32TabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scor
for (i = 0; i < scorelines; i++) for (i = 0; i < scorelines; i++)
{ {
if (players[tab[i].num].spectator && gametype != GT_COOP) if (players[tab[i].num].spectator && gametyperankings[gametype] != GT_COOP)
continue; //ignore them. continue; //ignore them.
greycheck = greycheckdef; greycheck = greycheckdef;
@ -2902,7 +2909,7 @@ static void HU_Draw32TabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scor
} }
// All data drawn with thin string for space. // All data drawn with thin string for space.
if (gametype == GT_RACE) if (gametyperankings[gametype] == GT_RACE)
{ {
if (circuitmap) if (circuitmap)
{ {
@ -3026,21 +3033,21 @@ static void HU_DrawRankings(void)
// draw the current gametype in the lower right // draw the current gametype in the lower right
HU_drawGametype(); HU_drawGametype();
if (gametype != GT_RACE && gametype != GT_COMPETITION && gametype != GT_COOP) if (gametyperules & (GTR_TIMELIMIT|GTR_POINTLIMIT))
{ {
if (cv_timelimit.value && timelimitintics > 0) if ((gametyperules & GTR_TIMELIMIT) && cv_timelimit.value && timelimitintics > 0)
{ {
V_DrawCenteredString(64, 8, 0, "TIME"); V_DrawCenteredString(64, 8, 0, "TIME");
V_DrawCenteredString(64, 16, 0, va("%i:%02i", G_TicsToMinutes(stplyr->realtime, true), G_TicsToSeconds(stplyr->realtime))); V_DrawCenteredString(64, 16, 0, va("%i:%02i", G_TicsToMinutes(stplyr->realtime, true), G_TicsToSeconds(stplyr->realtime)));
} }
if (cv_pointlimit.value > 0) if ((gametyperules & GTR_POINTLIMIT) && cv_pointlimit.value > 0)
{ {
V_DrawCenteredString(256, 8, 0, "POINT LIMIT"); V_DrawCenteredString(256, 8, 0, "POINT LIMIT");
V_DrawCenteredString(256, 16, 0, va("%d", cv_pointlimit.value)); V_DrawCenteredString(256, 16, 0, va("%d", cv_pointlimit.value));
} }
} }
else if (gametype == GT_COOP) else if (gametyperankings[gametype] == GT_COOP)
{ {
INT32 totalscore = 0; INT32 totalscore = 0;
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
@ -3074,7 +3081,7 @@ static void HU_DrawRankings(void)
tab[i].num = -1; tab[i].num = -1;
tab[i].name = 0; tab[i].name = 0;
if (gametype == GT_RACE && !circuitmap) if (gametyperankings[gametype] == GT_RACE && !circuitmap)
tab[i].count = INT32_MAX; tab[i].count = INT32_MAX;
} }
@ -3083,7 +3090,7 @@ static void HU_DrawRankings(void)
if (!playeringame[j]) if (!playeringame[j])
continue; continue;
if (gametype != GT_COOP && players[j].spectator) if (!G_PlatformGametype() && players[j].spectator)
continue; continue;
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
@ -3091,10 +3098,10 @@ static void HU_DrawRankings(void)
if (!playeringame[i]) if (!playeringame[i])
continue; continue;
if (gametype != GT_COOP && players[i].spectator) if (!G_PlatformGametype() && players[i].spectator)
continue; continue;
if (gametype == GT_RACE) if (gametyperankings[gametype] == GT_RACE)
{ {
if (circuitmap) if (circuitmap)
{ {
@ -3117,7 +3124,7 @@ static void HU_DrawRankings(void)
} }
} }
} }
else if (gametype == GT_COMPETITION) else if (gametyperankings[gametype] == GT_COMPETITION)
{ {
// todo put something more fitting for the gametype here, such as current // todo put something more fitting for the gametype here, such as current
// number of categories led // number of categories led

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -1,6 +1,6 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 2011-2018 by Sonic Team Junior. // Copyright (C) 2011-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -1,6 +1,6 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 2011-2018 by Sonic Team Junior. // Copyright (C) 2011-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -184,10 +184,6 @@ void I_StartupMouse(void);
*/ */
void I_StartupMouse2(void); void I_StartupMouse2(void);
/** \brief keyboard startup, shutdown, handler
*/
void I_StartupKeyboard(void);
/** \brief setup timer irq and user timer routine. /** \brief setup timer irq and user timer routine.
*/ */
void I_StartupTimer(void); void I_StartupTimer(void);
@ -292,6 +288,10 @@ void I_GetJoystick2Events(void);
*/ */
void I_GetMouseEvents(void); void I_GetMouseEvents(void);
/** \brief Checks if the mouse needs to be grabbed
*/
void I_UpdateMouseGrab(void);
char *I_GetEnv(const char *name); char *I_GetEnv(const char *name);
INT32 I_PutEnv(char *variable); INT32 I_PutEnv(char *variable);

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -209,7 +209,8 @@ static size_t numbans = 0;
static boolean SOCK_bannednode[MAXNETNODES+1]; /// \note do we really need the +1? static boolean SOCK_bannednode[MAXNETNODES+1]; /// \note do we really need the +1?
static boolean init_tcp_driver = false; static boolean init_tcp_driver = false;
static char port_name[8] = DEFAULTPORT; static const char *serverport_name = DEFAULTPORT;
static const char *clientport_name;/* any port */
#ifndef NONET #ifndef NONET
@ -887,6 +888,7 @@ static boolean UDP_Socket(void)
#ifdef HAVE_IPV6 #ifdef HAVE_IPV6
const INT32 b_ipv6 = M_CheckParm("-ipv6"); const INT32 b_ipv6 = M_CheckParm("-ipv6");
#endif #endif
const char *serv;
for (s = 0; s < mysocketses; s++) for (s = 0; s < mysocketses; s++)
@ -902,11 +904,16 @@ static boolean UDP_Socket(void)
hints.ai_socktype = SOCK_DGRAM; hints.ai_socktype = SOCK_DGRAM;
hints.ai_protocol = IPPROTO_UDP; hints.ai_protocol = IPPROTO_UDP;
if (serverrunning)
serv = serverport_name;
else
serv = clientport_name;
if (M_CheckParm("-bindaddr")) if (M_CheckParm("-bindaddr"))
{ {
while (M_IsNextParm()) while (M_IsNextParm())
{ {
gaie = I_getaddrinfo(M_GetNextParm(), port_name, &hints, &ai); gaie = I_getaddrinfo(M_GetNextParm(), serv, &hints, &ai);
if (gaie == 0) if (gaie == 0)
{ {
runp = ai; runp = ai;
@ -927,7 +934,7 @@ static boolean UDP_Socket(void)
} }
else else
{ {
gaie = I_getaddrinfo("0.0.0.0", port_name, &hints, &ai); gaie = I_getaddrinfo("0.0.0.0", serv, &hints, &ai);
if (gaie == 0) if (gaie == 0)
{ {
runp = ai; runp = ai;
@ -942,8 +949,8 @@ static boolean UDP_Socket(void)
#ifdef HAVE_MINIUPNPC #ifdef HAVE_MINIUPNPC
if (UPNP_support) if (UPNP_support)
{ {
I_UPnP_rem(port_name, "UDP"); I_UPnP_rem(serverport_name, "UDP");
I_UPnP_add(NULL, port_name, "UDP"); I_UPnP_add(NULL, serverport_name, "UDP");
} }
#endif #endif
} }
@ -960,7 +967,7 @@ static boolean UDP_Socket(void)
{ {
while (M_IsNextParm()) while (M_IsNextParm())
{ {
gaie = I_getaddrinfo(M_GetNextParm(), port_name, &hints, &ai); gaie = I_getaddrinfo(M_GetNextParm(), serv, &hints, &ai);
if (gaie == 0) if (gaie == 0)
{ {
runp = ai; runp = ai;
@ -981,7 +988,7 @@ static boolean UDP_Socket(void)
} }
else else
{ {
gaie = I_getaddrinfo("::", port_name, &hints, &ai); gaie = I_getaddrinfo("::", serv, &hints, &ai);
if (gaie == 0) if (gaie == 0)
{ {
runp = ai; runp = ai;
@ -1421,15 +1428,19 @@ boolean I_InitTcpNetwork(void)
if (!I_InitTcpDriver()) if (!I_InitTcpDriver())
return false; return false;
if (M_CheckParm("-port")) if (M_CheckParm("-port") || M_CheckParm("-serverport"))
// Combined -udpport and -clientport into -port // Combined -udpport and -clientport into -port
// As it was really redundant having two seperate parms that does the same thing // As it was really redundant having two seperate parms that does the same thing
/* Sorry Steel, I'm adding these back. But -udpport is a stupid name. */
{ {
if (M_IsNextParm()) /*
strcpy(port_name, M_GetNextParm()); If it's NULL, that's okay! Because then
else we'll get a random port from getaddrinfo.
strcpy(port_name, "0"); */
serverport_name = M_GetNextParm();
} }
if (M_CheckParm("-clientport"))
clientport_name = M_GetNextParm();
// parse network game options, // parse network game options,
if (M_CheckParm("-server") || dedicated) if (M_CheckParm("-server") || dedicated)

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -44,6 +44,7 @@ extern boolean highcolor;
/** \brief setup video mode /** \brief setup video mode
*/ */
void I_StartupGraphics(void); void I_StartupGraphics(void);
void I_StartupHardwareGraphics(void);
/** \brief restore old video mode /** \brief restore old video mode
*/ */
@ -84,6 +85,7 @@ INT32 VID_GetModeForSize(INT32 w, INT32 h);
\return currect video mode \return currect video mode
*/ */
INT32 VID_SetMode(INT32 modenum); INT32 VID_SetMode(INT32 modenum);
void VID_CheckRenderer(void);
/** \brief The VID_GetModeName function /** \brief The VID_GetModeName function

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -3880,11 +3880,11 @@ state_t states[NUMSTATES] =
{SPR_ROID, FF_ANIMATE|FF_RANDOMANIM, -1, {NULL}, 7, 2, S_NULL}, // S_ROCKCRUMBLED {SPR_ROID, FF_ANIMATE|FF_RANDOMANIM, -1, {NULL}, 7, 2, S_NULL}, // S_ROCKCRUMBLED
{SPR_ROIE, FF_ANIMATE|FF_RANDOMANIM, -1, {NULL}, 7, 2, S_NULL}, // S_ROCKCRUMBLEE {SPR_ROIE, FF_ANIMATE|FF_RANDOMANIM, -1, {NULL}, 7, 2, S_NULL}, // S_ROCKCRUMBLEE
{SPR_ROIF, FF_ANIMATE|FF_RANDOMANIM, -1, {NULL}, 7, 2, S_NULL}, // S_ROCKCRUMBLEF {SPR_ROIF, FF_ANIMATE|FF_RANDOMANIM, -1, {NULL}, 7, 2, S_NULL}, // S_ROCKCRUMBLEF
{SPR_ROIG, FF_ANIMATE|FF_RANDOMANIM, -1, {NULL}, 7, 2, S_NULL}, // S_ROCKCRUMBLEG {SPR_ROIG, FF_ANIMATE|FF_RANDOMANIM, -1, {NULL}, 4, 2, S_NULL}, // S_ROCKCRUMBLEG
{SPR_ROIH, FF_ANIMATE|FF_RANDOMANIM, -1, {NULL}, 7, 2, S_NULL}, // S_ROCKCRUMBLEH {SPR_ROIH, FF_ANIMATE|FF_RANDOMANIM, -1, {NULL}, 4, 2, S_NULL}, // S_ROCKCRUMBLEH
{SPR_ROII, FF_ANIMATE|FF_RANDOMANIM, -1, {NULL}, 7, 2, S_NULL}, // S_ROCKCRUMBLEI {SPR_ROII, FF_ANIMATE|FF_RANDOMANIM, -1, {NULL}, 7, 2, S_NULL}, // S_ROCKCRUMBLEI
{SPR_ROIJ, FF_ANIMATE|FF_RANDOMANIM, -1, {NULL}, 7, 2, S_NULL}, // S_ROCKCRUMBLEJ {SPR_ROIJ, FF_ANIMATE|FF_RANDOMANIM, -1, {NULL}, 4, 2, S_NULL}, // S_ROCKCRUMBLEJ
{SPR_ROIK, FF_ANIMATE|FF_RANDOMANIM, -1, {NULL}, 7, 2, S_NULL}, // S_ROCKCRUMBLEK {SPR_ROIK, FF_ANIMATE|FF_RANDOMANIM, -1, {NULL}, 4, 2, S_NULL}, // S_ROCKCRUMBLEK
{SPR_ROIL, FF_ANIMATE|FF_RANDOMANIM, -1, {NULL}, 7, 2, S_NULL}, // S_ROCKCRUMBLEL {SPR_ROIL, FF_ANIMATE|FF_RANDOMANIM, -1, {NULL}, 7, 2, S_NULL}, // S_ROCKCRUMBLEL
{SPR_ROIM, FF_ANIMATE|FF_RANDOMANIM, -1, {NULL}, 7, 2, S_NULL}, // S_ROCKCRUMBLEM {SPR_ROIM, FF_ANIMATE|FF_RANDOMANIM, -1, {NULL}, 7, 2, S_NULL}, // S_ROCKCRUMBLEM
{SPR_ROIN, FF_ANIMATE|FF_RANDOMANIM, -1, {NULL}, 7, 2, S_NULL}, // S_ROCKCRUMBLEN {SPR_ROIN, FF_ANIMATE|FF_RANDOMANIM, -1, {NULL}, 7, 2, S_NULL}, // S_ROCKCRUMBLEN
@ -4492,7 +4492,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
0, // mass 0, // mass
0, // damage 0, // damage
sfx_None, // activesound sfx_None, // activesound
MF_NOTHINK|MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY, // flags MF_SCENERY|MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY, // flags
S_NULL // raisestate S_NULL // raisestate
}, },
@ -6273,7 +6273,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
0, // mass 0, // mass
0, // damage 0, // damage
sfx_None, // activesound sfx_None, // activesound
MF_NOGRAVITY|MF_NOBLOCKMAP|MF_NOTHINK, // flags MF_NOGRAVITY|MF_NOBLOCKMAP|MF_SCENERY, // flags
S_NULL // raisestate S_NULL // raisestate
}, },
@ -11992,7 +11992,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass 100, // mass
0, // damage 0, // damage
sfx_None, // activesound sfx_None, // activesound
MF_NOTHINK|MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags
S_NULL // raisestate S_NULL // raisestate
}, },
@ -12019,7 +12019,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass 100, // mass
0, // damage 0, // damage
sfx_None, // activesound sfx_None, // activesound
MF_NOTHINK|MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags
S_NULL // raisestate S_NULL // raisestate
}, },
@ -17667,7 +17667,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
0, // damage 0, // damage
sfx_None, // activesound sfx_None, // activesound
MF_SPECIAL|MF_NOGRAVITY|MF_SCENERY, // flags MF_SPECIAL|MF_NOGRAVITY|MF_SCENERY, // flags
S_NULL // raisestate S_EXTRALARGEBUBBLE // raisestate
}, },
{ // MT_WATERZAP { // MT_WATERZAP

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -155,11 +155,9 @@ void A_SpawnObjectAbsolute();
void A_SpawnObjectRelative(); void A_SpawnObjectRelative();
void A_ChangeAngleRelative(); void A_ChangeAngleRelative();
void A_ChangeAngleAbsolute(); void A_ChangeAngleAbsolute();
#ifdef ROTSPRITE
void A_RollAngle(); void A_RollAngle();
void A_ChangeRollAngleRelative(); void A_ChangeRollAngleRelative();
void A_ChangeRollAngleAbsolute(); void A_ChangeRollAngleAbsolute();
#endif
void A_PlaySound(); void A_PlaySound();
void A_FindTarget(); void A_FindTarget();
void A_FindTracer(); void A_FindTracer();

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior. // Copyright (C) 1999-2019 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

Some files were not shown because too many files have changed in this diff Show more