diff --git a/.travis.yml b/.travis.yml
index 8a137d9d8..1131bff3a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -70,7 +70,7 @@ matrix:
- p7zip-full
- gcc-7
compiler: gcc-7
- env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wimplicit-fallthrough=3"
+ env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wno-implicit-fallthrough"
#gcc-7 (Ubuntu 7.2.0-1ubuntu1~14.04) 7.2.0 20170802
- os: linux
addons:
@@ -85,7 +85,7 @@ matrix:
- p7zip-full
- gcc-8
compiler: gcc-8
- env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wimplicit-fallthrough=3"
+ env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wno-implicit-fallthrough -Wno-error=format-overflow"
#gcc-8 (Ubuntu 7.2.0-1ubuntu1~14.04) 8.1.0
- os: linux
compiler: clang
@@ -227,7 +227,6 @@ matrix:
- compiler: clang-3.9
- compiler: clang-4.0
- compiler: clang-5.0
- - compiler: gcc-8
cache:
apt: true
diff --git a/CMakeLists.txt b/CMakeLists.txt
index eb91866f0..6eb065d04 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.0)
project(SRB2
- VERSION 2.1.20
+ VERSION 2.1.23
LANGUAGES C)
if(${PROJECT_SOURCE_DIR} MATCHES ${PROJECT_BINARY_DIR})
@@ -98,10 +98,10 @@ add_subdirectory(assets)
## config.h generation
set(GIT_EXECUTABLE "git" CACHE FILEPATH "Path to git binary")
include(GitUtilities)
-git_describe(SRB2_GIT_DESCRIBE "${CMAKE_SOURCE_DIR}")
+git_latest_commit(SRB2_COMP_COMMIT "${CMAKE_SOURCE_DIR}")
git_current_branch(SRB2_GIT_BRANCH "${CMAKE_SOURCE_DIR}")
set(SRB2_COMP_BRANCH "${SRB2_GIT_BRANCH}")
-set(SRB2_COMP_REVISION "${SRB2_GIT_DESCRIBE}")
+set(SRB2_COMP_REVISION "${SRB2_COMP_COMMIT}")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/src/config.h)
##### PACKAGE CONFIGURATION #####
diff --git a/SRB2_Debug.props b/SRB2_Debug.props
index 8be11c58a..74177c6ef 100644
--- a/SRB2_Debug.props
+++ b/SRB2_Debug.props
@@ -22,6 +22,7 @@
Debug
+ true
diff --git a/SRB2_Release.props b/SRB2_Release.props
index a216ea45a..905dfdcf9 100644
--- a/SRB2_Release.props
+++ b/SRB2_Release.props
@@ -24,6 +24,7 @@
DebugFastLink
true
true
+ true
diff --git a/SRB2_common.props b/SRB2_common.props
index 2fb2eb8c6..0f80ceb17 100644
--- a/SRB2_common.props
+++ b/SRB2_common.props
@@ -18,7 +18,7 @@
4244;4267
- ws2_32.lib;%(AdditionalDependencies)
+ advapi32.lib;ws2_32.lib;%(AdditionalDependencies)
Windows
false
true
diff --git a/appveyor.yml b/appveyor.yml
index 69913cfc8..f0f843fbb 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -1,11 +1,15 @@
-version: 2.1.20.{branch}-{build}
+version: 2.1.23.{branch}-{build}
os: MinGW
environment:
CC: ccache
CCACHE_CC: i686-w64-mingw32-gcc
+ CCACHE_CC_64: x86_64-w64-mingw32-gcc
WINDRES: windres
+ # c:\mingw-w64 i686 has gcc 6.3.0, so use c:\msys64 7.3.0 instead
MINGW_SDK: c:\msys64\mingw32
+ # c:\msys64 x86_64 has gcc 8.2.0, so use c:\mingw-w64 7.3.0 instead
+ MINGW_SDK_64: C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64
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_URL: http://www.nasm.us/pub/nasm/releasebuilds/2.12.01/win64/nasm-2.12.01-win64.zip
@@ -15,65 +19,114 @@ environment:
CCACHE_URL: http://alam.srb2.org/ccache.exe
CCACHE_COMPRESS: true
CCACHE_DIR: C:\Users\appveyor\.ccache
+ # Disable UPX by default. The user can override this in their Appveyor project settings
+ NOUPX: 1
+ ##############################
+ # DEPLOYER VARIABLES
+ # DPL_ENABLED=1 builds installers for branch names starting with `deployer`.
+ # DPL_TAG_ENABLED=1 will also build installers for release tags. DPL_ENABLED=1 must also be set.
+ # Set these in the Appveyor project settings
+ ##############################
+ DPL_ENABLED: 0
+ DPL_TAG_ENABLED: 0
+ DPL_INSTALLER_NAME: SRB2-v2123
+ # Asset handling is barebones vs. Travis Deployer. We operate on 7z only.
+ # Include the README files and the OpenGL batch in the main and patch archives.
+ # The x86/x64 archives contain the DLL binaries.
+ ASSET_ARCHIVE_PATH: https://github.com/mazmazz/SRB2/releases/download/SRB2_assets/SRB2-v2122-assets.7z
+ ASSET_ARCHIVE_PATCH_PATH: https://github.com/mazmazz/SRB2/releases/download/SRB2_assets/SRB2-v2122-patch-assets.7z
+ ASSET_ARCHIVE_X86_PATH: https://github.com/mazmazz/SRB2/releases/download/SRB2_assets/SRB2-v2122-x86-assets.7z
+ ASSET_ARCHIVE_X64_PATH: https://github.com/mazmazz/SRB2/releases/download/SRB2_assets/SRB2-v2122-x64-assets.7z
+ ASSET_ARCHIVE_OPTIONAL_PATH: https://github.com/mazmazz/SRB2/releases/download/SRB2_assets/SRB2-v2122-optional-assets.7z
+ # This is overridden to 1 for release tag builds
+ ASSET_FILES_OPTIONAL_GET: 0
+ # For patches, also include the X86/X64 DLLs.
+ PACKAGE_PATCH_DLL_GET: 0
+ # Delete all asset downloads so they can be redownloaded
+ ASSET_CLEAN: 0
cache:
- nasm-2.12.01.zip
- upx391w.zip
- ccache.exe
- C:\Users\appveyor\.ccache
+- C:\Users\appveyor\srb2_cache
install:
+- if [%CONFIGURATION%] == [SDL64] ( set "X86_64=1" )
+- if [%CONFIGURATION%] == [SDL64] ( set "CONFIGURATION=SDL" )
+- if [%CONFIGURATION%] == [DD64] ( set "X86_64=1" )
+- if [%CONFIGURATION%] == [DD64] ( set "CONFIGURATION=DD" )
+- 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
-- robocopy /S /xx /ns /nc /nfl /ndl /np /njh /njs %TMP%\%NASM_ZIP% %MINGW_SDK%\bin nasm.exe || exit 0
+- 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
-- robocopy /S /xx /ns /nc /nfl /ndl /np /njh /njs %TMP%\%UPX_ZIP% %MINGW_SDK%\bin upx.exe || exit 0
+- robocopy /S /xx /ns /nc /nfl /ndl /np /njh /njs "%TMP%\%UPX_ZIP%" "%MINGW_SDK%\bin" upx.exe || exit 0
- if not exist "%CCACHE_EXE%" appveyor DownloadFile "%CCACHE_URL%" -FileName "%CCACHE_EXE%"
- ccache -M 99M
-- xcopy /Y /V /I ccache.exe %MINGW_SDK%\bin
+- xcopy /Y /V /I ccache.exe "%MINGW_SDK%\bin"
configuration:
- SDL
+- SDL64
- DD
+- DD64
matrix:
allow_failures:
- configuration: DD
+ - configuration: DD64
before_build:
-- set Path=%MINGW_SDK%\bin;%Path%
-- i686-w64-mingw32-gcc --version
+- set "Path=%MINGW_SDK%\bin;%Path%"
+- if [%X86_64%] == [1] ( x86_64-w64-mingw32-gcc --version ) else ( i686-w64-mingw32-gcc --version )
- mingw32-make --version
-- nasm -v
-- upx -V
+- if not [%X86_64%] == [1] ( nasm -v )
+- if not [%NOUPX%] == [1] ( upx -V )
- ccache -V
- ccache -s
-- set SRB2_MFLAGS=-C src MINGW=1 WARNINGMODE=1 GCC72=1 CCACHE=1 NOOBJDUMP=1
+- if [%NOUPX%] == [1] ( set "NOUPX=NOUPX=1" ) else ( set "NOUPX=" )
+- set "SRB2_MFLAGS=-C src WARNINGMODE=1 CCACHE=1 GCC72=1 NOOBJDUMP=1 %NOUPX%"
+- if [%X86_64%] == [1] ( set "MINGW_FLAGS=MINGW64=1 X86_64=1" ) else ( set "MINGW_FLAGS=MINGW=1" )
+- set "SRB2_MFLAGS=%SRB2_MFLAGS% %MINGW_FLAGS% %CONFIGURATION%=1"
build_script:
-- cmd: mingw32-make.exe %SRB2_MFLAGS% %CONFIGURATION%=1 clean
-- cmd: mingw32-make.exe %SRB2_MFLAGS% %CONFIGURATION%=1 ERRORMODE=1 -k
+- cmd: mingw32-make.exe %SRB2_MFLAGS% clean
+- cmd: mingw32-make.exe %SRB2_MFLAGS% ERRORMODE=1 -k
after_build:
+- if [%X86_64%] == [1] (
+ set "BUILD_PATH=bin\Mingw64\Release"
+ ) else (
+ set "BUILD_PATH=bin\Mingw\Release"
+ )
+- if [%X86_64%] == [1] ( set "CONFIGURATION=%CONFIGURATION%64" )
- ccache -s
- cmd: git rev-parse --short %APPVEYOR_REPO_COMMIT%>%TMP%/gitshort.txt
- cmd: set /P GITSHORT=<%TMP%/gitshort.txt
- set BUILD_ARCHIVE=%APPVEYOR_REPO_BRANCH%-%GITSHORT%-%CONFIGURATION%.7z
- set BUILDSARCHIVE=%APPVEYOR_REPO_BRANCH%-%CONFIGURATION%.7z
-- cmd: 7z a %BUILD_ARCHIVE% bin\Mingw\Release -xr!.gitignore
+- cmd: 7z a %BUILD_ARCHIVE% %BUILD_PATH% -xr!.gitignore
- appveyor PushArtifact %BUILD_ARCHIVE%
- cmd: copy %BUILD_ARCHIVE% %BUILDSARCHIVE%
- appveyor PushArtifact %BUILDSARCHIVE%
+##############################
+# DEPLOYER SCRIPT
+##############################
+- if [%DPL_ENABLED%] == [1] ( call "deployer\appveyor\deployer.bat" )
test: off
#deploy:
# - provider: FTP
# protocol: ftps
-# host:
+# host:
# secure: NsLJEPIBvmwCOj8Tg8RoRQ==
# username:
# secure: ejxi5mvk7oLYu7QtbYojajEPigMy0mokaKhuEVuDZcA=
diff --git a/assets/.gitignore b/assets/.gitignore
index 37bb465dc..9ed61ca1a 100644
--- a/assets/.gitignore
+++ b/assets/.gitignore
@@ -1,2 +1,5 @@
*
*.*
+!README.txt
+!LICENSE.txt
+!LICENSE-3RD-PARTY.txt
\ No newline at end of file
diff --git a/assets/CMakeLists.txt b/assets/CMakeLists.txt
index 292e184c7..6edb3df13 100644
--- a/assets/CMakeLists.txt
+++ b/assets/CMakeLists.txt
@@ -8,6 +8,9 @@ set(SRB2_ASSET_ALL
${CMAKE_CURRENT_SOURCE_DIR}/zones.dta
${CMAKE_CURRENT_SOURCE_DIR}/patch.dta
${CMAKE_CURRENT_SOURCE_DIR}/music.dta
+ ${CMAKE_CURRENT_SOURCE_DIR}/README.txt
+ ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt
+ ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE-3RD-PARTY.txt
)
set(SRB2_ASSET_HASHED
diff --git a/assets/LICENSE-3RD-PARTY.txt b/assets/LICENSE-3RD-PARTY.txt
new file mode 100644
index 000000000..42ea20e96
--- /dev/null
+++ b/assets/LICENSE-3RD-PARTY.txt
@@ -0,0 +1,1710 @@
+--------------------------------------------------------------------------------
+ 3-Clause BSD License
+ applies to:
+ - MiniUPnPc
+ Copyright (c) 2005-2011, Thomas BERNARD
+ All rights reserved.
+ http://miniupnp.free.fr
+--------------------------------------------------------------------------------
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+--------------------------------------------------------------------------------
+ curl License
+ applies to:
+ - curl
+ Copyright (c) 1996 - 2018, Daniel Stenberg, daniel@haxx.se,
+ and many contributors, see the THANKS file.
+ https://curl.haxx.se
+--------------------------------------------------------------------------------
+
+All rights reserved.
+
+Permission to use, copy, modify, and distribute this software for any purpose
+with or without fee is hereby granted, provided that the above copyright notice
+and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN
+NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
+OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of a copyright holder shall not be
+used in advertising or otherwise to promote the sale, use or other dealings in
+this Software without prior written authorization of the copyright holder.
+
+--------------------------------------------------------------------------------
+ FMOD End User License Agreement
+ applies to:
+ - FMOD Ex
+ Copyright (c), Firelight Technologies Pty, Ltd. 2004-2018.
+ https://www.fmod.com
+--------------------------------------------------------------------------------
+
+This FMOD End User Licence Agreement (EULA) is a legal agreement between you and Firelight
+Technologies Pty Ltd (ACN 099 182 448) (us or we) and governs your use of FMOD Studio and FMOD
+Engine software (FMOD).
+
+1. GRANT OF LICENCE
+This EULA grants you the right to use FMOD, in a software application (Product), for
+personal (hobbyist), educational (students and teachers) or Non-Commercial use only,
+subject to the following:
+i) Non-Commercial use does not involve any form of monetisation, sponsorship
+or promotion.
+ii) FMOD is distributed as integrated into a Product only;
+iii) FMOD is not distributed as part of any Commercial Product or service;
+iv) FMOD is not distributed as part of a game engine or tool set;
+v) FMOD is not used in any Commercial enterprise or for any Commercial
+production or subcontracting, except for the purposes of Evaluation or
+Development of a Commercial Product;
+vi) Product includes attribution in accordance with Clause 3;
+
+2. OTHER USE
+For all Commercial use, and any Non Commercial use not permitted by this license, a
+separate license is required. Refer to www.fmod.com/licensing for information.
+
+3. CREDITS AND LOGO
+All Products require an in game credit line which must include the words "FMOD" or
+"FMOD Studio" (if applicable) and "Firelight Technologies Pty Ltd". This is non
+negotiable. Refer to www.fmod.com/licensing for examples. All products require a
+logo to be presented during start up of the application, before encountering any
+menus or interactivity. See www.fmod.com/licensing for logo information. The user
+has the option to 'buy out' the requirement to have a logo at the start of the
+product.
+
+4. INTELLECTUAL PROPERTY RIGHTS
+a) We are and remain at all times the owner of FMOD (including all intellectual
+property rights in or to the Software). For the avoidance of doubt, nothing in
+this EULA may be deemed to grant or assign to you any proprietary or ownership
+interest or intellectual property rights in or to FMOD other than the rights
+licensed pursuant to clause 1.
+b) You acknowledge and agree that you have no right, title or interest in and to the
+intellectual property rights in FMOD.
+
+5. SECURITY AND RISK
+You are responsible for protecting FMOD and any related materials at all times from
+unauthorised access, use or damage.
+
+6. WARRANTY AND LIMITATION OF LIABILITY
+a) FMOD is provided by us "as is" and, to the maximum extent permitted by law,
+any express or implied warranties of any kind, including (but not limited to) all
+implied warranties of merchantability and fitness for a particular purpose are
+disclaimed.
+b) In no event shall we (and our employees, contractors and subcontractors),
+developers and contributors be liable for any direct, special, indirect or
+consequential damages whatsoever resulting from loss of use of data or profits,
+whether in an action of contract, negligence or other tortious conduct, arising
+out of or in connection with the use or performance FMOD.
+
+7. OGG VORBIS CODEC
+a) FMOD uses the Ogg Vorbis codec.
+b) (c) 2002, Xiph.Org Foundation
+c) Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+i) Redistributions of source code must retain the above copyright notice, the
+list of conditions and the following disclaimer.
+ii) Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation
+and/or other material provided with the distribution.
+iii) Neither the name of the Xiph.org Foundation nor the names of its
+contributors may be used to endorse or promote products derived from this
+software without specific prior written permission.
+d) THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTIAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+8. GOOGLE VR (GVR)
+FMOD includes Google VR, licensed under the Apache Licence, Version 2.0 (the Licence);
+you may not use this file except in compliance with the License. You may obtain a copy of
+the License at:
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software distributed under the
+License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+either express or implied. See the License for the specific language governing permissions
+and limitations under the License.
+
+9. ANDROID PLATFORM CODE
+Copyright (C) 2010 The Android Open Source Project All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are
+permitted provided that the following conditions are met:
+* Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in
+the documentation and/or other materials provided with the
+distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+10. AUDIOGAMING AUDIOMOTORS DEMO CONTENT
+AudioGaming AudioMotors Demo Engine.agp is provided for evaluation purposes
+only and is not to be redistributed. To create your own engine content, you
+will need AudioMotors V2 Pro. A trial version be found at
+http://store.audiogaming.net/content/audiomotors-v2-pro-trial. For access to
+the full version, contact sales@fmod.com.
+
+© 2018 Firelight Technologies Pty Ltd.
+
+--------------------------------------------------------------------------------
+ GCC Runtime Library Exception, Version 3.1
+ applies to:
+ - GCC Runtime Library
+ Copyright (C) Free Software Foundation, Inc.
+ https://www.gnu.org/software/gcc/
+--------------------------------------------------------------------------------
+
+GCC RUNTIME LIBRARY EXCEPTION Version 3.1, 31 March 2009
+
+Copyright © 2009 Free Software Foundation, Inc.
+
+Everyone is permitted to copy and distribute verbatim copies of this license
+document, but changing it is not allowed.
+
+This GCC Runtime Library Exception ("Exception") is an additional permission
+under section 7 of the GNU General Public License, version 3 ("GPLv3"). It
+applies to a given file (the "Runtime Library") that bears a notice placed by
+the copyright holder of the file stating that the file is governed by GPLv3
+along with this Exception.
+
+When you use GCC to compile a program, GCC may combine portions of certain GCC
+header files and runtime libraries with the compiled program. The purpose of
+this Exception is to allow compilation of non-GPL (including proprietary)
+programs to use, in this way, the header files and runtime libraries covered by
+this Exception.
+
+0. Definitions. A file is an "Independent Module" if it either requires the
+Runtime Library for execution after a Compilation Process, or makes use of an
+interface provided by the Runtime Library, but is not otherwise based on the
+Runtime Library.
+
+"GCC" means a version of the GNU Compiler Collection, with or without
+modifications, governed by version 3 (or a specified later version) of the GNU
+General Public License (GPL) with the option of using any subsequent versions
+published by the FSF.
+
+"GPL-compatible Software" is software whose conditions of propagation,
+modification and use would permit combination with GCC in accord with the
+license of GCC.
+
+"Target Code" refers to output from any compiler for a real or virtual target
+processor architecture, in executable form or suitable for input to an
+assembler, loader, linker and/or execution phase. Notwithstanding that, Target
+Code does not include data in any format that is used as a compiler
+intermediate representation, or used for producing a compiler intermediate
+representation.
+
+The "Compilation Process" transforms code entirely represented in
+non-intermediate languages designed for human-written code, and/or in Java
+Virtual Machine byte code, into Target Code. Thus, for example, use of source
+code generators and preprocessors need not be considered part of the
+Compilation Process, since the Compilation Process can be understood as
+starting with the output of the generators or preprocessors.
+
+A Compilation Process is "Eligible" if it is done using GCC, alone or with
+other GPL-compatible software, or if it is done without using any work based on
+GCC. For example, using non-GPL-compatible Software to optimize any GCC
+intermediate representations would not qualify as an Eligible Compilation
+Process.
+
+1. Grant of Additional Permission. You have permission to propagate a work of
+Target Code formed by combining the Runtime Library with Independent Modules,
+even if such propagation would otherwise violate the terms of GPLv3, provided
+that all Target Code was generated by Eligible Compilation Processes. You may
+then convey such a combination under terms of your choice, consistent with the
+licensing of the Independent Modules.
+
+2. No Weakening of GCC Copyleft. The availability of this Exception does not
+imply any general presumption that third-party software is unaffected by the
+copyleft requirements of the license of GCC.
+
+--------------------------------------------------------------------------------
+ GNU General Public License, Version 3
+ applies to:
+ - GCC Runtime Library
+ Copyright (C) Free Software Foundation, Inc.
+ https://www.gnu.org/software/gcc/
+--------------------------------------------------------------------------------
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ Copyright (C)
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+.
+
+--------------------------------------------------------------------------------
+ GNU Lesser General Public License, Version 2.1
+ applies to:
+ - Game_Music_Emu
+ Shay Green
+ http://www.slack.net/~ant/
+
+ - libintl
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
+ https://www.gnu.org/software/gettext/
+
+ - mpg123
+ Copyright (c) 1995-2013 by Michael Hipp and others,
+ free software under the terms of the LGPL v2.1
+ https://www.mpg123.de
+--------------------------------------------------------------------------------
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ , 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
+--------------------------------------------------------------------------------
+ libpng License
+ applies to:
+ - libpng
+ Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson
+ http://www.libpng.org/pub/png/libpng.html
+--------------------------------------------------------------------------------
+
+This copy of the libpng notices is provided for your convenience. In case of
+any discrepancy between this copy and the notices in the file png.h that is
+included in the libpng distribution, the latter shall prevail.
+
+COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
+
+If you modify libpng you may insert additional notices immediately following
+this sentence.
+
+This code is released under the libpng license.
+
+libpng versions 1.0.7, July 1, 2000 through 1.6.35, July 15, 2018 are
+Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are
+derived from libpng-1.0.6, and are distributed according to the same
+disclaimer and license as libpng-1.0.6 with the following individuals
+added to the list of Contributing Authors:
+
+ Simon-Pierre Cadieux
+ Eric S. Raymond
+ Mans Rullgard
+ Cosmin Truta
+ Gilles Vollant
+ James Yu
+ Mandar Sahastrabuddhe
+ Google Inc.
+ Vadim Barkov
+
+and with the following additions to the disclaimer:
+
+ There is no warranty against interference with your enjoyment of the
+ library or against infringement. There is no warranty that our
+ efforts or the library will fulfill any of your particular purposes
+ or needs. This library is provided with all faults, and the entire
+ risk of satisfactory quality, performance, accuracy, and effort is with
+ the user.
+
+Some files in the "contrib" directory and some configure-generated
+files that are distributed with libpng have other copyright owners and
+are released under other open source licenses.
+
+libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
+Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from
+libpng-0.96, and are distributed according to the same disclaimer and
+license as libpng-0.96, with the following individuals added to the list
+of Contributing Authors:
+
+ Tom Lane
+ Glenn Randers-Pehrson
+ Willem van Schaik
+
+libpng versions 0.89, June 1996, through 0.96, May 1997, are
+Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88,
+and are distributed according to the same disclaimer and license as
+libpng-0.88, with the following individuals added to the list of
+Contributing Authors:
+
+ John Bowler
+ Kevin Bracey
+ Sam Bushell
+ Magnus Holmgren
+ Greg Roelofs
+ Tom Tanner
+
+Some files in the "scripts" directory have other copyright owners
+but are released under this license.
+
+libpng versions 0.5, May 1995, through 0.88, January 1996, are
+Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
+
+For the purposes of this copyright and license, "Contributing Authors"
+is defined as the following set of individuals:
+
+ Andreas Dilger
+ Dave Martindale
+ Guy Eric Schalnat
+ Paul Schmidt
+ Tim Wegner
+
+The PNG Reference Library is supplied "AS IS". The Contributing Authors
+and Group 42, Inc. disclaim all warranties, expressed or implied,
+including, without limitation, the warranties of merchantability and of
+fitness for any purpose. The Contributing Authors and Group 42, Inc.
+assume no liability for direct, indirect, incidental, special, exemplary,
+or consequential damages, which may result from the use of the PNG
+Reference Library, even if advised of the possibility of such damage.
+
+Permission is hereby granted to use, copy, modify, and distribute this
+source code, or portions hereof, for any purpose, without fee, subject
+to the following restrictions:
+
+ 1. The origin of this source code must not be misrepresented.
+
+ 2. Altered versions must be plainly marked as such and must not
+ be misrepresented as being the original source.
+
+ 3. This Copyright notice may not be removed or altered from any
+ source or altered source distribution.
+
+The Contributing Authors and Group 42, Inc. specifically permit, without
+fee, and encourage the use of this source code as a component to
+supporting the PNG file format in commercial products. If you use this
+source code in a product, acknowledgment is not required but would be
+appreciated.
+
+END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE.
+
+TRADEMARK:
+
+The name "libpng" has not been registered by the Copyright owner
+as a trademark in any jurisdiction. However, because libpng has
+been distributed and maintained world-wide, continually since 1995,
+the Copyright owner claims "common-law trademark protection" in any
+jurisdiction where common-law trademark is recognized.
+
+OSI CERTIFICATION:
+
+Libpng is OSI Certified Open Source Software. OSI Certified Open Source is
+a certification mark of the Open Source Initiative. OSI has not addressed
+the additional disclaimers inserted at version 1.0.7.
+
+EXPORT CONTROL:
+
+The Copyright owner believes that the Export Control Classification
+Number (ECCN) for libpng is EAR99, which means not subject to export
+controls or International Traffic in Arms Regulations (ITAR) because
+it is open source, publicly available software, that does not contain
+any encryption software. See the EAR, paragraphs 734.3(b)(3) and
+734.7(b).
+
+Glenn Randers-Pehrson
+glennrp at users.sourceforge.net
+July 15, 2018
+
+--------------------------------------------------------------------------------
+ New BSD License
+ applies to:
+ - FLAC
+ Copyright (C) 2000-2009 Josh Coalson
+ Copyright (C) 2011-2016 Xiph.Org Foundation
+ https://xiph.org/flac/api/
+
+ - Vorbis
+ Copyright (c) 2002-2008 Xiph.org Foundation
+ https://xiph.org/vorbis/
+
+ - Opus
+ Copyright 2001-2011 Xiph.Org, Skype Limited, Octasic,
+ Jean-Marc Valin, Timothy B. Terriberry,
+ CSIRO, Gregory Maxwell, Mark Borgerding,
+ Erik de Castro Lopo
+ https://opus-codec.org
+
+ - Opus File
+ Copyright (c) 1994-2013 Xiph.Org Foundation and contributors
+ https://opus-codec.org
+--------------------------------------------------------------------------------
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+- Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+
+- Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+
+[ For FLAC, Vorbis, and Opus File
+- Neither the name of the Xiph.org Foundation nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+]
+
+[ For Opus
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
+names of specific contributors, may be used to endorse or promote
+products derived from this software without specific prior written
+permission.
+]
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+--------------------------------------------------------------------------------
+ Public Domain
+ applies to:
+ - win_iconv
+ Yukihiro Nakadaira
+ win_iconv is placed in the public domain.
+ https://github.com/win-iconv/win-iconv
+
+ - libmodplug
+ ModPlug-XMMS and libmodplug are now in the public domain.
+ http://modplug-xmms.sourceforge.net
+--------------------------------------------------------------------------------
+
+--------------------------------------------------------------------------------
+ zlib License
+ applies to:
+ - Simple DirectMedia Layer
+ Copyright (C) 1997-2018 Sam Lantinga
+ https://www.libsdl.org/hg.php
+
+ - SDL_mixer: An audio mixer library based on the SDL library
+ Copyright (C) 1997-2018 Sam Lantinga
+ https://www.libsdl.org/projects/SDL_mixer/
+
+ - zlib
+ Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
+ https://zlib.net
+--------------------------------------------------------------------------------
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any damages
+arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
diff --git a/assets/LICENSE.txt b/assets/LICENSE.txt
new file mode 100644
index 000000000..d159169d1
--- /dev/null
+++ b/assets/LICENSE.txt
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ , 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/assets/README.txt b/assets/README.txt
new file mode 100644
index 000000000..37f7d8f29
--- /dev/null
+++ b/assets/README.txt
@@ -0,0 +1,51 @@
+SONIC ROBO BLAST 2
+
+Sonic Robo Blast 2 (SRB2) is a 3D Sonic the Hedgehog fangame based on a
+modified version of Doom Legacy.
+
+LICENSE
+
+The source code for SRB2 is licensed under the GNU General Public
+License, Version 2. See LICENSE.txt for the full text of this license.
+
+SRB2 uses various third-party libraries, including SDL, SDL Mixer, and
+their dependencies. See LICENSE-3RD-PARTY.txt for the licenses of these
+libraries.
+
+SOURCE CODE
+
+You may obtain the source code for SRB2, including the source code for
+specific version releases, at the following web sites:
+
+STJr GitLab:
+https://git.magicalgirl.moe/STJr/SRB2
+
+GitHub:
+https://github.com/STJr/SRB2
+
+CONTACT
+
+You may contact Sonic Team Junior via the following web sites:
+
+SRB2.ORG:
+https://www.srb2.org
+
+SRB2 Message Board:
+https://mb.srb2.org
+
+SRB2 Official Discord:
+https://discord.gg/pYDXzpX
+
+COPYRIGHT AND DISCLAIMER
+
+Design and content on SRB2 is copyright 1998-2018 by Sonic Team Junior.
+All non-original material on SRB2.ORG is copyrighted by their
+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
+responsible for any content on SRB2.ORG under the 1998 DMCA. This
+site, its webmaster, and its staff make no profit whatsoever (in fact,
+we lose money). Sonic Team Junior assumes no responsibility for the
+content on any Sonic Team Junior fan sites.
+
+Sonic Team Junior is in no way affiliated with SEGA or Sonic Team. We do
+not claim ownership of any of SEGA's intellectual property used in SRB2.
diff --git a/assets/debian/README.Debian b/assets/debian/README.Debian
index 4d9f067ac..68c952a4e 100644
--- a/assets/debian/README.Debian
+++ b/assets/debian/README.Debian
@@ -3,10 +3,45 @@ srb2 for Debian
SRB2 Debian package!
Hi there, to rebuild this package just use the SRB2 Makefile system, or, optionally, run
-dpkg-buildpackage in the in /bin/Resources directory. You can build these with or without a key
+dpkg-buildpackage in the in /assets directory. You can build these with or without a key
if you want, but if you want to put these on a repo, generate your own GnuPG key as per the
https://help.ubuntu.com/community/GnuPrivacyGuardHowto instructions and pass the -k
command to debuild. Make sure you export the key footprint and give them to your users to install
with apt-key add. Thanks!
-- Callum Dickinson Fri, 26 Nov 2010 18:25:31 +1300
+
+
+Signing for Launchpad PPA
+
+First, follow the above instructions to generate a GnuPG key with your identity. You will need
+to publish the fingerprint of that key to Ubuntu's key server.
+
+ https://help.ubuntu.com/community/GnuPrivacyGuardHowto#Uploading_the_key_to_Ubuntu_keyserver
+
+Next, you will have to add that key fingerprint to your Launchpad account. Go to your Launchpad
+profile and click the yellow Edit button next to "OpenPGP keys". Once you add the key, you can
+upload signed source packages and publish them onto your PPA.
+
+IF YOU UPLOAD A PACKAGE and Launchpad does NOT send you a confirmation or rejection email, that
+means your key is not set up correctly with your Launchpad account.
+
+
+Building for Launchpad PPA
+
+Use these steps to prepare building a source package for Launchpad:
+
+ 1. Highly recommend copying the assets/ folder to outside your repo folder, or else the asset
+ files may be included in the main source package, when you build that.
+ 2. cd [wherever-your-assets-folder-is]/assets/
+ 3. debuild -T clean (optional, if you already have asset files)
+
+Building the source package is a two-step process:
+
+ 1. debuild -T build (this downloads the asset files from srb2.org if necessary)
+ 2. debuild -S (builds the source package for Launchpad, including the asset files)
+
+Then follow the instructions at to upload
+to your PPA and have Launchpad build your binary deb packages.
+
+ -- Marco Zafra Mon, 26 Nov 2018 21:13:00 -0500
diff --git a/assets/debian/changelog b/assets/debian/changelog
index a316b7df7..f3a92e1cd 100644
--- a/assets/debian/changelog
+++ b/assets/debian/changelog
@@ -1,3 +1,10 @@
+srb2-data (2.1.21~7) trusty; urgency=high
+
+ * Updated for SRB2 v2.1.21
+
+ -- Marco Zafra Mon, 26 Nov 2018 14:31:00 -0500
+
+
srb2-data (2.1.14~1) unstable; urgency=low
* Updated for SRB2 v2.1.14
diff --git a/assets/debian/control b/assets/debian/control
index 123b58429..22d9643ee 100644
--- a/assets/debian/control
+++ b/assets/debian/control
@@ -3,8 +3,9 @@
Source: srb2-data
Section: games
Priority: extra
-Maintainer: Callum Dickinson
-Build-Depends: debhelper (>= 7.0.50~)
+Maintainer: Sonic Team Junior
+Build-Depends: debhelper (>= 7.0.50~),
+ wget
Standards-Version: 3.8.4
Homepage: http://www.srb2.org
@@ -15,8 +16,7 @@ Description: A cross-platform 3D Sonic fangame
fangame built using a modified version of the Doom Legacy
port of Doom. SRB2 is closely inspired by the original
Sonic games from the Sega Genesis, and attempts to recreate
- the design in 3D. While SRB2 isn't fully completed, it already
- features tons of levels, enemies, speed, and quite a lot
- of the fun that the original Sonic games provided.
+ the design in 3D. It features tons of levels, enemies, speed,
+ and quite a lot of the fun that the original Sonic games provided.
This is the data package that provides the data files that
- SRB2 requires to run, it will not work without it.
+ SRB2 requires to run; it will not work without it.
diff --git a/assets/debian/copyright b/assets/debian/copyright
index 8a8705190..97d606b0f 100644
--- a/assets/debian/copyright
+++ b/assets/debian/copyright
@@ -1,6 +1,6 @@
This work was packaged for Debian by:
- Callum Dickinson on Fri, 26 Nov 2010 15:19:16 +1300
+ Marco Zafra Mon, 26 Nov 2018 14:31:00 -0500
It was downloaded from:
@@ -12,7 +12,7 @@ Upstream Author(s):
Copyright:
- Copyright (C) 1998-2010 Sonic Team Junior
+ Copyright (C) 1998-2018 Sonic Team Junior
License:
@@ -21,6 +21,7 @@ License:
The Debian packaging is:
Copyright (C) 2010 Callum Dickinson
+ Copyright (C) 2010-2018 Sonic Team Junior
and is licensed under the GPL version 2,
see "/usr/share/common-licenses/GPL-2".
diff --git a/assets/debian/rules b/assets/debian/rules
index d86f92af2..a34a3393f 100755
--- a/assets/debian/rules
+++ b/assets/debian/rules
@@ -37,7 +37,7 @@ RM := rm -rf
DIR := $(shell pwd)
PACKAGE := $(shell cat $(DIR)/debian/control | grep 'Package:' | sed -e 's/Package: //g')
-DATAFILES := srb2.srb zones.dta player.dta rings.dta music.dta
+DATAFILES := srb2.srb zones.dta player.dta rings.dta music.dta patch.dta README.txt LICENSE.txt LICENSE-3RD-PARTY.txt
DATADIR := usr/games/SRB2
RESOURCEDIR := .
@@ -45,16 +45,21 @@ WGET := wget -P $(RESOURCEDIR) -c -nc
build:
$(MKDIR) $(DIR)/debian/tmp/$(DATADIR)
+ > $(DIR)/debian/source/include-binaries
# This will need to be updated every time SRB2 official version is
# Copy data files to their install locations, and add data files to include-binaries
for file in $(DATAFILES); do \
- $(WGET) http://alam.srb2.org/SRB2/2.1.14-Final/Resources/$$file; \
- if test "$$file" = "srb2.wad"; then \
- $(INSTALL) $(RESOURCEDIR)/$$file $(DIR)/debian/tmp/$(DATADIR)/srb2.srb; \
- else \
- $(INSTALL) $(RESOURCEDIR)/$$file $(DIR)/debian/tmp/$(DATADIR)/$$file; \
+ if [ ! -f $(RESOURCEDIR)/$$file ]; then \
+ $(WGET) http://alam.srb2.org/SRB2/2.1.21-Final/Resources/$$file; \
+ fi; \
+ if [ -f $(RESOURCEDIR)/$$file ]; then \
+ $(INSTALL) $(RESOURCEDIR)/$$file $(DIR)/debian/tmp/$(DATADIR)/$$file; \
+ echo $(RESOURCEDIR)/$$file >> $(DIR)/debian/source/include-binaries; \
+ fi; \
+ if [ ! -f $(DIR)/debian/tmp/$(DATADIR)/$$file ]; then \
+ echo $(DIR)/debian/tmp/$(DATADIR)/$$file not found and could not be downloaded!; \
+ return 1; \
fi; \
- echo $(RESOURCEDIR)/$$file >> $(DIR)/debian/source/include-binaries; \
done
binary-indep:
@@ -95,15 +100,18 @@ binary: binary-indep
dh_builddeb
clean:
- $(RM) $(RESOURCEDIR)/*.wad
- $(RM) $(RESOURCEDIR)/*.dta
- $(RM) $(RESOURCEDIR)/*.plr
- $(RM) $(RESOURCEDIR)/*.wpn
- $(RM) $(RESOURCEDIR)/*.srb
- $(RM) $(RESOURCEDIR)/*.dll
- $(RM) $(DIR)/debian/tmp/*
- $(RM) $(DIR)/debian/$(PACKAGE).install
- $(RM) $(DIR)/debian/files
- $(RM) $(DIR)/debian/source/include-binaries
+ $(RM) $(DIR)/debian/tmp/*; \
+ $(RM) $(DIR)/debian/$(PACKAGE).install; \
+ $(RM) $(DIR)/debian/files; \
+
+clean-all: clean
+ $(RM) $(RESOURCEDIR)/*.wad; \
+ $(RM) $(RESOURCEDIR)/*.dta; \
+ $(RM) $(RESOURCEDIR)/*.plr; \
+ $(RM) $(RESOURCEDIR)/*.wpn; \
+ $(RM) $(RESOURCEDIR)/*.srb; \
+ $(RM) $(RESOURCEDIR)/*.dll; \
+ $(RM) $(RESOURCEDIR)/*.txt; \
+ $(RM) $(DIR)/debian/source/include-binaries; \
.PHONY: all clean binary binary-arch binary-indep build
diff --git a/assets/debian/source/options b/assets/debian/source/options
new file mode 100644
index 000000000..8b331485a
--- /dev/null
+++ b/assets/debian/source/options
@@ -0,0 +1 @@
+tar-ignore = "tmp/*"
diff --git a/bin/Resources/exchndl.dll b/bin/Resources/exchndl.dll
deleted file mode 100644
index d836a6762..000000000
Binary files a/bin/Resources/exchndl.dll and /dev/null differ
diff --git a/cmake/Modules/GitUtilities.cmake b/cmake/Modules/GitUtilities.cmake
index 683cf9b6b..d29e6b509 100644
--- a/cmake/Modules/GitUtilities.cmake
+++ b/cmake/Modules/GitUtilities.cmake
@@ -27,5 +27,17 @@ function(git_current_branch variable path)
OUTPUT_STRIP_TRAILING_WHITESPACE
)
+ set(${variable} "${output}" PARENT_SCOPE)
+endfunction()
+
+function(git_latest_commit variable path)
+ execute_process(COMMAND ${GIT_EXECUTABLE} "rev-parse" "--short" "HEAD"
+ WORKING_DIRECTORY "${path}"
+ RESULT_VARIABLE result
+ OUTPUT_VARIABLE output
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+
set(${variable} "${output}" PARENT_SCOPE)
endfunction()
\ No newline at end of file
diff --git a/debian/README.Debian b/debian/README.Debian
index bbc306b16..4b724816e 100644
--- a/debian/README.Debian
+++ b/debian/README.Debian
@@ -9,3 +9,38 @@ instructions and pass the -k command to debuild. Make sure you export the
and give them to your users to install with apt-key add. Thanks!
-- Callum Dickinson Fri, 26 Nov 2010 18:25:31 +1300
+
+
+Signing for Launchpad PPA
+
+First, follow the above instructions to generate a GnuPG key with your identity. You will need
+to publish the fingerprint of that key to Ubuntu's key server.
+
+ https://help.ubuntu.com/community/GnuPrivacyGuardHowto#Uploading_the_key_to_Ubuntu_keyserver
+
+Next, you will have to add that key fingerprint to your Launchpad account. Go to your Launchpad
+profile and click the yellow Edit button next to "OpenPGP keys". Once you add the key, you can
+upload signed source packages and publish them onto your PPA.
+
+IF YOU UPLOAD A PACKAGE and Launchpad does NOT send you a confirmation or rejection email, that
+means your key is not set up correctly with your Launchpad account.
+
+
+Building for Launchpad PPA
+
+Use these steps to prepare building a source package for Launchpad:
+
+ 1. cd [srb2repo]
+ 2. git reset --hard; git clean -fd; git clean -fx;
+ * Resets your repo folder to a committed state and removes untracked files
+ * If you built srb2-data in the assets/ folder, MAKE SURE THAT FOLDER DOES NOT HAVE ASSETS,
+ OR THEY MAY BE INCLUDED IN THE MAIN SOURCE PACKAGE!
+
+Building the source package takes just one step:
+
+ 1. debuild -S (builds the source package for Launchpad)
+
+Then follow the instructions at to upload
+to your PPA and have Launchpad build your binary deb packages.
+
+ -- Marco Zafra Mon, 26 Nov 2018 21:13:00 -0500
diff --git a/debian/README.source b/debian/README.source
index ff2dddd41..f63a42cac 100644
--- a/debian/README.source
+++ b/debian/README.source
@@ -22,6 +22,10 @@ Build instructions:
make -C src LINUX=1
+Build instructions for non-X86 devices (such as X64):
+
+make -C src LINUX=1 NONX86=1
+
Build instructions to build for Wii Linux/SRB2Wii on a PowerPC system,
follow cross-compiling instructions for cross-compiling on a x86 system:
diff --git a/debian/changelog b/debian/changelog
index b454b1abd..b06a78e2b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+srb2 (2.1.23~9) trusty; urgency=high
+
+ * SRB2 v2.1.23 release
+
+ -- Marco Zafra Mon, 27 Nov 2018 16:45:00 -0500
+
+
srb2 (2.0.6-5) maverick; urgency=high
* Initial proper release..
diff --git a/debian/control b/debian/control
index 63b075f17..0f2d8062b 100644
--- a/debian/control
+++ b/debian/control
@@ -3,11 +3,13 @@
Source: srb2
Section: games
Priority: extra
-Maintainer: Callum Dickinson
+Maintainer: Sonic Team Junior
Build-Depends: debhelper (>= 7.0.50~),
libsdl2-dev,
libsdl2-mixer-dev,
- libpng12-dev (>= 1.2.7),
+ libpng12-dev (>= 1.2.7) | libpng-dev,
+ zlib1g-dev,
+ libgme-dev,
libglu1-dev | libglu-dev,
libosmesa6-dev | libgl-dev,
nasm [i386]
@@ -16,27 +18,26 @@ Homepage: http://www.srb2.org
Package: srb2
Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, srb2-data (= 2.1.14)
+Depends: ${shlibs:Depends}, ${misc:Depends}, srb2-data (>= 2.1.15), srb2-data (<= 2.1.23)
Description: A cross-platform 3D Sonic fangame
Sonic Robo Blast 2 is a 3D open-source Sonic the Hedgehog
fangame built using a modified version of the Doom Legacy
port of Doom. SRB2 is closely inspired by the original
Sonic games from the Sega Genesis, and attempts to recreate
- the design in 3D. While SRB2 isn't fully completed, it already
- features tons of levels, enemies, speed, and quite a lot
- of the fun that the original Sonic games provided.
+ the design in 3D. It features tons of levels, enemies, speed,
+ and quite a lot of the fun that the original Sonic games provided.
+
Package: srb2-dbg
Architecture: any
# FIXME: should be Depends: ${shlibs:Depends}, ${misc:Depends}, srb2-data (= 2.1.14), srb2 but dh_shlibdeps is being an asshat
-Depends: libc6, ${misc:Depends}, srb2-data (= 2.1.14), srb2
+Depends: libc6, ${misc:Depends}, srb2-data (>= 2.1.15), srb2-data (<= 2.1.23), srb2
Description: A cross-platform 3D Sonic fangame
Sonic Robo Blast 2 is a 3D open-source Sonic the Hedgehog
fangame built using a modified version of the Doom Legacy
port of Doom. SRB2 is closely inspired by the original
Sonic games from the Sega Genesis, and attempts to recreate
- the design in 3D. While SRB2 isn't fully completed, it already
- features tons of levels, enemies, speed, and quite a lot
- of the fun that the original Sonic games provided.
- This is a debug binary, its symbols will be loaded by gdb
+ the design in 3D. It features tons of levels, enemies, speed,
+ and quite a lot of the fun that the original Sonic games provided.
+ This is a debug binary; its symbols will be loaded by gdb
when the user starts the game with gdb for debugging.
diff --git a/debian/copyright b/debian/copyright
index 8a8705190..97d606b0f 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,6 +1,6 @@
This work was packaged for Debian by:
- Callum Dickinson on Fri, 26 Nov 2010 15:19:16 +1300
+ Marco Zafra Mon, 26 Nov 2018 14:31:00 -0500
It was downloaded from:
@@ -12,7 +12,7 @@ Upstream Author(s):
Copyright:
- Copyright (C) 1998-2010 Sonic Team Junior
+ Copyright (C) 1998-2018 Sonic Team Junior
License:
@@ -21,6 +21,7 @@ License:
The Debian packaging is:
Copyright (C) 2010 Callum Dickinson
+ Copyright (C) 2010-2018 Sonic Team Junior
and is licensed under the GPL version 2,
see "/usr/share/common-licenses/GPL-2".
diff --git a/debian/docs b/debian/docs
index b43bf86b5..dba2cd4c8 100644
--- a/debian/docs
+++ b/debian/docs
@@ -1 +1,4 @@
README.md
+assets/README.txt
+assets/LICENSE.txt
+assets/LICENSE-3RD-PARTY.txt
diff --git a/debian/rules b/debian/rules
index e49784a0f..ff80d50bf 100755
--- a/debian/rules
+++ b/debian/rules
@@ -57,21 +57,33 @@ SECTION = Games/Action
EXENAME = srb2
DBGNAME = debug/$(EXENAME)
-PKGDIR = usr/games
+PKGDIR = usr/games/SRB2
DBGDIR = usr/lib/debug/$(PKGDIR)
+LINKDIR = usr/games
PIXMAPS_DIR = usr/share/pixmaps
DESKTOP_DIR = usr/share/applications
PREFIX = $(shell test "$(CROSS_COMPILE_BUILD)" != "$(CROSS_COMPILE_HOST)" && echo "PREFIX=$(CROSS_COMPILE_HOST)")
OS = LINUX=1
NONX86 = $(shell test "`echo $(CROSS_COMPILE_HOST) | grep 'i[3-6]86'`" || echo "NONX86=1")
-MAKEARGS = $(OS) $(NONX86) $(PREFIX) EXENAME=$(EXENAME) DBGNAME=$(DBGNAME) SDL_PKGCONFIG=sdl2 PNG_PKGCONFIG=libpng NOOBJDUMP=1
+MAKEARGS = $(OS) $(NONX86) $(PREFIX) EXENAME=$(EXENAME) DBGNAME=$(DBGNAME) NOOBJDUMP=1 # SDL_PKGCONFIG=sdl2 PNG_PKGCONFIG=libpng
MENUFILE1 = ?package($(PACKAGE)):needs="X11" section="$(SECTION)"
MENUFILE2 = title="$(TITLE)" command="/$(PKGDIR)/$(PACKAGE)"
-# FIXME pkg-config dir hacks
-export PKG_CONFIG_LIBDIR = /usr/lib/$(CROSS_COMPILE_HOST)/pkgconfig
BINDIR := $(DIR)/bin/Linux/Release
+
+# FIXME pkg-config dir hacks
+# Launchpad doesn't need this; it actually makes i386 builds fail due to cross-compile
+# export PKG_CONFIG_LIBDIR = /usr/lib/$(CROSS_COMPILE_HOST)/pkgconfig
LDFLAGS += "-Wl,-rpath=/usr/lib/$(CROSS_COMPILE_HOST)"
+# Some libgme-dev packages don't use pkg-config yet, so include the linker flag ourselves
+PKG_CONFIG?=pkg-config
+LIBGME_PKGCONFIG?=libgme
+LIBGME_LDFLAGS?=$(shell $(PKG_CONFIG) $(LIBGME_PKGCONFIG) --libs)
+
+ifeq ($(LIBGME_LDFLAGS),)
+MAKEARGS += LIBGME_LDFLAGS=-lgme
+endif
+
build:
$(MKDIR) $(BINDIR)/debug
$(MAKE) -C $(DIR)/src $(MAKEARGS)
@@ -100,8 +112,8 @@ binary-arch:
echo $(DESKTOP_DIR) >> $(DIR)/debian/$(PACKAGE).install
echo $(PIXMAPS_DIR) >> $(DIR)/debian/$(PACKAGE).install
echo $(DBGDIR) > $(DIR)/debian/$(DBGPKG).install
-
-binary: binary-arch
+# Launchpad only calls binary-arch, so just move everything up
+#binary: binary-arch
# Generate .desktop specifications
echo "`echo '$(MENUFILE1)\\'`" > $(DIR)/debian/menu
echo " `echo '$(MENUFILE2)'`" >> $(DIR)/debian/menu
@@ -122,7 +134,7 @@ binary: binary-arch
# dh_installcron
# dh_installinfo
# dh_installman
- # dh_link
+ dh_link $(PKGDIR)/$(EXENAME) $(LINKDIR)/$(EXENAME)
dh_compress
dh_fixperms
# dh_perl
@@ -133,6 +145,8 @@ binary: binary-arch
dh_md5sums
dh_builddeb
+binary: binary-arch
+
clean:
$(MAKE) -C $(DIR)/src $(MAKEARGS) clean cleandep
$(RM) $(BINDIR)/*
@@ -145,4 +159,4 @@ clean:
$(RM) $(DIR)/debian/files
$(RM) $(DIR)/debian/source/include-binaries
-.PHONY: all clean binary binary-arch binary-indep build
+.PHONY: all clean binary binary-indep build
diff --git a/debian/source/options b/debian/source/options
new file mode 100644
index 000000000..841c65a6f
--- /dev/null
+++ b/debian/source/options
@@ -0,0 +1,10 @@
+tar-ignore = "assets/*.srb"
+tar-ignore = "assets/*.pk3"
+tar-ignore = "assets/*.dta"
+tar-ignore = "assets/*.wad"
+tar-ignore = "assets/debian/srb2-data/*"
+tar-ignore = "assets/debian/tmp/*"
+tar-ignore = "*.obj"
+tar-ignore = "*.dep"
+tar-ignore = ".git/*"
+tar-ignore = ".git*"
diff --git a/debian/srb2.desktop b/debian/srb2.desktop
index 661832b93..3a1cac9f6 100644
--- a/debian/srb2.desktop
+++ b/debian/srb2.desktop
@@ -1,8 +1,8 @@
[Desktop Entry]
Name=Sonic Robo Blast 2
-Comment=A free 3D Sonic the Hedgehog fan-game built using a modified ver. of the Doom Legacy source port
+Comment=A free 3D Sonic the Hedgehog fangame closely inspired by the original Sonic games on the Sega Genesis.
Encoding=UTF-8
-Exec=srb2
+Exec=/usr/games/SRB2/srb2
Icon=/usr/share/pixmaps/srb2.png
Terminal=false
Type=Application
diff --git a/deployer/appveyor/deployer.bat b/deployer/appveyor/deployer.bat
new file mode 100644
index 000000000..fae388590
--- /dev/null
+++ b/deployer/appveyor/deployer.bat
@@ -0,0 +1,195 @@
+@setlocal enableextensions enabledelayedexpansion
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+: Appveyor Deployer
+: See appveyor.yml for default variables
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+: Evaluate whether we should be deploying
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+if not [%DPL_ENABLED%] == [1] (
+ echo Deployer is not enabled...
+ exit /b
+)
+
+: Don't do DD installs because fmodex DLL handling is not implemented.
+if [%CONFIGURATION%] == [DD] (
+ echo Deployer does not support DD builds...
+ exit /b
+)
+
+if [%CONFIGURATION%] == [DD64] (
+ echo Deployer does not support DD builds...
+ exit /b
+)
+
+: Substring match from https://stackoverflow.com/questions/7005951/batch-file-find-if-substring-is-in-string-not-in-a-file
+: The below line says "if deployer is NOT in string"
+: Note that APPVEYOR_REPO_BRANCH for pull request builds is the BASE branch that PR is merging INTO
+if x%APPVEYOR_REPO_BRANCH:deployer=%==x%APPVEYOR_REPO_BRANCH% (
+ if not [%APPVEYOR_REPO_TAG%] == [true] (
+ echo Deployer is enabled but we are not in a release tag or a 'deployer' branch...
+ exit /b
+ ) else (
+ if not [%DPL_TAG_ENABLED%] == [1] (
+ echo Deployer is not enabled for release tags...
+ exit /b
+ )
+ )
+)
+
+: Release tags always get optional assets (music.dta)
+if [%APPVEYOR_REPO_TAG%] == [true] (
+ set "ASSET_FILES_OPTIONAL_GET=1"
+)
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+: Get asset archives
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+if exist "C:\Users\appveyor\srb2_cache\archives\" (
+ if [%ASSET_CLEAN%] == [1] (
+ echo Cleaning asset archives...
+ rmdir /s /q "C:\Users\appveyor\srb2_cache\archives"
+ )
+)
+
+if not exist "C:\Users\appveyor\srb2_cache\archives\" mkdir "C:\Users\appveyor\srb2_cache\archives"
+
+goto EXTRACT_ARCHIVES
+
+::::::::::::::::::::::::::::::::
+: ARCHIVE_NAME_PARTS
+: Call this like a function. %archivepath% is the path to extract parts from.
+::::::::::::::::::::::::::::::::
+
+for %%a in (%archivepath%) do (
+ set "file=%%~fa"
+ set "filepath=%%~dpa"
+ set "filename=%%~nxa"
+)
+
+set "localarchivepath=C:\Users\appveyor\srb2_cache\archives\%filename%"
+
+goto EOF
+
+::::::::::::::::::::::::::::::::
+: EXTRACT_ARCHIVES
+::::::::::::::::::::::::::::::::
+
+set "archivepath=%ASSET_ARCHIVE_PATH%"
+call :ARCHIVE_NAME_PARTS
+set "ASSET_ARCHIVE_PATH_LOCAL=%localarchivepath%"
+if not exist "%localarchivepath%" appveyor DownloadFile "%ASSET_ARCHIVE_PATH%" -FileName "%localarchivepath%"
+
+set "archivepath=%ASSET_ARCHIVE_PATCH_PATH%"
+call :ARCHIVE_NAME_PARTS
+set "ASSET_ARCHIVE_PATCH_PATH_LOCAL=%localarchivepath%"
+if not exist "%localarchivepath%" appveyor DownloadFile "%ASSET_ARCHIVE_PATCH_PATH%" -FileName "%localarchivepath%"
+
+if not [%X86_64%] == [1] (
+ set "archivepath=%ASSET_ARCHIVE_X86_PATH%"
+ call :ARCHIVE_NAME_PARTS
+ set "ASSET_ARCHIVE_X86_PATH_LOCAL=!localarchivepath!"
+ if not exist "!localarchivepath!" appveyor DownloadFile "%ASSET_ARCHIVE_X86_PATH%" -FileName "!localarchivepath!"
+)
+
+if [%X86_64%] == [1] (
+ set "archivepath=%ASSET_ARCHIVE_X64_PATH%"
+ call :ARCHIVE_NAME_PARTS
+ set "ASSET_ARCHIVE_X64_PATH_LOCAL=!localarchivepath!"
+ if not exist "!localarchivepath!" appveyor DownloadFile "%ASSET_ARCHIVE_X64_PATH%" -FileName "!localarchivepath!"
+)
+
+if [%ASSET_FILES_OPTIONAL_GET%] == [1] (
+ set "archivepath=%ASSET_ARCHIVE_OPTIONAL_PATH%"
+ call :ARCHIVE_NAME_PARTS
+ set "ASSET_ARCHIVE_OPTIONAL_PATH_LOCAL=!localarchivepath!"
+ if not exist "!localarchivepath!" appveyor DownloadFile "%ASSET_ARCHIVE_OPTIONAL_PATH%" -FileName "!localarchivepath!"
+)
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+: Build the installers
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+mkdir "assets\installer"
+mkdir "assets\patch"
+
+7z x -y "%ASSET_ARCHIVE_PATH_LOCAL%" -o"assets\installer" >null
+7z x -y "%ASSET_ARCHIVE_PATCH_PATH_LOCAL%" -o"assets\patch" >null
+
+: Copy optional files to full installer (music.dta)
+if [%ASSET_FILES_OPTIONAL_GET%] == [1] (
+ 7z x -y "%ASSET_ARCHIVE_OPTIONAL_PATH_LOCAL%" -o"assets\installer" >null
+)
+
+: Copy EXE -- BUILD_PATH is from appveyor.yml
+robocopy /S /ns /nc /nfl /ndl /np /njh /njs "%BUILD_PATH%" "assets\installer" /XF "*.debug" ".gitignore"
+robocopy /S /ns /nc /nfl /ndl /np /njh /njs "%BUILD_PATH%" "assets\patch" /XF "*.debug" ".gitignore"
+
+: Are we building DD? (we were supposed to exit earlier!)
+if [%CONFIGURATION%] == [DD] ( set "DPL_INSTALLER_NAME=%DPL_INSTALLER_NAME%-DD" )
+if [%CONFIGURATION%] == [DD64] ( set "DPL_INSTALLER_NAME=%DPL_INSTALLER_NAME%-DD" )
+
+: If we are not a release tag, suffix the filename
+if not [%APPVEYOR_REPO_TAG%] == [true] (
+ set "INSTALLER_SUFFIX=-%APPVEYOR_REPO_BRANCH%-%GITSHORT%-%CONFIGURATION%"
+) else (
+ set "INSTALLER_SUFFIX="
+)
+
+if not [%X86_64%] == [1] ( goto X86_INSTALL )
+
+::::::::::::::::::::::::::::::::
+: X64_INSTALL
+::::::::::::::::::::::::::::::::
+
+: Extract DLL binaries
+7z x -y "%ASSET_ARCHIVE_X64_PATH_LOCAL%" -o"assets\installer" >null
+if [%PACKAGE_PATCH_DLL_GET%] == [1] (
+ 7z x -y "!ASSET_ARCHIVE_X64_PATH_LOCAL!" -o"assets\patch" >null
+)
+
+: Build the installer
+7z a -sfx7z.sfx "%DPL_INSTALLER_NAME%-x64-Installer%INSTALLER_SUFFIX%.exe" .\assets\installer\*
+
+: Build the patch
+7z a "%DPL_INSTALLER_NAME%-x64-Patch%INSTALLER_SUFFIX%.zip" .\assets\patch\*
+
+: Upload artifacts
+appveyor PushArtifact "%DPL_INSTALLER_NAME%-x64-Installer%INSTALLER_SUFFIX%.exe"
+appveyor PushArtifact "%DPL_INSTALLER_NAME%-x64-Patch%INSTALLER_SUFFIX%.zip"
+
+: We only do x86 OR x64, one at a time, so exit now.
+goto EOF
+
+::::::::::::::::::::::::::::::::
+: X86_INSTALL
+::::::::::::::::::::::::::::::::
+
+: Extract DLL binaries
+7z x -y "%ASSET_ARCHIVE_X86_PATH_LOCAL%" -o"assets\installer" >null
+if [%PACKAGE_PATCH_DLL_GET%] == [1] (
+ 7z x -y "!ASSET_ARCHIVE_X86_PATH_LOCAL!" -o"assets\patch" >null
+)
+
+: Build the installer
+7z a -sfx7z.sfx "%DPL_INSTALLER_NAME%-Installer%INSTALLER_SUFFIX%.exe" .\assets\installer\*
+
+: Build the patch
+7z a "%DPL_INSTALLER_NAME%-Patch%INSTALLER_SUFFIX%.zip" .\assets\patch\*
+
+: Upload artifacts
+appveyor PushArtifact "%DPL_INSTALLER_NAME%-Installer%INSTALLER_SUFFIX%.exe"
+appveyor PushArtifact "%DPL_INSTALLER_NAME%-Patch%INSTALLER_SUFFIX%.zip"
+
+: We only do x86 OR x64, one at a time, so exit now
+goto EOF
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+: EOF
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+endlocal
diff --git a/libs/DLL-README.txt b/libs/DLL-README.txt
new file mode 100644
index 000000000..058ec0685
--- /dev/null
+++ b/libs/DLL-README.txt
@@ -0,0 +1,43 @@
+# SRB2 - Which DLLs do I need to bundle?
+
+Updated 12/4/2018 (v2.1.21)
+
+Here are the required DLLs, per build. For each architecture, copy all the binaries from these folders:
+
+* libs\dll-binaries\[i686/x86_64]
+* libs\SDL2\[i686/x86_64]...\bin
+* libs\SDL2_mixer\[i686/x86_64]...\bin
+
+and don't forget to build r_opengl.dll for srb2dd.
+
+## srb2win, 32-bit
+
+* libs\dll-binaries\i686\exchndl.dll
+* libs\dll-binaries\i686\libgme.dll
+* libs\dll-binaries\i686\mgwhelp.dll (depend for exchndl.dll)
+* libs\SDL2\i686-w64-mingw32\bin\SDL2.dll
+* libs\SDL2_mixer\i686-w64-mingw32\bin\*.dll (get everything)
+
+## srb2win, 64-bit
+
+* libs\dll-binaries\x86_64\exchndl.dll
+* libs\dll-binaries\x86_64\libgme.dll
+* libs\dll-binaries\x86_64\mgwhelp.dll (depend for exchndl.dll)
+* libs\SDL2\x86_64-w64-mingw32\bin\SDL2.dll
+* libs\SDL2_mixer\x86_64-w64-mingw32\bin\*.dll (get everything)
+
+## 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)
diff --git a/libs/SDL2/lib/ARM/SDL2.lib b/libs/SDL2/lib/ARM/SDL2.lib
new file mode 100644
index 000000000..be9d86949
Binary files /dev/null and b/libs/SDL2/lib/ARM/SDL2.lib differ
diff --git a/libs/SDL2/lib/ARM64/SDL2.dll b/libs/SDL2/lib/ARM64/SDL2.dll
new file mode 100644
index 000000000..f9eac1c0b
Binary files /dev/null and b/libs/SDL2/lib/ARM64/SDL2.dll differ
diff --git a/libs/SDL2/lib/ARM64/SDL2.lib b/libs/SDL2/lib/ARM64/SDL2.lib
new file mode 100644
index 000000000..40904c308
Binary files /dev/null and b/libs/SDL2/lib/ARM64/SDL2.lib differ
diff --git a/libs/SDL2_mixer/lib/ARM/SDL2_mixer.lib b/libs/SDL2_mixer/lib/ARM/SDL2_mixer.lib
new file mode 100644
index 000000000..3886f3aa9
Binary files /dev/null and b/libs/SDL2_mixer/lib/ARM/SDL2_mixer.lib differ
diff --git a/libs/SDL2_mixer/lib/ARM64/SDL2_mixer.dll b/libs/SDL2_mixer/lib/ARM64/SDL2_mixer.dll
new file mode 100644
index 000000000..d5650b0d2
Binary files /dev/null and b/libs/SDL2_mixer/lib/ARM64/SDL2_mixer.dll differ
diff --git a/libs/SDL2_mixer/lib/ARM64/SDL2_mixer.lib b/libs/SDL2_mixer/lib/ARM64/SDL2_mixer.lib
new file mode 100644
index 000000000..58c3e6966
Binary files /dev/null and b/libs/SDL2_mixer/lib/ARM64/SDL2_mixer.lib differ
diff --git a/bin/Resources/fmod.dll b/libs/dll-binaries/i686/Old/fmod.dll
similarity index 100%
rename from bin/Resources/fmod.dll
rename to libs/dll-binaries/i686/Old/fmod.dll
diff --git a/bin/Resources/fmodexL.dll b/libs/dll-binaries/i686/Old/fmodexL.dll
similarity index 100%
rename from bin/Resources/fmodexL.dll
rename to libs/dll-binaries/i686/Old/fmodexL.dll
diff --git a/bin/Resources/libgcc_s_dw2-1.dll b/libs/dll-binaries/i686/Old/libgcc_s_dw2-1.dll
similarity index 100%
rename from bin/Resources/libgcc_s_dw2-1.dll
rename to libs/dll-binaries/i686/Old/libgcc_s_dw2-1.dll
diff --git a/bin/Resources/libintl-8.dll b/libs/dll-binaries/i686/Old/libintl-8.dll
similarity index 100%
rename from bin/Resources/libintl-8.dll
rename to libs/dll-binaries/i686/Old/libintl-8.dll
diff --git a/libs/dll-binaries/i686/exchndl.dll b/libs/dll-binaries/i686/exchndl.dll
new file mode 100644
index 000000000..d6beb764a
Binary files /dev/null and b/libs/dll-binaries/i686/exchndl.dll differ
diff --git a/bin/Resources/fmodex.dll b/libs/dll-binaries/i686/fmodex.dll
similarity index 100%
rename from bin/Resources/fmodex.dll
rename to libs/dll-binaries/i686/fmodex.dll
diff --git a/bin/Resources/libgme.dll b/libs/dll-binaries/i686/libgme.dll
similarity index 100%
rename from bin/Resources/libgme.dll
rename to libs/dll-binaries/i686/libgme.dll
diff --git a/libs/dll-binaries/i686/mgwhelp.dll b/libs/dll-binaries/i686/mgwhelp.dll
new file mode 100644
index 000000000..3cf97424d
Binary files /dev/null and b/libs/dll-binaries/i686/mgwhelp.dll differ
diff --git a/bin/Resources/fmod64.dll b/libs/dll-binaries/x86_64/Old/fmod64.dll
similarity index 100%
rename from bin/Resources/fmod64.dll
rename to libs/dll-binaries/x86_64/Old/fmod64.dll
diff --git a/bin/Resources/fmodexL64.dll b/libs/dll-binaries/x86_64/Old/fmodexL64.dll
similarity index 100%
rename from bin/Resources/fmodexL64.dll
rename to libs/dll-binaries/x86_64/Old/fmodexL64.dll
diff --git a/libs/dll-binaries/x86_64/exchndl.dll b/libs/dll-binaries/x86_64/exchndl.dll
new file mode 100644
index 000000000..747d7a3d5
Binary files /dev/null and b/libs/dll-binaries/x86_64/exchndl.dll differ
diff --git a/bin/Resources/fmodex64.dll b/libs/dll-binaries/x86_64/fmodex64.dll
similarity index 100%
rename from bin/Resources/fmodex64.dll
rename to libs/dll-binaries/x86_64/fmodex64.dll
diff --git a/bin/Resources/libgme64.dll b/libs/dll-binaries/x86_64/libgme.dll
similarity index 100%
rename from bin/Resources/libgme64.dll
rename to libs/dll-binaries/x86_64/libgme.dll
diff --git a/libs/dll-binaries/x86_64/mgwhelp.dll b/libs/dll-binaries/x86_64/mgwhelp.dll
new file mode 100644
index 000000000..4e30e140e
Binary files /dev/null and b/libs/dll-binaries/x86_64/mgwhelp.dll differ
diff --git a/libs/libpng-src/projects/visualc10/.gitignore b/libs/libpng-src/projects/visualc10/.gitignore
index 118a15cbb..e1bec81fc 100644
--- a/libs/libpng-src/projects/visualc10/.gitignore
+++ b/libs/libpng-src/projects/visualc10/.gitignore
@@ -1,3 +1,5 @@
/Win32
/x64
/libpng.vcproj.*.*.user
+/ARM
+/ARM64
diff --git a/libs/libpng-src/projects/visualc10/libpng.vcxproj b/libs/libpng-src/projects/visualc10/libpng.vcxproj
index fb53826ec..eaa3d4ffb 100644
--- a/libs/libpng-src/projects/visualc10/libpng.vcxproj
+++ b/libs/libpng-src/projects/visualc10/libpng.vcxproj
@@ -1,6 +1,14 @@

+
+ Debug
+ ARM
+
+
+ Debug
+ ARM64
+
Debug
Win32
@@ -9,6 +17,14 @@
Debug
x64
+
+ Release
+ ARM
+
+
+ Release
+ ARM64
+
Release
Win32
@@ -21,7 +37,7 @@
{72B01ACA-7A1A-4F7B-ACEF-2607299CF052}
libpng
- 8.1
+ 10.0.16299.0
@@ -29,21 +45,45 @@
false
v140
+
+ StaticLibrary
+ false
+ v141
+ true
+
StaticLibrary
false
v140
+
+ StaticLibrary
+ false
+ v141
+ true
+
StaticLibrary
false
v140
+
+ StaticLibrary
+ false
+ v141
+ true
+
StaticLibrary
false
v140
+
+ StaticLibrary
+ false
+ v141
+ true
+
@@ -51,29 +91,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
<_ProjectFileVersion>10.0.30319.1
$(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
$(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
$(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
$(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
$(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
$(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
$(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
$(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
@@ -107,6 +171,38 @@
$(ProjectDir)$(PlatformName)\$(ConfigurationName)\libpng.bsc
+
+
+ MaxSpeed
+ OnlyExplicitInline
+ ..\..;..\..\..\zlib;%(AdditionalIncludeDirectories)
+ WIN32;NDEBUG;PNG_USE_PNGVCRD;PNG_LIBPNG_SPECIALBUILD;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
+ true
+ MultiThreadedDLL
+ true
+ $(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
+ Level3
+ true
+ CompileAsC
+ true
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ 0x0409
+ ..\..;%(AdditionalIncludeDirectories)
+
+
+ $(ProjectDir)$(Platform)\$(Configuration)\libpng.lib
+ true
+ MachineARM
+
+
+ true
+ $(ProjectDir)$(PlatformName)\$(ConfigurationName)\libpng.bsc
+
+
X64
@@ -143,6 +239,40 @@
$(ProjectDir)$(PlatformName)\$(ConfigurationName)\libpng.bsc
+
+
+
+ MaxSpeed
+ OnlyExplicitInline
+ ..\..;..\..\..\zlib;%(AdditionalIncludeDirectories)
+ WIN32;NDEBUG;PNG_USE_PNGVCRD;PNG_LIBPNG_SPECIALBUILD;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
+ true
+ MultiThreadedDLL
+ true
+ $(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
+ Level3
+ true
+ CompileAsC
+ 4267;%(DisableSpecificWarnings)
+ true
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ 0x0409
+ ..\..;%(AdditionalIncludeDirectories)
+
+
+ $(ProjectDir)$(Platform)\$(Configuration)\libpng.lib
+ true
+ MachineARM64
+
+
+ true
+ $(ProjectDir)$(PlatformName)\$(ConfigurationName)\libpng.bsc
+
+
Disabled
@@ -174,6 +304,36 @@
$(ProjectDir)$(PlatformName)\$(ConfigurationName)\libpng.bsc
+
+
+ Disabled
+ ..\..;..\..\..\zlib;%(AdditionalIncludeDirectories)
+ WIN32;_DEBUG;DEBUG;PNG_DEBUG=1;PNG_USE_PNGVCRD;PNG_LIBPNG_SPECIALBUILD;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
+ EnableFastChecks
+ MultiThreadedDebugDLL
+ $(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
+ Level3
+ true
+ ProgramDatabase
+ CompileAsC
+ false
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ 0x0409
+
+
+ $(ProjectDir)$(Platform)\$(Configuration)\libpng.lib
+ true
+ MachineARM
+
+
+ true
+ $(ProjectDir)$(PlatformName)\$(ConfigurationName)\libpng.bsc
+
+
X64
@@ -209,164 +369,320 @@
$(ProjectDir)$(PlatformName)\$(ConfigurationName)\libpng.bsc
+
+
+
+ Disabled
+ ..\..;..\..\..\zlib;%(AdditionalIncludeDirectories)
+ WIN32;_DEBUG;DEBUG;PNG_DEBUG=1;PNG_USE_PNGVCRD;PNG_LIBPNG_SPECIALBUILD;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
+ EnableFastChecks
+ MultiThreadedDebugDLL
+ $(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
+ Level3
+ true
+ ProgramDatabase
+ CompileAsC
+ 4267;%(DisableSpecificWarnings)
+ false
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ 0x0409
+
+
+ $(ProjectDir)$(Platform)\$(Configuration)\libpng.lib
+ true
+ MachineARM64
+
+
+ true
+ $(ProjectDir)$(PlatformName)\$(ConfigurationName)\libpng.bsc
+
+
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(AdditionalIncludeDirectories)
+ %(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
true
+ true
true
+ true
true
+ true
true
+ true
@@ -377,17 +693,29 @@
true
+ true
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
\Oogaland\Projects\orospakr.ca\srb2\tools\libpng-src\scripts;%(AdditionalIncludeDirectories)
+ \Oogaland\Projects\orospakr.ca\srb2\tools\libpng-src\scripts;%(AdditionalIncludeDirectories)
true
+ true
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
\Oogaland\Projects\orospakr.ca\srb2\tools\libpng-src\scripts;%(AdditionalIncludeDirectories)
+ \Oogaland\Projects\orospakr.ca\srb2\tools\libpng-src\scripts;%(AdditionalIncludeDirectories)
true
+ true
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
\Oogaland\Projects\orospakr.ca\srb2\tools\libpng-src\scripts;%(AdditionalIncludeDirectories)
+ \Oogaland\Projects\orospakr.ca\srb2\tools\libpng-src\scripts;%(AdditionalIncludeDirectories)
true
+ true
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
\Oogaland\Projects\orospakr.ca\srb2\tools\libpng-src\scripts;%(AdditionalIncludeDirectories)
+ \Oogaland\Projects\orospakr.ca\srb2\tools\libpng-src\scripts;%(AdditionalIncludeDirectories)
diff --git a/libs/zlib/projects/visualc10/.gitignore b/libs/zlib/projects/visualc10/.gitignore
index 488a5428b..1c5340cd4 100644
--- a/libs/zlib/projects/visualc10/.gitignore
+++ b/libs/zlib/projects/visualc10/.gitignore
@@ -1,3 +1,5 @@
/Win32
/x64
/zlib.vcproj.*.*.user
+/ARM
+/ARM64
diff --git a/libs/zlib/projects/visualc10/zlib.vcxproj b/libs/zlib/projects/visualc10/zlib.vcxproj
index 814641d34..a7055ddb8 100644
--- a/libs/zlib/projects/visualc10/zlib.vcxproj
+++ b/libs/zlib/projects/visualc10/zlib.vcxproj
@@ -1,6 +1,14 @@

+
+ Debug
+ ARM
+
+
+ Debug
+ ARM64
+
Debug
Win32
@@ -9,6 +17,14 @@
Debug
x64
+
+ Release
+ ARM
+
+
+ Release
+ ARM64
+
Release
Win32
@@ -21,7 +37,7 @@
{73A5729C-7323-41D4-AB48-8A03C9F81603}
zlib
- 8.1
+ 10.0.16299.0
@@ -29,21 +45,45 @@
false
v140
+
+ StaticLibrary
+ false
+ v141
+ true
+
StaticLibrary
false
v140
+
+ StaticLibrary
+ false
+ v141
+ true
+
StaticLibrary
false
v140
+ true
+
+
+ StaticLibrary
+ false
+ v141
StaticLibrary
false
v140
+
+ StaticLibrary
+ false
+ v141
+ true
+
@@ -52,29 +92,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
<_ProjectFileVersion>10.0.30319.1
$(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
$(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
$(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
$(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
$(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
$(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
$(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
$(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
@@ -106,6 +170,36 @@
$(ProjectDir)$(PlatformName)\$(ConfigurationName)\zlib.bsc
+
+
+ Disabled
+ WIN32;_DEBUG;ASMV;ASMINF;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)
+ Default
+ MultiThreadedDebugDLL
+ $(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
+ Level3
+ true
+ ProgramDatabase
+ CompileAsC
+ false
+ ASMV;ASMINF
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ 0x0409
+
+
+ $(ProjectDir)$(Platform)\$(Configuration)\zlib.lib
+ true
+ MachineARM
+
+
+ true
+ $(ProjectDir)$(PlatformName)\$(ConfigurationName)\zlib.bsc
+
+
X64
@@ -139,6 +233,36 @@
$(ProjectDir)$(PlatformName)\$(ConfigurationName)\zlib.bsc
+
+
+
+ Disabled
+ WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)
+ EnableFastChecks
+ MultiThreadedDebugDLL
+ $(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
+ Level3
+ true
+ ProgramDatabase
+ CompileAsC
+ false
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ 0x0409
+
+
+ $(ProjectDir)$(Platform)\$(Configuration)\zlib.lib
+ true
+ MachineARM64
+
+
+ true
+ $(ProjectDir)$(PlatformName)\$(ConfigurationName)\zlib.bsc
+
+
MaxSpeed
@@ -169,6 +293,37 @@
$(ProjectDir)$(PlatformName)\$(ConfigurationName)\zlib.bsc
+
+
+ MaxSpeed
+ OnlyExplicitInline
+ WIN32;NDEBUG;ASMV;ASMINF;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)
+ true
+ MultiThreadedDLL
+ true
+ $(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
+ Level3
+ true
+ CompileAsC
+ true
+ ASMV;ASMINF
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ 0x0409
+
+
+ $(ProjectDir)$(Platform)\$(Configuration)\zlib.lib
+ true
+ MachineARM
+
+
+ true
+ $(ProjectDir)$(PlatformName)\$(ConfigurationName)\zlib.bsc
+
+
X64
@@ -202,30 +357,77 @@
$(ProjectDir)$(PlatformName)\$(ConfigurationName)\zlib.bsc
+
+
+
+ MaxSpeed
+ OnlyExplicitInline
+ WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)
+ true
+ MultiThreadedDLL
+ true
+ $(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
+ $(ProjectDir)$(Platform)\$(Configuration)\
+ Level3
+ true
+ CompileAsC
+ true
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ 0x0409
+
+
+ $(ProjectDir)$(Platform)\$(Configuration)\zlib.lib
+ true
+ MachineARM64
+
+
+ true
+ $(ProjectDir)$(PlatformName)\$(ConfigurationName)\zlib.bsc
+
+
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
@@ -233,60 +435,97 @@
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
true
+ true
../;%(AdditionalIncludeDirectories)
+ ../;%(AdditionalIncludeDirectories)
../..;%(AdditionalIncludeDirectories)
+ ../..;%(AdditionalIncludeDirectories)
true
+ true
../..;%(AdditionalIncludeDirectories)
+ ../..;%(AdditionalIncludeDirectories)
true
+ true
true
+ true
true
+ true
true
+ true
@@ -306,39 +545,67 @@
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
\Oogaland\Projects\orospakr.ca\srb2\tools\zlib\win32;%(AdditionalIncludeDirectories)
+ \Oogaland\Projects\orospakr.ca\srb2\tools\zlib\win32;%(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
\Oogaland\Projects\orospakr.ca\srb2\tools\zlib\win32;%(AdditionalIncludeDirectories)
+ \Oogaland\Projects\orospakr.ca\srb2\tools\zlib\win32;%(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
\Oogaland\Projects\orospakr.ca\srb2\tools\zlib\win32;%(AdditionalIncludeDirectories)
+ \Oogaland\Projects\orospakr.ca\srb2\tools\zlib\win32;%(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
\Oogaland\Projects\orospakr.ca\srb2\tools\zlib\win32;%(AdditionalIncludeDirectories)
+ \Oogaland\Projects\orospakr.ca\srb2\tools\zlib\win32;%(AdditionalIncludeDirectories)
true
+ true
true
+ true
+ true
+ true
true
+ true
true
+ true
+ true
+ true
true
+ true
true
+ true
true
+ true
true
+ true
true
+ true
true
+ true
true
+ true
true
+ true
true
+ true
true
+ true
true
+ true
true
+ true
diff --git a/srb2-vc10.sln b/srb2-vc10.sln
index ecceafd56..b4415bfc0 100644
--- a/srb2-vc10.sln
+++ b/srb2-vc10.sln
@@ -1,9 +1,9 @@

Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 14
-VisualStudioVersion = 14.0.25123.0
+# Visual Studio 15
+VisualStudioVersion = 15.0.28307.136
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Srb2win", "src\win32\Srb2win-vc10.vcxproj", "{0F554F1D-ED49-4D65-A9A7-F63C57F277BE}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Srb2DD", "src\win32\Srb2win-vc10.vcxproj", "{0F554F1D-ED49-4D65-A9A7-F63C57F277BE}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpng", "libs\libpng-src\projects\visualc10\libpng.vcxproj", "{72B01ACA-7A1A-4F7B-ACEF-2607299CF052}"
EndProject
@@ -13,56 +13,104 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "libs\zlib\projects\
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "s_openal", "src\hardware\s_openal\s_openal-vc10.vcxproj", "{E662D0B3-412D-4D55-A5EC-8CBD680DDCBE}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Srb2SDL", "src\sdl\Srb2SDL-vc10.vcxproj", "{61BA7D3C-F77D-4D31-B718-1177FE482CF2}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Srb2Win", "src\sdl\Srb2SDL-vc10.vcxproj", "{61BA7D3C-F77D-4D31-B718-1177FE482CF2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|ARM = Debug|ARM
+ Debug|ARM64 = Debug|ARM64
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
+ Release|ARM = Release|ARM
+ Release|ARM64 = Release|ARM64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {0F554F1D-ED49-4D65-A9A7-F63C57F277BE}.Debug|ARM.ActiveCfg = Debug|ARM
+ {0F554F1D-ED49-4D65-A9A7-F63C57F277BE}.Debug|ARM.Build.0 = Debug|ARM
+ {0F554F1D-ED49-4D65-A9A7-F63C57F277BE}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {0F554F1D-ED49-4D65-A9A7-F63C57F277BE}.Debug|ARM64.Build.0 = Debug|ARM64
{0F554F1D-ED49-4D65-A9A7-F63C57F277BE}.Debug|Win32.ActiveCfg = Debug|Win32
{0F554F1D-ED49-4D65-A9A7-F63C57F277BE}.Debug|Win32.Build.0 = Debug|Win32
{0F554F1D-ED49-4D65-A9A7-F63C57F277BE}.Debug|x64.ActiveCfg = Debug|x64
{0F554F1D-ED49-4D65-A9A7-F63C57F277BE}.Debug|x64.Build.0 = Debug|x64
+ {0F554F1D-ED49-4D65-A9A7-F63C57F277BE}.Release|ARM.ActiveCfg = Release|ARM
+ {0F554F1D-ED49-4D65-A9A7-F63C57F277BE}.Release|ARM.Build.0 = Release|ARM
+ {0F554F1D-ED49-4D65-A9A7-F63C57F277BE}.Release|ARM64.ActiveCfg = Release|ARM64
+ {0F554F1D-ED49-4D65-A9A7-F63C57F277BE}.Release|ARM64.Build.0 = Release|ARM64
{0F554F1D-ED49-4D65-A9A7-F63C57F277BE}.Release|Win32.ActiveCfg = Release|Win32
{0F554F1D-ED49-4D65-A9A7-F63C57F277BE}.Release|Win32.Build.0 = Release|Win32
{0F554F1D-ED49-4D65-A9A7-F63C57F277BE}.Release|x64.ActiveCfg = Release|x64
{0F554F1D-ED49-4D65-A9A7-F63C57F277BE}.Release|x64.Build.0 = Release|x64
+ {72B01ACA-7A1A-4F7B-ACEF-2607299CF052}.Debug|ARM.ActiveCfg = Debug|ARM
+ {72B01ACA-7A1A-4F7B-ACEF-2607299CF052}.Debug|ARM.Build.0 = Debug|ARM
+ {72B01ACA-7A1A-4F7B-ACEF-2607299CF052}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {72B01ACA-7A1A-4F7B-ACEF-2607299CF052}.Debug|ARM64.Build.0 = Debug|ARM64
{72B01ACA-7A1A-4F7B-ACEF-2607299CF052}.Debug|Win32.ActiveCfg = Debug|Win32
{72B01ACA-7A1A-4F7B-ACEF-2607299CF052}.Debug|Win32.Build.0 = Debug|Win32
{72B01ACA-7A1A-4F7B-ACEF-2607299CF052}.Debug|x64.ActiveCfg = Debug|x64
{72B01ACA-7A1A-4F7B-ACEF-2607299CF052}.Debug|x64.Build.0 = Debug|x64
+ {72B01ACA-7A1A-4F7B-ACEF-2607299CF052}.Release|ARM.ActiveCfg = Release|ARM
+ {72B01ACA-7A1A-4F7B-ACEF-2607299CF052}.Release|ARM.Build.0 = Release|ARM
+ {72B01ACA-7A1A-4F7B-ACEF-2607299CF052}.Release|ARM64.ActiveCfg = Release|ARM64
+ {72B01ACA-7A1A-4F7B-ACEF-2607299CF052}.Release|ARM64.Build.0 = Release|ARM64
{72B01ACA-7A1A-4F7B-ACEF-2607299CF052}.Release|Win32.ActiveCfg = Release|Win32
{72B01ACA-7A1A-4F7B-ACEF-2607299CF052}.Release|Win32.Build.0 = Release|Win32
{72B01ACA-7A1A-4F7B-ACEF-2607299CF052}.Release|x64.ActiveCfg = Release|x64
{72B01ACA-7A1A-4F7B-ACEF-2607299CF052}.Release|x64.Build.0 = Release|x64
+ {51137D5C-4E81-4955-AACF-EA3092006051}.Debug|ARM.ActiveCfg = Debug|ARM
+ {51137D5C-4E81-4955-AACF-EA3092006051}.Debug|ARM.Build.0 = Debug|ARM
+ {51137D5C-4E81-4955-AACF-EA3092006051}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {51137D5C-4E81-4955-AACF-EA3092006051}.Debug|ARM64.Build.0 = Debug|ARM64
{51137D5C-4E81-4955-AACF-EA3092006051}.Debug|Win32.ActiveCfg = Debug|Win32
{51137D5C-4E81-4955-AACF-EA3092006051}.Debug|Win32.Build.0 = Debug|Win32
{51137D5C-4E81-4955-AACF-EA3092006051}.Debug|x64.ActiveCfg = Debug|x64
{51137D5C-4E81-4955-AACF-EA3092006051}.Debug|x64.Build.0 = Debug|x64
+ {51137D5C-4E81-4955-AACF-EA3092006051}.Release|ARM.ActiveCfg = Release|ARM
+ {51137D5C-4E81-4955-AACF-EA3092006051}.Release|ARM.Build.0 = Release|ARM
+ {51137D5C-4E81-4955-AACF-EA3092006051}.Release|ARM64.ActiveCfg = Release|ARM64
+ {51137D5C-4E81-4955-AACF-EA3092006051}.Release|ARM64.Build.0 = Release|ARM64
{51137D5C-4E81-4955-AACF-EA3092006051}.Release|Win32.ActiveCfg = Release|Win32
{51137D5C-4E81-4955-AACF-EA3092006051}.Release|Win32.Build.0 = Release|Win32
{51137D5C-4E81-4955-AACF-EA3092006051}.Release|x64.ActiveCfg = Release|x64
{51137D5C-4E81-4955-AACF-EA3092006051}.Release|x64.Build.0 = Release|x64
+ {73A5729C-7323-41D4-AB48-8A03C9F81603}.Debug|ARM.ActiveCfg = Debug|ARM
+ {73A5729C-7323-41D4-AB48-8A03C9F81603}.Debug|ARM.Build.0 = Debug|ARM
+ {73A5729C-7323-41D4-AB48-8A03C9F81603}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {73A5729C-7323-41D4-AB48-8A03C9F81603}.Debug|ARM64.Build.0 = Debug|ARM64
{73A5729C-7323-41D4-AB48-8A03C9F81603}.Debug|Win32.ActiveCfg = Debug|Win32
{73A5729C-7323-41D4-AB48-8A03C9F81603}.Debug|Win32.Build.0 = Debug|Win32
{73A5729C-7323-41D4-AB48-8A03C9F81603}.Debug|x64.ActiveCfg = Debug|x64
{73A5729C-7323-41D4-AB48-8A03C9F81603}.Debug|x64.Build.0 = Debug|x64
+ {73A5729C-7323-41D4-AB48-8A03C9F81603}.Release|ARM.ActiveCfg = Release|ARM
+ {73A5729C-7323-41D4-AB48-8A03C9F81603}.Release|ARM.Build.0 = Release|ARM
+ {73A5729C-7323-41D4-AB48-8A03C9F81603}.Release|ARM64.ActiveCfg = Release|ARM64
+ {73A5729C-7323-41D4-AB48-8A03C9F81603}.Release|ARM64.Build.0 = Release|ARM64
{73A5729C-7323-41D4-AB48-8A03C9F81603}.Release|Win32.ActiveCfg = Release|Win32
{73A5729C-7323-41D4-AB48-8A03C9F81603}.Release|Win32.Build.0 = Release|Win32
{73A5729C-7323-41D4-AB48-8A03C9F81603}.Release|x64.ActiveCfg = Release|x64
{73A5729C-7323-41D4-AB48-8A03C9F81603}.Release|x64.Build.0 = Release|x64
+ {E662D0B3-412D-4D55-A5EC-8CBD680DDCBE}.Debug|ARM.ActiveCfg = Debug|ARM
+ {E662D0B3-412D-4D55-A5EC-8CBD680DDCBE}.Debug|ARM64.ActiveCfg = Debug|ARM64
{E662D0B3-412D-4D55-A5EC-8CBD680DDCBE}.Debug|Win32.ActiveCfg = Debug|Win32
{E662D0B3-412D-4D55-A5EC-8CBD680DDCBE}.Debug|x64.ActiveCfg = Debug|x64
+ {E662D0B3-412D-4D55-A5EC-8CBD680DDCBE}.Release|ARM.ActiveCfg = Release|ARM
+ {E662D0B3-412D-4D55-A5EC-8CBD680DDCBE}.Release|ARM64.ActiveCfg = Release|ARM64
{E662D0B3-412D-4D55-A5EC-8CBD680DDCBE}.Release|Win32.ActiveCfg = Release|Win32
{E662D0B3-412D-4D55-A5EC-8CBD680DDCBE}.Release|x64.ActiveCfg = Release|x64
+ {61BA7D3C-F77D-4D31-B718-1177FE482CF2}.Debug|ARM.ActiveCfg = Debug|ARM
+ {61BA7D3C-F77D-4D31-B718-1177FE482CF2}.Debug|ARM.Build.0 = Debug|ARM
+ {61BA7D3C-F77D-4D31-B718-1177FE482CF2}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {61BA7D3C-F77D-4D31-B718-1177FE482CF2}.Debug|ARM64.Build.0 = Debug|ARM64
{61BA7D3C-F77D-4D31-B718-1177FE482CF2}.Debug|Win32.ActiveCfg = Debug|Win32
{61BA7D3C-F77D-4D31-B718-1177FE482CF2}.Debug|Win32.Build.0 = Debug|Win32
{61BA7D3C-F77D-4D31-B718-1177FE482CF2}.Debug|x64.ActiveCfg = Debug|x64
{61BA7D3C-F77D-4D31-B718-1177FE482CF2}.Debug|x64.Build.0 = Debug|x64
+ {61BA7D3C-F77D-4D31-B718-1177FE482CF2}.Release|ARM.ActiveCfg = Release|ARM
+ {61BA7D3C-F77D-4D31-B718-1177FE482CF2}.Release|ARM.Build.0 = Release|ARM
+ {61BA7D3C-F77D-4D31-B718-1177FE482CF2}.Release|ARM64.ActiveCfg = Release|ARM64
+ {61BA7D3C-F77D-4D31-B718-1177FE482CF2}.Release|ARM64.Build.0 = Release|ARM64
{61BA7D3C-F77D-4D31-B718-1177FE482CF2}.Release|Win32.ActiveCfg = Release|Win32
{61BA7D3C-F77D-4D31-B718-1177FE482CF2}.Release|Win32.Build.0 = Release|Win32
{61BA7D3C-F77D-4D31-B718-1177FE482CF2}.Release|x64.ActiveCfg = Release|x64
@@ -71,4 +119,7 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {8C0B5F99-D9B8-4CB2-BA67-5D350E71C6FC}
+ EndGlobalSection
EndGlobal
diff --git a/srb2.png b/srb2.png
index 9c13eae9a..72a08f664 100644
Binary files a/srb2.png and b/srb2.png differ
diff --git a/srb2banner.png b/srb2banner.png
new file mode 100644
index 000000000..9c13eae9a
Binary files /dev/null and b/srb2banner.png differ
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6a8b7e3f1..4a9ef5ba8 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -227,6 +227,12 @@ set(SRB2_CONFIG_YASM OFF CACHE BOOL
set(SRB2_CONFIG_STATIC_OPENGL OFF CACHE BOOL
"Use statically linked OpenGL. NOT RECOMMENDED.")
+### use internal libraries?
+if(${CMAKE_SYSTEM} MATCHES "Windows") ###set on Windows only
+ set(SRB2_CONFIG_USE_INTERNAL_LIBRARIES OFF CACHE BOOL
+ "Use SRB2's internal copies of required dependencies (SDL2, PNG, zlib, GME).")
+endif()
+
if(${SRB2_CONFIG_HAVE_BLUA})
add_definitions(-DHAVE_BLUA)
set(SRB2_LUA_SOURCES
@@ -315,7 +321,17 @@ if(${SRB2_CONFIG_HAVE_BLUA})
endif()
if(${SRB2_CONFIG_HAVE_GME})
- find_package(GME)
+ if(${SRB2_CONFIG_USE_INTERNAL_LIBRARIES})
+ set(GME_FOUND ON)
+ set(GME_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/libs/gme/include)
+ if(${SRB2_SYSTEM_BITS} EQUAL 64)
+ set(GME_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/gme/win64 -lgme")
+ else() # 32-bit
+ set(GME_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/gme/win32 -lgme")
+ endif()
+ else()
+ find_package(GME)
+ endif()
if(${GME_FOUND})
set(SRB2_HAVE_GME ON)
add_definitions(-DHAVE_LIBGME)
@@ -325,9 +341,20 @@ if(${SRB2_CONFIG_HAVE_GME})
endif()
if(${SRB2_CONFIG_HAVE_ZLIB})
- find_package(ZLIB)
+ if(${SRB2_CONFIG_USE_INTERNAL_LIBRARIES})
+ set(ZLIB_FOUND ON)
+ set(ZLIB_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/libs/zlib)
+ if(${SRB2_SYSTEM_BITS} EQUAL 64)
+ set(ZLIB_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/zlib/win32 -lz64")
+ else() # 32-bit
+ set(ZLIB_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/zlib/win32 -lz32")
+ endif()
+ else()
+ find_package(ZLIB)
+ endif()
if(${ZLIB_FOUND})
set(SRB2_HAVE_ZLIB ON)
+ add_definitions(-DHAVE_ZLIB)
else()
message(WARNING "You have specified that ZLIB is available but it was not found. SRB2 may not compile correctly.")
endif()
@@ -335,7 +362,17 @@ endif()
if(${SRB2_CONFIG_HAVE_PNG} AND ${SRB2_CONFIG_HAVE_ZLIB})
if (${ZLIB_FOUND})
- find_package(PNG)
+ if(${SRB2_CONFIG_USE_INTERNAL_LIBRARIES})
+ set(PNG_FOUND ON)
+ set(PNG_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/libs/libpng-src)
+ if(${SRB2_SYSTEM_BITS} EQUAL 64)
+ set(PNG_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/libpng-src/projects -lpng64")
+ else() # 32-bit
+ set(PNG_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/libpng-src/projects -lpng32")
+ endif()
+ else()
+ find_package(PNG)
+ endif()
if(${PNG_FOUND})
set(SRB2_HAVE_PNG ON)
add_definitions(-DHAVE_PNG)
diff --git a/src/Makefile b/src/Makefile
index 8dda87564..48eb6119b 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -2,7 +2,7 @@
# GNU Make makefile for SRB2
#############################################################################
# Copyright (C) 1998-2000 by DooM Legacy Team.
-# Copyright (C) 2003-2014 by Sonic Team Junior.
+# Copyright (C) 2003-2018 by Sonic Team Junior.
#
# This program is free software distributed under the
# terms of the GNU General Public License, version 2.
@@ -98,8 +98,18 @@ endif
ifdef LINUX64
LINUX=1
NONX86=1
+# LINUX64 does not imply X86_64=1; could mean ARM64 or Itanium
endif
+ifdef MINGW64
+MINGW=1
+NONX86=1
+NOASM=1
+# MINGW64 should not necessarily imply X86_64=1, but we make that assumption elsewhere
+# Once that changes, remove this
+X86_64=1
+endif #ifdef MINGW64
+
ifdef HAIKU
SDL=1
endif
@@ -144,11 +154,6 @@ ifdef MINGW
include win32/Makefile.cfg
endif #ifdef MINGW
-ifdef MINGW64
-MINGW=1
-include win32/Makefile.cfg
-endif #ifdef MINGW64
-
ifdef UNIX
UNIXCOMMON=1
endif
@@ -231,11 +236,13 @@ OPTS += -DCOMPVERSION
ifndef NONX86
ifndef GCC29
- M5=-march=pentium
- M4=-march=i486
+ ARCHOPTS?=-march=pentium
else
- M5=-mpentium
- M4=-m486
+ ARCHOPTS?=-mpentium
+endif
+else
+ifdef X86_64
+ ARCHOPTS?=-march=nocona
endif
endif
@@ -356,7 +363,7 @@ else
WINDRESFLAGS = -DNDEBUG
CFLAGS+=-O3
endif
- CFLAGS+=-g $(OPTS) $(M5) $(WINDRESFLAGS)
+ CFLAGS+=-g $(OPTS) $(ARCHOPTS) $(WINDRESFLAGS)
ifdef YASM
ifdef STABS
@@ -725,15 +732,15 @@ endif
ifndef NOHS
$(OBJDIR)/s_ds3d.o: hardware/s_ds3d/s_ds3d.c hardware/hw3dsdrv.h \
hardware/hw_dll.h
- $(CC) $(M5) -Os -o $(OBJDIR)/s_ds3d.o $(WFLAGS) -D_WINDOWS -mwindows -c hardware/s_ds3d/s_ds3d.c
+ $(CC) $(ARCHOPTS) -Os -o $(OBJDIR)/s_ds3d.o $(WFLAGS) -D_WINDOWS -mwindows -c hardware/s_ds3d/s_ds3d.c
$(OBJDIR)/s_fmod.o: hardware/s_openal/s_openal.c hardware/hw3dsdrv.h \
hardware/hw_dll.h
- $(CC) $(M5) -Os -o $(OBJDIR)/s_fmod.o $(WFLAGS) -D_WINDOWS -mwindows -c hardware/s_fmod/s_fmod.c
+ $(CC) $(ARCHOPTS) -Os -o $(OBJDIR)/s_fmod.o $(WFLAGS) -D_WINDOWS -mwindows -c hardware/s_fmod/s_fmod.c
$(OBJDIR)/s_openal.o: hardware/s_openal/s_openal.c hardware/hw3dsdrv.h \
hardware/hw_dll.h
- $(CC) $(M5) -Os -o $(OBJDIR)/s_openal.o $(WFLAGS) -D_WINDOWS -mwindows -c hardware/s_openal/s_openal.c
+ $(CC) $(ARCHOPTS) -Os -o $(OBJDIR)/s_openal.o $(WFLAGS) -D_WINDOWS -mwindows -c hardware/s_openal/s_openal.c
endif
endif
endif
@@ -763,11 +770,11 @@ else
$(OBJDIR)/s_fmod.o: hardware/s_fmod/s_fmod.c hardware/hw3dsdrv.h \
hardware/hw_dll.h
- $(CC) $(M5) -Os -o $(OBJDIR)/s_fmod.o -DHW3SOUND -DUNIXCOMMON -shared -nostartfiles -c hardware/s_fmod/s_fmod.c
+ $(CC) $(ARCHOPTS) -Os -o $(OBJDIR)/s_fmod.o -DHW3SOUND -DUNIXCOMMON -shared -nostartfiles -c hardware/s_fmod/s_fmod.c
$(OBJDIR)/s_openal.o: hardware/s_openal/s_openal.c hardware/hw3dsdrv.h \
hardware/hw_dll.h
- $(CC) $(M5) -Os -o $(OBJDIR)/s_openal.o -DHW3SOUND -DUNIXCOMMON -shared -nostartfiles -c hardware/s_openal/s_openal.c
+ $(CC) $(ARCHOPTS) -Os -o $(OBJDIR)/s_openal.o -DHW3SOUND -DUNIXCOMMON -shared -nostartfiles -c hardware/s_openal/s_openal.c
endif
endif
diff --git a/src/Makefile.cfg b/src/Makefile.cfg
index 6a1367275..5976746b8 100644
--- a/src/Makefile.cfg
+++ b/src/Makefile.cfg
@@ -20,7 +20,7 @@ GCC64=1
endif
ifdef GCC64
-GCC64=1
+GCC63=1
endif
ifdef GCC63
@@ -108,9 +108,7 @@ ifndef GCC295
WFLAGS+=-Wno-div-by-zero
endif
#WFLAGS+=-Wsystem-headers
-ifndef ERRORMODE
-#WFLAGS+=-Wfloat-equal
-endif
+WFLAGS+=-Wfloat-equal
#WFLAGS+=-Wtraditional
ifdef VCHELP
WFLAGS+=-Wdeclaration-after-statement
@@ -182,9 +180,6 @@ endif
ifdef GCC46
WFLAGS+=-Wno-suggest-attribute=noreturn
endif
-ifdef GCC71
-WFLAGS+=-Wno-error=implicit-fallthrough -Wimplicit-fallthrough=3
-endif
ifndef MINGW
ifdef GCC45
@@ -214,6 +209,18 @@ endif
ifdef GCC61
WFLAGS+=-Wno-tautological-compare -Wno-error=tautological-compare
endif
+ifdef GCC71
+ WFLAGS+=-Wno-error=implicit-fallthrough
+ WFLAGS+=-Wno-implicit-fallthrough
+endif
+ifdef GCC80
+ WFLAGS+=-Wno-error=format-overflow
+ WFLAGS+=-Wno-error=stringop-truncation
+ WFLAGS+=-Wno-error=stringop-overflow
+ WFLAGS+=-Wno-format-overflow
+ WFLAGS+=-Wno-stringop-truncation
+ WFLAGS+=-Wno-stringop-overflow
+endif
#indicate platform and what interface use with
diff --git a/src/am_map.c b/src/am_map.c
index 7e012a304..6d7042f1c 100644
--- a/src/am_map.c
+++ b/src/am_map.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -11,8 +11,8 @@
/// \file am_map.c
/// \brief Code for the 'automap', former Doom feature used for DEVMODE testing
-#include "g_game.h"
#include "am_map.h"
+#include "g_game.h"
#include "g_input.h"
#include "p_local.h"
#include "p_slopes.h"
@@ -33,7 +33,6 @@ static const UINT8 GRAYSRANGE = 16;
static const UINT8 BROWNS = (3*16);
static const UINT8 YELLOWS = (7*16);
static const UINT8 GREENS = (10*16);
-static const UINT8 GREENRANGE = 16;
static const UINT8 DBLACK = 31;
static const UINT8 DWHITE = 0;
@@ -46,8 +45,6 @@ static const UINT8 NOCLIMBYELLOWS = (11*16);
// Automap colors
#define BACKGROUND DBLACK
-#define YOURCOLORS DWHITE
-#define YOURRANGE 0
#define WALLCOLORS (REDS + REDRANGE/2)
#define WALLRANGE (REDRANGE/2)
#define NOCLIMBWALLCOLORS (NOCLIMBREDS + NOCLIMBREDRANGE/2)
@@ -64,31 +61,23 @@ static const UINT8 NOCLIMBYELLOWS = (11*16);
#define CDWALLCOLORS YELLOWS
#define NOCLIMBCDWALLCOLORS NOCLIMBYELLOWS
#define THINGCOLORS GREENS
-#define THINGRANGE GREENRANGE
-#define SECRETWALLCOLORS WALLCOLORS
-#define SECRETWALLRANGE WALLRANGE
#define GRIDCOLORS (GRAYS + GRAYSRANGE/2)
-#define GRIDRANGE 0
#define XHAIRCOLORS GRAYS
-// drawing stuff
-#define FB 0
-
-#define AM_PANDOWNKEY KEY_DOWNARROW
+// controls
#define AM_PANUPKEY KEY_UPARROW
-#define AM_PANRIGHTKEY KEY_RIGHTARROW
+#define AM_PANDOWNKEY KEY_DOWNARROW
#define AM_PANLEFTKEY KEY_LEFTARROW
+#define AM_PANRIGHTKEY KEY_RIGHTARROW
+
#define AM_ZOOMINKEY '='
#define AM_ZOOMOUTKEY '-'
-#define AM_STARTKEY KEY_TAB
-#define AM_ENDKEY KEY_TAB
#define AM_GOBIGKEY '0'
+
#define AM_FOLLOWKEY 'f'
#define AM_GRIDKEY 'g'
-#define AM_MARKKEY 'm'
-#define AM_CLEARMARKKEY 'c'
-#define AM_NUMMARKPOINTS 10
+#define AM_TOGGLEKEY KEY_TAB
// scale on entry
#define INITSCALEMTOF (FRACUNIT/5)
@@ -109,6 +98,9 @@ static const UINT8 NOCLIMBYELLOWS = (11*16);
#define CXMTOF(x) (f_x + MTOF((x)-m_x))
#define CYMTOF(y) (f_y + (f_h - MTOF((y)-m_y)))
+#define MAPBITS (FRACBITS-4)
+#define FRACTOMAPBITS (FRACBITS-MAPBITS)
+
typedef struct
{
fixed_t x, y;
@@ -129,7 +121,10 @@ typedef struct
// A line drawing of the player pointing right,
// starting from the middle.
//
+
+#define PLAYERRADIUS (16*(1<
@@ -162,27 +157,15 @@ static const mline_t thintriangle_guy[] = {
#undef R
#define NUMTHINTRIANGLEGUYLINES (sizeof (thintriangle_guy)/sizeof (mline_t))
-static INT32 bigstate; //added : 24-01-98 : moved here, toggle between
- // user view and large view (full map view)
-
-static INT32 grid = 0;
-
-static INT32 leveljuststarted = 1; // kluge until AM_LevelInit() is called
+static boolean bigstate; // user view and large view (full map view)
+static boolean draw_grid = false;
boolean automapactive = false;
boolean am_recalc = false; //added : 05-02-98 : true when screen size changes
+static boolean am_stopped = true;
-// location of window on screen
-static INT32 f_x;
-static INT32 f_y;
-
-// size of window on screen
-static INT32 f_w;
-static INT32 f_h;
-
-static INT32 lightlev; // used for funky strobing effect
-static UINT8 *fb; // pseudo-frame buffer
-static INT32 amclock;
+static INT32 f_x, f_y; // location of window on screen (always zero for both)
+static INT32 f_w, f_h; // size of window on screen (always the screen width and height respectively)
static mpoint_t m_paninc; // how far the window pans each tic (map coords)
static fixed_t mtof_zoommul; // how far the window zooms in each tic (map coords)
@@ -206,11 +189,6 @@ static fixed_t max_y;
static fixed_t max_w; // max_x-min_x,
static fixed_t max_h; // max_y-min_y
-// based on player size
-static fixed_t min_w;
-static fixed_t min_h;
-
-
static fixed_t min_scale_mtof; // used to tell when to stop zooming out
static fixed_t max_scale_mtof; // used to tell when to stop zooming in
@@ -228,13 +206,7 @@ static fixed_t scale_ftom;
static player_t *plr; // the player represented by an arrow
-static patch_t *marknums[10]; // numbers used for marking by the automap
-static mpoint_t markpoints[AM_NUMMARKPOINTS]; // where the points are
-static INT32 markpointnum = 0; // next point to be assigned
-
-static INT32 followplayer = 1; // specifies whether to follow the player around
-
-static boolean stopped = true;
+static INT32 followplayer = true; // specifies whether to follow the player around
// function for drawing lines, depends on rendermode
typedef void (*AMDRAWFLINEFUNC) (const fline_t *fl, INT32 color);
@@ -273,8 +245,8 @@ static inline void AM_restoreScaleAndLoc(void)
}
else
{
- m_x = plr->mo->x - m_w/2;
- m_y = plr->mo->y - m_h/2;
+ m_x = (plr->mo->x >> FRACTOMAPBITS) - m_w/2;
+ m_y = (plr->mo->y >> FRACTOMAPBITS) - m_h/2;
}
m_x2 = m_x + m_w;
m_y2 = m_y + m_h;
@@ -284,15 +256,6 @@ static inline void AM_restoreScaleAndLoc(void)
scale_ftom = FixedDiv(FRACUNIT, scale_mtof);
}
-/** Adds a marker at the current location.
- */
-static inline void AM_addMark(void)
-{
- markpoints[markpointnum].x = m_x + m_w/2;
- markpoints[markpointnum].y = m_y + m_h/2;
- markpointnum = (markpointnum + 1) % AM_NUMMARKPOINTS;
-}
-
/** Determines the bounding box around all vertices.
* This is used to set global variables controlling the zoom range.
*/
@@ -318,11 +281,8 @@ static void AM_findMinMaxBoundaries(void)
max_y = vertexes[i].y;
}
- max_w = max_x - min_x;
- max_h = max_y - min_y;
-
- min_w = 2*PLAYERRADIUS; // const? never changed?
- min_h = 2*PLAYERRADIUS;
+ max_w = (max_x >>= FRACTOMAPBITS) - (min_x >>= FRACTOMAPBITS);
+ max_h = (max_y >>= FRACTOMAPBITS) - (min_y >>= FRACTOMAPBITS);
a = FixedDiv(f_w<mo->x - m_w/2;
- m_y = plr->mo->y - m_h/2;
+ if (plr != NULL && plr->mo != NULL)
+ {
+ m_x = (plr->mo->x >> FRACTOMAPBITS) - m_w/2;
+ m_y = (plr->mo->y >> FRACTOMAPBITS) - m_h/2;
+ }
AM_changeWindowLoc();
// for saving & restoring
@@ -392,41 +351,21 @@ static void AM_initVariables(void)
old_m_h = m_h;
}
-static const UINT8 *maplump; // pointer to the raw data for the automap background.
-
-/** Clears all map markers.
- */
-static void AM_clearMarks(void)
-{
- INT32 i;
-
- for (i = 0; i < AM_NUMMARKPOINTS; i++)
- markpoints[i].x = -1; // means empty
- markpointnum = 0;
-}
-
//
// should be called at the start of every level
// right now, i figure it out myself
//
static void AM_LevelInit(void)
{
- leveljuststarted = 0;
-
f_x = f_y = 0;
f_w = vid.width;
f_h = vid.height;
- if (rendermode == render_soft)
- AM_drawFline = AM_drawFline_soft;
-#ifdef HWRENDER // not win32 only 19990829 by Kin
- else if (rendermode != render_none)
+ AM_drawFline = AM_drawFline_soft;
+#ifdef HWRENDER
+ if (rendermode == render_opengl)
AM_drawFline = HWR_drawAMline;
#endif
- else
- I_Error("Automap can't run without a render system");
-
- AM_clearMarks();
AM_findMinMaxBoundaries();
scale_mtof = FixedDiv(min_scale_mtof*10, 7*FRACUNIT);
@@ -442,7 +381,7 @@ static void AM_LevelInit(void)
void AM_Stop(void)
{
automapactive = false;
- stopped = true;
+ am_stopped = true;
}
/** Enables automap.
@@ -453,15 +392,14 @@ static inline void AM_Start(void)
{
static INT32 lastlevel = -1;
- if (!stopped)
+ if (!am_stopped)
AM_Stop();
- stopped = false;
+ am_stopped = false;
if (lastlevel != gamemap || am_recalc) // screen size changed
{
- am_recalc = false;
-
AM_LevelInit();
lastlevel = gamemap;
+ am_recalc = false;
}
AM_initVariables();
}
@@ -499,7 +437,7 @@ boolean AM_Responder(event_t *ev)
{
if (!automapactive)
{
- if (ev->type == ev_keydown && ev->data1 == AM_STARTKEY)
+ if (ev->type == ev_keydown && ev->data1 == AM_TOGGLEKEY)
{
//faB: prevent alt-tab in win32 version to activate automap just before
// minimizing the app; doesn't do any harm to the DOS version
@@ -511,10 +449,8 @@ boolean AM_Responder(event_t *ev)
}
}
}
-
else if (ev->type == ev_keydown)
{
-
rc = true;
switch (ev->data1)
{
@@ -550,7 +486,7 @@ boolean AM_Responder(event_t *ev)
mtof_zoommul = M_ZOOMIN;
ftom_zoommul = M_ZOOMOUT;
break;
- case AM_ENDKEY:
+ case AM_TOGGLEKEY:
AM_Stop();
break;
case AM_GOBIGKEY:
@@ -568,13 +504,7 @@ boolean AM_Responder(event_t *ev)
f_oldloc.x = INT32_MAX;
break;
case AM_GRIDKEY:
- grid = !grid;
- break;
- case AM_MARKKEY:
- AM_addMark();
- break;
- case AM_CLEARMARKKEY:
- AM_clearMarks();
+ draw_grid = !draw_grid;
break;
default:
rc = false;
@@ -628,8 +558,8 @@ static inline void AM_doFollowPlayer(void)
{
if (f_oldloc.x != plr->mo->x || f_oldloc.y != plr->mo->y)
{
- m_x = FTOM(MTOF(plr->mo->x)) - m_w/2;
- m_y = FTOM(MTOF(plr->mo->y)) - m_h/2;
+ m_x = FTOM(MTOF(plr->mo->x >> FRACTOMAPBITS)) - m_w/2;
+ m_y = FTOM(MTOF(plr->mo->y >> FRACTOMAPBITS)) - m_h/2;
m_x2 = m_x + m_w;
m_y2 = m_y + m_h;
f_oldloc.x = plr->mo->x;
@@ -647,8 +577,6 @@ void AM_Ticker(void)
if (dedicated || !automapactive)
return;
- amclock++;
-
if (followplayer)
AM_doFollowPlayer();
@@ -667,72 +595,7 @@ void AM_Ticker(void)
*/
static void AM_clearFB(INT32 color)
{
-#ifdef HWRENDER
- if (rendermode != render_soft && rendermode != render_none)
- {
- HWR_clearAutomap();
- return;
- }
-#endif
-
- if (!maplump)
- memset(fb, color, f_w*f_h*vid.bpp);
- else
- {
- INT32 dmapx, dmapy, i, y;
- static INT32 mapxstart, mapystart;
- UINT8 *dest = screens[0];
- const UINT8 *src;
-#define MAPLUMPHEIGHT (200 - 42)
-
- if (followplayer)
- {
- static vertex_t oldplr;
-
- dmapx = MTOF(plr->mo->x) - MTOF(oldplr.x); //fixed point
- dmapy = MTOF(oldplr.y) - MTOF(plr->mo->y);
-
- oldplr.x = plr->mo->x;
- oldplr.y = plr->mo->y;
- mapxstart += dmapx>>1;
- mapystart += dmapy>>1;
-
- while (mapxstart >= BASEVIDWIDTH)
- mapxstart -= BASEVIDWIDTH;
- while (mapxstart < 0)
- mapxstart += BASEVIDWIDTH;
- while (mapystart >= MAPLUMPHEIGHT)
- mapystart -= MAPLUMPHEIGHT;
- while (mapystart < 0)
- mapystart += MAPLUMPHEIGHT;
- }
- else
- {
- mapxstart += (MTOF(m_paninc.x)>>1);
- mapystart -= (MTOF(m_paninc.y)>>1);
- if (mapxstart >= BASEVIDWIDTH)
- mapxstart -= BASEVIDWIDTH;
- if (mapxstart < 0)
- mapxstart += BASEVIDWIDTH;
- if (mapystart >= MAPLUMPHEIGHT)
- mapystart -= MAPLUMPHEIGHT;
- if (mapystart < 0)
- mapystart += MAPLUMPHEIGHT;
- }
-
- //blit the automap background to the screen.
- for (y = 0; y < f_h; y++)
- {
- src = maplump + mapxstart + (y + mapystart)*BASEVIDWIDTH;
- for (i = 0; i < BASEVIDWIDTH*vid.dupx; i++)
- {
- while (src > maplump + BASEVIDWIDTH*MAPLUMPHEIGHT)
- src -= BASEVIDWIDTH*MAPLUMPHEIGHT;
- *dest++ = *src++;
- }
- dest += vid.width - vid.dupx*BASEVIDWIDTH;
- }
- }
+ V_DrawFill(f_x, f_y, f_w, f_h, color|V_NOSCALESTART);
}
/** Performs automap clipping of lines.
@@ -867,7 +730,7 @@ static boolean AM_clipMline(const mline_t *ml, fline_t *fl)
//
static void AM_drawFline_soft(const fline_t *fl, INT32 color)
{
- register INT32 x, y, dx, dy, sx, sy, ax, ay, d;
+ INT32 x, y, dx, dy, sx, sy, ax, ay, d;
#ifdef _DEBUG
static INT32 num = 0;
@@ -883,7 +746,7 @@ static void AM_drawFline_soft(const fline_t *fl, INT32 color)
}
#endif
-#define PUTDOT(xx,yy,cc) fb[(yy)*f_w + (xx)]=(UINT8)(cc)
+ #define PUTDOT(xx,yy,cc) V_DrawFill(xx,yy,1,1,cc|V_NOSCALESTART);
dx = fl->b.x - fl->a.x;
ax = 2 * (dx < 0 ? -dx : dx);
@@ -901,7 +764,7 @@ static void AM_drawFline_soft(const fline_t *fl, INT32 color)
d = ay - ax/2;
for (;;)
{
- PUTDOT(x, y, color);
+ PUTDOT(x, y, color)
if (x == fl->b.x)
return;
if (d >= 0)
@@ -918,7 +781,7 @@ static void AM_drawFline_soft(const fline_t *fl, INT32 color)
d = ax - ay/2;
for (;;)
{
- PUTDOT(x, y, color);
+ PUTDOT(x, y, color)
if (y == fl->b.y)
return;
if (d >= 0)
@@ -930,6 +793,8 @@ static void AM_drawFline_soft(const fline_t *fl, INT32 color)
d += ax;
}
}
+
+ #undef PUTDOT
}
//
@@ -1000,15 +865,15 @@ static inline void AM_drawWalls(void)
for (i = 0; i < numlines; i++)
{
- l.a.x = lines[i].v1->x;
- l.a.y = lines[i].v1->y;
- l.b.x = lines[i].v2->x;
- l.b.y = lines[i].v2->y;
+ l.a.x = lines[i].v1->x >> FRACTOMAPBITS;
+ l.a.y = lines[i].v1->y >> FRACTOMAPBITS;
+ l.b.x = lines[i].v2->x >> FRACTOMAPBITS;
+ l.b.y = lines[i].v2->y >> FRACTOMAPBITS;
#ifdef ESLOPE
#define SLOPEPARAMS(slope, end1, end2, normalheight) \
if (slope) { \
- end1 = P_GetZAt(slope, l.a.x, l.a.y); \
- end2 = P_GetZAt(slope, l.b.x, l.b.y); \
+ end1 = P_GetZAt(slope, lines[i].v1->x, lines[i].v1->y); \
+ end2 = P_GetZAt(slope, lines[i].v2->x, lines[i].v2->y); \
} else \
end1 = end2 = normalheight;
@@ -1021,17 +886,12 @@ static inline void AM_drawWalls(void)
#undef SLOPEPARAMS
#endif
-// AM_drawMline(&l, GRAYS + 3); // Old, everything-is-gray automap
if (!lines[i].backsector) // 1-sided
{
if (lines[i].flags & ML_NOCLIMB)
- {
- AM_drawMline(&l, NOCLIMBWALLCOLORS+lightlev);
- }
+ AM_drawMline(&l, NOCLIMBWALLCOLORS);
else
- {
- AM_drawMline(&l, WALLCOLORS+lightlev);
- }
+ AM_drawMline(&l, WALLCOLORS);
}
#ifdef ESLOPE
else if ((backf1 == backc1 && backf2 == backc2) // Back is thok barrier
@@ -1048,24 +908,16 @@ static inline void AM_drawWalls(void)
#endif
{
if (lines[i].flags & ML_NOCLIMB)
- {
- AM_drawMline(&l, NOCLIMBTSWALLCOLORS+lightlev);
- }
+ AM_drawMline(&l, NOCLIMBTSWALLCOLORS);
else
- {
- AM_drawMline(&l, TSWALLCOLORS+lightlev);
- }
+ AM_drawMline(&l, TSWALLCOLORS);
}
else
{
if (lines[i].flags & ML_NOCLIMB)
- {
- AM_drawMline(&l, NOCLIMBTHOKWALLCOLORS+lightlev);
- }
+ AM_drawMline(&l, NOCLIMBTHOKWALLCOLORS);
else
- {
- AM_drawMline(&l, THOKWALLCOLORS+lightlev);
- }
+ AM_drawMline(&l, THOKWALLCOLORS);
}
}
else
@@ -1077,7 +929,7 @@ static inline void AM_drawWalls(void)
if (lines[i].backsector->floorheight
!= lines[i].frontsector->floorheight) {
#endif
- AM_drawMline(&l, NOCLIMBFDWALLCOLORS + lightlev); // floor level change
+ AM_drawMline(&l, NOCLIMBFDWALLCOLORS); // floor level change
}
#ifdef ESLOPE
else if (backc1 != frontc1 || backc2 != frontc2) {
@@ -1085,11 +937,10 @@ static inline void AM_drawWalls(void)
else if (lines[i].backsector->ceilingheight
!= lines[i].frontsector->ceilingheight) {
#endif
- AM_drawMline(&l, NOCLIMBCDWALLCOLORS+lightlev); // ceiling level change
- }
- else {
- AM_drawMline(&l, NOCLIMBTSWALLCOLORS+lightlev);
+ AM_drawMline(&l, NOCLIMBCDWALLCOLORS); // ceiling level change
}
+ else
+ AM_drawMline(&l, NOCLIMBTSWALLCOLORS);
}
else
{
@@ -1099,7 +950,7 @@ static inline void AM_drawWalls(void)
if (lines[i].backsector->floorheight
!= lines[i].frontsector->floorheight) {
#endif
- AM_drawMline(&l, FDWALLCOLORS + lightlev); // floor level change
+ AM_drawMline(&l, FDWALLCOLORS); // floor level change
}
#ifdef ESLOPE
else if (backc1 != frontc1 || backc2 != frontc2) {
@@ -1107,11 +958,10 @@ static inline void AM_drawWalls(void)
else if (lines[i].backsector->ceilingheight
!= lines[i].frontsector->ceilingheight) {
#endif
- AM_drawMline(&l, CDWALLCOLORS+lightlev); // ceiling level change
- }
- else {
- AM_drawMline(&l, TSWALLCOLORS+lightlev);
+ AM_drawMline(&l, CDWALLCOLORS); // ceiling level change
}
+ else
+ AM_drawMline(&l, TSWALLCOLORS);
}
}
}
@@ -1172,6 +1022,11 @@ static void AM_drawLineCharacter(const mline_t *lineguy, size_t lineguylines, fi
l.b.x += x;
l.b.y += y;
+ l.a.x >>= FRACTOMAPBITS;
+ l.a.y >>= FRACTOMAPBITS;
+ l.b.x >>= FRACTOMAPBITS;
+ l.b.y >>= FRACTOMAPBITS;
+
AM_drawMline(&l, color);
}
}
@@ -1180,83 +1035,51 @@ static inline void AM_drawPlayers(void)
{
INT32 i;
player_t *p;
- INT32 color;
+ INT32 color = GREENS;
if (!multiplayer)
{
- AM_drawLineCharacter(player_arrow, NUMPLYRLINES, 0,
- plr->mo->angle, DWHITE, plr->mo->x, plr->mo->y);
+ AM_drawLineCharacter(player_arrow, NUMPLYRLINES, 0, plr->mo->angle, DWHITE, plr->mo->x, plr->mo->y);
return;
}
- // multiplayer
+ // multiplayer (how??)
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i] || players[i].spectator)
continue;
p = &players[i];
- if (p->skincolor == 0)
- color = GREENS;
- else
+ if (p->skincolor > 0)
color = R_GetTranslationColormap(TC_DEFAULT, p->skincolor, GTC_CACHE)[GREENS + 8];
- AM_drawLineCharacter(player_arrow, NUMPLYRLINES, 0, p->mo->angle,
- color, p->mo->x, p->mo->y);
+ AM_drawLineCharacter(player_arrow, NUMPLYRLINES, 0, p->mo->angle, color, p->mo->x, p->mo->y);
}
}
-static inline void AM_drawThings(INT32 colors, INT32 colorrange)
+static inline void AM_drawThings(UINT8 colors)
{
size_t i;
mobj_t *t;
- (void)colorrange;
for (i = 0; i < numsectors; i++)
{
t = sectors[i].thinglist;
while (t)
{
- AM_drawLineCharacter(thintriangle_guy, NUMTHINTRIANGLEGUYLINES,
- 16<angle, colors + lightlev, t->x, t->y);
+ AM_drawLineCharacter(thintriangle_guy, NUMTHINTRIANGLEGUYLINES, 16<angle, colors, t->x, t->y);
t = t->snext;
}
}
}
-static inline void AM_drawMarks(void)
-{
- INT32 i, fx, fy, w, h;
-
- for (i = 0; i < AM_NUMMARKPOINTS; i++)
- {
- if (markpoints[i].x != -1 && marknums[i])
- {
- // w = SHORT(marknums[i]->width);
- // h = SHORT(marknums[i]->height);
- w = 5; // because something's wrong with the wad, i guess
- h = 6; // because something's wrong with the wad, i guess
- fx = CXMTOF(markpoints[i].x);
- fy = CYMTOF(markpoints[i].y);
- if (fx >= f_x && fx <= f_w - w && fy >= f_y && fy <= f_h - h)
- V_DrawPatch(fx, fy, FB, marknums[i]);
- }
- }
-}
-
/** Draws the crosshair, actually just a dot in software mode.
*
* \param color Color for the crosshair.
*/
-static inline void AM_drawCrosshair(INT32 color)
+static inline void AM_drawCrosshair(UINT8 color)
{
- if (rendermode != render_soft)
- return; // BP: should be putpixel here
-
- if (scr_bpp == 1)
- fb[(f_w*(f_h + 1))/2] = (UINT8)color; // single point for now
- else
- *((INT16 *)(void *)fb + (f_w*(f_h + 1))/2) = (INT16)color;
+ V_DrawFill(f_w/2 + f_x, f_h/2 + f_y, 1, 1, color|V_NOSCALESTART);
}
/** Draws the automap.
@@ -1267,13 +1090,10 @@ void AM_Drawer(void)
return;
AM_clearFB(BACKGROUND);
- if (grid)
- AM_drawGrid(GRIDCOLORS);
+ if (draw_grid) AM_drawGrid(GRIDCOLORS);
AM_drawWalls();
AM_drawPlayers();
- AM_drawThings(THINGCOLORS, THINGRANGE);
+ AM_drawThings(THINGCOLORS);
AM_drawCrosshair(XHAIRCOLORS);
-
- AM_drawMarks();
}
diff --git a/src/am_map.h b/src/am_map.h
index df145848b..4e8c782a9 100644
--- a/src/am_map.h
+++ b/src/am_map.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/asm_defs.inc b/src/asm_defs.inc
index db59d2c69..e494a676e 100644
--- a/src/asm_defs.inc
+++ b/src/asm_defs.inc
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2014 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/b_bot.c b/src/b_bot.c
index 5f884896f..17211b353 100644
--- a/src/b_bot.c
+++ b/src/b_bot.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2007-2016 by John "JTE" Muniz.
-// Copyright (C) 2011-2016 by Sonic Team Junior.
+// Copyright (C) 2011-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/b_bot.h b/src/b_bot.h
index 259405f38..20b2803b6 100644
--- a/src/b_bot.h
+++ b/src/b_bot.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2007-2016 by John "JTE" Muniz.
-// Copyright (C) 2012-2016 by Sonic Team Junior.
+// Copyright (C) 2012-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/blua/Makefile.cfg b/src/blua/Makefile.cfg
index 8d2e73714..182f63092 100644
--- a/src/blua/Makefile.cfg
+++ b/src/blua/Makefile.cfg
@@ -39,6 +39,7 @@ OBJS:=$(OBJS) \
$(OBJDIR)/lvm.o \
$(OBJDIR)/lua_script.o \
$(OBJDIR)/lua_baselib.o \
+ $(OBJDIR)/lua_blockmaplib.o \
$(OBJDIR)/lua_mathlib.o \
$(OBJDIR)/lua_hooklib.o \
$(OBJDIR)/lua_consolelib.o \
diff --git a/src/byteptr.h b/src/byteptr.h
index 364e6520c..aa09d6be4 100644
--- a/src/byteptr.h
+++ b/src/byteptr.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/command.c b/src/command.c
index 10af3a576..62e673322 100644
--- a/src/command.c
+++ b/src/command.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -32,6 +32,7 @@
#include "hu_stuff.h"
#include "p_setup.h"
#include "lua_script.h"
+#include "d_netfil.h" // findfile
//========
// protos.
@@ -49,6 +50,8 @@ static void COM_Wait_f(void);
static void COM_Help_f(void);
static void COM_Toggle_f(void);
+static void CV_EnforceExecVersion(void);
+static boolean CV_FilterVarByVersion(consvar_t *v, const char *valstr);
static boolean CV_Command(void);
static consvar_t *CV_FindVar(const char *name);
static const char *CV_StringValue(const char *var_name);
@@ -62,6 +65,18 @@ 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_Natural[] = {{1, "MIN"}, {999999999, "MAX"}, {0, NULL}};
+// Filter consvars by EXECVERSION
+// First implementation is 26 (2.1.21), so earlier configs default at 25 (2.1.20)
+// Also set CV_HIDEN during runtime, after config is loaded
+static boolean execversion_enabled = false;
+consvar_t cv_execversion = {"execversion","25",CV_CALL,CV_Unsigned, CV_EnforceExecVersion, 0, NULL, NULL, 0, 0, NULL};
+
+// for default joyaxis detection
+static boolean joyaxis_default = false;
+static boolean joyaxis2_default = false;
+static INT32 joyaxis_count = 0;
+static INT32 joyaxis2_count = 0;
+
#define COM_BUF_SIZE 8192 // command buffer size
#define MAX_ALIAS_RECURSION 100 // max recursion allowed for aliases
@@ -629,6 +644,7 @@ static void COM_CEchoDuration_f(void)
static void COM_Exec_f(void)
{
UINT8 *buf = NULL;
+ char filename[256];
if (COM_Argc() < 2 || COM_Argc() > 3)
{
@@ -637,13 +653,23 @@ static void COM_Exec_f(void)
}
// load file
+ // Try with Argv passed verbatim first, for back compat
FIL_ReadFile(COM_Argv(1), &buf);
if (!buf)
{
- if (!COM_CheckParm("-noerror"))
- CONS_Printf(M_GetText("couldn't execute file %s\n"), COM_Argv(1));
- return;
+ // Now try by searching the file path
+ // filename is modified with the full found path
+ strcpy(filename, COM_Argv(1));
+ if (findfile(filename, NULL, true) != FS_NOTFOUND)
+ FIL_ReadFile(filename, &buf);
+
+ if (!buf)
+ {
+ if (!COM_CheckParm("-noerror"))
+ CONS_Printf(M_GetText("couldn't execute file %s\n"), COM_Argv(1));
+ return;
+ }
}
if (!COM_CheckParm("-silent"))
@@ -1078,7 +1104,7 @@ static void Setvalue(consvar_t *var, const char *valstr, boolean stealth)
if (var->flags & CV_FLOAT)
{
double d = atof(valstr);
- if (!d && valstr[0] != '0')
+ if (fpclassify(d) == FP_ZERO && valstr[0] != '0')
v = INT32_MIN;
else
v = (INT32)(d * FRACUNIT);
@@ -1241,7 +1267,7 @@ static void Got_NetVar(UINT8 **p, INT32 playernum)
char *svalue;
UINT8 stealth = false;
- if (playernum != serverplayer && playernum != adminplayer && !serverloading)
+ if (playernum != serverplayer && !IsPlayerAdmin(playernum) && !serverloading)
{
// not from server or remote admin, must be hacked/buggy client
CONS_Alert(CONS_WARNING, M_GetText("Illegal netvar command received from %s\n"), player_names[playernum]);
@@ -1367,7 +1393,7 @@ static void CV_SetCVar(consvar_t *var, const char *value, boolean stealth)
// send the value of the variable
UINT8 buf[128];
UINT8 *p = buf;
- if (!(server || (adminplayer == consoleplayer)))
+ if (!(server || (IsPlayerAdmin(consoleplayer))))
{
CONS_Printf(M_GetText("Only the server or admin can change: %s %s\n"), var->name, var->string);
return;
@@ -1611,6 +1637,210 @@ void CV_AddValue(consvar_t *var, INT32 increment)
var->changed = 1; // user has changed it now
}
+void CV_InitFilterVar(void)
+{
+ joyaxis_default = joyaxis2_default = true;
+ joyaxis_count = joyaxis2_count = 0;
+}
+
+void CV_ToggleExecVersion(boolean enable)
+{
+ execversion_enabled = enable;
+}
+
+static void CV_EnforceExecVersion(void)
+{
+ if (!execversion_enabled)
+ CV_StealthSetValue(&cv_execversion, EXECVERSION);
+}
+
+static boolean CV_FilterJoyAxisVars(consvar_t *v, const char *valstr)
+{
+ // If ALL axis settings are previous defaults, set them to the new defaults
+ // EXECVERSION < 26 (2.1.21)
+
+ if (joyaxis_default)
+ {
+#if !defined (_WII) && !defined (WMINPUT)
+ if (!stricmp(v->name, "joyaxis_turn"))
+ {
+ if (joyaxis_count > 6) return false;
+ // we're currently setting the new defaults, don't interfere
+ else if (joyaxis_count == 6) return true;
+
+ if (!stricmp(valstr, "X-Axis")) joyaxis_count++;
+ else joyaxis_default = false;
+ }
+#if !defined (PSP)
+ if (!stricmp(v->name, "joyaxis_move"))
+ {
+ if (joyaxis_count > 6) return false;
+ else if (joyaxis_count == 6) return true;
+
+ if (!stricmp(valstr, "Y-Axis")) joyaxis_count++;
+ else joyaxis_default = false;
+ }
+#endif
+#if !defined (_arch_dreamcast) && !defined (_XBOX) && !defined (PSP)
+ if (!stricmp(v->name, "joyaxis_side"))
+ {
+ if (joyaxis_count > 6) return false;
+ else if (joyaxis_count == 6) return true;
+
+ if (!stricmp(valstr, "Z-Axis")) joyaxis_count++;
+ else joyaxis_default = false;
+ }
+#endif
+#if !defined (_XBOX) && !defined (PSP)
+ if (!stricmp(v->name, "joyaxis_look"))
+ {
+ if (joyaxis_count > 6) return false;
+ else if (joyaxis_count == 6) return true;
+
+ if (!stricmp(valstr, "None")) joyaxis_count++;
+ else joyaxis_default = false;
+ }
+#endif
+ if (!stricmp(v->name, "joyaxis_fire")
+ || !stricmp(v->name, "joyaxis_firenormal"))
+ {
+ if (joyaxis_count > 6) return false;
+ else if (joyaxis_count == 6) return true;
+
+ if (!stricmp(valstr, "None")) joyaxis_count++;
+ else joyaxis_default = false;
+ }
+#endif
+ // reset all axis settings to defaults
+ if (joyaxis_count == 6)
+ {
+ COM_BufInsertText(va("%s \"%s\"\n", cv_turnaxis.name, cv_turnaxis.defaultvalue));
+ COM_BufInsertText(va("%s \"%s\"\n", cv_moveaxis.name, cv_moveaxis.defaultvalue));
+ COM_BufInsertText(va("%s \"%s\"\n", cv_sideaxis.name, cv_sideaxis.defaultvalue));
+ COM_BufInsertText(va("%s \"%s\"\n", cv_lookaxis.name, cv_lookaxis.defaultvalue));
+ COM_BufInsertText(va("%s \"%s\"\n", cv_fireaxis.name, cv_fireaxis.defaultvalue));
+ COM_BufInsertText(va("%s \"%s\"\n", cv_firenaxis.name, cv_firenaxis.defaultvalue));
+ joyaxis_count++;
+ return false;
+ }
+ }
+
+ if (joyaxis2_default)
+ {
+#if !defined (_WII) && !defined (WMINPUT)
+ if (!stricmp(v->name, "joyaxis2_turn"))
+ {
+ if (joyaxis2_count > 6) return false;
+ // we're currently setting the new defaults, don't interfere
+ else if (joyaxis2_count == 6) return true;
+
+ if (!stricmp(valstr, "X-Axis")) joyaxis2_count++;
+ else joyaxis2_default = false;
+ }
+// #if !defined (PSP)
+ if (!stricmp(v->name, "joyaxis2_move"))
+ {
+ if (joyaxis2_count > 6) return false;
+ else if (joyaxis2_count == 6) return true;
+
+ if (!stricmp(valstr, "Y-Axis")) joyaxis2_count++;
+ else joyaxis2_default = false;
+ }
+// #endif
+#if !defined (_arch_dreamcast) && !defined (_XBOX) && !defined (PSP)
+ if (!stricmp(v->name, "joyaxis2_side"))
+ {
+ if (joyaxis2_count > 6) return false;
+ else if (joyaxis2_count == 6) return true;
+
+ if (!stricmp(valstr, "Z-Axis")) joyaxis2_count++;
+ else joyaxis2_default = false;
+ }
+#endif
+#if !defined (_XBOX) // && !defined (PSP)
+ if (!stricmp(v->name, "joyaxis2_look"))
+ {
+ if (joyaxis2_count > 6) return false;
+ else if (joyaxis2_count == 6) return true;
+
+ if (!stricmp(valstr, "None")) joyaxis2_count++;
+ else joyaxis2_default = false;
+ }
+#endif
+ if (!stricmp(v->name, "joyaxis2_fire")
+ || !stricmp(v->name, "joyaxis2_firenormal"))
+ {
+ if (joyaxis2_count > 6) return false;
+ else if (joyaxis2_count == 6) return true;
+
+ if (!stricmp(valstr, "None")) joyaxis2_count++;
+ else joyaxis2_default = false;
+ }
+#endif
+
+ // reset all axis settings to defaults
+ if (joyaxis2_count == 6)
+ {
+ COM_BufInsertText(va("%s \"%s\"\n", cv_turnaxis2.name, cv_turnaxis2.defaultvalue));
+ COM_BufInsertText(va("%s \"%s\"\n", cv_moveaxis2.name, cv_moveaxis2.defaultvalue));
+ COM_BufInsertText(va("%s \"%s\"\n", cv_sideaxis2.name, cv_sideaxis2.defaultvalue));
+ COM_BufInsertText(va("%s \"%s\"\n", cv_lookaxis2.name, cv_lookaxis2.defaultvalue));
+ COM_BufInsertText(va("%s \"%s\"\n", cv_fireaxis2.name, cv_fireaxis2.defaultvalue));
+ COM_BufInsertText(va("%s \"%s\"\n", cv_firenaxis2.name, cv_firenaxis2.defaultvalue));
+ joyaxis2_count++;
+ return false;
+ }
+ }
+
+ // we haven't reached our counts yet, or we're not default
+ return true;
+}
+
+static boolean CV_FilterVarByVersion(consvar_t *v, const char *valstr)
+{
+ // True means allow the CV change, False means block it
+
+ // We only care about CV_SAVE because this filters the user's config files
+ // We do this same check in CV_Command
+ if (!(v->flags & CV_SAVE))
+ return true;
+
+ if (GETMAJOREXECVERSION(cv_execversion.value) < 26) // 26 = 2.1.21
+ {
+ // MOUSE SETTINGS
+ // alwaysfreelook split between first and third person (chasefreelook)
+ // mousemove was on by default, which invalidates the current approach
+ if (!stricmp(v->name, "alwaysmlook")
+ || !stricmp(v->name, "alwaysmlook2")
+ || !stricmp(v->name, "mousemove")
+ || !stricmp(v->name, "mousemove2"))
+ return false;
+
+ // mousesens was changed from 35 to 20 due to oversensitivity
+ if ((!stricmp(v->name, "mousesens")
+ || !stricmp(v->name, "mousesens2")
+ || !stricmp(v->name, "mouseysens")
+ || !stricmp(v->name, "mouseysens2"))
+ && atoi(valstr) == 35)
+ return false;
+
+ // JOYSTICK DEFAULTS
+ // use_joystick was changed from 0 to 1 to automatically use a joystick if available
+#if defined(HAVE_SDL) || defined(_WINDOWS)
+ if ((!stricmp(v->name, "use_joystick")
+ || !stricmp(v->name, "use_joystick2"))
+ && atoi(valstr) == 0)
+ return false;
+#endif
+
+ // axis defaults were changed to be friendly to 360 controllers
+ // if ALL axis settings are defaults, then change them to new values
+ if (!CV_FilterJoyAxisVars(v, valstr))
+ return false;
+ }
+ return true;
+}
+
/** Displays or changes a variable from the console.
* Since the user is presumed to have been directly responsible
* for this change, the variable is marked as changed this game.
@@ -1635,8 +1865,11 @@ static boolean CV_Command(void)
return true;
}
- CV_Set(v, COM_Argv(1));
- v->changed = 1; // now it's been changed by (presumably) the user
+ if (!(v->flags & CV_SAVE) || CV_FilterVarByVersion(v, COM_Argv(1)))
+ {
+ CV_Set(v, COM_Argv(1));
+ v->changed = 1; // now it's been changed by (presumably) the user
+ }
return true;
}
diff --git a/src/command.h b/src/command.h
index 989ead8cf..e6767825c 100644
--- a/src/command.h
+++ b/src/command.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -125,6 +125,13 @@ extern CV_PossibleValue_t CV_OnOff[];
extern CV_PossibleValue_t CV_YesNo[];
extern CV_PossibleValue_t CV_Unsigned[];
extern CV_PossibleValue_t CV_Natural[];
+
+// Filter consvars by version
+extern consvar_t cv_execversion;
+
+void CV_InitFilterVar(void);
+void CV_ToggleExecVersion(boolean enable);
+
// register a variable for use at the console
void CV_RegisterVar(consvar_t *variable);
diff --git a/src/config.h.in b/src/config.h.in
index 174b34430..1b67b1f75 100644
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -21,15 +21,14 @@
#define SRB2_COMP_REVISION "${SRB2_COMP_REVISION}"
#define SRB2_COMP_BRANCH "${SRB2_COMP_BRANCH}"
-#define SRB2_GIT_DESCRIBE "${SRB2_GIT_DESCRIBE}"
-#define SRB2_GIT_BRANCH "${SRB2_GIT_BRANCH}"
#define CMAKE_ASSETS_DIR "${CMAKE_SOURCE_DIR}/assets"
#else
/* Manually defined asset hashes for non-CMake builds
- * Last updated 2015 / 05 / 03
+ * Last updated 2015 / 05 / 03 - v2.1.15 - main assets
+ * Last updated 2018 / ?? / ?? - v2.2 - patch.pk3
*/
#define ASSET_HASH_SRB2_PK3 "c1b9577687f8a795104aef4600720ea7"
#define ASSET_HASH_ZONES_DTA "303838c6c534d9540288360fa49cca60"
diff --git a/src/console.c b/src/console.c
index f4234d949..8782c7255 100644
--- a/src/console.c
+++ b/src/console.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -56,10 +56,7 @@ static boolean consoleready; // console prompt is ready
INT32 con_destlines; // vid lines used by console at final position
static INT32 con_curlines; // vid lines currently used by console
- INT32 con_clipviewtop; // clip value for planes & sprites, so that the
- // part of the view covered by the console is not
- // drawn when not needed, this must be -1 when
- // console is off
+ INT32 con_clipviewtop; // (useless)
static INT32 con_hudlines; // number of console heads up message lines
static INT32 con_hudtime[MAXHUDLINES]; // remaining time of display for hud msg lines
@@ -99,8 +96,6 @@ static void CON_RecalcSize(void);
static void CONS_hudlines_Change(void);
static void CONS_backcolor_Change(void);
-static void CON_DrawBackpic(patch_t *pic, INT32 startx, INT32 destwidth);
-//static void CON_DrawBackpic2(pic_t *pic, INT32 startx, INT32 destwidth);
//======================================================================
// CONSOLE VARS AND COMMANDS
@@ -131,11 +126,15 @@ static CV_PossibleValue_t backpic_cons_t[] = {{0, "translucent"}, {1, "picture"}
// whether to use console background picture, or translucent mode
static consvar_t cons_backpic = {"con_backpic", "translucent", CV_SAVE, backpic_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
-static CV_PossibleValue_t backcolor_cons_t[] = {{0, "White"}, {1, "Gray"}, {2, "Brown"},
- {3, "Red"}, {4, "Orange"}, {5, "Yellow"},
- {6, "Green"}, {7, "Blue"}, {8, "Purple"},
- {9, "Magenta"}, {10, "Aqua"},
+static CV_PossibleValue_t backcolor_cons_t[] = {{0, "White"}, {1, "Black"}, {2, "Sepia"},
+ {3, "Brown"}, {4, "Pink"}, {5, "Raspberry"},
+ {6, "Red"}, {7, "Creamsicle"}, {8, "Orange"},
+ {9, "Gold"}, {10,"Yellow"}, {11,"Emerald"},
+ {12,"Green"}, {13,"Cyan"}, {14,"Steel"},
+ {15,"Periwinkle"}, {16,"Blue"}, {17,"Purple"},
+ {18,"Lavender"},
{0, NULL}};
+
consvar_t cons_backcolor = {"con_backcolor", "Green", CV_CALL|CV_SAVE, backcolor_cons_t, CONS_backcolor_Change, 0, NULL, NULL, 0, 0, NULL};
static void CON_Print(char *msg);
@@ -240,6 +239,7 @@ void CON_SetupBackColormapEx(INT32 color, boolean prompt)
UINT16 i, palsum;
UINT8 j, palindex, shift;
UINT8 *pal = W_CacheLumpName(GetPalette(), PU_CACHE);
+ INT32 shift = 6;
if (color == INT32_MAX)
color = cons_backcolor.value;
@@ -247,19 +247,27 @@ void CON_SetupBackColormapEx(INT32 color, boolean prompt)
shift = 6; // 12 colors -- shift of 7 means 6 colors
switch (color)
{
- case 0: palindex = 15; break; // White
- case 1: palindex = 31; break; // Gray
- case 2: palindex = 239; break; // Brown
- case 3: palindex = 47; break; // Red
- case 4: palindex = 63; break; // Orange
- case 5: palindex = 79; shift = 7; break; // Yellow
- case 6: palindex = 111; break; // Green
- case 7: palindex = 159; break; // Blue
- case 8: palindex = 199; shift = 7; break; // Purple
- case 9: palindex = 187; break; // Magenta
- case 10: palindex = 139; break; // Aqua
+ case 0: palindex = 15; break; // White
+ case 1: palindex = 31; break; // Gray
+ case 2: palindex = 47; break; // Sepia
+ case 3: palindex = 63; break; // Brown
+ case 4: palindex = 150; shift = 7; break; // Pink
+ case 5: palindex = 127; shift = 7; break; // Raspberry
+ case 6: palindex = 143; break; // Red
+ case 7: palindex = 86; shift = 7; break; // Creamsicle
+ case 8: palindex = 95; break; // Orange
+ case 9: palindex = 119; shift = 7; break; // Gold
+ case 10: palindex = 111; break; // Yellow
+ case 11: palindex = 191; shift = 7; break; // Emerald
+ case 12: palindex = 175; break; // Green
+ case 13: palindex = 219; break; // Cyan
+ case 14: palindex = 207; shift = 7; break; // Steel
+ case 15: palindex = 230; shift = 7; break; // Periwinkle
+ case 16: palindex = 239; break; // Blue
+ case 17: palindex = 199; shift = 7; break; // Purple
+ case 18: palindex = 255; shift = 7; break; // Lavender
// Default green
- default: palindex = 175; color = 11; break;
+ default: palindex = 175; break;
}
if (prompt)
@@ -871,7 +879,7 @@ boolean CON_Responder(event_t *ev)
// ...why shouldn't it eat the key? if it doesn't, it just means you
// can control Sonic from the console, which is silly
- return true; //return false;
+ return true;//return false;
}
// command completion forward (tab) and backward (shift-tab)
@@ -1065,15 +1073,30 @@ boolean CON_Responder(event_t *ev)
else if (key == KEY_KPADSLASH)
key = '/';
- if (shiftdown)
+ // capslock
+ if (key == KEY_CAPSLOCK) // it's a toggle.
+ {
+ if (capslock)
+ capslock = false;
+ else
+ capslock = true;
+ return true;
+ }
+
+ if (key >= 'a' && key <= 'z')
+ {
+ if (capslock ^ shiftdown)
+ key = shiftxform[key];
+ }
+ else if (shiftdown)
key = shiftxform[key];
// enter a char into the command prompt
if (key < 32 || key > 127)
- return true; // even if key can't be printed, eat it anyway
+ return true;
// add key to cmd line here
- if (key >= 'A' && key <= 'Z' && !shiftdown) //this is only really necessary for dedicated servers
+ if (key >= 'A' && key <= 'Z' && !(shiftdown ^ capslock)) //this is only really necessary for dedicated servers
key = key + 'a' - 'A';
if (input_sel != input_cur)
@@ -1255,24 +1278,15 @@ void CONS_Printf(const char *fmt, ...)
if (con_startup)
{
#ifdef _WINDOWS
- static lumpnum_t con_backpic_lumpnum = UINT32_MAX;
- patch_t *con_backpic;
+ patch_t *con_backpic = W_CachePatchName("CONSBACK", PU_CACHE);
- if (con_backpic_lumpnum == UINT32_MAX)
- con_backpic_lumpnum = W_GetNumForName("CONSBACK");
+ // Jimita: CON_DrawBackpic just called V_DrawScaledPatch
+ V_DrawScaledPatch(0, 0, 0, con_backpic);
- // We load the raw lump, even in hardware mode
- con_backpic = (patch_t*)W_CacheLumpNum(con_backpic_lumpnum, PU_CACHE);
-
- // show startup screen and message using only 'software' graphics
- // (rendermode may be hardware accelerated, but the video mode is not set yet)
- CON_DrawBackpic(con_backpic, 0, vid.width); // put console background
- I_LoadingScreen(txt);
-
- Z_Unlock(con_backpic);
+ W_UnlockCachedPatch(con_backpic);
+ I_LoadingScreen(txt); // Win32/OS2 only
#else
- // here we display the console background and console text
- // (no hardware accelerated support for these versions)
+ // here we display the console text
CON_Drawer();
I_FinishUpdate(); // page flip or blit buffer
#endif
@@ -1458,8 +1472,8 @@ static void CON_DrawHudlines(void)
if (con_hudlines <= 0)
return;
- if (chat_on)
- y = charheight; // leave place for chat input in the first row of text
+ if (chat_on && OLDCHAT)
+ y = charheight; // leave place for chat input in the first row of text (only do it if consolechat is on.)
else
y = 0;
@@ -1499,64 +1513,6 @@ static void CON_DrawHudlines(void)
con_clearlines = y; // this is handled by HU_Erase();
}
-// Scale a pic_t at 'startx' pos, to 'destwidth' columns.
-// startx, destwidth is resolution dependent
-// Used to draw console borders, console background.
-// The pic must be sized BASEVIDHEIGHT height.
-static void CON_DrawBackpic(patch_t *pic, INT32 startx, INT32 destwidth)
-{
- (void)startx;
- (void)destwidth;
- V_DrawScaledPatch(0, 0, 0, pic);
-}
-
-#if 0
-static inline void CON_DrawBackpic2(pic_t *pic, INT32 startx, INT32 destwidth)
-{
- INT32 x, y;
- INT32 v;
- UINT8 *src, *dest;
- const UINT8 *deststop;
- INT32 frac, fracstep;
-
- dest = screens[0]+startx;
- deststop = screens[0] + vid.rowbytes * vid.height;
-
- for (y = 0; y < con_curlines; y++, dest += vid.width)
- {
- // scale the picture to the resolution
- v = SHORT(pic->height) - ((con_curlines - y) * (BASEVIDHEIGHT-1) / vid.height) - 1;
-
- src = pic->data + v*SHORT(pic->width);
-
- // in case of the console backpic, simplify
- if (SHORT(pic->width) == destwidth)
- M_Memcpy(dest, src, destwidth);
- else
- {
- // scale pic to screen width
- frac = 0;
- fracstep = (SHORT(pic->width)<<16)/destwidth;
- for (x = 0; x < destwidth; x += 4)
- {
- if (dest+x > deststop) break;
- dest[x] = src[frac>>FRACBITS];
- frac += fracstep;
- if (dest+x+1 > deststop) break;
- dest[x+1] = src[frac>>FRACBITS];
- frac += fracstep;
- if (dest+x+2 > deststop) break;
- dest[x+2] = src[frac>>FRACBITS];
- frac += fracstep;
- if (dest+x+3 > deststop) break;
- dest[x+3] = src[frac>>FRACBITS];
- frac += fracstep;
- }
- }
- }
-}
-#endif
-
// draw the console background, text, and prompt if enough place
//
static void CON_DrawConsole(void)
@@ -1579,18 +1535,10 @@ static void CON_DrawConsole(void)
// draw console background
if (cons_backpic.value || con_forcepic)
{
- static lumpnum_t con_backpic_lumpnum = UINT32_MAX;
- patch_t *con_backpic;
+ patch_t *con_backpic = W_CachePatchName("CONSBACK", PU_CACHE);
- if (con_backpic_lumpnum == UINT32_MAX)
- con_backpic_lumpnum = W_GetNumForName("CONSBACK");
-
- con_backpic = (patch_t*)W_CachePatchNum(con_backpic_lumpnum, PU_CACHE);
-
- if (rendermode != render_soft)
- V_DrawScaledPatch(0, 0, 0, con_backpic);
- else if (rendermode != render_none)
- CON_DrawBackpic(con_backpic, 0, vid.width); // picture as background
+ // Jimita: CON_DrawBackpic just called V_DrawScaledPatch
+ V_DrawScaledPatch(0, 0, 0, con_backpic);
W_UnlockCachedPatch(con_backpic);
}
diff --git a/src/console.h b/src/console.h
index c194f44bf..f62808033 100644
--- a/src/console.h
+++ b/src/console.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/d_clisrv.c b/src/d_clisrv.c
index af2c1f762..f24db52a9 100644
--- a/src/d_clisrv.c
+++ b/src/d_clisrv.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -23,6 +23,7 @@
#include "g_game.h"
#include "hu_stuff.h"
#include "keys.h"
+#include "g_input.h" // JOY1
#include "m_menu.h"
#include "console.h"
#include "d_netfil.h"
@@ -1383,7 +1384,6 @@ static boolean SV_SendServerConfig(INT32 node)
netbuffer->u.servercfg.gamestate = (UINT8)gamestate;
netbuffer->u.servercfg.gametype = (UINT8)gametype;
netbuffer->u.servercfg.modifiedgame = (UINT8)modifiedgame;
- netbuffer->u.servercfg.adminplayer = (SINT8)adminplayer;
// we fill these structs with FFs so that any players not in game get sent as 0xFFFF
// which is nice and easy for us to detect
@@ -1391,8 +1391,12 @@ static boolean SV_SendServerConfig(INT32 node)
memset(netbuffer->u.servercfg.playercolor, 0xFF, sizeof(netbuffer->u.servercfg.playercolor));
memset(netbuffer->u.servercfg.playeravailabilities, 0xFF, sizeof(netbuffer->u.servercfg.playeravailabilities));
+ memset(netbuffer->u.servercfg.adminplayers, -1, sizeof(netbuffer->u.servercfg.adminplayers));
+
for (i = 0; i < MAXPLAYERS; i++)
{
+ netbuffer->u.servercfg.adminplayers[i] = (SINT8)adminplayers[i];
+
if (!playeringame[i])
continue;
netbuffer->u.servercfg.playerskins[i] = (UINT8)players[i].skin;
@@ -1643,6 +1647,8 @@ static void SendAskInfo(INT32 node, boolean viams)
serverelem_t serverlist[MAXSERVERLIST];
UINT32 serverlistcount = 0;
+#define FORCECLOSE 0x8000
+
static void SL_ClearServerList(INT32 connectedserver)
{
UINT32 i;
@@ -1650,7 +1656,7 @@ static void SL_ClearServerList(INT32 connectedserver)
for (i = 0; i < serverlistcount; i++)
if (connectedserver != serverlist[i].node)
{
- Net_CloseConnection(serverlist[i].node);
+ Net_CloseConnection(serverlist[i].node|FORCECLOSE);
serverlist[i].node = 0;
}
serverlistcount = 0;
@@ -1732,12 +1738,25 @@ void CL_UpdateServerList(boolean internetsearch, INT32 room)
// Make sure MS version matches our own, to
// thwart nefarious servers who lie to the MS.
- if(strcmp(version, server_list[i].version) == 0)
+ if (strcmp(version, server_list[i].version) == 0)
{
INT32 node = I_NetMakeNodewPort(server_list[i].ip, server_list[i].port);
if (node == -1)
break; // no more node free
SendAskInfo(node, true);
+ // Force close the connection so that servers can't eat
+ // up nodes forever if we never get a reply back from them
+ // (usually when they've not forwarded their ports).
+ //
+ // Don't worry, we'll get in contact with the working
+ // servers again when they send SERVERINFO to us later!
+ //
+ // (Note: as a side effect this probably means every
+ // server in the list will probably be using the same node (e.g. node 1),
+ // not that it matters which nodes they use when
+ // the connections are closed afterwards anyway)
+ // -- Monster Iestyn 12/11/18
+ Net_CloseConnection(node|FORCECLOSE);
}
}
}
@@ -1964,7 +1983,7 @@ static boolean CL_ServerConnectionTicker(boolean viams, const char *tmpsave, tic
I_OsPolling();
key = I_GetKey();
- if (key == KEY_ESCAPE)
+ if (key == KEY_ESCAPE || key == KEY_JOY1+1)
{
CONS_Printf(M_GetText("Network game synchronization aborted.\n"));
// M_StartMessage(M_GetText("Network game synchronization aborted.\n\nPress ESC\n"), NULL, MM_NOTHING);
@@ -2047,7 +2066,7 @@ static void CL_ConnectToServer(boolean viams)
G_SetGamestate(GS_WAITINGPLAYERS);
wipegamestate = GS_WAITINGPLAYERS;
- adminplayer = -1;
+ ClearAdminPlayers();
pnumnodes = 1;
oldtic = I_GetTime() - 1;
#ifndef NONET
@@ -2424,8 +2443,10 @@ static void CL_RemovePlayer(INT32 playernum, INT32 reason)
// Reset the name
sprintf(player_names[playernum], "Player %d", playernum+1);
- if (playernum == adminplayer)
- adminplayer = -1; // don't stay admin after you're gone
+ if (IsPlayerAdmin(playernum))
+ {
+ 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
@@ -2543,7 +2564,7 @@ static void Command_Nodes(void)
if (I_GetNodeAddress && (address = I_GetNodeAddress(playernode[i])) != NULL)
CONS_Printf(" - %s", address);
- if (i == adminplayer)
+ if (IsPlayerAdmin(i))
CONS_Printf(M_GetText(" (verified admin)"));
if (players[i].spectator)
@@ -2568,7 +2589,7 @@ static void Command_Ban(void)
return;
}
- if (server || adminplayer == consoleplayer)
+ if (server || IsPlayerAdmin(consoleplayer))
{
UINT8 buf[3 + MAX_REASONLENGTH];
UINT8 *p = buf;
@@ -2634,7 +2655,7 @@ static void Command_Kick(void)
return;
}
- if (server || adminplayer == consoleplayer)
+ if (server || IsPlayerAdmin(consoleplayer))
{
UINT8 buf[3 + MAX_REASONLENGTH];
UINT8 *p = buf;
@@ -2643,13 +2664,16 @@ static void Command_Kick(void)
if (pn == -1 || pn == 0)
return;
- // Special case if we are trying to kick a player who is downloading the game state:
- // trigger a timeout instead of kicking them, because a kick would only
- // take effect after they have finished downloading
- if (sendingsavegame[playernode[pn]])
+ if (server)
{
- Net_ConnectionTimeout(playernode[pn]);
- return;
+ // Special case if we are trying to kick a player who is downloading the game state:
+ // trigger a timeout instead of kicking them, because a kick would only
+ // take effect after they have finished downloading
+ if (sendingsavegame[playernode[pn]])
+ {
+ Net_ConnectionTimeout(playernode[pn]);
+ return;
+ }
}
WRITESINT8(p, pn);
@@ -2692,7 +2716,7 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
pnum = READUINT8(*p);
msg = READUINT8(*p);
- if (pnum == serverplayer && playernum == adminplayer)
+ if (pnum == serverplayer && IsPlayerAdmin(playernum))
{
CONS_Printf(M_GetText("Server is being shut down remotely. Goodbye!\n"));
@@ -2703,7 +2727,7 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
}
// Is playernum authorized to make this kick?
- if (playernum != serverplayer && playernum != adminplayer
+ if (playernum != serverplayer && !IsPlayerAdmin(playernum)
&& !(playerpernode[playernode[playernum]] == 2
&& nodetoplayer2[playernode[playernum]] == pnum))
{
@@ -2752,7 +2776,7 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
msg = KICK_MSG_CON_FAIL;
}
- CONS_Printf("\x82%s ", player_names[pnum]);
+ //CONS_Printf("\x82%s ", player_names[pnum]);
// If a verified admin banned someone, the server needs to know about it.
// If the playernum isn't zero (the server) then the server needs to record the ban.
@@ -2769,17 +2793,17 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
switch (msg)
{
case KICK_MSG_GO_AWAY:
- CONS_Printf(M_GetText("has been kicked (Go away)\n"));
+ HU_AddChatText(va("\x82*%s has been kicked (Go away)", player_names[pnum]), false);
kickreason = KR_KICK;
break;
#ifdef NEWPING
case KICK_MSG_PING_HIGH:
- CONS_Printf(M_GetText("left the game (Broke ping limit)\n"));
+ HU_AddChatText(va("\x82*%s left the game (Broke ping limit)", player_names[pnum]), false);
kickreason = KR_PINGLIMIT;
break;
#endif
case KICK_MSG_CON_FAIL:
- CONS_Printf(M_GetText("left the game (Synch failure)\n"));
+ HU_AddChatText(va("\x82*%s left the game (Synch Failure)", player_names[pnum]), false);
kickreason = KR_SYNCH;
if (M_CheckParm("-consisdump")) // Helps debugging some problems
@@ -2816,26 +2840,26 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
}
break;
case KICK_MSG_TIMEOUT:
- CONS_Printf(M_GetText("left the game (Connection timeout)\n"));
+ HU_AddChatText(va("\x82*%s left the game (Connection timeout)", player_names[pnum]), false);
kickreason = KR_TIMEOUT;
break;
case KICK_MSG_PLAYER_QUIT:
if (netgame) // not splitscreen/bots
- CONS_Printf(M_GetText("left the game\n"));
+ HU_AddChatText(va("\x82*%s left the game", player_names[pnum]), false);
kickreason = KR_LEAVE;
break;
case KICK_MSG_BANNED:
- CONS_Printf(M_GetText("has been banned (Don't come back)\n"));
+ HU_AddChatText(va("\x82*%s has been banned (Don't come back)", player_names[pnum]), false);
kickreason = KR_BAN;
break;
case KICK_MSG_CUSTOM_KICK:
READSTRINGN(*p, reason, MAX_REASONLENGTH+1);
- CONS_Printf(M_GetText("has been kicked (%s)\n"), reason);
+ HU_AddChatText(va("\x82*%s has been kicked (%s)", player_names[pnum], reason), false);
kickreason = KR_KICK;
break;
case KICK_MSG_CUSTOM_BAN:
READSTRINGN(*p, reason, MAX_REASONLENGTH+1);
- CONS_Printf(M_GetText("has been banned (%s)\n"), reason);
+ HU_AddChatText(va("\x82*%s has been banned (%s)", player_names[pnum], reason), false);
kickreason = KR_BAN;
break;
}
@@ -2974,6 +2998,7 @@ void SV_ResetServer(void)
playeringame[i] = false;
playernode[i] = UINT8_MAX;
sprintf(player_names[i], "Player %d", i + 1);
+ adminplayers[i] = -1; // Populate the entire adminplayers array with -1.
}
mynode = 0;
@@ -3048,7 +3073,7 @@ void D_QuitNetGame(void)
}
D_CloseConnection();
- adminplayer = -1;
+ ClearAdminPlayers();
DEBFILE("===========================================================================\n"
" Log finish\n"
@@ -3079,7 +3104,7 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
INT16 node, newplayernum;
boolean splitscreenplayer;
- if (playernum != serverplayer && playernum != adminplayer)
+ if (playernum != serverplayer && !IsPlayerAdmin(playernum))
{
// protect against hacked/buggy client
CONS_Alert(CONS_WARNING, M_GetText("Illegal add player command received from %s\n"), player_names[playernum]);
@@ -3108,9 +3133,6 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
if (newplayernum+1 > doomcom->numslots)
doomcom->numslots = (INT16)(newplayernum+1);
- if (netgame)
- CONS_Printf(M_GetText("Player %d has joined the game (node %d)\n"), newplayernum+1, node);
-
// the server is creating my player
if (node == mynode)
{
@@ -3132,11 +3154,17 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
D_SendPlayerConfig();
addedtogame = true;
}
- else if (server && netgame && cv_showjoinaddress.value)
+
+ if (netgame)
{
- const char *address;
- if (I_GetNodeAddress && (address = I_GetNodeAddress(node)) != NULL)
- CONS_Printf(M_GetText("Player Address is %s\n"), address);
+ if (server && cv_showjoinaddress.value)
+ {
+ const char *address;
+ if (I_GetNodeAddress && (address = I_GetNodeAddress(node)) != NULL)
+ HU_AddChatText(va("\x82*Player %d has joined the game (node %d) (%s)", newplayernum+1, node, address), false); // merge join notification + IP to avoid clogging console/chat.
+ }
+ else
+ HU_AddChatText(va("\x82*Player %d has joined the game (node %d)", newplayernum+1, node), false); // if you don't wanna see the join address.
}
if (server && multiplayer && motd[0] != '\0')
@@ -3604,7 +3632,8 @@ static void HandlePacketFromAwayNode(SINT8 node)
maketic = gametic = neededtic = (tic_t)LONG(netbuffer->u.servercfg.gametic);
gametype = netbuffer->u.servercfg.gametype;
modifiedgame = netbuffer->u.servercfg.modifiedgame;
- adminplayer = netbuffer->u.servercfg.adminplayer;
+ for (j = 0; j < MAXPLAYERS; j++)
+ adminplayers[j] = netbuffer->u.servercfg.adminplayers[j];
memcpy(server_context, netbuffer->u.servercfg.server_context, 8);
}
diff --git a/src/d_clisrv.h b/src/d_clisrv.h
index d5edd79d7..4ed7ff957 100644
--- a/src/d_clisrv.h
+++ b/src/d_clisrv.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -291,7 +291,7 @@ typedef struct
UINT8 gametype;
UINT8 modifiedgame;
- SINT8 adminplayer; // Needs to be signed
+ SINT8 adminplayers[MAXPLAYERS]; // Needs to be signed
char server_context[8]; // Unique context id, generated at server startup.
@@ -439,9 +439,9 @@ extern doomdata_t *netbuffer;
extern consvar_t cv_playbackspeed;
-#define BASEPACKETSIZE ((size_t)&(((doomdata_t *)0)->u))
-#define FILETXHEADER ((size_t)((filetx_pak *)0)->data)
-#define BASESERVERTICSSIZE ((size_t)&(((doomdata_t *)0)->u.serverpak.cmds[0]))
+#define BASEPACKETSIZE offsetof(doomdata_t, u)
+#define FILETXHEADER offsetof(filetx_pak, data)
+#define BASESERVERTICSSIZE offsetof(doomdata_t, u.serverpak.cmds[0])
#define KICK_MSG_GO_AWAY 1
#define KICK_MSG_CON_FAIL 2
diff --git a/src/d_event.h b/src/d_event.h
index b0d0e3c58..e9374efaf 100644
--- a/src/d_event.h
+++ b/src/d_event.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/d_main.c b/src/d_main.c
index c7708acf1..c13a712df 100644
--- a/src/d_main.c
+++ b/src/d_main.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -160,6 +160,7 @@ void D_PostEvent_end(void) {};
UINT8 shiftdown = 0; // 0x1 left, 0x2 right
UINT8 ctrldown = 0; // 0x1 left, 0x2 right
UINT8 altdown = 0; // 0x1 left, 0x2 right
+boolean capslock = 0; // gee i wonder what this does.
//
// D_ModifierKeyResponder
// Sets global shift/ctrl/alt variables, never actually eats events
@@ -307,8 +308,7 @@ static void D_Display(void)
if (!gametic)
break;
HU_Erase();
- if (automapactive)
- AM_Drawer();
+ AM_Drawer();
break;
case GS_INTERMISSION:
@@ -863,25 +863,20 @@ static void IdentifyVersion(void)
#if !defined (HAVE_SDL) || defined (HAVE_MIXER)
{
- const char *musicfile = "music.dta";
- const char *musicpath = va(pandf,srb2waddir,musicfile);
- int ms = W_VerifyNMUSlumps(musicpath); // Don't forget the music!
- if (ms == 1)
- D_AddFile(musicpath);
- else if (ms == 0)
- I_Error("File %s has been modified with non-music lumps",musicfile);
- }
-#endif
+#define MUSICTEST(str) \
+ {\
+ const char *musicpath = va(pandf,srb2waddir,str);\
+ int ms = W_VerifyNMUSlumps(musicpath); \
+ if (ms == 1) \
+ D_AddFile(musicpath); \
+ else if (ms == 0) \
+ I_Error("File "str" has been modified with non-music/sound lumps"); \
+ }
-#ifdef DEVELOP // This section can be deleted when music_new is merged with music.dta
- {
- const char *musicfile = "music_new.dta";
- const char *musicpath = va(pandf,srb2waddir,musicfile);
- int ms = W_VerifyNMUSlumps(musicpath); // Don't forget the music!
- if (ms == 1)
- D_AddFile(musicpath);
- else if (ms == 0)
- I_Error("File %s has been modified with non-music lumps",musicfile);
+ MUSICTEST("music.dta")
+#ifdef DEVELOP // remove when music_new.dta is merged into music.dta
+ MUSICTEST("music_new.dta")
+#endif
}
#endif
}
@@ -954,6 +949,20 @@ void D_SRB2Main(void)
INT32 pstartmap = 1;
boolean autostart = false;
+ // Print GPL notice for our console users (Linux)
+ CONS_Printf(
+ "\n\nSonic Robo Blast 2\n"
+ "Copyright (C) 1998-2018 by Sonic Team Junior\n\n"
+ "This program comes with ABSOLUTELY NO WARRANTY.\n\n"
+ "This is free software, and you are welcome to redistribute it\n"
+ "and/or modify it under the terms of the GNU General Public License\n"
+ "as published by the Free Software Foundation; either version 2 of\n"
+ "the License, or (at your option) any later version.\n"
+ "See the 'LICENSE.txt' file for details.\n\n"
+ "Sonic the Hedgehog and related characters are trademarks of SEGA.\n"
+ "We do not claim ownership of SEGA's intellectual property used\n"
+ "in this program.\n\n");
+
// keep error messages until the final flush(stderr)
#if !defined (PC_DOS) && !defined(NOTERMIOS)
if (setvbuf(stderr, NULL, _IOFBF, 1000))
@@ -1128,27 +1137,37 @@ void D_SRB2Main(void)
#endif
D_CleanFile();
+ mainwads = 0;
+
#ifndef DEVELOP // md5s last updated 12/14/14
// Check MD5s of autoloaded files
- //W_VerifyFileMD5(0, ASSET_HASH_SRB2_PK3); // srb2.pk3
- //W_VerifyFileMD5(1, ASSET_HASH_ZONES_DTA); // zones.dta
- //W_VerifyFileMD5(2, ASSET_HASH_PLAYER_DTA); // player.dta
+ W_VerifyFileMD5(mainwads++, ASSET_HASH_SRB2_SRB); // srb2.srb/srb2.wad
+ W_VerifyFileMD5(mainwads++, ASSET_HASH_ZONES_DTA); // zones.dta
+ W_VerifyFileMD5(mainwads++, ASSET_HASH_PLAYER_DTA); // player.dta
+ W_VerifyFileMD5(mainwads++, ASSET_HASH_RINGS_DTA); // rings.dta
#ifdef USE_PATCH_DTA
- //W_VerifyFileMD5(3, ASSET_HASH_PATCH_PK3); // patch.pk3
+ W_VerifyFileMD5(mainwads++, ASSET_HASH_PATCH_DTA); // patch.dta
#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.srb/srb2.wad
+ mainwads++; // zones.dta
+ mainwads++; // player.dta
+ mainwads++; // rings.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
+
#endif //ifndef DEVELOP
- mainwads = 3; // there are 3 wads not to unload
-#ifdef USE_PATCH_DTA
- ++mainwads; // patch.pk3 adds one more
-#endif
-#ifdef DEVELOP
- ++mainwads; // music_new, too
-#endif
+ mainwadstally = packetsizetally;
mainwadstally = packetsizetally;
@@ -1226,7 +1245,7 @@ void D_SRB2Main(void)
else
{
if (M_CheckParm("-nomidimusic"))
- midi_disabled = true; ; // WARNING: DOS version initmusic in I_StartupSound
+ midi_disabled = true; // WARNING: DOS version initmusic in I_StartupSound
if (M_CheckParm("-nodigmusic"))
digital_disabled = true; // WARNING: DOS version initmusic in I_StartupSound
}
diff --git a/src/d_main.h b/src/d_main.h
index 4c9c99ea5..d67a5bb49 100644
--- a/src/d_main.h
+++ b/src/d_main.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/d_net.c b/src/d_net.c
index 2c0a8a329..9f68c187c 100644
--- a/src/d_net.c
+++ b/src/d_net.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -27,6 +27,7 @@
#include "d_clisrv.h"
#include "z_zone.h"
#include "i_tcp.h"
+#include "d_main.h" // srb2home
//
// NETWORKING
@@ -1369,12 +1370,12 @@ boolean D_CheckNetGame(void)
{
k++;
sprintf(filename, "debug%d.txt", k);
- debugfile = fopen(filename, "w");
+ debugfile = fopen(va("%s" PATHSEP "%s", srb2home, filename), "w");
}
if (debugfile)
- CONS_Printf(M_GetText("debug output to: %s\n"), filename);
+ CONS_Printf(M_GetText("debug output to: %s\n"), va("%s" PATHSEP "%s", srb2home, filename));
else
- CONS_Alert(CONS_WARNING, M_GetText("cannot debug output to file %s!\n"), filename);
+ CONS_Alert(CONS_WARNING, M_GetText("cannot debug output to file %s!\n"), va("%s" PATHSEP "%s", srb2home, filename));
}
#endif
diff --git a/src/d_net.h b/src/d_net.h
index 84814ce39..61c669dbb 100644
--- a/src/d_net.h
+++ b/src/d_net.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -22,6 +22,7 @@
#define MAXNETNODES 32
#define BROADCASTADDR MAXNETNODES
#define MAXSPLITSCREENPLAYERS 2 // Max number of players on a single computer
+//#define NETSPLITSCREEN // Kart's splitscreen netgame feature
#define STATLENGTH (TICRATE*2)
diff --git a/src/d_netcmd.c b/src/d_netcmd.c
index d17860243..4f4107c17 100644
--- a/src/d_netcmd.c
+++ b/src/d_netcmd.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -142,7 +142,9 @@ static void Command_Changepassword_f(void);
static void Command_Login_f(void);
static void Got_Login(UINT8 **cp, INT32 playernum);
static void Got_Verification(UINT8 **cp, INT32 playernum);
+static void Got_Removal(UINT8 **cp, INT32 playernum);
static void Command_Verify_f(void);
+static void Command_RemoveAdmin_f(void);
static void Command_MotD_f(void);
static void Got_MotD_f(UINT8 **cp, INT32 playernum);
@@ -244,9 +246,9 @@ INT32 cv_debug;
consvar_t cv_usemouse = {"use_mouse", "On", CV_SAVE|CV_CALL,usemouse_cons_t, I_StartupMouse, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_usemouse2 = {"use_mouse2", "Off", CV_SAVE|CV_CALL,usemouse_cons_t, I_StartupMouse2, 0, NULL, NULL, 0, 0, NULL};
-consvar_t cv_usejoystick = {"use_joystick", "0", CV_SAVE|CV_CALL, usejoystick_cons_t,
+consvar_t cv_usejoystick = {"use_joystick", "1", CV_SAVE|CV_CALL, usejoystick_cons_t,
I_InitJoystick, 0, NULL, NULL, 0, 0, NULL};
-consvar_t cv_usejoystick2 = {"use_joystick2", "0", CV_SAVE|CV_CALL, usejoystick_cons_t,
+consvar_t cv_usejoystick2 = {"use_joystick2", "2", CV_SAVE|CV_CALL, usejoystick_cons_t,
I_InitJoystick2, 0, NULL, NULL, 0, 0, NULL};
#if (defined (LJOYSTICK) || defined (HAVE_SDL))
#ifdef LJOYSTICK
@@ -366,7 +368,7 @@ consvar_t cv_sleep = {"cpusleep", "-1", CV_SAVE, sleeping_cons_t, NULL, -1, NULL
INT16 gametype = GT_COOP;
boolean splitscreen = false;
boolean circuitmap = false;
-INT32 adminplayer = -1;
+INT32 adminplayers[MAXPLAYERS];
/// \warning Keep this up-to-date if you add/remove/rename net text commands
const char *netxcmdnames[MAXNETXCMD - 1] =
@@ -435,8 +437,10 @@ void D_RegisterServerCommands(void)
COM_AddCommand("password", Command_Changepassword_f);
RegisterNetXCmd(XD_LOGIN, Got_Login);
COM_AddCommand("login", Command_Login_f); // useful in dedicated to kick off remote admin
- COM_AddCommand("verify", Command_Verify_f);
+ COM_AddCommand("promote", Command_Verify_f);
RegisterNetXCmd(XD_VERIFIED, Got_Verification);
+ COM_AddCommand("demote", Command_RemoveAdmin_f);
+ RegisterNetXCmd(XD_DEMOTED, Got_Removal);
COM_AddCommand("motd", Command_MotD_f);
RegisterNetXCmd(XD_SETMOTD, Got_MotD_f); // For remote admin
@@ -708,10 +712,20 @@ void D_RegisterClientCommands(void)
CV_RegisterVar(&cv_msaturation);
// m_menu.c
+ CV_RegisterVar(&cv_compactscoreboard);
+ CV_RegisterVar(&cv_chatheight);
+ CV_RegisterVar(&cv_chatwidth);
+ CV_RegisterVar(&cv_chattime);
+ CV_RegisterVar(&cv_chatspamprotection);
+ CV_RegisterVar(&cv_chatbacktint);
+ CV_RegisterVar(&cv_consolechat);
+ CV_RegisterVar(&cv_chatnotifications);
CV_RegisterVar(&cv_crosshair);
CV_RegisterVar(&cv_crosshair2);
CV_RegisterVar(&cv_alwaysfreelook);
CV_RegisterVar(&cv_alwaysfreelook2);
+ CV_RegisterVar(&cv_chasefreelook);
+ CV_RegisterVar(&cv_chasefreelook2);
CV_RegisterVar(&cv_tutorialprompt);
// g_input.c
@@ -1038,8 +1052,8 @@ static void SetPlayerName(INT32 playernum, char *newname)
if (strcasecmp(newname, player_names[playernum]) != 0)
{
if (netgame)
- CONS_Printf(M_GetText("%s renamed to %s\n"),
- player_names[playernum], newname);
+ HU_AddChatText(va("\x82*%s renamed to %s", player_names[playernum], newname), false);
+
strcpy(player_names[playernum], newname);
}
}
@@ -1064,7 +1078,11 @@ UINT8 CanChangeSkin(INT32 playernum)
return true;
// Force skin in effect.
+<<<<<<< HEAD
if ((cv_forceskin.value != -1) || (mapheaderinfo[gamemap-1] && mapheaderinfo[gamemap-1]->forcecharacter[0] != '\0'))
+=======
+ if (client && (cv_forceskin.value != -1) && !(IsPlayerAdmin(playernum) && serverplayer == -1))
+>>>>>>> public_next-20190101
return false;
// Can change skin in intermission and whatnot.
@@ -1217,7 +1235,7 @@ static void SendNameAndColor(void)
snacpending++;
// Don't change name if muted
- if (cv_mute.value && !(server || adminplayer == consoleplayer))
+ if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer)))
CV_StealthSet(&cv_playername, player_names[consoleplayer]);
else // Cleanup name if changing it
CleanupPlayerName(consoleplayer, cv_playername.zstring);
@@ -1653,7 +1671,7 @@ void D_MapChange(INT32 mapnum, INT32 newgametype, boolean pultmode, boolean rese
mapchangepending = 0;
// spawn the server if needed
// reset players if there is a new one
- if (!(adminplayer == consoleplayer))
+ if (!IsPlayerAdmin(consoleplayer))
{
if (SV_SpawnServer())
buf[0] &= ~(1<<1);
@@ -1711,7 +1729,7 @@ static void Command_Map_f(void)
return;
}
- if (client && !(adminplayer == consoleplayer))
+ if (client && !IsPlayerAdmin(consoleplayer))
{
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
return;
@@ -1835,8 +1853,11 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
UINT8 flags;
INT32 resetplayer = 1, lastgametype;
UINT8 skipprecutscene, FLS;
+#ifdef HAVE_BLUA
+ INT16 mapnumber;
+#endif
- if (playernum != serverplayer && playernum != adminplayer)
+ if (playernum != serverplayer && !IsPlayerAdmin(playernum))
{
CONS_Alert(CONS_WARNING, M_GetText("Illegal map change received from %s\n"), player_names[playernum]);
if (server)
@@ -1882,6 +1903,10 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
mapname, resetplayer, lastgametype, gametype, chmappending));
CONS_Printf(M_GetText("Speeding off to level...\n"));
}
+
+ CON_ToggleOff();
+ CON_ClearHUD();
+
if (demoplayback && !timingdemo)
precache = false;
@@ -1896,13 +1921,13 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
}
#ifdef HAVE_BLUA
- LUAh_MapChange();
+ mapnumber = M_MapNumber(mapname[3], mapname[4]);
+ LUAh_MapChange(mapnumber);
#endif
G_InitNew(ultimatemode, mapname, resetplayer, skipprecutscene, FLS);
if (demoplayback && !timingdemo)
precache = true;
- CON_ToggleOff();
if (timingdemo)
G_DoneLevelLoad();
@@ -1928,7 +1953,7 @@ static void Command_Pause(void)
else
WRITEUINT8(cp, 0);
- if (cv_pause.value || server || (adminplayer == consoleplayer))
+ if (cv_pause.value || server || (IsPlayerAdmin(consoleplayer)))
{
if (modeattacking || !(gamestate == GS_LEVEL || gamestate == GS_INTERMISSION))
{
@@ -1946,7 +1971,7 @@ static void Got_Pause(UINT8 **cp, INT32 playernum)
UINT8 dedicatedpause = false;
const char *playername;
- if (netgame && !cv_pause.value && playernum != serverplayer && playernum != adminplayer)
+ if (netgame && !cv_pause.value && playernum != serverplayer && !IsPlayerAdmin(playernum))
{
CONS_Alert(CONS_WARNING, M_GetText("Illegal pause command received from %s\n"), player_names[playernum]);
if (server)
@@ -2075,7 +2100,7 @@ static void Got_RandomSeed(UINT8 **cp, INT32 playernum)
*/
static void Command_Clearscores_f(void)
{
- if (!(server || (adminplayer == consoleplayer)))
+ if (!(server || (IsPlayerAdmin(consoleplayer))))
return;
SendNetXCmd(XD_CLEARSCORES, NULL, 1);
@@ -2095,7 +2120,7 @@ static void Got_Clearscores(UINT8 **cp, INT32 playernum)
INT32 i;
(void)cp;
- if (playernum != serverplayer && playernum != adminplayer)
+ if (playernum != serverplayer && !IsPlayerAdmin(playernum))
{
CONS_Alert(CONS_WARNING, M_GetText("Illegal clear scores command received from %s\n"), player_names[playernum]);
if (server)
@@ -2316,7 +2341,7 @@ static void Command_ServerTeamChange_f(void)
UINT16 usvalue;
NetPacket.value.l = NetPacket.value.b = 0;
- if (!(server || (adminplayer == consoleplayer)))
+ if (!(server || (IsPlayerAdmin(consoleplayer))))
{
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
return;
@@ -2463,7 +2488,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
if (NetPacket.packet.verification) // Special marker that the server sent the request
{
- if (playernum != serverplayer && (playernum != adminplayer))
+ if (playernum != serverplayer && (!IsPlayerAdmin(playernum)))
{
CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]);
if (server)
@@ -2502,7 +2527,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
}
else
{
- if (playernum != serverplayer && (playernum != adminplayer))
+ if (playernum != serverplayer && (!IsPlayerAdmin(playernum)))
{
CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]);
if (server)
@@ -2824,13 +2849,56 @@ static void Got_Login(UINT8 **cp, INT32 playernum)
if (!memcmp(sentmd5, finalmd5, 16))
{
CONS_Printf(M_GetText("%s passed authentication.\n"), player_names[playernum]);
- COM_BufInsertText(va("verify %d\n", playernum)); // do this immediately
+ COM_BufInsertText(va("promote %d\n", playernum)); // do this immediately
}
else
CONS_Printf(M_GetText("Password from %s failed.\n"), player_names[playernum]);
#endif
}
+boolean IsPlayerAdmin(INT32 playernum)
+{
+ INT32 i;
+ for (i = 0; i < MAXPLAYERS; i++)
+ if (playernum == adminplayers[i])
+ return true;
+
+ return false;
+}
+
+void SetAdminPlayer(INT32 playernum)
+{
+ INT32 i;
+ for (i = 0; i < MAXPLAYERS; i++)
+ {
+ if (playernum == adminplayers[i])
+ return; // Player is already admin
+
+ if (adminplayers[i] == -1)
+ {
+ adminplayers[i] = playernum; // Set the player to a free spot
+ break; // End the loop now. If it keeps going, the same player might get assigned to two slots.
+ }
+
+
+ }
+}
+
+void ClearAdminPlayers(void)
+{
+ INT32 i;
+ for (i = 0; i < MAXPLAYERS; i++)
+ adminplayers[i] = -1;
+}
+
+void RemoveAdminPlayer(INT32 playernum)
+{
+ INT32 i;
+ for (i = 0; i < MAXPLAYERS; i++)
+ if (playernum == adminplayers[i])
+ adminplayers[i] = -1;
+}
+
static void Command_Verify_f(void)
{
char buf[8]; // Should be plenty
@@ -2851,7 +2919,7 @@ static void Command_Verify_f(void)
if (COM_Argc() != 2)
{
- CONS_Printf(M_GetText("verify : give admin privileges to a node\n"));
+ CONS_Printf(M_GetText("promote : give admin privileges to a node\n"));
return;
}
@@ -2885,7 +2953,7 @@ static void Got_Verification(UINT8 **cp, INT32 playernum)
return;
}
- adminplayer = num;
+ SetAdminPlayer(num);
if (num != consoleplayer)
return;
@@ -2893,6 +2961,62 @@ static void Got_Verification(UINT8 **cp, INT32 playernum)
CONS_Printf(M_GetText("You are now a server administrator.\n"));
}
+static void Command_RemoveAdmin_f(void)
+{
+ XBOXSTATIC char buf[8]; // Should be plenty
+ char *temp;
+ INT32 playernum;
+
+ if (client)
+ {
+ CONS_Printf(M_GetText("Only the server can use this.\n"));
+ return;
+ }
+
+ if (COM_Argc() != 2)
+ {
+ CONS_Printf(M_GetText("demote : remove admin privileges from a node\n"));
+ return;
+ }
+
+ strlcpy(buf, COM_Argv(1), sizeof(buf));
+
+ playernum = atoi(buf);
+
+ temp = buf;
+
+ WRITEUINT8(temp, playernum);
+
+ if (playeringame[playernum])
+ SendNetXCmd(XD_DEMOTED, buf, 1);
+}
+
+static void Got_Removal(UINT8 **cp, INT32 playernum)
+{
+ INT16 num = READUINT8(*cp);
+
+ if (playernum != serverplayer) // it's not from the server (hacker or bug)
+ {
+ CONS_Alert(CONS_WARNING, M_GetText("Illegal demotion received from %s (serverplayer is %s)\n"), player_names[playernum], player_names[serverplayer]);
+ if (server)
+ {
+ XBOXSTATIC UINT8 buf[2];
+
+ buf[0] = (UINT8)playernum;
+ buf[1] = KICK_MSG_CON_FAIL;
+ SendNetXCmd(XD_KICK, &buf, 2);
+ }
+ return;
+ }
+
+ RemoveAdminPlayer(num);
+
+ if (num != consoleplayer)
+ return;
+
+ CONS_Printf(M_GetText("You are no longer a server administrator.\n"));
+}
+
static void Command_MotD_f(void)
{
size_t i, j;
@@ -2904,7 +3028,7 @@ static void Command_MotD_f(void)
return;
}
- if (!(server || (adminplayer == consoleplayer)))
+ if (!(server || (IsPlayerAdmin(consoleplayer))))
{
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
return;
@@ -2928,7 +3052,7 @@ static void Command_MotD_f(void)
}
if ((netgame || multiplayer) && client)
- SendNetXCmd(XD_SETMOTD, mymotd, sizeof(motd));
+ SendNetXCmd(XD_SETMOTD, mymotd, i); // send the actual size of the motd string, not the full buffer's size
else
{
strcpy(motd, mymotd);
@@ -2951,7 +3075,7 @@ static void Got_MotD_f(UINT8 **cp, INT32 playernum)
if (!isprint(mymotd[i]) || mymotd[i] == ';')
kick = true;
- if ((playernum != serverplayer && playernum != adminplayer) || kick)
+ if ((playernum != serverplayer && !IsPlayerAdmin(playernum)) || kick)
{
CONS_Alert(CONS_WARNING, M_GetText("Illegal motd change received from %s\n"), player_names[playernum]);
if (server)
@@ -2988,7 +3112,7 @@ static void Command_RunSOC(void)
else
fn = COM_Argv(1);
- if (netgame && !(server || consoleplayer == adminplayer))
+ if (netgame && !(server || IsPlayerAdmin(consoleplayer)))
{
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
return;
@@ -3014,7 +3138,7 @@ static void Got_RunSOCcmd(UINT8 **cp, INT32 playernum)
char filename[256];
filestatus_t ncs = FS_NOTFOUND;
- if (playernum != serverplayer && playernum != adminplayer)
+ if (playernum != serverplayer && !IsPlayerAdmin(playernum))
{
CONS_Alert(CONS_WARNING, M_GetText("Illegal runsoc command received from %s\n"), player_names[playernum]);
if (server)
@@ -3085,7 +3209,7 @@ static void Command_Addfile(void)
if (!musiconly)
{
// ... But only so long as they contain nothing more then music and sprites.
- if (netgame && !(server || adminplayer == consoleplayer))
+ if (netgame && !(server || IsPlayerAdmin(consoleplayer)))
{
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
return;
@@ -3148,7 +3272,7 @@ static void Command_Addfile(void)
WRITEMEM(buf_p, md5sum, 16);
}
- if (adminplayer == consoleplayer && (!server)) // Request to add file
+ if (IsPlayerAdmin(consoleplayer) && (!server)) // Request to add file
SendNetXCmd(XD_REQADDFILE, buf, buf_p - buf);
else
SendNetXCmd(XD_ADDFILE, buf, buf_p - buf);
@@ -3161,7 +3285,15 @@ static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum)
UINT8 md5sum[16];
boolean kick = false;
boolean toomany = false;
+<<<<<<< HEAD
INT32 i;
+=======
+ INT32 i,j;
+ serverinfo_pak *dummycheck = NULL;
+
+ // Shut the compiler up.
+ (void)dummycheck;
+>>>>>>> public_next-20190101
READSTRINGN(*cp, filename, 240);
READMEM(*cp, md5sum, 16);
@@ -3175,7 +3307,7 @@ static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum)
if (!isprint(filename[i]) || filename[i] == ';')
kick = true;
- if ((playernum != serverplayer && playernum != adminplayer) || kick)
+ if ((playernum != serverplayer && !IsPlayerAdmin(playernum)) || kick)
{
UINT8 buf[2];
@@ -3209,8 +3341,9 @@ static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum)
CONS_Printf("%s",message);
- if (adminplayer)
- COM_BufAddText(va("sayto %d %s", adminplayer, message));
+ for (j = 0; j < MAXPLAYERS; j++)
+ if (adminplayers[j])
+ COM_BufAddText(va("sayto %d %s", adminplayers[j], message));
return;
}
@@ -3300,10 +3433,56 @@ static void Command_ListWADS_f(void)
static void Command_Version_f(void)
{
#ifdef DEVELOP
- CONS_Printf("Sonic Robo Blast 2 %s-%s (%s %s)\n", compbranch, comprevision, compdate, comptime);
+ CONS_Printf("Sonic Robo Blast 2 %s-%s (%s %s) ", compbranch, comprevision, compdate, comptime);
#else
- CONS_Printf("Sonic Robo Blast 2 %s (%s %s %s)\n", VERSIONSTRING, compdate, comptime, comprevision);
+ CONS_Printf("Sonic Robo Blast 2 %s (%s %s %s) ", VERSIONSTRING, compdate, comptime, comprevision);
#endif
+
+ // Base library
+#if defined( HAVE_SDL)
+ CONS_Printf("SDL ");
+#elif defined(_WINDOWS)
+ CONS_Printf("DD ");
+#endif
+
+ // OS
+ // Would be nice to use SDL_GetPlatform for this
+#if defined (_WIN32) || defined (_WIN64)
+ CONS_Printf("Windows ");
+#elif defined(__linux__)
+ CONS_Printf("Linux ");
+#elif defined(MACOSX)
+ CONS_Printf("macOS ");
+#elif defined(UNIXCOMMON)
+ CONS_Printf("Unix (Common) ");
+#else
+ CONS_Printf("Other OS ");
+#endif
+
+ // Bitness
+ if (sizeof(void*) == 4)
+ CONS_Printf("32-bit ");
+ else if (sizeof(void*) == 8)
+ CONS_Printf("64-bit ");
+ else // 16-bit? 128-bit?
+ CONS_Printf("Bits Unknown ");
+
+ // No ASM?
+#ifdef NOASM
+ CONS_Printf("\x85" "NOASM " "\x80");
+#endif
+
+ // Debug build
+#ifdef _DEBUG
+ CONS_Printf("\x85" "DEBUG " "\x80");
+#endif
+
+ // DEVELOP build
+#ifdef DEVELOP
+ CONS_Printf("\x87" "DEVELOP " "\x80");
+#endif
+
+ CONS_Printf("\n");
}
#ifdef UPDATE_ALERT
@@ -3671,7 +3850,7 @@ void D_GameTypeChanged(INT32 lastgametype)
if (playeringame[i])
players[i].ctfteam = 0;
- if (server || (adminplayer == consoleplayer))
+ if (server || (IsPlayerAdmin(consoleplayer)))
{
CV_StealthSetValue(&cv_teamscramble, 0);
teamscramble = 0;
@@ -3754,7 +3933,7 @@ static void TeamScramble_OnChange(void)
if (!cv_teamscramble.value)
teamscramble = 0;
- if (!G_GametypeHasTeams() && (server || consoleplayer == adminplayer))
+ if (!G_GametypeHasTeams() && (server || IsPlayerAdmin(consoleplayer)))
{
CONS_Alert(CONS_NOTICE, M_GetText("This command cannot be used in this gametype.\n"));
CV_StealthSetValue(&cv_teamscramble, 0);
@@ -3930,7 +4109,7 @@ static void Command_ExitLevel_f(void)
{
if (!(netgame || (multiplayer && gametype != GT_COOP)) && !cv_debug)
CONS_Printf(M_GetText("This only works in a netgame.\n"));
- else if (!(server || (adminplayer == consoleplayer)))
+ else if (!(server || (IsPlayerAdmin(consoleplayer))))
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
else if (gamestate != GS_LEVEL || demoplayback)
CONS_Printf(M_GetText("You must be in a level to use this.\n"));
@@ -3946,7 +4125,7 @@ static void Got_ExitLevelcmd(UINT8 **cp, INT32 playernum)
if (gameaction == ga_completed)
return;
- if (playernum != serverplayer && playernum != adminplayer)
+ if (playernum != serverplayer && !IsPlayerAdmin(playernum))
{
CONS_Alert(CONS_WARNING, M_GetText("Illegal exitlevel command received from %s\n"), player_names[playernum]);
if (server)
@@ -4054,7 +4233,7 @@ static void Command_Cheats_f(void)
{
if (COM_CheckParm("off"))
{
- if (!(server || (adminplayer == consoleplayer)))
+ if (!(server || (IsPlayerAdmin(consoleplayer))))
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
else
CV_ResetCheatNetVars();
@@ -4064,7 +4243,7 @@ static void Command_Cheats_f(void)
if (CV_CheatsEnabled())
{
CONS_Printf(M_GetText("At least one CHEAT-marked variable has been changed -- Cheats are enabled.\n"));
- if (server || (adminplayer == consoleplayer))
+ if (server || (IsPlayerAdmin(consoleplayer)))
CONS_Printf(M_GetText("Type CHEATS OFF to reset all cheat variables to default.\n"));
}
else
@@ -4133,6 +4312,23 @@ static void Command_Archivetest_f(void)
*/
static void ForceSkin_OnChange(void)
{
+<<<<<<< HEAD
+=======
+ if ((server || IsPlayerAdmin(consoleplayer)) && (cv_forceskin.value < -1 || cv_forceskin.value >= numskins))
+ {
+ if (cv_forceskin.value == -2)
+ CV_SetValue(&cv_forceskin, numskins-1);
+ else
+ {
+ // hack because I can't restrict this and still allow added skins to be used with forceskin.
+ if (!menuactive)
+ CONS_Printf(M_GetText("Valid skin numbers are 0 to %d (-1 disables)\n"), numskins - 1);
+ CV_SetValue(&cv_forceskin, -1);
+ }
+ return;
+ }
+
+>>>>>>> public_next-20190101
// NOT in SP, silly!
if (!(netgame || multiplayer))
return;
@@ -4149,7 +4345,7 @@ static void ForceSkin_OnChange(void)
//Allows the player's name to be changed if cv_mute is off.
static void Name_OnChange(void)
{
- if (cv_mute.value && !(server || adminplayer == consoleplayer))
+ if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer)))
{
CONS_Alert(CONS_NOTICE, M_GetText("You may not change your name when chat is muted.\n"));
CV_StealthSet(&cv_playername, player_names[consoleplayer]);
@@ -4272,7 +4468,7 @@ static void Color2_OnChange(void)
*/
static void Mute_OnChange(void)
{
- if (server || (adminplayer == consoleplayer))
+ if (server || (IsPlayerAdmin(consoleplayer)))
return;
if (cv_mute.value)
diff --git a/src/d_netcmd.h b/src/d_netcmd.h
index 3ffa3f3f1..d9889d979 100644
--- a/src/d_netcmd.h
+++ b/src/d_netcmd.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -137,9 +137,10 @@ typedef enum
XD_DELFILE, // 18 - replace next time we add an XD
XD_SETMOTD, // 19
XD_SUICIDE, // 20
+ XD_DEMOTED, // 21
#ifdef HAVE_BLUA
- XD_LUACMD, // 21
- XD_LUAVAR, // 22
+ XD_LUACMD, // 22
+ XD_LUAVAR, // 23
#endif
MAXNETXCMD
} netxcmd_t;
@@ -194,6 +195,10 @@ void Command_ExitGame_f(void);
void Command_Retry_f(void);
void D_GameTypeChanged(INT32 lastgametype); // not a real _OnChange function anymore
void D_MapChange(INT32 pmapnum, INT32 pgametype, boolean pultmode, boolean presetplayers, INT32 pdelay, boolean pskipprecutscene, boolean pfromlevelselect);
+boolean IsPlayerAdmin(INT32 playernum);
+void SetAdminPlayer(INT32 playernum);
+void ClearAdminPlayers(void);
+void RemoveAdminPlayer(INT32 playernum);
void ItemFinder_OnChange(void);
void D_SetPassword(const char *pw);
diff --git a/src/d_netfil.c b/src/d_netfil.c
index 92ecab950..db9fa12e4 100644
--- a/src/d_netfil.c
+++ b/src/d_netfil.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/d_netfil.h b/src/d_netfil.h
index 28d9d5a63..3d7c2ed59 100644
--- a/src/d_netfil.h
+++ b/src/d_netfil.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/d_player.h b/src/d_player.h
index 0b271ec2f..e68992e15 100644
--- a/src/d_player.h
+++ b/src/d_player.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/d_think.h b/src/d_think.h
index 2831b9f2b..b907c17fd 100644
--- a/src/d_think.h
+++ b/src/d_think.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/d_ticcmd.h b/src/d_ticcmd.h
index 83f684b6f..1ea015439 100644
--- a/src/d_ticcmd.h
+++ b/src/d_ticcmd.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/dehacked.c b/src/dehacked.c
index d844097b6..cb05b8d06 100644
--- a/src/dehacked.c
+++ b/src/dehacked.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -1216,6 +1216,19 @@ static void readlevelheader(MYFILE *f, INT32 num)
else if (fastcmp(word, "MAXBONUSLIVES"))
mapheaderinfo[num-1]->maxbonuslives = (SINT8)i;
+
+ else if (fastcmp(word, "SAVEOVERRIDE"))
+ {
+ if (fastcmp(word2, "DEFAULT")) i = SAVE_DEFAULT;
+ else if (fastcmp(word2, "ALWAYS")) i = SAVE_ALWAYS;
+ else if (fastcmp(word2, "NEVER")) i = SAVE_NEVER;
+
+ if (i >= SAVE_NEVER && i <= SAVE_ALWAYS)
+ mapheaderinfo[num-1]->saveoverride = (SINT8)i;
+ else
+ deh_warning("Level header %d: invalid save override number %d", num, i);
+ }
+
else if (fastcmp(word, "LEVELFLAGS"))
mapheaderinfo[num-1]->levelflags = (UINT8)i;
else if (fastcmp(word, "MENUFLAGS"))
@@ -3138,7 +3151,7 @@ static void readmaincfg(MYFILE *f)
}
else if (fastcmp(word, "LOOPTITLE"))
{
- looptitle = (boolean)(value || word2[0] == 'T' || word2[0] == 'Y');
+ looptitle = (value || word2[0] == 'T' || word2[0] == 'Y');
titlechanged = true;
}
else if (fastcmp(word, "TITLEMAP"))
@@ -3174,7 +3187,7 @@ static void readmaincfg(MYFILE *f)
}
else if (fastcmp(word, "DISABLESPEEDADJUST"))
{
- disableSpeedAdjust = (UINT8)get_number(word2);
+ disableSpeedAdjust = (value || word2[0] == 'T' || word2[0] == 'Y');
}
else if (fastcmp(word, "NUMDEMOS"))
{
@@ -3219,7 +3232,7 @@ static void readmaincfg(MYFILE *f)
strncpy(timeattackfolder, gamedatafilename, min(filenamelen, sizeof (timeattackfolder)));
timeattackfolder[min(filenamelen, sizeof (timeattackfolder) - 1)] = '\0';
- strncpy(savegamename, timeattackfolder, strlen(timeattackfolder));
+ strcpy(savegamename, timeattackfolder);
strlcat(savegamename, "%u.ssg", sizeof(savegamename));
// can't use sprintf since there is %u in savegamename
strcatbf(savegamename, srb2home, PATHSEP);
@@ -7881,6 +7894,11 @@ struct {
{"LF2_NOVISITNEEDED",LF2_NOVISITNEEDED},
{"LF2_WIDEICON",LF2_WIDEICON},
+ // Save override
+ {"SAVE_NEVER",SAVE_NEVER},
+ {"SAVE_DEFAULT",SAVE_DEFAULT},
+ {"SAVE_ALWAYS",SAVE_ALWAYS},
+
// NiGHTS grades
{"GRADE_F",GRADE_F},
{"GRADE_E",GRADE_E},
@@ -9248,10 +9266,11 @@ static inline int lib_getenum(lua_State *L)
return 0;
LUA_PushUserdata(L, &players[serverplayer], META_PLAYER);
return 1;
- } else if (fastcmp(word,"admin")) {
- if (!playeringame[adminplayer] || adminplayer == serverplayer)
+ } 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[adminplayer], META_PLAYER);
+ LUA_PushUserdata(L, &players[adminplayers[0]], META_PLAYER);
return 1;
} else if (fastcmp(word,"emeralds")) {
lua_pushinteger(L, emeralds);
@@ -9266,7 +9285,6 @@ static inline int lib_getenum(lua_State *L)
lua_pushinteger(L, token);
return 1;
}
-
return 0;
}
diff --git a/src/dehacked.h b/src/dehacked.h
index dfce996a2..93d39aee2 100644
--- a/src/dehacked.h
+++ b/src/dehacked.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/djgppdos/rdb-s.h b/src/djgppdos/rdb-s.h
index 6202dacfa..7a6d8be3c 100644
--- a/src/djgppdos/rdb-s.h
+++ b/src/djgppdos/rdb-s.h
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// Copyright (C) 2005 by Sonic Team Jr.
+// Copyright (C) 2005-2018 by Sonic Team Jr.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
diff --git a/src/doomdata.h b/src/doomdata.h
index 5ee39c5a8..2b9472569 100644
--- a/src/doomdata.h
+++ b/src/doomdata.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/doomdef.h b/src/doomdef.h
index 2981fecf6..9ef1a43f0 100644
--- a/src/doomdef.h
+++ b/src/doomdef.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -150,6 +150,9 @@ extern FILE *logstream;
// Comment or uncomment this as necessary.
#define USE_PATCH_DTA
+// Use .kart extension addons
+//#define USE_KART
+
// Modification options
// If you want to take advantage of the Master Server's ability to force clients to update
// to the latest version, fill these out. Otherwise, just comment out UPDATE_ALERT and leave
@@ -203,7 +206,21 @@ extern FILE *logstream;
// 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.
// Note that we use this to help keep internal testing in check; this is why v2.1.0 is not version "1".
-#define MODVERSION 25
+#define MODVERSION 28
+
+// To version config.cfg, MAJOREXECVERSION is set equal to MODVERSION automatically.
+// Increment MINOREXECVERSION whenever a config change is needed that does not correspond
+// to an increment in MODVERSION. This might never happen in practice.
+// If MODVERSION increases, set MINOREXECVERSION to 0.
+#define MAJOREXECVERSION MODVERSION
+#define MINOREXECVERSION 0
+// (It would have been nice to use VERSION and SUBVERSION but those are zero'd out for DEVELOP builds)
+
+// Macros
+#define GETMAJOREXECVERSION(v) (v & 0xFFFF)
+#define GETMINOREXECVERSION(v) (v >> 16)
+#define GETEXECVERSION(major,minor) (major + (minor << 16))
+#define EXECVERSION GETEXECVERSION(MAJOREXECVERSION, MINOREXECVERSION)
// =========================================================================
@@ -464,6 +481,7 @@ extern INT32 cv_debug;
// Modifier key variables, accessible anywhere
extern UINT8 shiftdown, ctrldown, altdown;
+extern boolean capslock;
// if we ever make our alloc stuff...
#define ZZ_Alloc(x) Z_Malloc(x, PU_STATIC, NULL)
@@ -478,6 +496,15 @@ INT32 I_GetKey(void);
#define max(x, y) (((x) > (y)) ? (x) : (y))
#endif
+// Floating point comparison epsilons from float.h
+#ifndef FLT_EPSILON
+#define FLT_EPSILON 1.1920928955078125e-7f
+#endif
+
+#ifndef DBL_EPSILON
+#define DBL_EPSILON 2.2204460492503131e-16
+#endif
+
// An assert-type mechanism.
#ifdef PARANOIA
#define I_Assert(e) ((e) ? (void)0 : I_Error("assert failed: %s, file %s, line %d", #e, __FILE__, __LINE__))
diff --git a/src/doomstat.h b/src/doomstat.h
index 337eff7a9..f36883d8a 100644
--- a/src/doomstat.h
+++ b/src/doomstat.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -304,6 +304,7 @@ typedef struct
UINT8 levelselect; ///< Is this map available in the level select? If so, which map list is it available in?
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 saveoverride; ///< Set how the game is allowed to save (1 for always, -1 for never, 0 is 2.1 default)
UINT8 levelflags; ///< LF_flags: merged eight booleans into one UINT8 for space, see below
UINT8 menuflags; ///< LF2_flags: options that affect record attack / nights mode menus
@@ -339,6 +340,11 @@ typedef struct
#define LF2_NOVISITNEEDED 16 ///< Available in time attack/nights mode without visiting the level
#define LF2_WIDEICON 32 ///< If you're in a circumstance where it fits, use a wide map icon
+// Save override
+#define SAVE_NEVER -1
+#define SAVE_DEFAULT 0
+#define SAVE_ALWAYS 1
+
extern mapheader_t* mapheaderinfo[NUMMAPS];
enum TypeOfLevel
@@ -562,7 +568,8 @@ extern consvar_t cv_showinputjoy; // display joystick in time attack
extern consvar_t cv_forceskin; // force clients to use the server's skin
extern consvar_t cv_downloading; // allow clients to downloading WADs.
extern ticcmd_t netcmds[BACKUPTICS][MAXPLAYERS];
-extern INT32 adminplayer, serverplayer;
+extern INT32 serverplayer;
+extern INT32 adminplayers[MAXPLAYERS];
/// \note put these in d_clisrv outright?
diff --git a/src/doomtype.h b/src/doomtype.h
index 741b68c21..48a10a19a 100644
--- a/src/doomtype.h
+++ b/src/doomtype.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/endian.h b/src/endian.h
index 2b876e7cb..d3c1cb18b 100644
--- a/src/endian.h
+++ b/src/endian.h
@@ -1,6 +1,6 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
-// Copyright (C) 2014-2016 by Sonic Team Junior.
+// Copyright (C) 2014-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/f_finale.c b/src/f_finale.c
index 1212fcdcb..f4d7a32f1 100644
--- a/src/f_finale.c
+++ b/src/f_finale.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -1015,6 +1015,8 @@ static const char *credits[] = {
"Callum Dickinson",
"Scott \"Graue\" Feeney",
"Nathan \"Jazz\" Giroux",
+ "Vivian \"toaster\" Grannell",
+ "Kepa \"Nev3r\" Iceta",
"Thomas \"Shadow Hog\" Igoe",
"Iestyn \"Monster Iestyn\" Jealous",
"Ronald \"Furyhunter\" Kinard", // The SDL2 port
@@ -1022,6 +1024,7 @@ static const char *credits[] = {
"Ehab \"Wolfy\" Saeed",
"\"Kaito Sinclaire\"",
"\"SSNTails\"",
+ "Marco \"mazmazz\" Zafra",
"",
"\1Programming",
"\1Assistance",
@@ -1029,15 +1032,21 @@ static const char *credits[] = {
"Andrew \"orospakr\" Clunis",
"Gregor \"Oogaland\" Dick",
"Louis-Antoine \"LJSonic\" de Moulins", // for fixing 2.1's netcode (de Rochefort doesn't quite fit on the screen sorry lol)
- "Vivian \"toaster\" Grannell",
"Julio \"Chaos Zero 64\" Guir",
+ "\"Jimita\"",
"\"Kalaron\"", // Coded some of Sryder13's collection of OpenGL fixes, especially fog
+ "\"Lat'\"", // SRB2-CHAT, the chat window from Kart
"Matthew \"Shuffle\" Marsalko",
"Steven \"StroggOnMeth\" McGranahan",
"\"Morph\"", // For SRB2Morphed stuff
"Colin \"Sonict\" Pfaff",
"Sean \"Sryder13\" Ryder",
+ "Tasos \"tatokis\" Sahanidis", // Corrected C FixedMul, making 64-bit builds netplay compatible
+ "\"Steel Titanium\"",
"Ben \"Cue\" Woodford",
+ // Git contributors with 5+ approved merges of substantive quality,
+ // or contributors with at least one groundbreaking merge, may be named.
+ // Everyone else is acknowledged under "Special Thanks > SRB2 Community Contributors".
"",
"\1Sprite Artists",
"Odi \"Iceman404\" Atunzu",
@@ -1086,13 +1095,13 @@ static const char *credits[] = {
"Thomas \"Shadow Hog\" Igoe",
"Erik \"Torgo\" Nielsen",
"\"Kaito Sinclaire\"",
- "Wessel \"Spherallic\" Smit",
+ "Wessel \"sphere\" Smit",
"\"Spazzo\"",
"\"SSNTails\"",
"Rob Tisdell",
"Jarrett \"JEV3\" Voight",
"Johnny \"Sonikku\" Wallbank",
- "Marco \"Digiku\" Zafra",
+ "Marco \"mazmazz\" Zafra",
"",
"\1Boss Design",
"Ben \"Mystic\" Geyer",
@@ -1113,11 +1122,17 @@ static const char *credits[] = {
"Bill \"Tets\" Reed",
"",
"\1Special Thanks",
- "Doom Legacy Project",
"iD Software",
- "Alex \"MistaED\" Fuller",
+ "Doom Legacy Project",
"FreeDoom Project", // Used some of the mancubus and rocket launcher sprites for Brak
+ "Alex \"MistaED\" Fuller",
+ "Pascal \"CodeImp\" vd Heiden", // Doom Builder developer
"Randi Heit ()", // For their MSPaint sprite that we nicked
+ "Simon \"sirjuddington\" Judd", // SLADE developer
+ // Acknowledged here are the following:
+ // Minor merge request authors, see guideline above
+ // Golden - Expanded thin font
+ "SRB2 Community Contributors",
"",
"\1Produced By",
"Sonic Team Junior",
@@ -1190,6 +1205,9 @@ void F_CreditDrawer(void)
for (i = 0; credits_pics[i].patch; i++)
V_DrawSciencePatch(credits_pics[i].x<>1);
+ // Dim the background
+ V_DrawFadeScreen();
+
// Draw credits text on top
for (i = 0; credits[i]; i++)
{
@@ -1998,7 +2016,7 @@ void F_CutsceneTicker(void)
for (i = 0; i < MAXPLAYERS; i++)
{
- if (netgame && i != serverplayer && i != adminplayer)
+ if (netgame && i != serverplayer && !IsPlayerAdmin(i))
continue;
if (players[i].cmd.buttons & BT_USE)
diff --git a/src/f_finale.h b/src/f_finale.h
index 8e8a06365..ce3c65c29 100644
--- a/src/f_finale.h
+++ b/src/f_finale.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/f_wipe.c b/src/f_wipe.c
index 49ab9cc01..3d561075e 100644
--- a/src/f_wipe.c
+++ b/src/f_wipe.c
@@ -3,7 +3,7 @@
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 2013-2016 by Matthew "Inuyasha" Walsh.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/filesrch.c b/src/filesrch.c
index c1abccde3..5a30d2582 100644
--- a/src/filesrch.c
+++ b/src/filesrch.c
@@ -305,6 +305,8 @@ closedir (DIR * dirp)
return rc;
}
#endif
+<<<<<<< HEAD
+=======
static CV_PossibleValue_t addons_cons_t[] = {{0, "Default"},
#if 1
@@ -340,6 +342,111 @@ char *refreshdirname = NULL;
size_t packetsizetally = 0;
size_t mainwadstally = 0;
+#if defined (_XBOX) && defined (_MSC_VER)
+filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *wantedmd5sum,
+ boolean completepath, int maxsearchdepth)
+{
+//NONE?
+ startpath = filename = NULL;
+ wantedmd5sum = NULL;
+ maxsearchdepth = 0;
+ completepath = false;
+ return FS_NOTFOUND;
+}
+
+void closefilemenu(boolean validsize)
+{
+ (void)validsize;
+ return;
+}
+
+void searchfilemenu(char *tempname)
+{
+ (void)tempname;
+ return;
+}
+
+boolean preparefilemenu(boolean samedepth)
+{
+ (void)samedepth;
+ return false;
+}
+
+#elif defined (_WIN32_WCE)
+filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *wantedmd5sum,
+ boolean completepath, int maxsearchdepth)
+{
+#ifdef __GNUC__
+//NONE?
+ startpath = filename = NULL;
+ wantedmd5sum = NULL;
+ maxsearchdepth = 0;
+ completepath = false;
+#else
+ WIN32_FIND_DATA dta;
+ HANDLE searchhandle = INVALID_HANDLE_VALUE;
+ const wchar_t wm[4] = L"*.*";
+>>>>>>> public_next-20190101
+
+static CV_PossibleValue_t addons_cons_t[] = {{0, "Default"},
+#if 1
+ {1, "HOME"}, {2, "SRB2"},
+#endif
+<<<<<<< HEAD
+ {3, "CUSTOM"}, {0, NULL}};
+
+consvar_t cv_addons_option = {"addons_option", "Default", CV_SAVE|CV_CALL, addons_cons_t, Addons_option_Onchange, 0, NULL, NULL, 0, 0, NULL};
+consvar_t cv_addons_folder = {"addons_folder", "", CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
+
+static CV_PossibleValue_t addons_md5_cons_t[] = {{0, "Name"}, {1, "Contents"}, {0, NULL}};
+consvar_t cv_addons_md5 = {"addons_md5", "Name", CV_SAVE, addons_md5_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
+
+consvar_t cv_addons_showall = {"addons_showall", "No", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
+
+consvar_t cv_addons_search_case = {"addons_search_case", "No", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
+
+static CV_PossibleValue_t addons_search_type_cons_t[] = {{0, "Start"}, {1, "Anywhere"}, {0, NULL}};
+consvar_t cv_addons_search_type = {"addons_search_type", "Anywhere", CV_SAVE, addons_search_type_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
+
+char menupath[1024];
+size_t menupathindex[menudepth];
+size_t menudepthleft = menudepth;
+
+char menusearch[MAXSTRINGLENGTH+1];
+
+char **dirmenu, **coredirmenu; // core only local for this file
+size_t sizedirmenu, sizecoredirmenu; // ditto
+size_t dir_on[menudepth];
+UINT8 refreshdirmenu = 0;
+char *refreshdirname = NULL;
+
+size_t packetsizetally = 0;
+size_t mainwadstally = 0;
+=======
+ return FS_NOTFOUND;
+}
+
+void closefilemenu(boolean validsize)
+{
+ (void)validsize;
+ return;
+}
+
+void searchfilemenu(char *tempname)
+{
+ (void)tempname;
+ return;
+}
+
+boolean preparefilemenu(boolean samedepth)
+{
+ (void)samedepth;
+ return false;
+}
+
+#else
+>>>>>>> public_next-20190101
+
filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *wantedmd5sum, boolean completepath, int maxsearchdepth)
{
filestatus_t retval = FS_NOTFOUND;
@@ -445,9 +552,19 @@ filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *want
return retval;
}
+<<<<<<< HEAD
char exttable[NUM_EXT_TABLE][5] = {
".txt", ".cfg", // exec
".wad", ".pk3", ".soc", ".lua"}; // addfile
+=======
+char exttable[NUM_EXT_TABLE][7] = { // maximum extension length (currently 4) plus 3 (null terminator, stop, and length including previous two)
+ "\5.txt", "\5.cfg", // exec
+ "\5.wad",
+#ifdef USE_KART
+ "\6.kart",
+#endif
+ "\5.pk3", "\5.soc", "\5.lua"}; // addfile
+>>>>>>> public_next-20190101
char filenamebuf[MAX_WADFILES][MAX_WADPATH];
@@ -458,9 +575,15 @@ static boolean filemenucmp(char *haystack, char *needle)
strlcpy(localhaystack, haystack, 128);
if (!cv_addons_search_case.value)
strupr(localhaystack);
+<<<<<<< HEAD
return ((cv_addons_search_type.value)
? (strstr(localhaystack, needle) != 0)
: (!strncmp(localhaystack, needle, menusearch[0])));
+=======
+ if (cv_addons_search_type.value)
+ return (strstr(localhaystack, needle) != 0);
+ return (!strncmp(localhaystack, needle, menusearch[0]));
+>>>>>>> public_next-20190101
}
void closefilemenu(boolean validsize)
@@ -568,7 +691,11 @@ void searchfilemenu(char *tempname)
{
if ((!(dirmenu = Z_Realloc(dirmenu, sizeof(char *), PU_STATIC, NULL)))
|| !(dirmenu[0] = Z_StrDup(va("%c\13No results...", EXT_NORESULTS))))
+<<<<<<< HEAD
I_Error("Ran out of memory whilst preparing add-ons menu");
+=======
+ I_Error("searchfilemenu(): could not create \"No results...\".");
+>>>>>>> public_next-20190101
sizedirmenu = 1;
dir_on[menudepthleft] = 0;
if (tempname)
@@ -577,7 +704,11 @@ void searchfilemenu(char *tempname)
}
if (!(dirmenu = Z_Realloc(dirmenu, sizedirmenu*sizeof(char *), PU_STATIC, NULL)))
+<<<<<<< HEAD
I_Error("Ran out of memory whilst preparing add-ons menu");
+=======
+ I_Error("searchfilemenu(): could not reallocate dirmenu.");
+>>>>>>> public_next-20190101
sizedirmenu = 0;
for (i = first; i < sizecoredirmenu; i++)
@@ -596,7 +727,11 @@ void searchfilemenu(char *tempname)
if (tempname)
{
+<<<<<<< HEAD
dir_on[menudepthleft] = 0;
+=======
+ dir_on[menudepthleft] = 0; //first; -- can't be first, causes problems
+>>>>>>> public_next-20190101
Z_Free(tempname);
}
}
@@ -655,7 +790,11 @@ boolean preparefilemenu(boolean samedepth)
size_t len = strlen(dent->d_name)+1;
UINT8 ext;
for (ext = 0; ext < NUM_EXT_TABLE; ext++)
+<<<<<<< HEAD
if (!strcasecmp(exttable[ext], dent->d_name+len-5)) break; // extension comparison
+=======
+ if (!strcasecmp(exttable[ext]+1, dent->d_name+len-(exttable[ext][0]))) break; // extension comparison
+>>>>>>> public_next-20190101
if (ext == NUM_EXT_TABLE) continue; // not an addfile-able (or exec-able) file
}
}
@@ -688,7 +827,11 @@ boolean preparefilemenu(boolean samedepth)
if (!(coredirmenu = Z_Realloc(coredirmenu, sizecoredirmenu*sizeof(char *), PU_STATIC, NULL)))
{
closedir(dirhandle); // just in case
+<<<<<<< HEAD
I_Error("Ran out of memory whilst preparing add-ons menu");
+=======
+ I_Error("preparefilemenu(): could not reallocate coredirmenu.");
+>>>>>>> public_next-20190101
}
rewinddir(dirhandle);
@@ -721,7 +864,11 @@ boolean preparefilemenu(boolean samedepth)
{
if (!((numfolders+pos) < sizecoredirmenu)) continue; // crash prevention
for (; ext < NUM_EXT_TABLE; ext++)
+<<<<<<< HEAD
if (!strcasecmp(exttable[ext], dent->d_name+len-5)) break; // extension comparison
+=======
+ if (!strcasecmp(exttable[ext]+1, dent->d_name+len-(exttable[ext][0]))) break; // extension comparison
+>>>>>>> public_next-20190101
if (ext == NUM_EXT_TABLE && !cv_addons_showall.value) continue; // not an addfile-able (or exec-able) file
ext += EXT_START; // moving to be appropriate position
@@ -763,7 +910,11 @@ boolean preparefilemenu(boolean samedepth)
len = 255;
if (!(temp = Z_Malloc((len+DIR_STRING+folder) * sizeof (char), PU_STATIC, NULL)))
+<<<<<<< HEAD
I_Error("Ran out of memory whilst preparing add-ons menu");
+=======
+ I_Error("preparefilemenu(): could not create file entry.");
+>>>>>>> public_next-20190101
temp[DIR_TYPE] = ext;
temp[DIR_LEN] = (UINT8)(len);
strlcpy(temp+DIR_STRING, dent->d_name, len);
@@ -781,7 +932,11 @@ boolean preparefilemenu(boolean samedepth)
if ((menudepthleft != menudepth-1) // now for UP... entry
&& !(coredirmenu[0] = Z_StrDup(va("%c\5UP...", EXT_UP))))
+<<<<<<< HEAD
I_Error("Ran out of memory whilst preparing add-ons menu");
+=======
+ I_Error("preparefilemenu(): could not create \"UP...\".");
+>>>>>>> public_next-20190101
menupath[menupathindex[menudepthleft]] = 0;
sizecoredirmenu = (numfolders+pos); // just in case things shrink between opening and rewind
@@ -797,3 +952,8 @@ boolean preparefilemenu(boolean samedepth)
return true;
}
+<<<<<<< HEAD
+=======
+
+#endif
+>>>>>>> public_next-20190101
diff --git a/src/filesrch.h b/src/filesrch.h
index 41dc80d13..4186271b0 100644
--- a/src/filesrch.h
+++ b/src/filesrch.h
@@ -55,6 +55,9 @@ typedef enum
EXT_CFG,
EXT_LOADSTART,
EXT_WAD = EXT_LOADSTART,
+#ifdef USE_KART
+ EXT_KART,
+#endif
EXT_PK3,
EXT_SOC,
EXT_LUA, // allowed even if not HAVE_BLUA so that we can yell on load attempt
diff --git a/src/g_game.c b/src/g_game.c
index 79c09f6b1..1e3d0a088 100644
--- a/src/g_game.c
+++ b/src/g_game.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -325,12 +325,45 @@ static CV_PossibleValue_t joyaxis_cons_t[] = {{0, "None"},
"More Axis Sets"
#endif
+// don't mind me putting these here, I was lazy to figure out where else I could put those without blowing up the compiler.
+
+// it automatically becomes compact with 20+ players, but if you like it, I guess you can turn that on!
+consvar_t cv_compactscoreboard= {"compactscoreboard", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
+
+// chat timer thingy
+static CV_PossibleValue_t chattime_cons_t[] = {{5, "MIN"}, {999, "MAX"}, {0, NULL}};
+consvar_t cv_chattime = {"chattime", "8", CV_SAVE, chattime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
+
+// chatwidth
+static CV_PossibleValue_t chatwidth_cons_t[] = {{64, "MIN"}, {150, "MAX"}, {0, NULL}};
+consvar_t cv_chatwidth = {"chatwidth", "128", CV_SAVE, chatwidth_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
+
+// chatheight
+static CV_PossibleValue_t chatheight_cons_t[] = {{6, "MIN"}, {22, "MAX"}, {0, NULL}};
+consvar_t cv_chatheight= {"chatheight", "8", CV_SAVE, chatheight_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
+
+// chat notifications (do you want to hear beeps? I'd understand if you didn't.)
+consvar_t cv_chatnotifications= {"chatnotifications", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
+
+// chat spam protection (why would you want to disable that???)
+consvar_t cv_chatspamprotection= {"chatspamprotection", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
+
+// minichat text background
+consvar_t cv_chatbacktint = {"chatbacktint", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
+
+// old shit console chat. (mostly exists for stuff like terminal, not because I cared if anyone liked the old chat.)
+static CV_PossibleValue_t consolechat_cons_t[] = {{0, "Window"}, {1, "Console"}, {2, "Window (Hidden)"}, {0, NULL}};
+consvar_t cv_consolechat = {"chatmode", "Window", CV_SAVE, consolechat_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
+
+
consvar_t cv_crosshair = {"crosshair", "Cross", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_crosshair2 = {"crosshair2", "Cross", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_invertmouse = {"invertmouse", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_alwaysfreelook = {"alwaysmlook", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_invertmouse2 = {"invertmouse2", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_alwaysfreelook2 = {"alwaysmlook2", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
+consvar_t cv_chasefreelook = {"chasemlook", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
+consvar_t cv_chasefreelook2 = {"chasemlook2", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_mousemove = {"mousemove", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_mousemove2 = {"mousemove2", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
@@ -362,23 +395,23 @@ typedef enum
AXISFIRENORMAL,
} axis_input_e;
-consvar_t cv_turnaxis = {"joyaxis_turn", "X-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
+consvar_t cv_turnaxis = {"joyaxis_turn", "X-Rudder", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_moveaxis = {"joyaxis_move", "Y-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
-consvar_t cv_sideaxis = {"joyaxis_side", "Z-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
-consvar_t cv_lookaxis = {"joyaxis_look", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
-consvar_t cv_fireaxis = {"joyaxis_fire", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
-consvar_t cv_firenaxis = {"joyaxis_firenormal", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
+consvar_t cv_sideaxis = {"joyaxis_side", "X-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
+consvar_t cv_lookaxis = {"joyaxis_look", "Y-Rudder-", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_jumpaxis = {"joyaxis_jump", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_spinaxis = {"joyaxis_spin", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
+consvar_t cv_fireaxis = {"joyaxis_fire", "Z-Axis-", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
+consvar_t cv_firenaxis = {"joyaxis_firenormal", "Z-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
-consvar_t cv_turnaxis2 = {"joyaxis2_turn", "X-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
+consvar_t cv_turnaxis2 = {"joyaxis2_turn", "X-Rudder", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_moveaxis2 = {"joyaxis2_move", "Y-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
-consvar_t cv_sideaxis2 = {"joyaxis2_side", "Z-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
-consvar_t cv_lookaxis2 = {"joyaxis2_look", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
-consvar_t cv_fireaxis2 = {"joyaxis2_fire", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
-consvar_t cv_firenaxis2 = {"joyaxis2_firenormal", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
+consvar_t cv_sideaxis2 = {"joyaxis2_side", "X-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
+consvar_t cv_lookaxis2 = {"joyaxis2_look", "Y-Rudder-", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_jumpaxis2 = {"joyaxis2_jump", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_spinaxis2 = {"joyaxis2_spin", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
+consvar_t cv_fireaxis2 = {"joyaxis2_fire", "Z-Axis-", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
+consvar_t cv_firenaxis2 = {"joyaxis2_firenormal", "Z-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
#if MAXPLAYERS > 32
#error "please update player_name table using the new value for MAXPLAYERS"
@@ -883,16 +916,17 @@ static fixed_t angleturn[3] = {640, 1280, 320}; // + slow turn
void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics)
{
boolean forcestrafe = false;
- INT32 tspeed, forward, side, axis, i;
+ INT32 tspeed, forward, side, axis, altaxis, i;
const INT32 speed = 1;
// these ones used for multiple conditions
- boolean turnleft, turnright, strafelkey, straferkey, movefkey, movebkey, mouseaiming, analogjoystickmove, gamepadjoystickmove;
+ boolean turnleft, turnright, strafelkey, straferkey, movefkey, movebkey, mouseaiming, analogjoystickmove, gamepadjoystickmove, thisjoyaiming;
player_t *player = &players[consoleplayer];
camera_t *thiscam = &camera;
static INT32 turnheld; // for accelerative turning
static boolean keyboard_look; // true if lookup/down using keyboard
static boolean resetdown; // don't cam reset every frame
+ static boolean joyaiming; // check the last frame's value if we need to reset the camera
G_CopyTiccmd(cmd, I_BaseTiccmd(), 1); // empty, or external driver
@@ -915,10 +949,18 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics)
movefkey = PLAYER1INPUTDOWN(gc_forward);
movebkey = PLAYER1INPUTDOWN(gc_backward);
- mouseaiming = (PLAYER1INPUTDOWN(gc_mouseaiming)) ^ cv_alwaysfreelook.value;
+ mouseaiming = (PLAYER1INPUTDOWN(gc_mouseaiming)) ^
+ (cv_chasecam.value ? cv_chasefreelook.value : cv_alwaysfreelook.value);
analogjoystickmove = cv_usejoystick.value && !Joystick.bGamepadStyle;
gamepadjoystickmove = cv_usejoystick.value && Joystick.bGamepadStyle;
+ thisjoyaiming = (cv_chasecam.value) ? cv_chasefreelook.value : cv_alwaysfreelook.value;
+
+ // Reset the vertical look if we're no longer joyaiming
+ if (!thisjoyaiming && joyaiming)
+ localaiming = 0;
+ joyaiming = thisjoyaiming;
+
axis = JoyAxis(AXISTURN);
if (gamepadjoystickmove && axis != 0)
{
@@ -1003,9 +1045,14 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics)
// forward with key or button
axis = JoyAxis(AXISMOVE);
- if (movefkey || (gamepadjoystickmove && axis < 0))
+ altaxis = JoyAxis(AXISLOOK);
+ if (movefkey || (gamepadjoystickmove && axis < 0)
+ || ((player->pflags & PF_NIGHTSMODE)
+ && (PLAYER1INPUTDOWN(gc_lookup) || (gamepadjoystickmove && altaxis < 0))))
forward = forwardmove[speed];
- if (movebkey || (gamepadjoystickmove && axis > 0))
+ if (movebkey || (gamepadjoystickmove && axis > 0)
+ || ((player->pflags & PF_NIGHTSMODE)
+ && (PLAYER1INPUTDOWN(gc_lookdown) || (gamepadjoystickmove && altaxis > 0))))
forward -= forwardmove[speed];
if (analogjoystickmove && axis != 0)
@@ -1093,25 +1140,28 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics)
}
axis = JoyAxis(AXISLOOK);
- if (analogjoystickmove && axis != 0 && cv_lookaxis.value != 0)
+ if (analogjoystickmove && joyaiming && axis != 0 && cv_lookaxis.value != 0)
localaiming += (axis<<16) * screen_invert;
// spring back if not using keyboard neither mouselookin'
- if (!keyboard_look && cv_lookaxis.value == 0 && !mouseaiming)
+ if (!keyboard_look && cv_lookaxis.value == 0 && !joyaiming && !mouseaiming)
localaiming = 0;
- if (PLAYER1INPUTDOWN(gc_lookup) || (gamepadjoystickmove && axis < 0))
+ if (!(player->pflags & PF_NIGHTSMODE))
{
- localaiming += KB_LOOKSPEED * screen_invert;
- keyboard_look = true;
+ if (PLAYER1INPUTDOWN(gc_lookup) || (gamepadjoystickmove && axis < 0))
+ {
+ localaiming += KB_LOOKSPEED * screen_invert;
+ keyboard_look = true;
+ }
+ else if (PLAYER1INPUTDOWN(gc_lookdown) || (gamepadjoystickmove && axis > 0))
+ {
+ localaiming -= KB_LOOKSPEED * screen_invert;
+ keyboard_look = true;
+ }
+ else if (PLAYER1INPUTDOWN(gc_centerview))
+ localaiming = 0;
}
- else if (PLAYER1INPUTDOWN(gc_lookdown) || (gamepadjoystickmove && axis > 0))
- {
- localaiming -= KB_LOOKSPEED * screen_invert;
- keyboard_look = true;
- }
- else if (PLAYER1INPUTDOWN(gc_centerview))
- localaiming = 0;
// accept no mlook for network games
if (!cv_allowmlook.value)
@@ -1192,16 +1242,17 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics)
void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics)
{
boolean forcestrafe = false;
- INT32 tspeed, forward, side, axis, i;
+ INT32 tspeed, forward, side, axis, altaxis, i;
const INT32 speed = 1;
// these ones used for multiple conditions
- boolean turnleft, turnright, strafelkey, straferkey, movefkey, movebkey, mouseaiming, analogjoystickmove, gamepadjoystickmove;
+ boolean turnleft, turnright, strafelkey, straferkey, movefkey, movebkey, mouseaiming, analogjoystickmove, gamepadjoystickmove, thisjoyaiming;
player_t *player = &players[secondarydisplayplayer];
camera_t *thiscam = (player->bot == 2 ? &camera : &camera2);
static INT32 turnheld; // for accelerative turning
static boolean keyboard_look; // true if lookup/down using keyboard
static boolean resetdown; // don't cam reset every frame
+ static boolean joyaiming; // check the last frame's value if we need to reset the camera
G_CopyTiccmd(cmd, I_BaseTiccmd2(), 1); // empty, or external driver
@@ -1222,10 +1273,18 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics)
movefkey = PLAYER2INPUTDOWN(gc_forward);
movebkey = PLAYER2INPUTDOWN(gc_backward);
- mouseaiming = (PLAYER2INPUTDOWN(gc_mouseaiming)) ^ cv_alwaysfreelook2.value;
+ mouseaiming = (PLAYER2INPUTDOWN(gc_mouseaiming)) ^
+ (cv_chasecam2.value ? cv_chasefreelook2.value : cv_alwaysfreelook2.value);
analogjoystickmove = cv_usejoystick2.value && !Joystick2.bGamepadStyle;
gamepadjoystickmove = cv_usejoystick2.value && Joystick2.bGamepadStyle;
+ thisjoyaiming = (cv_chasecam2.value) ? cv_chasefreelook2.value : cv_alwaysfreelook2.value;
+
+ // Reset the vertical look if we're no longer joyaiming
+ if (!thisjoyaiming && joyaiming)
+ localaiming2 = 0;
+ joyaiming = thisjoyaiming;
+
axis = Joy2Axis(AXISTURN);
if (gamepadjoystickmove && axis != 0)
{
@@ -1310,9 +1369,14 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics)
// forward with key or button
axis = Joy2Axis(AXISMOVE);
- if (movefkey || (gamepadjoystickmove && axis < 0))
+ altaxis = Joy2Axis(AXISLOOK);
+ if (movefkey || (gamepadjoystickmove && axis < 0)
+ || ((player->pflags & PF_NIGHTSMODE)
+ && (PLAYER2INPUTDOWN(gc_lookup) || (gamepadjoystickmove && altaxis < 0))))
forward = forwardmove[speed];
- if (movebkey || (gamepadjoystickmove && axis > 0))
+ if (movebkey || (gamepadjoystickmove && axis > 0)
+ || ((player->pflags & PF_NIGHTSMODE)
+ && (PLAYER2INPUTDOWN(gc_lookdown) || (gamepadjoystickmove && altaxis > 0))))
forward -= forwardmove[speed];
if (analogjoystickmove && axis != 0)
@@ -1397,25 +1461,28 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics)
}
axis = Joy2Axis(AXISLOOK);
- if (analogjoystickmove && axis != 0 && cv_lookaxis2.value != 0)
+ if (analogjoystickmove && joyaiming && axis != 0 && cv_lookaxis2.value != 0)
localaiming2 += (axis<<16) * screen_invert;
// spring back if not using keyboard neither mouselookin'
- if (!keyboard_look && cv_lookaxis2.value == 0 && !mouseaiming)
+ if (!keyboard_look && cv_lookaxis2.value == 0 && !joyaiming && !mouseaiming)
localaiming2 = 0;
- if (PLAYER2INPUTDOWN(gc_lookup) || (gamepadjoystickmove && axis < 0))
+ if (!(player->pflags & PF_NIGHTSMODE))
{
- localaiming2 += KB_LOOKSPEED * screen_invert;
- keyboard_look = true;
+ if (PLAYER2INPUTDOWN(gc_lookup) || (gamepadjoystickmove && axis < 0))
+ {
+ localaiming2 += KB_LOOKSPEED * screen_invert;
+ keyboard_look = true;
+ }
+ else if (PLAYER2INPUTDOWN(gc_lookdown) || (gamepadjoystickmove && axis > 0))
+ {
+ localaiming2 -= KB_LOOKSPEED * screen_invert;
+ keyboard_look = true;
+ }
+ else if (PLAYER2INPUTDOWN(gc_centerview))
+ localaiming2 = 0;
}
- else if (PLAYER2INPUTDOWN(gc_lookdown) || (gamepadjoystickmove && axis > 0))
- {
- localaiming2 -= KB_LOOKSPEED * screen_invert;
- keyboard_look = true;
- }
- else if (PLAYER2INPUTDOWN(gc_centerview))
- localaiming2 = 0;
// accept no mlook for network games
if (!cv_allowmlook.value)
@@ -1663,7 +1730,8 @@ static INT32 camtoggledelay, camtoggledelay2 = 0;
boolean G_Responder(event_t *ev)
{
// allow spy mode changes even during the demo
- if (gamestate == GS_LEVEL && ev->type == ev_keydown && ev->data1 == KEY_F12)
+ if (gamestate == GS_LEVEL && ev->type == ev_keydown
+ && (ev->data1 == KEY_F12 || ev->data1 == gamecontrol[gc_viewpoint][0] || ev->data1 == gamecontrol[gc_viewpoint][1]))
{
if (splitscreen || !netgame)
displayplayer = consoleplayer;
@@ -2668,7 +2736,7 @@ void G_DoReborn(INT32 playernum)
else
{
#ifdef HAVE_BLUA
- LUAh_MapChange();
+ LUAh_MapChange(gamemap);
#endif
G_DoLoadLevel(true);
return;
@@ -3828,7 +3896,7 @@ void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, boolean
unlocktriggers = 0;
// clear itemfinder, just in case
- if (!dedicated) // except in dedicated servers, where it is not registered and can actually I_Error debug builds
+ if (!dedicated) // except in dedicated servers, where it is not registered and can actually I_Error debug builds
CV_StealthSetValue(&cv_itemfinder, 0);
}
@@ -5462,7 +5530,7 @@ void G_DoPlayDemo(char *defdemoname)
SetPlayerSkin(0, skin);
#ifdef HAVE_BLUA
- LUAh_MapChange();
+ LUAh_MapChange(gamemap);
#endif
displayplayer = consoleplayer = 0;
memset(playeringame,0,sizeof(playeringame));
diff --git a/src/g_game.h b/src/g_game.h
index 1e30831d8..3cbde9a3c 100644
--- a/src/g_game.h
+++ b/src/g_game.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -58,9 +58,10 @@ extern boolean pausebreakkey;
// used in game menu
extern consvar_t cv_tutorialprompt;
+extern consvar_t cv_chatwidth, cv_chatnotifications, cv_chatheight, cv_chattime, cv_consolechat, cv_chatbacktint, cv_chatspamprotection, cv_compactscoreboard;
extern consvar_t cv_crosshair, cv_crosshair2;
-extern consvar_t cv_invertmouse, cv_alwaysfreelook, cv_mousemove;
-extern consvar_t cv_invertmouse2, cv_alwaysfreelook2, cv_mousemove2;
+extern consvar_t cv_invertmouse, cv_alwaysfreelook, cv_chasefreelook, cv_mousemove;
+extern consvar_t cv_invertmouse2, cv_alwaysfreelook2, cv_chasefreelook2, cv_mousemove2;
extern consvar_t cv_useranalog, cv_useranalog2;
extern consvar_t cv_analog, cv_analog2;
extern consvar_t cv_directionchar, cv_directionchar2;
diff --git a/src/g_input.c b/src/g_input.c
index 4686f57ce..45c517e1a 100644
--- a/src/g_input.c
+++ b/src/g_input.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -25,10 +25,10 @@ static CV_PossibleValue_t mousesens_cons_t[] = {{1, "MIN"}, {MAXMOUSESENSITIVITY
static CV_PossibleValue_t onecontrolperkey_cons_t[] = {{1, "One"}, {2, "Several"}, {0, NULL}};
// mouse values are used once
-consvar_t cv_mousesens = {"mousesens", "12", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
-consvar_t cv_mousesens2 = {"mousesens2", "12", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
-consvar_t cv_mouseysens = {"mouseysens", "12", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
-consvar_t cv_mouseysens2 = {"mouseysens2", "12", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
+consvar_t cv_mousesens = {"mousesens", "20", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
+consvar_t cv_mousesens2 = {"mousesens2", "20", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
+consvar_t cv_mouseysens = {"mouseysens", "20", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
+consvar_t cv_mouseysens2 = {"mouseysens2", "20", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_controlperkey = {"controlperkey", "One", CV_SAVE, onecontrolperkey_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
INT32 mousex, mousey;
@@ -46,6 +46,7 @@ UINT8 gamekeydown[NUMINPUTS];
INT32 gamecontrol[num_gamecontrols][2];
INT32 gamecontrolbis[num_gamecontrols][2]; // secondary splitscreen player
INT32 gamecontroldefault[num_gamecontrolschemes][num_gamecontrols][2]; // default control storage, use 0 (gcs_custom) for memory retention
+INT32 gamecontrolbisdefault[num_gamecontrolschemes][num_gamecontrols][2];
// lists of GC codes for selective operation
const INT32 gcl_tutorial_check[num_gcl_tutorial_check] = {
@@ -139,6 +140,8 @@ void G_MapEventsToControls(event_t *ev)
break;
case ev_mouse: // buttons are virtual keys
+ if (menuactive || CON_Ready() || chat_on)
+ break;
mousex = (INT32)(ev->data2*((cv_mousesens.value*cv_mousesens.value)/110.0f + 0.1f));
mousey = (INT32)(ev->data3*((cv_mousesens.value*cv_mousesens.value)/110.0f + 0.1f));
mlooky = (INT32)(ev->data3*((cv_mouseysens.value*cv_mousesens.value)/110.0f + 0.1f));
@@ -146,7 +149,7 @@ void G_MapEventsToControls(event_t *ev)
case ev_joystick: // buttons are virtual keys
i = ev->data1;
- if (i >= JOYAXISSET)
+ if (i >= JOYAXISSET || menuactive || CON_Ready() || chat_on)
break;
if (ev->data2 != INT32_MAX) joyxmove[i] = ev->data2;
if (ev->data3 != INT32_MAX) joyymove[i] = ev->data3;
@@ -154,13 +157,15 @@ void G_MapEventsToControls(event_t *ev)
case ev_joystick2: // buttons are virtual keys
i = ev->data1;
- if (i >= JOYAXISSET)
+ if (i >= JOYAXISSET || menuactive || CON_Ready() || chat_on)
break;
if (ev->data2 != INT32_MAX) joy2xmove[i] = ev->data2;
if (ev->data3 != INT32_MAX) joy2ymove[i] = ev->data3;
break;
case ev_mouse2: // buttons are virtual keys
+ if (menuactive || CON_Ready() || chat_on)
+ break;
mouse2x = (INT32)(ev->data2*((cv_mousesens2.value*cv_mousesens2.value)/110.0f + 0.1f));
mouse2y = (INT32)(ev->data3*((cv_mousesens2.value*cv_mousesens2.value)/110.0f + 0.1f));
mlook2y = (INT32)(ev->data3*((cv_mouseysens2.value*cv_mousesens2.value)/110.0f + 0.1f));
@@ -591,6 +596,10 @@ static const char *gamecontrolname[num_gamecontrols] =
"jump",
"console",
"pause",
+ "systemmenu",
+ "screenshot",
+ "recordgif",
+ "viewpoint",
"custom1",
"custom2",
"custom3",
@@ -607,6 +616,16 @@ void G_ClearControlKeys(INT32 (*setupcontrols)[2], INT32 control)
setupcontrols[control][1] = KEY_NULL;
}
+void G_ClearAllControlKeys(void)
+{
+ INT32 i;
+ for (i = 0; i < num_gamecontrols; i++)
+ {
+ G_ClearControlKeys(gamecontrol, i);
+ G_ClearControlKeys(gamecontrolbis, i);
+ }
+}
+
//
// Returns the name of a key (or virtual key for mouse and joy)
// the input value being an keynum
@@ -710,6 +729,39 @@ void G_DefineDefaultControls(void)
gamecontroldefault[i][gc_scores ][0] = KEY_TAB;
gamecontroldefault[i][gc_console ][0] = KEY_CONSOLE;
gamecontroldefault[i][gc_pause ][0] = 'p';
+ gamecontroldefault[i][gc_screenshot ][0] = KEY_F8;
+ gamecontroldefault[i][gc_recordgif ][0] = KEY_F9;
+ gamecontroldefault[i][gc_viewpoint ][0] = KEY_F12;
+
+ // Gamepad controls -- same for both schemes
+ gamecontroldefault[i][gc_weaponnext ][1] = KEY_JOY1+1; // B
+ gamecontroldefault[i][gc_weaponprev ][1] = KEY_JOY1+2; // X
+ gamecontroldefault[i][gc_tossflag ][1] = KEY_JOY1+0; // A
+ gamecontroldefault[i][gc_use ][1] = KEY_JOY1+4; // LB
+ gamecontroldefault[i][gc_camtoggle ][1] = KEY_HAT1+0; // D-Pad Up
+ gamecontroldefault[i][gc_camreset ][1] = KEY_JOY1+3; // Y
+ gamecontroldefault[i][gc_centerview ][1] = KEY_JOY1+9; // Right Stick
+ gamecontroldefault[i][gc_talkkey ][1] = KEY_HAT1+2; // D-Pad Left
+ gamecontroldefault[i][gc_scores ][1] = KEY_HAT1+3; // D-Pad Right
+ gamecontroldefault[i][gc_jump ][1] = KEY_JOY1+5; // RB
+ gamecontroldefault[i][gc_pause ][1] = KEY_JOY1+6; // Back
+ gamecontroldefault[i][gc_screenshot ][1] = KEY_HAT1+1; // D-Pad Down
+ gamecontroldefault[i][gc_systemmenu ][0] = KEY_JOY1+7; // Start
+
+ // Second player controls only have joypad defaults
+ gamecontrolbisdefault[i][gc_weaponnext][0] = KEY_2JOY1+1; // B
+ gamecontrolbisdefault[i][gc_weaponprev][0] = KEY_2JOY1+2; // X
+ gamecontrolbisdefault[i][gc_tossflag ][0] = KEY_2JOY1+0; // A
+ gamecontrolbisdefault[i][gc_use ][0] = KEY_2JOY1+4; // LB
+ gamecontrolbisdefault[i][gc_camreset ][0] = KEY_2JOY1+3; // Y
+ gamecontrolbisdefault[i][gc_centerview][0] = KEY_2JOY1+9; // Right Stick
+ gamecontrolbisdefault[i][gc_jump ][0] = KEY_2JOY1+5; // RB
+ //gamecontrolbisdefault[i][gc_pause ][0] = KEY_2JOY1+6; // Back
+ //gamecontrolbisdefault[i][gc_systemmenu][0] = KEY_2JOY1+7; // Start
+ gamecontrolbisdefault[i][gc_camtoggle ][0] = KEY_2HAT1+0; // D-Pad Up
+ gamecontrolbisdefault[i][gc_screenshot][0] = KEY_2HAT1+1; // D-Pad Down
+ //gamecontrolbisdefault[i][gc_talkkey ][0] = KEY_2HAT1+2; // D-Pad Left
+ //gamecontrolbisdefault[i][gc_scores ][0] = KEY_2HAT1+3; // D-Pad Right
}
}
@@ -779,30 +831,164 @@ void G_SaveKeySetting(FILE *f, INT32 (*fromcontrols)[2], INT32 (*fromcontrolsbis
}
}
-void G_CheckDoubleUsage(INT32 keynum)
+INT32 G_CheckDoubleUsage(INT32 keynum, boolean modify)
{
+ INT32 result = gc_null;
if (cv_controlperkey.value == 1)
{
INT32 i;
for (i = 0; i < num_gamecontrols; i++)
{
if (gamecontrol[i][0] == keynum)
- gamecontrol[i][0] = KEY_NULL;
+ {
+ result = i;
+ if (modify) gamecontrol[i][0] = KEY_NULL;
+ }
if (gamecontrol[i][1] == keynum)
- gamecontrol[i][1] = KEY_NULL;
+ {
+ result = i;
+ if (modify) gamecontrol[i][1] = KEY_NULL;
+ }
if (gamecontrolbis[i][0] == keynum)
- gamecontrolbis[i][0] = KEY_NULL;
+ {
+ result = i;
+ if (modify) gamecontrolbis[i][0] = KEY_NULL;
+ }
if (gamecontrolbis[i][1] == keynum)
- gamecontrolbis[i][1] = KEY_NULL;
+ {
+ result = i;
+ if (modify) gamecontrolbis[i][1] = KEY_NULL;
+ }
+ if (result && !modify)
+ return result;
}
}
+ return result;
}
-static void setcontrol(INT32 (*gc)[2], INT32 na)
+static INT32 G_FilterKeyByVersion(INT32 numctrl, INT32 keyidx, INT32 player, INT32 *keynum1, INT32 *keynum2, boolean *nestedoverride)
+{
+ // Special case: ignore KEY_PAUSE because it's hardcoded
+ if (keyidx == 0 && *keynum1 == KEY_PAUSE)
+ {
+ if (*keynum2 != KEY_PAUSE)
+ {
+ *keynum1 = *keynum2; // shift down keynum2 and continue
+ *keynum2 = 0;
+ }
+ else
+ return -1; // skip setting control
+ }
+ else if (keyidx == 1 && *keynum2 == KEY_PAUSE)
+ return -1; // skip setting control
+
+ if (GETMAJOREXECVERSION(cv_execversion.value) < 27 && ( // v2.1.22
+ numctrl == gc_weaponnext || numctrl == gc_weaponprev || numctrl == gc_tossflag ||
+ numctrl == gc_use || numctrl == gc_camreset || numctrl == gc_jump ||
+ numctrl == gc_pause || numctrl == gc_systemmenu || numctrl == gc_camtoggle ||
+ numctrl == gc_screenshot || numctrl == gc_talkkey || numctrl == gc_scores ||
+ numctrl == gc_centerview
+ ))
+ {
+ INT32 keynum = 0, existingctrl = 0;
+ INT32 defaultkey;
+ boolean defaultoverride = false;
+
+ // get the default gamecontrol
+ if (player == 0 && numctrl == gc_systemmenu)
+ defaultkey = gamecontrol[numctrl][0];
+ else
+ defaultkey = (player == 1 ? gamecontrolbis[numctrl][0] : gamecontrol[numctrl][1]);
+
+ // Assign joypad button defaults if there is an open slot.
+ // At this point, gamecontrol/bis should have the default controls
+ // (unless LOADCONFIG is being run)
+ //
+ // If the player runs SETCONTROL in-game, this block should not be reached
+ // because EXECVERSION is locked onto the latest version.
+ if (keyidx == 0 && !*keynum1)
+ {
+ if (*keynum2) // push keynum2 down; this is an edge case
+ {
+ *keynum1 = *keynum2;
+ *keynum2 = 0;
+ keynum = *keynum1;
+ }
+ else
+ {
+ keynum = defaultkey;
+ defaultoverride = true;
+ }
+ }
+ else if (keyidx == 1 && (!*keynum2 || (!*keynum1 && *keynum2))) // last one is the same edge case as above
+ {
+ keynum = defaultkey;
+ defaultoverride = true;
+ }
+ else // default to the specified keynum
+ keynum = (keyidx == 1 ? *keynum2 : *keynum1);
+
+ // Did our last call override keynum2?
+ if (*nestedoverride)
+ {
+ defaultoverride = true;
+ *nestedoverride = false;
+ }
+
+ // Fill keynum2 with the default control
+ if (keyidx == 0 && !*keynum2)
+ {
+ *keynum2 = defaultkey;
+ // Tell the next call that this is an override
+ *nestedoverride = true;
+
+ // if keynum2 already matches keynum1, we probably recursed
+ // so unset it
+ if (*keynum1 == *keynum2)
+ {
+ *keynum2 = 0;
+ *nestedoverride = false;
+ }
+ }
+
+ // check if the key is being used somewhere else before passing it
+ // pass it through if it's the same numctrl. This is an edge case -- when using
+ // LOADCONFIG, gamecontrol is not reset with default.
+ //
+ // Also, only check if we're actually overriding, to preserve behavior where
+ // config'd keys overwrite default keys.
+ if (defaultoverride)
+ existingctrl = G_CheckDoubleUsage(keynum, false);
+
+ if (keynum && (!existingctrl || existingctrl == numctrl))
+ return keynum;
+ else if (keyidx == 0 && *keynum2)
+ {
+ // try it again and push down keynum2
+ *keynum1 = *keynum2;
+ *keynum2 = 0;
+ return G_FilterKeyByVersion(numctrl, keyidx, player, keynum1, keynum2, nestedoverride);
+ // recursion *should* be safe because we only assign keynum2 to a joy default
+ // and then clear it if we find that keynum1 already has the joy default.
+ }
+ else
+ return 0;
+ }
+
+ // All's good, so pass the keynum as-is
+ if (keyidx == 1)
+ return *keynum2;
+ else //if (keyidx == 0)
+ return *keynum1;
+}
+
+static void setcontrol(INT32 (*gc)[2])
{
INT32 numctrl;
const char *namectrl;
- INT32 keynum;
+ INT32 keynum, keynum1, keynum2;
+ INT32 player = ((void*)gc == (void*)&gamecontrolbis ? 1 : 0);
+ boolean nestedoverride = false;
namectrl = COM_Argv(1);
for (numctrl = 0; numctrl < num_gamecontrols && stricmp(namectrl, gamecontrolname[numctrl]);
@@ -813,31 +999,38 @@ static void setcontrol(INT32 (*gc)[2], INT32 na)
CONS_Printf(M_GetText("Control '%s' unknown\n"), namectrl);
return;
}
- keynum = G_KeyStringtoNum(COM_Argv(2));
+ keynum1 = G_KeyStringtoNum(COM_Argv(2));
+ keynum2 = G_KeyStringtoNum(COM_Argv(3));
+ keynum = G_FilterKeyByVersion(numctrl, 0, player, &keynum1, &keynum2, &nestedoverride);
- if (keynum == KEY_PAUSE) // fail silently; pause is hardcoded
+ if (keynum >= 0)
{
- if (na == 4)
+ (void)G_CheckDoubleUsage(keynum, true);
+
+ // if keynum was rejected, try it again with keynum2
+ if (!keynum && keynum2)
{
- na--;
- keynum = G_KeyStringtoNum(COM_Argv(3));
- if (keynum == KEY_PAUSE)
- return;
+ keynum1 = keynum2; // push down keynum2
+ keynum2 = 0;
+ keynum = G_FilterKeyByVersion(numctrl, 0, player, &keynum1, &keynum2, &nestedoverride);
+ if (keynum >= 0)
+ (void)G_CheckDoubleUsage(keynum, true);
}
- else
- return;
}
- G_CheckDoubleUsage(keynum);
- gc[numctrl][0] = keynum;
+ if (keynum >= 0)
+ gc[numctrl][0] = keynum;
- if (na == 4)
+ if (keynum2)
{
- keynum = G_KeyStringtoNum(COM_Argv(3));
- if (keynum != KEY_PAUSE)
- gc[numctrl][1] = keynum;
- else
- gc[numctrl][1] = 0;
+ keynum = G_FilterKeyByVersion(numctrl, 1, player, &keynum1, &keynum2, &nestedoverride);
+ if (keynum >= 0)
+ {
+ if (keynum != gc[numctrl][0])
+ gc[numctrl][1] = keynum;
+ else
+ gc[numctrl][1] = 0;
+ }
}
else
gc[numctrl][1] = 0;
@@ -855,7 +1048,7 @@ void Command_Setcontrol_f(void)
return;
}
- setcontrol(gamecontrol, na);
+ setcontrol(gamecontrol);
}
void Command_Setcontrol2_f(void)
@@ -870,5 +1063,5 @@ void Command_Setcontrol2_f(void)
return;
}
- setcontrol(gamecontrolbis, na);
+ setcontrol(gamecontrolbis);
}
diff --git a/src/g_input.h b/src/g_input.h
index 4bf67ebd8..d3c693781 100644
--- a/src/g_input.h
+++ b/src/g_input.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -93,6 +93,10 @@ typedef enum
gc_jump,
gc_console,
gc_pause,
+ gc_systemmenu,
+ gc_screenshot,
+ gc_recordgif,
+ gc_viewpoint,
gc_custom1, // Lua scriptable
gc_custom2, // Lua scriptable
gc_custom3, // Lua scriptable
@@ -125,6 +129,7 @@ extern UINT8 gamekeydown[NUMINPUTS];
extern INT32 gamecontrol[num_gamecontrols][2];
extern INT32 gamecontrolbis[num_gamecontrols][2]; // secondary splitscreen player
extern INT32 gamecontroldefault[num_gamecontrolschemes][num_gamecontrols][2]; // default control storage, use 0 (gcs_custom) for memory retention
+extern INT32 gamecontrolbisdefault[num_gamecontrolschemes][num_gamecontrols][2];
#define PLAYER1INPUTDOWN(gc) (gamekeydown[gamecontrol[gc][0]] || gamekeydown[gamecontrol[gc][1]])
#define PLAYER2INPUTDOWN(gc) (gamekeydown[gamecontrolbis[gc][0]] || gamekeydown[gamecontrolbis[gc][1]])
@@ -160,12 +165,13 @@ INT32 G_KeyStringtoNum(const char *keystr);
// detach any keys associated to the given game control
void G_ClearControlKeys(INT32 (*setupcontrols)[2], INT32 control);
+void G_ClearAllControlKeys(void);
void Command_Setcontrol_f(void);
void Command_Setcontrol2_f(void);
void G_DefineDefaultControls(void);
INT32 G_GetControlScheme(INT32 (*fromcontrols)[2], const INT32 *gclist, INT32 gclen);
void G_CopyControls(INT32 (*setupcontrols)[2], INT32 (*fromcontrols)[2], const INT32 *gclist, INT32 gclen);
void G_SaveKeySetting(FILE *f, INT32 (*fromcontrols)[2], INT32 (*fromcontrolsbis)[2]);
-void G_CheckDoubleUsage(INT32 keynum);
+INT32 G_CheckDoubleUsage(INT32 keynum, boolean modify);
#endif
diff --git a/src/g_state.h b/src/g_state.h
index 81548b7ce..76c9bd16f 100644
--- a/src/g_state.h
+++ b/src/g_state.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/hardware/hw_bsp.c b/src/hardware/hw_bsp.c
index 04afb9be9..483932492 100644
--- a/src/hardware/hw_bsp.c
+++ b/src/hardware/hw_bsp.c
@@ -194,14 +194,14 @@ static polyvertex_t *fracdivline(fdivline_t *bsp, polyvertex_t *v1,
v2dy = bsp->dy;
den = v2dy*v1dx - v2dx*v1dy;
- if (den == 0)
+ if (fabsf((float)den) < 1.0E-36f) // avoid checking exactly for 0.0
return NULL; // parallel
// first check the frac along the polygon segment,
// (do not accept hit with the extensions)
num = (v2x - v1x)*v2dy + (v1y - v2y)*v2dx;
frac = num / den;
- if (frac < 0 || frac > 1)
+ if (frac < 0.0 || frac > 1.0)
return NULL;
// now get the frac along the BSP line
@@ -218,29 +218,6 @@ static polyvertex_t *fracdivline(fdivline_t *bsp, polyvertex_t *v1,
return &pt;
}
-#if 0
-//Hurdler: it's not used anymore
-static boolean NearVertice (polyvertex_t *p1, polyvertex_t *p2)
-{
-#if 1
- float diff;
- diff = p2->x - p1->x;
- if (diff < -1.5f || diff > 1.5f)
- return false;
- diff = p2->y - p1->y;
- if (diff < -1.5f || diff > 1.5f)
- return false;
-#else
- if (p1->x != p2->x)
- return false;
- if (p1->y != p2->y)
- return false;
-#endif
- // p1 and p2 are considered the same vertex
- return true;
-}
-#endif
-
// if two vertice coords have a x and/or y difference
// of less or equal than 1 FRACUNIT, they are considered the same
// point. Note: hardcoded value, 1.0f could be anything else.
@@ -254,11 +231,23 @@ static boolean SameVertice (polyvertex_t *p1, polyvertex_t *p2)
diff = p2->y - p1->y;
if (diff < -1.5f || diff > 1.5f)
return false;
-#else
+#elif 0
if (p1->x != p2->x)
return false;
if (p1->y != p2->y)
return false;
+#elif 0
+ if (fabsf( p2->x - p1->x ) > 1.0E-36f )
+ return false;
+ if (fabsf( p2->y - p1->y ) > 1.0E-36f )
+ return false;
+#else
+#define DIVLINE_VERTEX_DIFF 0.45f
+ float ep = DIVLINE_VERTEX_DIFF;
+ if (fabsf( p2->x - p1->x ) > ep )
+ return false;
+ if (fabsf( p2->y - p1->y ) > ep )
+ return false;
#endif
// p1 and p2 are considered the same vertex
return true;
@@ -295,57 +284,57 @@ static void SplitPoly (fdivline_t *bsp, //splitting parametric line
// start & end points
pv = fracdivline(bsp, &poly->pts[i], &poly->pts[j]);
- if (pv)
+ if (pv == NULL)
+ continue;
+
+ if (ps < 0)
{
- if (ps < 0)
+ // first point
+ ps = i;
+ vs = *pv;
+ fracs = bspfrac;
+ }
+ else
+ {
+ //the partition line traverse a junction between two segments
+ // or the two points are so close, they can be considered as one
+ // thus, don't accept, since split 2 must be another vertex
+ if (SameVertice(pv, &lastpv))
{
- // first point
- ps = i;
- vs = *pv;
- fracs = bspfrac;
- }
- else
- {
- //the partition line traverse a junction between two segments
- // or the two points are so close, they can be considered as one
- // thus, don't accept, since split 2 must be another vertex
- if (SameVertice(pv, &lastpv))
+ if (pe < 0)
{
- if (pe < 0)
- {
- ps = i;
- psonline = 1;
- }
- else
- {
- pe = i;
- peonline = 1;
- }
+ ps = i;
+ psonline = 1;
}
else
{
- if (pe < 0)
- {
- pe = i;
- ve = *pv;
- frace = bspfrac;
- }
- else
- {
- // a frac, not same vertice as last one
- // we already got pt2 so pt 2 is not on the line,
- // so we probably got back to the start point
- // which is on the line
- if (SameVertice(pv, &vs))
- psonline = 1;
- break;
- }
+ pe = i;
+ peonline = 1;
+ }
+ }
+ else
+ {
+ if (pe < 0)
+ {
+ pe = i;
+ ve = *pv;
+ frace = bspfrac;
+ }
+ else
+ {
+ // a frac, not same vertice as last one
+ // we already got pt2 so pt 2 is not on the line,
+ // so we probably got back to the start point
+ // which is on the line
+ if (SameVertice(pv, &vs))
+ psonline = 1;
+ break;
}
}
-
- // remember last point intercept to detect identical points
- lastpv = *pv;
}
+
+ // remember last point intercept to detect identical points
+ lastpv = *pv;
}
// no split: the partition line is either parallel and
@@ -369,7 +358,7 @@ static void SplitPoly (fdivline_t *bsp, //splitting parametric line
return;
}
- if (ps >= 0 && pe < 0)
+ if (pe < 0)
{
//I_Error("SplitPoly: only one point for split line (%d %d)", ps, pe);
*frontpoly = poly;
@@ -388,7 +377,7 @@ static void SplitPoly (fdivline_t *bsp, //splitting parametric line
*backpoly = HWR_AllocPoly(2 + nptback);
else
*backpoly = NULL;
- if (nptfront)
+ if (nptfront > 0)
*frontpoly = HWR_AllocPoly(2 + nptfront);
else
*frontpoly = NULL;
@@ -483,42 +472,42 @@ static poly_t *CutOutSubsecPoly(seg_t *lseg, INT32 count, poly_t *poly)
pv = fracdivline(&cutseg, &poly->pts[i], &poly->pts[j]);
- if (pv)
+ if (pv == NULL)
+ continue;
+
+ if (ps < 0)
{
- if (ps < 0)
+ ps = i;
+ vs = *pv;
+ fracs = bspfrac;
+ }
+ else
+ {
+ //frac 1 on previous segment,
+ // 0 on the next,
+ //the split line goes through one of the convex poly
+ // vertices, happens quite often since the convex
+ // poly is already adjacent to the subsector segs
+ // on most borders
+ if (SameVertice(pv, &vs))
+ continue;
+
+ if (fracs <= bspfrac)
{
+ nump = 2 + poly->numpts - (i-ps);
+ pe = ps;
ps = i;
- vs = *pv;
- fracs = bspfrac;
+ ve = *pv;
}
else
{
- //frac 1 on previous segment,
- // 0 on the next,
- //the split line goes through one of the convex poly
- // vertices, happens quite often since the convex
- // poly is already adjacent to the subsector segs
- // on most borders
- if (SameVertice(pv, &vs))
- continue;
-
- if (fracs <= bspfrac)
- {
- nump = 2 + poly->numpts - (i-ps);
- pe = ps;
- ps = i;
- ve = *pv;
- }
- else
- {
- nump = 2 + (i-ps);
- pe = i;
- ve = vs;
- vs = *pv;
- }
- //found 2nd point
- break;
+ nump = 2 + (i-ps);
+ pe = i;
+ ve = vs;
+ vs = *pv;
}
+ //found 2nd point
+ break;
}
}
@@ -582,18 +571,42 @@ static inline void HWR_SubsecPoly(INT32 num, poly_t *poly)
// search for the segs source of this divline
static inline void SearchDivline(node_t *bsp, fdivline_t *divline)
{
-#if 0 // MAR - If you don't use the same partition line that the BSP uses, the front/back polys won't match the subsectors in the BSP!
-#endif
divline->x = FIXED_TO_FLOAT(bsp->x);
divline->y = FIXED_TO_FLOAT(bsp->y);
divline->dx = FIXED_TO_FLOAT(bsp->dx);
divline->dy = FIXED_TO_FLOAT(bsp->dy);
}
+#ifdef HWR_LOADING_SCREEN
//Hurdler: implement a loading status
static size_t ls_count = 0;
static UINT8 ls_percent = 0;
+static void loading_status(void)
+{
+ char s[16];
+ int x, y;
+
+ I_OsPolling();
+ CON_Drawer();
+ sprintf(s, "%d%%", (++ls_percent)<<1);
+ x = BASEVIDWIDTH/2;
+ y = BASEVIDHEIGHT/2;
+ V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); // Black background to match fade in effect
+ //V_DrawPatchFill(W_CachePatchName("SRB2BACK",PU_CACHE)); // SRB2 background, ehhh too bright.
+ M_DrawTextBox(x-58, y-8, 13, 1);
+ V_DrawString(x-50, y, V_YELLOWMAP, "Loading...");
+ V_DrawRightAlignedString(x+50, y, V_YELLOWMAP, s);
+
+ // Is this really necessary at this point..?
+ V_DrawCenteredString(BASEVIDWIDTH/2, 40, V_YELLOWMAP, "OPENGL MODE IS INCOMPLETE AND MAY");
+ V_DrawCenteredString(BASEVIDWIDTH/2, 50, V_YELLOWMAP, "NOT DISPLAY SOME SURFACES.");
+ V_DrawCenteredString(BASEVIDWIDTH/2, 70, V_YELLOWMAP, "USE AT SONIC'S RISK.");
+
+ I_UpdateNoVsync();
+}
+#endif
+
// poly : the convex polygon that encloses all child subsectors
static void WalkBSPNode(INT32 bspnum, poly_t *poly, UINT16 *leafnode, fixed_t *bbox)
{
@@ -631,36 +644,19 @@ static void WalkBSPNode(INT32 bspnum, poly_t *poly, UINT16 *leafnode, fixed_t *b
}
else
{
- HWR_SubsecPoly(bspnum&(~NF_SUBSECTOR), poly);
- //Hurdler: implement a loading status
+ HWR_SubsecPoly(bspnum & ~NF_SUBSECTOR, poly);
+ //Hurdler: implement a loading status
+#ifdef HWR_LOADING_SCREEN
if (ls_count-- <= 0)
{
- char s[16];
- int x, y;
-
- I_OsPolling();
ls_count = numsubsectors/50;
- CON_Drawer();
- sprintf(s, "%d%%", (++ls_percent)<<1);
- x = BASEVIDWIDTH/2;
- y = BASEVIDHEIGHT/2;
- V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol); // Background to match fade in effect
- //V_DrawPatchFill(W_CachePatchName("SRB2BACK",PU_CACHE)); // SRB2 background, ehhh too bright.
- M_DrawTextBox(x-58, y-8, 13, 1);
- V_DrawString(x-50, y, V_YELLOWMAP, "Loading...");
- V_DrawRightAlignedString(x+50, y, V_YELLOWMAP, s);
-
- // Is this really necessary at this point..?
- V_DrawCenteredString(BASEVIDWIDTH/2, 40, V_YELLOWMAP, "OPENGL MODE IS INCOMPLETE AND MAY");
- V_DrawCenteredString(BASEVIDWIDTH/2, 50, V_YELLOWMAP, "NOT DISPLAY SOME SURFACES.");
- V_DrawCenteredString(BASEVIDWIDTH/2, 70, V_YELLOWMAP, "USE AT SONIC'S RISK.");
-
- I_UpdateNoVsync();
+ loading_status();
}
+#endif
}
M_ClearBox(bbox);
- poly = extrasubsectors[bspnum&~NF_SUBSECTOR].planepoly;
+ poly = extrasubsectors[bspnum & ~NF_SUBSECTOR].planepoly;
for (i = 0, pt = poly->pts; i < poly->numpts; i++,pt++)
M_AddToBox(bbox, FLOAT_TO_FIXED(pt->x), FLOAT_TO_FIXED(pt->y));
@@ -692,14 +688,13 @@ static void WalkBSPNode(INT32 bspnum, poly_t *poly, UINT16 *leafnode, fixed_t *b
if (backpoly)
{
// Correct back bbox to include floor/ceiling convex polygon
- WalkBSPNode(bsp->children[1], backpoly, &bsp->children[1],
- bsp->bbox[1]);
+ WalkBSPNode(bsp->children[1], backpoly, &bsp->children[1], bsp->bbox[1]);
- // enlarge bbox with seconde child
+ // enlarge bbox with second child
M_AddToBox(bbox, bsp->bbox[1][BOXLEFT ],
- bsp->bbox[1][BOXTOP ]);
+ bsp->bbox[1][BOXTOP ]);
M_AddToBox(bbox, bsp->bbox[1][BOXRIGHT ],
- bsp->bbox[1][BOXBOTTOM]);
+ bsp->bbox[1][BOXBOTTOM]);
}
}
@@ -779,9 +774,9 @@ static void SearchSegInBSP(INT32 bspnum,polyvertex_t *p,poly_t *poly)
if (bspnum & NF_SUBSECTOR)
{
- if (bspnum!=-1)
+ if (bspnum != -1)
{
- bspnum&=~NF_SUBSECTOR;
+ bspnum &= ~NF_SUBSECTOR;
q = extrasubsectors[bspnum].planepoly;
if (poly == q || !q)
return;
@@ -967,7 +962,9 @@ void HWR_CreatePlanePolygons(INT32 bspnum)
fixed_t rootbbox[4];
CONS_Debug(DBG_RENDER, "Creating polygons, please wait...\n");
+#ifdef HWR_LOADING_SCREEN
ls_count = ls_percent = 0; // reset the loading status
+#endif
CON_Drawer(); //let the user know what we are doing
I_FinishUpdate(); // page flip or blit buffer
diff --git a/src/hardware/hw_draw.c b/src/hardware/hw_draw.c
index 100bb1180..c43cfe82a 100644
--- a/src/hardware/hw_draw.c
+++ b/src/hardware/hw_draw.c
@@ -296,7 +296,7 @@ void HWR_DrawFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
Z_Free(realpatch);
}
// centre screen
- if ((float)vid.width != (float)BASEVIDWIDTH * dupx)
+ if (fabsf((float)vid.width - (float)BASEVIDWIDTH * dupx) > 1.0E-36f)
{
if (option & V_SNAPTORIGHT)
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx));
@@ -307,7 +307,7 @@ void HWR_DrawFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
else if (perplayershuffle & 8)
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx))/4;
}
- if ((float)vid.height != (float)BASEVIDHEIGHT * dupy)
+ if (fabsf((float)vid.height - (float)BASEVIDHEIGHT * dupy) > 1.0E-36f)
{
if (option & V_SNAPTOBOTTOM)
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy));
@@ -452,14 +452,14 @@ void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscal
Z_Free(realpatch);
}
// centre screen
- if ((float)vid.width != (float)BASEVIDWIDTH * dupx)
+ if (fabsf((float)vid.width - (float)BASEVIDWIDTH * dupx) > 1.0E-36f)
{
if (option & V_SNAPTORIGHT)
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx));
else if (!(option & V_SNAPTOLEFT))
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx))/2;
}
- if ((float)vid.height != (float)BASEVIDHEIGHT * dupy)
+ if (fabsf((float)vid.height - (float)BASEVIDHEIGHT * dupy) > 1.0E-36f)
{
if (option & V_SNAPTOBOTTOM)
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy));
@@ -876,18 +876,6 @@ void HWR_DrawViewBorder(INT32 clearlines)
// AM_MAP.C DRAWING STUFF
// ==========================================================================
-// Clear the automap part of the screen
-void HWR_clearAutomap(void)
-{
- FRGBAFloat fColor = {0, 0, 0, 1};
-
- // minx,miny,maxx,maxy
- HWD.pfnGClipRect(0, 0, vid.width, vid.height, NZCLIP_PLANE);
- HWD.pfnClearBuffer(true, true, &fColor);
- HWD.pfnGClipRect(0, 0, vid.width, vid.height, NZCLIP_PLANE);
-}
-
-
// -----------------+
// HWR_drawAMline : draw a line of the automap (the clipping is already done in automap code)
// Arg : color is a RGB 888 value
@@ -908,6 +896,110 @@ void HWR_drawAMline(const fline_t *fl, INT32 color)
HWD.pfnDraw2DLine(&v1, &v2, color_rgba);
}
+// -------------------+
+// HWR_DrawConsoleFill : draw flat coloured transparent rectangle because that's cool, and hw sucks less than sw for that.
+// -------------------+
+void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32 options)
+{
+ FOutVector v[4];
+ FSurfaceInfo Surf;
+ float fx, fy, fw, fh;
+
+ if (w < 0 || h < 0)
+ return; // consistency w/ software
+
+// 3--2
+// | /|
+// |/ |
+// 0--1
+
+ fx = (float)x;
+ fy = (float)y;
+ fw = (float)w;
+ fh = (float)h;
+
+ if (!(options & V_NOSCALESTART))
+ {
+ float dupx = (float)vid.dupx, dupy = (float)vid.dupy;
+
+ if (x == 0 && y == 0 && w == BASEVIDWIDTH && h == BASEVIDHEIGHT)
+ {
+ RGBA_t rgbaColour = V_GetColor(color);
+ FRGBAFloat clearColour;
+ clearColour.red = (float)rgbaColour.s.red / 255;
+ clearColour.green = (float)rgbaColour.s.green / 255;
+ clearColour.blue = (float)rgbaColour.s.blue / 255;
+ clearColour.alpha = 1;
+ HWD.pfnClearBuffer(true, false, &clearColour);
+ return;
+ }
+
+ fx *= dupx;
+ fy *= dupy;
+ fw *= dupx;
+ fh *= dupy;
+
+ if (fabsf((float)vid.width - ((float)BASEVIDWIDTH * dupx)) > 1.0E-36f)
+ {
+ if (options & V_SNAPTORIGHT)
+ fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx));
+ else if (!(options & V_SNAPTOLEFT))
+ fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 2;
+ }
+ if (fabsf((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) > 1.0E-36f)
+ {
+ // same thing here
+ if (options & V_SNAPTOBOTTOM)
+ fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy));
+ else if (!(options & V_SNAPTOTOP))
+ fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 2;
+ }
+ }
+
+ if (fx >= vid.width || fy >= vid.height)
+ return;
+ if (fx < 0)
+ {
+ fw += fx;
+ fx = 0;
+ }
+ if (fy < 0)
+ {
+ fh += fy;
+ fy = 0;
+ }
+
+ if (fw <= 0 || fh <= 0)
+ return;
+ if (fx + fw > vid.width)
+ fw = (float)vid.width - fx;
+ if (fy + fh > vid.height)
+ fh = (float)vid.height - fy;
+
+ fx = -1 + fx / (vid.width / 2);
+ fy = 1 - fy / (vid.height / 2);
+ fw = fw / (vid.width / 2);
+ fh = fh / (vid.height / 2);
+
+ v[0].x = v[3].x = fx;
+ v[2].x = v[1].x = fx + fw;
+ v[0].y = v[1].y = fy;
+ v[2].y = v[3].y = fy - fh;
+
+ //Hurdler: do we still use this argb color? if not, we should remove it
+ v[0].argb = v[1].argb = v[2].argb = v[3].argb = 0xff00ff00; //;
+ v[0].z = v[1].z = v[2].z = v[3].z = 1.0f;
+
+ v[0].sow = v[3].sow = 0.0f;
+ v[2].sow = v[1].sow = 1.0f;
+ v[0].tow = v[1].tow = 0.0f;
+ v[2].tow = v[3].tow = 1.0f;
+
+ Surf.FlatColor.rgba = UINT2RGBA(color);
+ Surf.FlatColor.s.alpha = 0x80;
+
+ HWD.pfnDrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest);
+}
// -----------------+
// HWR_DrawFill : draw flat coloured rectangle, with no texture
@@ -1022,7 +1114,7 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
fw *= dupx;
fh *= dupy;
- if ((float)vid.width != (float)BASEVIDWIDTH * dupx)
+ if (fabsf((float)vid.width - (float)BASEVIDWIDTH * dupx) > 1.0E-36f)
{
if (color & V_SNAPTORIGHT)
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx));
@@ -1033,7 +1125,7 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
else if (perplayershuffle & 8)
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 4;
}
- if ((float)vid.height != (float)BASEVIDHEIGHT * dupy)
+ if (fabsf((float)vid.height - (float)BASEVIDHEIGHT * dupy) > 1.0E-36f)
{
// same thing here
if (color & V_SNAPTOBOTTOM)
diff --git a/src/hardware/hw_glob.h b/src/hardware/hw_glob.h
index 5d1a81d4f..9656e54e9 100644
--- a/src/hardware/hw_glob.h
+++ b/src/hardware/hw_glob.h
@@ -27,6 +27,9 @@
// the original aspect ratio of Doom graphics isn't square
#define ORIGINAL_ASPECT (320.0f/200.0f)
+// Uncomment this to enable the OpenGL loading screen
+//#define HWR_LOADING_SCREEN
+
// -----------
// structures
// -----------
diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c
index 3a152562b..2b32d8ff8 100644
--- a/src/hardware/hw_main.c
+++ b/src/hardware/hw_main.c
@@ -3576,9 +3576,7 @@ static void HWR_Subsector(size_t num)
#ifndef POLYSKY
// Moved here because before, when above the ceiling and the floor does not have the sky flat, it doesn't draw the sky
if (gr_frontsector->ceilingpic == skyflatnum || gr_frontsector->floorpic == skyflatnum)
- {
drawsky = true;
- }
#endif
#ifdef R_FAKEFLOORS
@@ -4158,7 +4156,7 @@ static void HWR_DrawSpriteShadow(gr_vissprite_t *spr, GLPatch_t *gpatch, float t
swallVerts[0].z = swallVerts[3].z = spr->z1;
swallVerts[2].z = swallVerts[1].z = spr->z2;
- if (spr->mobj && this_scale != 1.0f)
+ if (spr->mobj && fabsf(this_scale - 1.0f) > 1.0E-36f)
{
// Always a pixel above the floor, perfectly flat.
swallVerts[0].y = swallVerts[1].y = swallVerts[2].y = swallVerts[3].y = spr->ty - gpatch->topoffset * this_scale - (floorheight+3);
@@ -4326,7 +4324,7 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
wallVerts[1].z = wallVerts[2].z = spr->z2;
wallVerts[2].y = wallVerts[3].y = spr->ty;
- if (spr->mobj && this_scale != 1.0f)
+ if (spr->mobj && fabsf(this_scale - 1.0f) > 1.0E-36f)
wallVerts[0].y = wallVerts[1].y = spr->ty - gpatch->height * this_scale;
else
wallVerts[0].y = wallVerts[1].y = spr->ty - gpatch->height;
@@ -4355,6 +4353,16 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
wallVerts[0].tow = wallVerts[1].tow = gpatch->max_t;
}
+ // if it has a dispoffset, push it a little towards the camera
+ if (spr->dispoffset) {
+ float co = -gr_viewcos*(0.05f*spr->dispoffset);
+ float si = -gr_viewsin*(0.05f*spr->dispoffset);
+ wallVerts[0].z = wallVerts[3].z = wallVerts[0].z+si;
+ wallVerts[1].z = wallVerts[2].z = wallVerts[1].z+si;
+ wallVerts[0].x = wallVerts[3].x = wallVerts[0].x+co;
+ wallVerts[1].x = wallVerts[2].x = wallVerts[1].x+co;
+ }
+
realtop = top = wallVerts[3].y;
realbot = bot = wallVerts[0].y;
towtop = wallVerts[3].tow;
@@ -4607,7 +4615,7 @@ static void HWR_DrawSprite(gr_vissprite_t *spr)
wallVerts[0].x = wallVerts[3].x = spr->x1;
wallVerts[2].x = wallVerts[1].x = spr->x2;
wallVerts[2].y = wallVerts[3].y = spr->ty;
- if (spr->mobj && this_scale != 1.0f)
+ if (spr->mobj && fabsf(this_scale - 1.0f) > 1.0E-36f)
wallVerts[0].y = wallVerts[1].y = spr->ty - gpatch->height * this_scale;
else
wallVerts[0].y = wallVerts[1].y = spr->ty - gpatch->height;
@@ -4657,6 +4665,16 @@ static void HWR_DrawSprite(gr_vissprite_t *spr)
HWR_DrawSpriteShadow(spr, gpatch, this_scale);
}
+ // if it has a dispoffset, push it a little towards the camera
+ if (spr->dispoffset) {
+ float co = -gr_viewcos*(0.05f*spr->dispoffset);
+ float si = -gr_viewsin*(0.05f*spr->dispoffset);
+ wallVerts[0].z = wallVerts[3].z = wallVerts[0].z+si;
+ wallVerts[1].z = wallVerts[2].z = wallVerts[1].z+si;
+ wallVerts[0].x = wallVerts[3].x = wallVerts[0].x+co;
+ wallVerts[1].x = wallVerts[2].x = wallVerts[1].x+co;
+ }
+
// This needs to be AFTER the shadows so that the regular sprites aren't drawn completely black.
// sprite lighting by modulating the RGB components
/// \todo coloured
@@ -4853,7 +4871,7 @@ static void HWR_SortVisSprites(void)
best = ds;
}
// order visprites of same scale by dispoffset, smallest first
- else if (ds->tz == bestdist && ds->dispoffset < bestdispoffset)
+ else if (fabsf(ds->tz - bestdist) < 1.0E-36f && ds->dispoffset < bestdispoffset)
{
bestdispoffset = ds->dispoffset;
best = ds;
@@ -5694,7 +5712,7 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing)
// ==========================================================================
//
// ==========================================================================
-static void HWR_DrawSkyBackground(player_t *player)
+static void HWR_DrawSkyBackground(void)
{
FOutVector v[4];
angle_t angle;
@@ -5702,18 +5720,18 @@ static void HWR_DrawSkyBackground(player_t *player)
float aspectratio;
float angleturn;
-// 3--2
-// | /|
-// |/ |
-// 0--1
-
- (void)player;
HWR_GetTexture(texturetranslation[skytexture]);
+ aspectratio = (float)vid.width/(float)vid.height;
//Hurdler: the sky is the only texture who need 4.0f instead of 1.0
// because it's called just after clearing the screen
// and thus, the near clipping plane is set to 3.99
// Sryder: Just use the near clipping plane value then
+
+ // 3--2
+ // | /|
+ // |/ |
+ // 0--1
v[0].x = v[3].x = -ZCLIP_PLANE-1;
v[1].x = v[2].x = ZCLIP_PLANE+1;
v[0].y = v[1].y = -ZCLIP_PLANE-1;
@@ -5737,10 +5755,13 @@ static void HWR_DrawSkyBackground(player_t *player)
// Y
angle = aimingangle;
-
- aspectratio = (float)vid.width/(float)vid.height;
dimensionmultiply = ((float)textures[texturetranslation[skytexture]]->height/(128.0f*aspectratio));
- angleturn = (((float)ANGLE_45-1.0f)*aspectratio)*dimensionmultiply;
+
+ if (splitscreen)
+ {
+ dimensionmultiply *= 2;
+ angle *= 2;
+ }
// Middle of the sky should always be at angle 0
// need to keep correct aspect ratio with X
@@ -5756,6 +5777,8 @@ static void HWR_DrawSkyBackground(player_t *player)
v[3].tow = v[2].tow = v[0].tow - (1.0f/dimensionmultiply); // top (or bottom - 1.0f)
}
+ angleturn = (((float)ANGLE_45-1.0f)*aspectratio)*dimensionmultiply;
+
if (angle > ANGLE_180) // Do this because we don't want the sky to suddenly teleport when crossing over 0 to 360 and vice versa
{
angle = InvAngle(angle);
@@ -5814,7 +5837,7 @@ void HWR_SetViewSize(void)
gr_viewwindowx = (vid.width - gr_viewwidth) / 2;
gr_windowcenterx = (float)(vid.width / 2);
- if (gr_viewwidth == vid.width)
+ if (fabsf(gr_viewwidth - vid.width) < 1.0E-36f)
{
gr_baseviewwindowy = 0;
gr_basewindowcentery = gr_viewheight / 2; // window top left corner at 0,0
@@ -5920,7 +5943,7 @@ if (0)
}
if (drawsky)
- HWR_DrawSkyBackground(player);
+ HWR_DrawSkyBackground();
//Hurdler: it doesn't work in splitscreen mode
drawsky = splitscreen;
@@ -6137,7 +6160,7 @@ if (0)
}
if (!skybox && drawsky) // Don't draw the regular sky if there's a skybox
- HWR_DrawSkyBackground(player);
+ HWR_DrawSkyBackground();
//Hurdler: it doesn't work in splitscreen mode
drawsky = splitscreen;
diff --git a/src/hardware/hw_main.h b/src/hardware/hw_main.h
index f25720d1e..642e440d6 100644
--- a/src/hardware/hw_main.h
+++ b/src/hardware/hw_main.h
@@ -31,7 +31,6 @@
void HWR_Startup(void);
void HWR_Shutdown(void);
-void HWR_clearAutomap(void);
void HWR_drawAMline(const fline_t *fl, INT32 color);
void HWR_FadeScreenMenuBack(UINT16 color, UINT8 strength);
void HWR_DrawConsoleBack(UINT32 color, INT32 height);
@@ -52,6 +51,7 @@ void HWR_CreatePlanePolygons(INT32 bspnum);
void HWR_CreateStaticLightmaps(INT32 bspnum);
void HWR_PrepLevelCache(size_t pnumtextures);
void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color);
+void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32 options); // Lat: separate flags from color since color needs to be an uint to work right.
void HWR_DrawPic(INT32 x,INT32 y,lumpnum_t lumpnum);
void HWR_AddCommands(void);
diff --git a/src/hardware/r_opengl/r_opengl-vc10.vcxproj b/src/hardware/r_opengl/r_opengl-vc10.vcxproj
index f04ae320b..d1f856e96 100644
--- a/src/hardware/r_opengl/r_opengl-vc10.vcxproj
+++ b/src/hardware/r_opengl/r_opengl-vc10.vcxproj
@@ -1,6 +1,14 @@

+
+ Debug
+ ARM
+
+
+ Debug
+ ARM64
+
Debug
Win32
@@ -9,6 +17,14 @@
Debug
x64
+
+ Release
+ ARM
+
+
+ Release
+ ARM64
+
Release
Win32
@@ -22,7 +38,7 @@
r_opengl
{51137D5C-4E81-4955-AACF-EA3092006051}
r_opengl
- 8.1
+ 10.0.16299.0
@@ -30,21 +46,45 @@
false
v140
+
+ DynamicLibrary
+ false
+ v141
+ true
+
DynamicLibrary
false
v140
+
+ DynamicLibrary
+ false
+ v141
+ true
+
DynamicLibrary
false
v140
+
+ DynamicLibrary
+ false
+ v141
+ true
+
DynamicLibrary
false
v140
+
+ DynamicLibrary
+ false
+ v141
+ true
+
@@ -52,37 +92,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
<_ProjectFileVersion>10.0.30319.1
.\..\..\..\bin\VC10\$(Platform)\$(Configuration)\
+ .\..\..\..\bin\VC10\$(Platform)\$(Configuration)\
.\..\..\..\objs\VC10\$(Platform)\$(Configuration)\r_opengl\
+ .\..\..\..\objs\VC10\$(Platform)\$(Configuration)\r_opengl\
true
+ true
true
+ true
.\..\..\..\bin\VC10\$(Platform)\$(Configuration)\
+ .\..\..\..\bin\VC10\$(Platform)\$(Configuration)\
.\..\..\..\objs\VC10\$(Platform)\$(Configuration)\r_opengl\
+ .\..\..\..\objs\VC10\$(Platform)\$(Configuration)\r_opengl\
true
+ true
true
+ true
.\..\..\..\bin\VC10\$(Platform)\$(Configuration)\
+ .\..\..\..\bin\VC10\$(Platform)\$(Configuration)\
.\..\..\..\objs\VC10\$(Platform)\$(Configuration)\r_opengl\
+ .\..\..\..\objs\VC10\$(Platform)\$(Configuration)\r_opengl\
true
+ true
false
+ false
.\..\..\..\bin\VC10\$(Platform)\$(Configuration)\
+ .\..\..\..\bin\VC10\$(Platform)\$(Configuration)\
.\..\..\..\objs\VC10\$(Platform)\$(Configuration)\r_opengl\
+ .\..\..\..\objs\VC10\$(Platform)\$(Configuration)\r_opengl\
true
+ true
false
+ false
@@ -123,6 +195,49 @@
$(IntDir)r_opengl.lib
MachineX86
Windows
+ gdi32.lib;%(AdditionalDependencies)
+
+
+ true
+ $(OutDir)r_opengl.bsc
+
+
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ true
+ true
+ .\..\..\..\bin\VC10\$(Platform)\$(Configuration)\r_opengl\r_opengl.tlb
+
+
+
+
+ Disabled
+ _DEBUG;WIN32;_WINDOWS;__WIN32__;__MSC__;USE_WGL_SWAP;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
+ EnableFastChecks
+ MultiThreadedDebug
+ $(IntDir)
+ $(IntDir)r_opengl.pdb
+ true
+ Level4
+ true
+ ProgramDatabase
+ CompileAsC
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ 0x0409
+
+
+ $(OutDir)r_opengl.dll
+ true
+ true
+ $(OutDir)r_opengl.pdb
+
+
+ $(IntDir)r_opengl.lib
+ Windows
+ gdi32.lib;%(AdditionalDependencies)
true
@@ -168,6 +283,49 @@
$(IntDir)r_opengl.lib
MachineX64
Windows
+ gdi32.lib;%(AdditionalDependencies)
+
+
+ true
+ $(OutDir)r_opengl.bsc
+
+
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ true
+ true
+ .\..\..\..\bin\VC10\$(Platform)\$(Configuration)\r_opengl\r_opengl.tlb
+
+
+
+
+ Disabled
+ _DEBUG;WIN32;_WINDOWS;__WIN32__;__MSC__;USE_WGL_SWAP;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
+ EnableFastChecks
+ MultiThreadedDebug
+ $(IntDir)
+ $(IntDir)r_opengl.pdb
+ true
+ Level4
+ true
+ ProgramDatabase
+ CompileAsC
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ 0x0409
+
+
+ $(OutDir)r_opengl.dll
+ true
+ true
+ $(OutDir)r_opengl.pdb
+
+
+ $(IntDir)r_opengl.lib
+ Windows
+ gdi32.lib;%(AdditionalDependencies)
true
@@ -215,6 +373,52 @@
$(IntDir)r_opengl.lib
MachineX86
Windows
+ gdi32.lib;%(AdditionalDependencies)
+
+
+ true
+ $(OutDir)r_opengl.bsc
+
+
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ true
+ true
+ .\..\..\..\bin\VC10\$(Platform)\$(Configuration)\r_opengl\r_opengl.tlb
+
+
+
+
+ /MP %(AdditionalOptions)
+ MaxSpeed
+ OnlyExplicitInline
+ NDEBUG;WIN32;_WINDOWS;__WIN32__;__MSC__;USE_WGL_SWAP;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
+ true
+ MultiThreaded
+ true
+ $(IntDir)
+ $(IntDir)r_opengl.pdb
+ true
+ Level3
+ true
+ ProgramDatabase
+ CompileAsC
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ 0x0409
+
+
+ $(OutDir)r_opengl.dll
+ true
+ true
+ $(OutDir)r_opengl.pdb
+
+
+ $(IntDir)r_opengl.lib
+ Windows
+ gdi32.lib;%(AdditionalDependencies)
true
@@ -262,6 +466,52 @@
$(IntDir)r_opengl.lib
MachineX64
Windows
+ gdi32.lib;%(AdditionalDependencies)
+
+
+ true
+ $(OutDir)r_opengl.bsc
+
+
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ true
+ true
+ .\..\..\..\bin\VC10\$(Platform)\$(Configuration)\r_opengl\r_opengl.tlb
+
+
+
+
+ /MP %(AdditionalOptions)
+ MaxSpeed
+ OnlyExplicitInline
+ NDEBUG;WIN32;_WINDOWS;__WIN32__;__MSC__;USE_WGL_SWAP;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
+ true
+ MultiThreaded
+ true
+ $(IntDir)
+ $(IntDir)r_opengl.pdb
+ true
+ Level3
+ true
+ ProgramDatabase
+ CompileAsC
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ 0x0409
+
+
+ $(OutDir)r_opengl.dll
+ true
+ true
+ $(OutDir)r_opengl.pdb
+
+
+ $(IntDir)r_opengl.lib
+ Windows
+ gdi32.lib;%(AdditionalDependencies)
true
@@ -271,15 +521,23 @@
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c
index 6ab268a85..dfee19857 100644
--- a/src/hardware/r_opengl/r_opengl.c
+++ b/src/hardware/r_opengl/r_opengl.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// Copyright (C) 1998-2006 by Sonic Team Junior.
+// Copyright (C) 1998-2018 by Sonic Team Junior.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
@@ -551,7 +551,8 @@ static void GLPerspective(GLdouble fovy, GLdouble aspect)
const GLdouble deltaZ = zFar - zNear;
GLdouble cotangent;
- if ((deltaZ == 0.0f) || (sine == 0.0f) || (aspect == 0.0f)) {
+ if ((fabsf((float)deltaZ) < 1.0E-36f) || fpclassify(sine) == FP_ZERO || fpclassify(aspect) == FP_ZERO)
+ {
return;
}
cotangent = cos(radians) / sine;
@@ -585,7 +586,7 @@ static void GLProject(GLdouble objX, GLdouble objY, GLdouble objZ,
out[2] * projMatrix[2*4+i] +
out[3] * projMatrix[3*4+i];
}
- if (in[3] == 0.0f) return;
+ if (fpclassify(in[3]) == FP_ZERO) return;
in[0] /= in[3];
in[1] /= in[3];
in[2] /= in[3];
@@ -1660,7 +1661,7 @@ static void DrawMD2Ex(INT32 *gl_cmd_buffer, md2_frame_t *frame, INT32 duration,
pglTexCoord2f(s, t);
- if (!nextframe || pol == 0.0f)
+ if (!nextframe || fpclassify(pol) == FP_ZERO)
{
pglNormal3f(frame->vertices[pindex].normal[0],
frame->vertices[pindex].normal[1],
@@ -1729,6 +1730,7 @@ EXPORT void HWRAPI(SetTransform) (FTransform *stransform)
pglLoadIdentity();
if (stransform)
{
+ boolean fovx90;
// keep a trace of the transformation for md2
memcpy(&md2_transform, stransform, sizeof (md2_transform));
@@ -1743,7 +1745,8 @@ EXPORT void HWRAPI(SetTransform) (FTransform *stransform)
pglMatrixMode(GL_PROJECTION);
pglLoadIdentity();
- special_splitscreen = (stransform->splitscreen && stransform->fovxangle == 90.0f);
+ fovx90 = stransform->fovxangle > 0.0f && fabsf(stransform->fovxangle - 90.0f) < 0.5f;
+ special_splitscreen = (stransform->splitscreen && fovx90);
if (special_splitscreen)
GLPerspective(53.13l, 2*ASPECT_RATIO); // 53.13 = 2*atan(0.5)
else
diff --git a/src/hardware/s_openal/s_openal-vc10.vcxproj b/src/hardware/s_openal/s_openal-vc10.vcxproj
index 8b4f6cbbe..5039cd006 100644
--- a/src/hardware/s_openal/s_openal-vc10.vcxproj
+++ b/src/hardware/s_openal/s_openal-vc10.vcxproj
@@ -1,6 +1,14 @@

+
+ Debug
+ ARM
+
+
+ Debug
+ ARM64
+
Debug
Win32
@@ -9,6 +17,14 @@
Debug
x64
+
+ Release
+ ARM
+
+
+ Release
+ ARM64
+
Release
Win32
@@ -22,7 +38,7 @@
s_openal
{E662D0B3-412D-4D55-A5EC-8CBD680DDCBE}
s_openal
- 8.1
+ 10.0.16299.0
@@ -31,22 +47,44 @@
MultiByte
v140
+
+ DynamicLibrary
+ false
+ MultiByte
+ v141
+
DynamicLibrary
false
v140
+
+ DynamicLibrary
+ false
+ v141
+
DynamicLibrary
false
MultiByte
v140
+
+ DynamicLibrary
+ false
+ MultiByte
+ v141
+
DynamicLibrary
false
v140
+
+ DynamicLibrary
+ false
+ v141
+
@@ -54,37 +92,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
<_ProjectFileVersion>10.0.30319.1
.\..\..\..\bin\VC10\$(Platform)\$(Configuration)\
+ .\..\..\..\bin\VC10\$(Platform)\$(Configuration)\
.\..\..\..\objs\VC10\$(Platform)\$(Configuration)\s_openal\
+ .\..\..\..\objs\VC10\$(Platform)\$(Configuration)\s_openal\
true
+ true
false
+ false
.\..\..\..\bin\VC10\$(Platform)\$(Configuration)\
+ .\..\..\..\bin\VC10\$(Platform)\$(Configuration)\
.\..\..\..\objs\VC10\$(Platform)\$(Configuration)\s_openal\
+ .\..\..\..\objs\VC10\$(Platform)\$(Configuration)\s_openal\
true
+ true
false
+ false
.\..\..\..\bin\VC10\$(Platform)\$(Configuration)\
+ .\..\..\..\bin\VC10\$(Platform)\$(Configuration)\
.\..\..\..\objs\VC10\$(Platform)\$(Configuration)\s_openal\
+ .\..\..\..\objs\VC10\$(Platform)\$(Configuration)\s_openal\
true
+ true
true
+ true
.\..\..\..\bin\VC10\$(Platform)\$(Configuration)\
+ .\..\..\..\bin\VC10\$(Platform)\$(Configuration)\
.\..\..\..\objs\VC10\$(Platform)\$(Configuration)\s_openal\
+ .\..\..\..\objs\VC10\$(Platform)\$(Configuration)\s_openal\
true
+ true
true
+ true
@@ -132,6 +202,50 @@
$(OutDir)s_openal.bsc
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ true
+ .\..\..\..\bin\VC10\$(Platform)\$(Configuration)\s_openal\s_openal.tlb
+
+
+
+
+ /MP %(AdditionalOptions)
+ MaxSpeed
+ OnlyExplicitInline
+ WIN32;NDEBUG;_WINDOWS;__WIN32__;__MSC__;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
+ true
+ MultiThreaded
+ true
+ $(IntDir)
+ $(IntDir)s_openal.pdb
+ true
+ Level3
+ true
+ CompileAsC
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ 0x0409
+
+
+ OpenAL32.lib;%(AdditionalDependencies)
+ $(OutDir)s_openal.dll
+ true
+ true
+ $(OutDir)s_openal.pdb
+ false
+
+
+ $(IntDir)s_openal.lib
+ Windows
+
+
+ true
+ $(OutDir)s_openal.bsc
+
+
NDEBUG;%(PreprocessorDefinitions)
@@ -178,6 +292,50 @@
$(OutDir)s_openal.bsc
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ true
+ .\..\..\..\bin\VC10\$(Platform)\$(Configuration)\s_openal\s_openal.tlb
+
+
+
+
+ /MP %(AdditionalOptions)
+ MaxSpeed
+ OnlyExplicitInline
+ WIN32;NDEBUG;_WINDOWS;__WIN32__;__MSC__;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
+ true
+ MultiThreaded
+ true
+ $(IntDir)
+ $(IntDir)s_openal.pdb
+ true
+ Level3
+ true
+ CompileAsC
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ 0x0409
+
+
+ OpenAL32.lib;%(AdditionalDependencies)
+ $(OutDir)s_openal.dll
+ true
+ true
+ $(OutDir)s_openal.pdb
+ false
+
+
+ $(IntDir)s_openal.lib
+ Windows
+
+
+ true
+ $(OutDir)s_openal.bsc
+
+
_DEBUG;%(PreprocessorDefinitions)
@@ -225,6 +383,50 @@
$(OutDir)s_openal.bsc
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ true
+ true
+ .\..\..\..\bin\VC10\$(Platform)\$(Configuration)\s_openal\s_openal.tlb
+
+
+
+
+ /MP /SAFESEH:OFF %(AdditionalOptions)
+ Disabled
+ WIN32;_DEBUG;_WINDOWS;__WIN32__;__MSC__;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
+ EnableFastChecks
+ MultiThreadedDebug
+ $(IntDir)
+ $(IntDir)s_openal.pdb
+ true
+ Level4
+ true
+ ProgramDatabase
+ CompileAsC
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ 0x0409
+
+
+ OpenAL32.lib;%(AdditionalDependencies)
+ $(OutDir)s_openal.dll
+ true
+ true
+ $(OutDir)s_openal.pdb
+ false
+
+
+ $(IntDir)s_openal.lib
+ Windows
+
+
+ true
+ $(OutDir)s_openal.bsc
+
+
_DEBUG;%(PreprocessorDefinitions)
@@ -272,12 +474,60 @@
$(OutDir)s_openal.bsc
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ true
+ true
+ .\..\..\..\bin\VC10\$(Platform)\$(Configuration)\s_openal\s_openal.tlb
+
+
+
+
+ Disabled
+ WIN32;_DEBUG;_WINDOWS;__WIN32__;__MSC__;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
+ EnableFastChecks
+ MultiThreadedDebug
+ $(IntDir)
+ $(IntDir)s_openal.pdb
+ true
+ Level4
+ true
+ ProgramDatabase
+ CompileAsC
+ /MP /SAFESEH:OFF %(AdditionalOptions)
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ 0x0409
+
+
+ OpenAL32.lib;%(AdditionalDependencies)
+ $(OutDir)s_openal.dll
+ true
+ true
+ $(OutDir)s_openal.pdb
+ false
+
+
+ $(IntDir)s_openal.lib
+ Windows
+
+
+ true
+ $(OutDir)s_openal.bsc
+
+
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
%(PreprocessorDefinitions)
+ %(PreprocessorDefinitions)
diff --git a/src/hu_stuff.c b/src/hu_stuff.c
index 6e17b939d..a727d002d 100644
--- a/src/hu_stuff.c
+++ b/src/hu_stuff.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -74,6 +74,7 @@ patch_t *ttlnum[20]; // act numbers (0-19)
static player_t *plr;
boolean chat_on; // entering a chat message?
static char w_chat[HU_MAXMSGLEN];
+static size_t c_input = 0; // let's try to make the chat input less shitty.
static boolean headsupactive = false;
boolean hu_showscores; // draw rankings
static char hu_tick;
@@ -327,6 +328,88 @@ void HU_Start(void)
//======================================================================
#ifndef NONET
+
+// EVERY CHANGE IN THIS SCRIPT IS LOL XD! BY VINCYTM
+
+static UINT32 chat_nummsg_log = 0;
+static UINT32 chat_nummsg_min = 0;
+static UINT32 chat_scroll = 0;
+static tic_t chat_scrolltime = 0;
+
+static UINT32 chat_maxscroll = 0; // how far can we scroll?
+
+//static chatmsg_t chat_mini[CHAT_BUFSIZE]; // Display the last few messages sent.
+//static chatmsg_t chat_log[CHAT_BUFSIZE]; // Keep every message sent to us in memory so we can scroll n shit, it's cool.
+
+static char chat_log[CHAT_BUFSIZE][255]; // hold the last 48 or so messages in that log.
+static char chat_mini[8][255]; // display up to 8 messages that will fade away / get overwritten
+static tic_t chat_timers[8];
+
+static boolean chat_scrollmedown = false; // force instant scroll down on the chat log. Happens when you open it / send a message.
+
+// remove text from minichat table
+
+static INT16 addy = 0; // use this to make the messages scroll smoothly when one fades away
+
+static void HU_removeChatText_Mini(void)
+{
+ // MPC: Don't create new arrays, just iterate through an existing one
+ size_t i;
+ for(i=0;i= CHAT_BUFSIZE) // too many messages!
+ HU_removeChatText_Log();
+
+ strcpy(chat_log[chat_nummsg_log], text);
+ chat_nummsg_log++;
+
+ if (chat_nummsg_min >= 8)
+ HU_removeChatText_Mini();
+
+ strcpy(chat_mini[chat_nummsg_min], text);
+ chat_timers[chat_nummsg_min] = TICRATE*cv_chattime.value;
+ chat_nummsg_min++;
+
+ if (OLDCHAT) // if we're using oldchat, print directly in console
+ CONS_Printf("%s\n", text);
+ else // if we aren't, still save the message to log.txt
+ CON_LogMessage(va("%s\n", text));
+#else
+ (void)playsound;
+ CONS_Printf("%s\n", text);
+#endif
+}
+
+#ifndef NONET
+
/** Runs a say command, sending an ::XD_SAY message.
* A say command consists of a signed 8-bit integer for the target, an
* unsigned 8-bit flag variable, and then the message itself.
@@ -345,6 +428,8 @@ void HU_Start(void)
* \sa Command_Say_f, Command_Sayteam_f, Command_Sayto_f, Got_Saycmd
* \author Graue
*/
+
+
static void DoSayCommand(SINT8 target, size_t usedargs, UINT8 flags)
{
char buf[254];
@@ -355,14 +440,14 @@ static void DoSayCommand(SINT8 target, size_t usedargs, UINT8 flags)
numwords = COM_Argc() - usedargs;
I_Assert(numwords > 0);
- if (cv_mute.value && !(server || adminplayer == consoleplayer))
+ if (CHAT_MUTE) // TODO: Per Player mute.
{
- CONS_Alert(CONS_NOTICE, M_GetText("The chat is muted. You can't say anything at the moment.\n"));
+ HU_AddChatText(va("%s>ERROR: The chat is muted. You can't say anything.", "\x85"), false);
return;
}
// Only servers/admins can CSAY.
- if(!server && adminplayer != consoleplayer)
+ if(!server && !(IsPlayerAdmin(consoleplayer)))
flags &= ~HU_CSAY;
// We handle HU_SERVER_SAY, not the caller.
@@ -381,6 +466,57 @@ static void DoSayCommand(SINT8 target, size_t usedargs, UINT8 flags)
strlcat(msg, COM_Argv(ix + usedargs), msgspace);
}
+ if (strlen(msg) > 4 && strnicmp(msg, "/pm", 3) == 0) // used /pm
+ {
+ // what we're gonna do now is check if the node exists
+ // with that logic, characters 4 and 5 are our numbers:
+ const char *newmsg;
+ char *nodenum = (char*) malloc(3);
+ INT32 spc = 1; // used if nodenum[1] is a space.
+
+ strncpy(nodenum, msg+3, 3);
+ // check for undesirable characters in our "number"
+ if (((nodenum[0] < '0') || (nodenum[0] > '9')) || ((nodenum[1] < '0') || (nodenum[1] > '9')))
+ {
+ // check if nodenum[1] is a space
+ if (nodenum[1] == ' ')
+ spc = 0;
+ // let it slide
+ else
+ {
+ HU_AddChatText("\x82NOTICE: \x80Invalid command format. Correct format is \'/pm \'.", false);
+ free(nodenum);
+ return;
+ }
+ }
+ // I'm very bad at C, I swear I am, additional checks eww!
+ if (spc != 0)
+ {
+ if (msg[5] != ' ')
+ {
+ HU_AddChatText("\x82NOTICE: \x80Invalid command format. Correct format is \'/pm \'.", false);
+ free(nodenum);
+ return;
+ }
+ }
+
+ target = atoi((const char*) nodenum); // turn that into a number
+ free(nodenum);
+ //CONS_Printf("%d\n", target);
+
+ // check for target player, if it doesn't exist then we can't send the message!
+ if (target < MAXPLAYERS && playeringame[target]) // player exists
+ target++; // even though playernums are from 0 to 31, target is 1 to 32, so up that by 1 to have it work!
+ else
+ {
+ HU_AddChatText(va("\x82NOTICE: \x80Player %d does not exist.", target), false); // same
+ return;
+ }
+ buf[0] = target;
+ newmsg = msg+5+spc;
+ strlcpy(msg, newmsg, 252);
+ }
+
SendNetXCmd(XD_SAY, buf, strlen(msg) + 1 + msg-buf);
}
@@ -456,7 +592,7 @@ static void Command_CSay_f(void)
return;
}
- if(!server && adminplayer != consoleplayer)
+ if(!server && !IsPlayerAdmin(consoleplayer))
{
CONS_Alert(CONS_NOTICE, M_GetText("Only servers and admins can use csay.\n"));
return;
@@ -464,6 +600,7 @@ static void Command_CSay_f(void)
DoSayCommand(0, 1, HU_CSAY);
}
+static tic_t stop_spamming[MAXPLAYERS];
/** Receives a message, processing an ::XD_SAY command.
* \sa DoSayCommand
@@ -477,6 +614,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
char *msg;
boolean action = false;
char *ptr;
+ INT32 spam_eatmsg = 0;
CONS_Debug(DBG_NETPLAY,"Received SAY cmd from Player %d (%s)\n", playernum+1, player_names[playernum]);
@@ -485,7 +623,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
msg = (char *)*p;
SKIPSTRING(*p);
- if ((cv_mute.value || flags & (HU_CSAY|HU_SERVER_SAY)) && playernum != serverplayer && playernum != adminplayer)
+ if ((cv_mute.value || flags & (HU_CSAY|HU_SERVER_SAY)) && playernum != serverplayer && !(IsPlayerAdmin(playernum)))
{
CONS_Alert(CONS_WARNING, cv_mute.value ?
M_GetText("Illegal say command received from %s while muted\n") : M_GetText("Illegal csay command received from non-admin %s\n"),
@@ -523,11 +661,28 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
}
}
+ // before we do anything, let's verify the guy isn't spamming, get this easier on us.
+
+ //if (stop_spamming[playernum] != 0 && cv_chatspamprotection.value && !(flags & HU_CSAY))
+ if (stop_spamming[playernum] != 0 && consoleplayer != playernum && cv_chatspamprotection.value && !(flags & HU_CSAY))
+ {
+ CONS_Debug(DBG_NETPLAY,"Received SAY cmd too quickly from Player %d (%s), assuming as spam and blocking message.\n", playernum+1, player_names[playernum]);
+ stop_spamming[playernum] = 4;
+ spam_eatmsg = 1;
+ }
+ else
+ stop_spamming[playernum] = 4; // you can hold off for 4 tics, can you?
+
+ // run the lua hook even if we were supposed to eat the msg, netgame consistency goes first.
+
#ifdef HAVE_BLUA
if (LUAh_PlayerMsg(playernum, target, flags, msg))
return;
#endif
+ if (spam_eatmsg)
+ return; // don't proceed if we were supposed to eat the message.
+
// If it's a CSAY, just CECHO and be done with it.
if (flags & HU_CSAY)
{
@@ -567,31 +722,69 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|| target == 0 // To everyone
|| consoleplayer == target-1) // To you
{
- const char *cstart = "", *cend = "", *adminchar = "~", *remotechar = "@", *fmt;
+ const char *prefix = "", *cstart = "", *cend = "", *adminchar = "\x82~\x83", *remotechar = "\x82@\x83", *fmt2, *textcolor = "\x80";
char *tempchar = NULL;
- // In CTF and team match, color the player's name.
- if (G_GametypeHasTeams())
+ // player is a spectator?
+ if (players[playernum].spectator)
{
- cend = "\x80";
- if (players[playernum].ctfteam == 1) // red
- cstart = "\x85";
- else if (players[playernum].ctfteam == 2) // blue
- cstart = "\x84";
+ cstart = "\x86"; // grey name
+ textcolor = "\x86";
}
+ else if (target == -1) // say team
+ {
+ if (players[playernum].ctfteam == 1) // red
+ {
+ cstart = "\x85";
+ textcolor = "\x85";
+ }
+ else // blue
+ {
+ cstart = "\x84";
+ textcolor = "\x84";
+ }
+ }
+ else
+ {
+ const UINT8 color = players[playernum].skincolor;
+
+ cstart = "\x83";
+
+ if (color <= SKINCOLOR_SILVER)
+ cstart = "\x80"; // White
+ else if (color <= SKINCOLOR_BLACK)
+ cstart = "\x86"; // Grey
+ else if (color <= SKINCOLOR_BLUE)
+ cstart = "\x84"; // Blue
+ else if (color <= SKINCOLOR_PEACH)
+ cstart = "\x87"; //... Orange???
+ else if (color == SKINCOLOR_PINK)
+ cstart = "\x85"; // Red.
+ else if (color <= SKINCOLOR_PURPLE)
+ cstart = "\x81"; // Purple
+ else if (color <= SKINCOLOR_ROSEWOOD)
+ cstart = "\x87"; // Orange
+ else if (color <= SKINCOLOR_DARKRED)
+ cstart = "\x85"; // Red
+ else if (color <= SKINCOLOR_OLIVE)
+ cstart = "\x83"; // green
+ else if (color <= SKINCOLOR_GOLD)
+ cstart = "\x82"; // Yellow
+ }
+ prefix = cstart;
// Give admins and remote admins their symbols.
if (playernum == serverplayer)
tempchar = (char *)Z_Calloc(strlen(cstart) + strlen(adminchar) + 1, PU_STATIC, NULL);
- else if (playernum == adminplayer)
+ else if (IsPlayerAdmin(playernum))
tempchar = (char *)Z_Calloc(strlen(cstart) + strlen(remotechar) + 1, PU_STATIC, NULL);
if (tempchar)
{
- strcat(tempchar, cstart);
if (playernum == serverplayer)
strcat(tempchar, adminchar);
else
strcat(tempchar, remotechar);
+ strcat(tempchar, cstart);
cstart = tempchar;
}
@@ -600,21 +793,39 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
// name, color end, and the message itself.
// '\4' makes the message yellow and beeps; '\3' just beeps.
if (action)
- fmt = "\4* %s%s%s \x82%s\n";
- else if (target == 0) // To everyone
- fmt = "\3<%s%s%s> %s\n";
+ fmt2 = "* %s%s%s%s \x82%s%s";
else if (target-1 == consoleplayer) // To you
- fmt = "\3*%s%s%s* %s\n";
+ {
+ prefix = "\x82[PM]";
+ cstart = "\x82";
+ textcolor = "\x82";
+ fmt2 = "%s<%s%s>%s\x80 %s%s";
+ }
else if (target > 0) // By you, to another player
{
// Use target's name.
dispname = player_names[target-1];
- fmt = "\3->*%s%s%s* %s\n";
- }
- else // To your team
- fmt = "\3>>%s%s%s<< (team) %s\n";
+ prefix = "\x82[TO]";
+ cstart = "\x82";
+ fmt2 = "%s<%s%s>%s\x80 %s%s";
+
+ }
+ else if (target == 0) // To everyone
+ fmt2 = "%s<%s%s%s>\x80 %s%s";
+ else // To your team
+ {
+ if (players[playernum].ctfteam == 1) // red
+ prefix = "\x85[TEAM]";
+ else if (players[playernum].ctfteam == 2) // blue
+ prefix = "\x84[TEAM]";
+ else
+ prefix = "\x83"; // makes sure this doesn't implode if you sayteam on non-team gamemodes
+
+ fmt2 = "%s<%s%s>\x80%s %s%s";
+ }
+
+ HU_AddChatText(va(fmt2, prefix, cstart, dispname, cend, textcolor, msg), cv_chatnotifications.value); // add to chat
- CONS_Printf(fmt, cstart, dispname, cend, msg);
if (tempchar)
Z_Free(tempchar);
}
@@ -627,7 +838,6 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
CONS_Printf("Dropped chat: %d %d %s\n", playernum, target, msg);
#endif
}
-#endif
// Handles key input and string input
//
@@ -641,19 +851,53 @@ static inline boolean HU_keyInChatString(char *s, char ch)
l = strlen(s);
if (l < HU_MAXMSGLEN - 1)
{
- s[l++] = ch;
- s[l]=0;
+ if (c_input >= strlen(s)) // don't do anything complicated
+ {
+ s[l++] = ch;
+ s[l]=0;
+ }
+ else
+ {
+
+ // move everything past c_input for new characters:
+ size_t m = HU_MAXMSGLEN-1;
+ while (m>=c_input)
+ {
+ if (s[m])
+ s[m+1] = (s[m]);
+ if (m == 0) // prevent overflow
+ break;
+ m--;
+ }
+ s[c_input] = ch; // and replace this.
+ }
+ c_input++;
return true;
}
return false;
}
else if (ch == KEY_BACKSPACE)
{
- l = strlen(s);
- if (l)
- s[--l] = 0;
- else
+ size_t i = c_input;
+
+ if (c_input <= 0)
return false;
+
+ if (!s[i-1])
+ return false;
+
+ if (i >= strlen(s)-1)
+ {
+ s[strlen(s)-1] = 0;
+ c_input--;
+ return false;
+ }
+
+ for (; (i < HU_MAXMSGLEN); i++)
+ {
+ s[i-1] = s[i];
+ }
+ c_input--;
}
else if (ch != KEY_ENTER)
return false; // did not eat key
@@ -661,6 +905,8 @@ static inline boolean HU_keyInChatString(char *s, char ch)
return true; // ate the key
}
+#endif
+
//
//
void HU_Ticker(void)
@@ -677,28 +923,32 @@ void HU_Ticker(void)
hu_showscores = false;
}
-#define QUEUESIZE 256
+#ifndef NONET
static boolean teamtalk = false;
-static char chatchars[QUEUESIZE];
-static INT32 head = 0, tail = 0;
+/*static char chatchars[QUEUESIZE];
+static INT32 head = 0, tail = 0;*/
+// WHY DO YOU OVERCOMPLICATE EVERYTHING?????????
-//
-// HU_dequeueChatChar
-//
-char HU_dequeueChatChar(void)
+// Clear spaces so we don't end up with messages only made out of emptiness
+static boolean HU_clearChatSpaces(void)
{
- char c;
+ size_t i = 0; // Used to just check our message
+ char c; // current character we're iterating.
+ boolean nothingbutspaces = true;
- if (head != tail)
+ for (; i < strlen(w_chat); i++) // iterate through message and eradicate all spaces that don't belong.
{
- c = chatchars[tail];
- tail = (tail + 1) & (QUEUESIZE-1);
- }
- else
- c = 0;
+ c = w_chat[i];
+ if (!c)
+ break; // if there's nothing, it's safe to assume our message has ended, so let's not waste any more time here.
- return c;
+ if (c != ' ') // Isn't a space
+ {
+ nothingbutspaces = false;
+ }
+ }
+ return nothingbutspaces;
}
//
@@ -709,95 +959,194 @@ static void HU_queueChatChar(char c)
if (c == KEY_ENTER)
{
char buf[2+256];
+ char *msg = &buf[2];
+ size_t i = 0;
size_t ci = 2;
+ INT32 target = 0;
+
+ if (HU_clearChatSpaces()) // Avoids being able to send empty messages, or something.
+ return; // If this returns true, that means our message was NOTHING but spaces, so don't send it period.
do {
- c = HU_dequeueChatChar();
+ c = w_chat[-2+ci++];
if (!c || (c >= ' ' && !(c & 0x80))) // copy printable characters and terminating '\0' only.
- buf[ci++]=c;
+ buf[ci-1]=c;
} while (c);
+ for (;(iERROR: The chat is muted. You can't say anything.", "\x85"), false);
return;
}
+ if (strlen(msg) > 4 && strnicmp(msg, "/pm", 3) == 0) // used /pm
+ {
+ INT32 spc = 1; // used if nodenum[1] is a space.
+ char *nodenum = (char*) malloc(3);
+ const char *newmsg;
+
+ // what we're gonna do now is check if the node exists
+ // with that logic, characters 4 and 5 are our numbers:
+
+ // teamtalk can't send PMs, just don't send it, else everyone would be able to see it, and no one wants to see your sex RP sicko.
+ if (teamtalk)
+ {
+ HU_AddChatText(va("%sCannot send sayto in Say-Team.", "\x85"), false);
+ return;
+ }
+
+ strncpy(nodenum, msg+3, 3);
+ // check for undesirable characters in our "number"
+ if (((nodenum[0] < '0') || (nodenum[0] > '9')) || ((nodenum[1] < '0') || (nodenum[1] > '9')))
+ {
+ // check if nodenum[1] is a space
+ if (nodenum[1] == ' ')
+ spc = 0;
+ // let it slide
+ else
+ {
+ HU_AddChatText("\x82NOTICE: \x80Invalid command format. Correct format is \'/pm \'.", false);
+ free(nodenum);
+ return;
+ }
+ }
+ // I'm very bad at C, I swear I am, additional checks eww!
+ if (spc != 0)
+ {
+ if (msg[5] != ' ')
+ {
+ HU_AddChatText("\x82NOTICE: \x80Invalid command format. Correct format is \'/pm \'.", false);
+ free(nodenum);
+ return;
+ }
+ }
+
+ target = atoi((const char*) nodenum); // turn that into a number
+ free(nodenum);
+ //CONS_Printf("%d\n", target);
+
+ // check for target player, if it doesn't exist then we can't send the message!
+ if (target < MAXPLAYERS && playeringame[target]) // player exists
+ target++; // even though playernums are from 0 to 31, target is 1 to 32, so up that by 1 to have it work!
+ else
+ {
+ HU_AddChatText(va("\x82NOTICE: \x80Player %d does not exist.", target), false); // same
+ return;
+ }
+
+ // we need to get rid of the /pm
+ newmsg = msg+5+spc;
+ strlcpy(msg, newmsg, 255);
+ }
if (ci > 3) // don't send target+flags+empty message.
{
if (teamtalk)
buf[0] = -1; // target
else
- buf[0] = 0; // target
+ buf[0] = target;
+
buf[1] = 0; // flags
SendNetXCmd(XD_SAY, buf, 2 + strlen(&buf[2]) + 1);
}
return;
}
-
- if (((head + 1) & (QUEUESIZE-1)) == tail)
- CONS_Printf(M_GetText("[Message unsent]\n")); // message not sent
- else
- {
- if (c == KEY_BACKSPACE)
- {
- if (tail != head)
- head = (head - 1) & (QUEUESIZE-1);
- }
- else
- {
- chatchars[head] = c;
- head = (head + 1) & (QUEUESIZE-1);
- }
- }
}
+#endif
void HU_clearChatChars(void)
{
- while (tail != head)
- HU_queueChatChar(KEY_BACKSPACE);
+ size_t i = 0;
+ for (;itype != ev_keydown)
return false;
// only KeyDown events now...
+ /*// Shoot, to prevent P1 chatting from ruining the game for everyone else, it's either:
+ // A. completely disallow opening chat entirely in online splitscreen
+ // or B. iterate through all controls to make sure it's bound to player 1 before eating
+ // You can see which one I chose.
+ // (Unless if you're sharing a keyboard, since you probably establish when you start chatting that you have dibs on it...)
+ // (Ahhh, the good ol days when I was a kid who couldn't afford an extra USB controller...)
+
+ if (ev->data1 >= KEY_MOUSE1)
+ {
+ INT32 i;
+ for (i = 0; i < num_gamecontrols; i++)
+ {
+ if (gamecontrol[i][0] == ev->data1 || gamecontrol[i][1] == ev->data1)
+ break;
+ }
+
+ if (i == num_gamecontrols)
+ return false;
+ }*/ //We don't actually care about that unless we get splitscreen netgames. :V
+
+ c = (INT32)ev->data1;
+
+ // capslock (now handled outside of chat on so that it works everytime......)
+ if (c && c == KEY_CAPSLOCK) // it's a toggle.
+ {
+ if (capslock)
+ capslock = false;
+ else
+ capslock = true;
+ return true;
+ }
+
+#ifndef NONET
if (!chat_on)
{
// enter chat mode
if ((ev->data1 == gamecontrol[gc_talkkey][0] || ev->data1 == gamecontrol[gc_talkkey][1])
- && netgame && (!cv_mute.value || server || (adminplayer == consoleplayer)))
+ && netgame && !OLD_MUTE) // check for old chat mute, still let the players open the chat incase they want to scroll otherwise.
{
- if (cv_mute.value && !(server || adminplayer == consoleplayer))
- return false;
chat_on = true;
w_chat[0] = 0;
teamtalk = false;
+ chat_scrollmedown = true;
+ typelines = 1;
return true;
}
if ((ev->data1 == gamecontrol[gc_teamkey][0] || ev->data1 == gamecontrol[gc_teamkey][1])
- && netgame && (!cv_mute.value || server || (adminplayer == consoleplayer)))
+ && netgame && !OLD_MUTE)
{
- if (cv_mute.value && !(server || adminplayer == consoleplayer))
- return false;
chat_on = true;
w_chat[0] = 0;
- teamtalk = true;
+ teamtalk = G_GametypeHasTeams(); // Don't teamtalk if we don't have teams.
+ chat_scrollmedown = true;
+ typelines = 1;
return true;
}
}
else // if chat_on
{
+
// Ignore modifier keys
// Note that we do this here so users can still set
// their chat keys to one of these, if they so desire.
@@ -806,34 +1155,626 @@ boolean HU_Responder(event_t *ev)
|| ev->data1 == KEY_LALT || ev->data1 == KEY_RALT)
return true;
- c = (UINT8)ev->data1;
+ c = (INT32)ev->data1;
- // use console translations
- if (shiftdown)
- c = shiftxform[c];
+ // I know this looks very messy but this works. If it ain't broke, don't fix it!
+ // shift LETTERS to uppercase if we have capslock or are holding shift
+ if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
+ {
+ if (shiftdown ^ capslock)
+ c = shiftxform[c];
+ }
+ else // if we're holding shift we should still shift non letter symbols
+ {
+ if (shiftdown)
+ c = shiftxform[c];
+ }
- if (HU_keyInChatString(w_chat,c))
+ // pasting. pasting is cool. chat is a bit limited, though :(
+ if (((c == 'v' || c == 'V') && ctrldown) && !CHAT_MUTE)
+ {
+ const char *paste = I_ClipboardPaste();
+ size_t chatlen;
+ size_t pastelen;
+
+ // create a dummy string real quickly
+
+ if (paste == NULL)
+ return true;
+
+ chatlen = strlen(w_chat);
+ pastelen = strlen(paste);
+ if (chatlen+pastelen > HU_MAXMSGLEN)
+ return true; // we can't paste this!!
+
+ if (c_input >= strlen(w_chat)) // add it at the end of the string.
+ {
+ memcpy(&w_chat[chatlen], paste, pastelen); // copy all of that.
+ c_input += pastelen;
+ /*size_t i = 0;
+ for (;i= c_input)
+ {
+ if (w_chat[i])
+ w_chat[i+pastelen] = w_chat[i];
+ if (i == 0) // prevent overflow
+ break;
+ i--;
+ }
+ memcpy(&w_chat[c_input], paste, pastelen); // copy all of that.
+ c_input += pastelen;
+ return true;
+ }
+ }
+
+ if (!CHAT_MUTE && HU_keyInChatString(w_chat,c))
+ {
HU_queueChatChar(c);
+ }
if (c == KEY_ENTER)
+ {
chat_on = false;
- else if (c == KEY_ESCAPE)
+ c_input = 0; // reset input cursor
+ chat_scrollmedown = true; // you hit enter, so you might wanna autoscroll to see what you just sent. :)
+ }
+ else if (c == KEY_ESCAPE
+ || ((c == gamecontrol[gc_talkkey][0] || c == gamecontrol[gc_talkkey][1]
+ || c == gamecontrol[gc_teamkey][0] || c == gamecontrol[gc_teamkey][1])
+ && c >= KEY_MOUSE1)) // If it's not a keyboard key, then the chat button is used as a toggle.
+ {
chat_on = false;
-
+ c_input = 0; // reset input cursor
+ }
+ else if ((c == KEY_UPARROW || c == KEY_MOUSEWHEELUP) && chat_scroll > 0 && !OLDCHAT) // CHAT SCROLLING YAYS!
+ {
+ chat_scroll--;
+ justscrolledup = true;
+ chat_scrolltime = 4;
+ }
+ else if ((c == KEY_DOWNARROW || c == KEY_MOUSEWHEELDOWN) && chat_scroll < chat_maxscroll && chat_maxscroll > 0 && !OLDCHAT)
+ {
+ chat_scroll++;
+ justscrolleddown = true;
+ chat_scrolltime = 4;
+ }
+ else if (c == KEY_LEFTARROW && c_input != 0 && !OLDCHAT) // i said go back
+ c_input--;
+ else if (c == KEY_RIGHTARROW && c_input < strlen(w_chat) && !OLDCHAT) // don't need to check for admin or w/e here since the chat won't ever contain anything if it's muted.
+ c_input++;
return true;
}
+#endif
+
return false;
}
+
//======================================================================
// HEADS UP DRAWING
//======================================================================
+#ifndef NONET
+
+// Precompile a wordwrapped string to any given width.
+// This is a muuuch better method than V_WORDWRAP.
+// again stolen and modified a bit from video.c, don't mind me, will need to rearrange this one day.
+// this one is simplified for the chat drawer.
+static char *CHAT_WordWrap(INT32 x, INT32 w, INT32 option, const char *string)
+{
+ INT32 c;
+ size_t chw, i, lastusablespace = 0;
+ size_t slen;
+ char *newstring = Z_StrDup(string);
+ INT32 spacewidth = (vid.width < 640) ? 8 : 4, charwidth = (vid.width < 640) ? 8 : 4;
+
+ slen = strlen(string);
+ x = 0;
+
+ for (i = 0; i < slen; ++i)
+ {
+ c = newstring[i];
+ if ((UINT8)c >= 0x80 && (UINT8)c <= 0x89) //color parsing! -Inuyasha 2.16.09
+ continue;
+
+ if (c == '\n')
+ {
+ x = 0;
+ lastusablespace = 0;
+ continue;
+ }
+
+ if (!(option & V_ALLOWLOWERCASE))
+ c = toupper(c);
+ c -= HU_FONTSTART;
+
+ if (c < 0 || c >= HU_FONTSIZE || !hu_font[c])
+ {
+ chw = spacewidth;
+ lastusablespace = i;
+ }
+ else
+ chw = charwidth;
+
+ x += chw;
+
+ if (lastusablespace != 0 && x > w)
+ {
+ //CONS_Printf("Wrap at index %d\n", i);
+ newstring[lastusablespace] = '\n';
+ i = lastusablespace+1;
+ lastusablespace = 0;
+ x = 0;
+ }
+ }
+ return newstring;
+}
+
+
+// 30/7/18: chaty is now the distance at which the lowest point of the chat will be drawn if that makes any sense.
+
+INT16 chatx = 13, chaty = 169; // let's use this as our coordinates, shh
+
+// chat stuff by VincyTM LOL XD!
+
+// HU_DrawMiniChat
+
+static void HU_drawMiniChat(void)
+{
+ INT32 x = chatx+2;
+ INT32 charwidth = 4, charheight = 6;
+ INT32 boxw = cv_chatwidth.value;
+ INT32 dx = 0, dy = 0;
+ size_t i = chat_nummsg_min;
+ boolean prev_linereturn = false; // a hack to prevent double \n while I have no idea why they happen in the first place.
+
+ INT32 msglines = 0;
+ // process all messages once without rendering anything or doing anything fancy so that we know how many lines each message has...
+ INT32 y;
+
+ if (!chat_nummsg_min)
+ return; // needless to say it's useless to do anything if we don't have anything to draw.
+
+ /*if (splitscreen > 1)
+ boxw = max(64, boxw/2);*/
+
+ for (; i>0; i--)
+ {
+ const char *msg = CHAT_WordWrap(x+2, boxw-(charwidth*2), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, chat_mini[i-1]);
+ size_t j = 0;
+ INT32 linescount = 0;
+
+ while(msg[j]) // iterate through msg
+ {
+ if (msg[j] < HU_FONTSTART) // don't draw
+ {
+ if (msg[j] == '\n') // get back down.
+ {
+ ++j;
+ if (!prev_linereturn)
+ {
+ linescount += 1;
+ dx = 0;
+ }
+ prev_linereturn = true;
+ continue;
+ }
+ else if (msg[j] & 0x80) // stolen from video.c, nice.
+ {
+ ++j;
+ continue;
+ }
+
+ ++j;
+ }
+ else
+ {
+ j++;
+ }
+ prev_linereturn = false;
+ dx += charwidth;
+ if (dx >= boxw)
+ {
+ dx = 0;
+ linescount += 1;
+ }
+ }
+ dy = 0;
+ dx = 0;
+ msglines += linescount+1;
+ }
+
+ y = chaty - charheight*(msglines+1);
+
+ /*if (splitscreen)
+ {
+ y -= BASEVIDHEIGHT/2;
+ if (splitscreen > 1)
+ y += 16;
+ }*/
+ y -= (G_RingSlingerGametype() ? 16 : 0);
+
+ dx = 0;
+ dy = 0;
+ i = 0;
+ prev_linereturn = false;
+
+ for (; i<=(chat_nummsg_min-1); i++) // iterate through our hot messages
+ {
+ INT32 clrflag = 0;
+ INT32 timer = ((cv_chattime.value*TICRATE)-chat_timers[i]) - cv_chattime.value*TICRATE+9; // see below...
+ INT32 transflag = (timer >= 0 && timer <= 9) ? (timer*V_10TRANS) : 0; // you can make bad jokes out of this one.
+ size_t j = 0;
+ const char *msg = CHAT_WordWrap(x+2, boxw-(charwidth*2), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, chat_mini[i]); // get the current message, and word wrap it.
+ UINT8 *colormap = NULL;
+
+ while(msg[j]) // iterate through msg
+ {
+ if (msg[j] < HU_FONTSTART) // don't draw
+ {
+ if (msg[j] == '\n') // get back down.
+ {
+ ++j;
+ if (!prev_linereturn)
+ {
+ dy += charheight;
+ dx = 0;
+ }
+ prev_linereturn = true;
+ continue;
+ }
+ else if (msg[j] & 0x80) // stolen from video.c, nice.
+ {
+ clrflag = ((msg[j] & 0x7f) << V_CHARCOLORSHIFT) & V_CHARCOLORMASK;
+ colormap = V_GetStringColormap(clrflag);
+ ++j;
+ continue;
+ }
+
+ ++j;
+ }
+ else
+ {
+ if (cv_chatbacktint.value) // on request of wolfy
+ V_DrawFillConsoleMap(x + dx + 2, y+dy, charwidth, charheight, 239|V_SNAPTOBOTTOM|V_SNAPTOLEFT);
+
+ V_DrawChatCharacter(x + dx + 2, y+dy, msg[j++] |V_SNAPTOBOTTOM|V_SNAPTOLEFT|transflag, !cv_allcaps.value, colormap);
+ }
+
+ dx += charwidth;
+ prev_linereturn = false;
+ if (dx >= boxw)
+ {
+ dx = 0;
+ dy += charheight;
+ }
+ }
+ dy += charheight;
+ dx = 0;
+ }
+
+ // decrement addy and make that shit smooth:
+ addy /= 2;
+
+}
+
+// HU_DrawChatLog
+
+static void HU_drawChatLog(INT32 offset)
+{
+ INT32 charwidth = 4, charheight = 6;
+ INT32 boxw = cv_chatwidth.value, boxh = cv_chatheight.value;
+ INT32 x = chatx+2, y, dx = 0, dy = 0;
+ UINT32 i = 0;
+ INT32 chat_topy, chat_bottomy;
+ boolean atbottom = false;
+
+ // make sure that our scroll position isn't "illegal";
+ if (chat_scroll > chat_maxscroll)
+ chat_scroll = chat_maxscroll;
+
+#ifdef NETSPLITSCREEN
+ if (splitscreen)
+ {
+ boxh = max(6, boxh/2);
+ if (splitscreen > 1)
+ boxw = max(64, boxw/2);
+ }
+#endif
+
+ y = chaty - offset*charheight - (chat_scroll*charheight) - boxh*charheight - 12;
+
+#ifdef NETSPLITSCREEN
+ if (splitscreen)
+ {
+ y -= BASEVIDHEIGHT/2;
+ if (splitscreen > 1)
+ y += 16;
+ }
+#endif
+ y -= (G_RingSlingerGametype() ? 16 : 0);
+
+
+ chat_topy = y + chat_scroll*charheight;
+ chat_bottomy = chat_topy + boxh*charheight;
+
+ V_DrawFillConsoleMap(chatx, chat_topy, boxw, boxh*charheight +2, 239|V_SNAPTOBOTTOM|V_SNAPTOLEFT); // log box
+
+ for (i=0; i= chat_topy) && (y+dy < (chat_bottomy)))
+ V_DrawChatCharacter(x + dx + 2, y+dy+2, msg[j++] |V_SNAPTOBOTTOM|V_SNAPTOLEFT, !cv_allcaps.value, colormap);
+ else
+ j++; // don't forget to increment this or we'll get stuck in the limbo.
+ }
+
+ dx += charwidth;
+ if (dx >= boxw-charwidth-2 && i= HU_FONTSTART) // end of message shouldn't count, nor should invisible characters!!!!
+ {
+ dx = 0;
+ dy += charheight;
+ }
+ }
+ dy += charheight;
+ dx = 0;
+ }
+
+
+ if (((chat_scroll >= chat_maxscroll) || (chat_scrollmedown)) && !(justscrolleddown || justscrolledup || chat_scrolltime)) // was already at the bottom of the page before new maxscroll calculation and was NOT scrolling.
+ {
+ atbottom = true; // we should scroll
+ }
+ chat_scrollmedown = false;
+
+ // getmaxscroll through a lazy hack. We do all these loops, so let's not do more loops that are gonna lag the game more. :P
+ chat_maxscroll = (dy/charheight); // welcome to C, we don't know what min() and max() are.
+ if (chat_maxscroll <= (UINT32)cv_chatheight.value)
+ chat_maxscroll = 0;
+ else
+ chat_maxscroll -= cv_chatheight.value;
+
+ // if we're not bound by the time, autoscroll for next frame:
+ if (atbottom)
+ chat_scroll = chat_maxscroll;
+
+ // draw arrows to indicate that we can (or not) scroll.
+ if (chat_scroll > 0)
+ V_DrawThinString(chatx-8, ((justscrolledup) ? (chat_topy-1) : (chat_topy)), V_SNAPTOBOTTOM | V_SNAPTOLEFT | V_YELLOWMAP, "\x1A"); // up arrow
+ if (chat_scroll < chat_maxscroll)
+ V_DrawThinString(chatx-8, chat_bottomy-((justscrolleddown) ? 5 : 6), V_SNAPTOBOTTOM | V_SNAPTOLEFT | V_YELLOWMAP, "\x1B"); // down arrow
+
+ justscrolleddown = false;
+ justscrolledup = false;
+}
+
//
// HU_DrawChat
//
// Draw chat input
//
+
static void HU_DrawChat(void)
+{
+ INT32 charwidth = 4, charheight = 6;
+ INT32 boxw = cv_chatwidth.value;
+ INT32 t = 0, c = 0, y = chaty - (typelines*charheight);
+ UINT32 i = 0, saylen = strlen(w_chat); // You learn new things everyday!
+ INT32 cflag = 0;
+ const char *ntalk = "Say: ", *ttalk = "Team: ";
+ const char *talk = ntalk;
+ const char *mute = "Chat has been muted.";
+
+#ifdef NETSPLITSCREEN
+ if (splitscreen)
+ {
+ y -= BASEVIDHEIGHT/2;
+ if (splitscreen > 1)
+ {
+ y += 16;
+ boxw = max(64, boxw/2);
+ }
+ }
+#endif
+ y -= (G_RingSlingerGametype() ? 16 : 0);
+
+ if (teamtalk)
+ {
+ talk = ttalk;
+#if 0
+ if (players[consoleplayer].ctfteam == 1)
+ t = 0x500; // Red
+ else if (players[consoleplayer].ctfteam == 2)
+ t = 0x400; // Blue
+#endif
+ }
+
+ if (CHAT_MUTE)
+ {
+ talk = mute;
+ typelines = 1;
+ cflag = V_GRAYMAP; // set text in gray if chat is muted.
+ }
+
+ V_DrawFillConsoleMap(chatx, y-1, boxw, (typelines*charheight), 239 | V_SNAPTOBOTTOM | V_SNAPTOLEFT);
+
+ while (talk[i])
+ {
+ if (talk[i] < HU_FONTSTART)
+ ++i;
+ else
+ {
+ V_DrawChatCharacter(chatx + c + 2, y, talk[i] |V_SNAPTOBOTTOM|V_SNAPTOLEFT|cflag, !cv_allcaps.value, V_GetStringColormap(talk[i]|cflag));
+ i++;
+ }
+
+ c += charwidth;
+ }
+
+ // if chat is muted, just draw the log and get it over with, no need to draw anything else.
+ if (CHAT_MUTE)
+ {
+ HU_drawChatLog(0);
+ return;
+ }
+
+ i = 0;
+ typelines = 1;
+
+ if ((strlen(w_chat) == 0 || c_input == 0) && hu_tick < 4)
+ V_DrawChatCharacter(chatx + 2 + c, y+1, '_' |V_SNAPTOBOTTOM|V_SNAPTOLEFT|t, !cv_allcaps.value, NULL);
+
+ while (w_chat[i])
+ {
+ boolean skippedline = false;
+ if (c_input == (i+1))
+ {
+ INT32 cursorx = (c+charwidth < boxw-charwidth) ? (chatx + 2 + c+charwidth) : (chatx+1); // we may have to go down.
+ INT32 cursory = (cursorx != chatx+1) ? (y) : (y+charheight);
+ if (hu_tick < 4)
+ V_DrawChatCharacter(cursorx, cursory+1, '_' |V_SNAPTOBOTTOM|V_SNAPTOLEFT|t, !cv_allcaps.value, NULL);
+
+ if (cursorx == chatx+1 && saylen == i) // a weirdo hack
+ {
+ typelines += 1;
+ skippedline = true;
+ }
+ }
+
+ //Hurdler: isn't it better like that?
+ if (w_chat[i] < HU_FONTSTART)
+ ++i;
+ else
+ V_DrawChatCharacter(chatx + c + 2, y, w_chat[i++] | V_SNAPTOBOTTOM|V_SNAPTOLEFT | t, !cv_allcaps.value, NULL);
+
+ c += charwidth;
+ if (c > boxw-(charwidth*2) && !skippedline)
+ {
+ c = 0;
+ y += charheight;
+ typelines += 1;
+ }
+ }
+
+ // handle /pm list. It's messy, horrible and I don't care.
+ if (strnicmp(w_chat, "/pm", 3) == 0 && vid.width >= 400 && !teamtalk) // 320x200 unsupported kthxbai
+ {
+ INT32 count = 0;
+ INT32 p_dispy = chaty - charheight -1;
+#ifdef NETSPLITSCREEN
+ if (splitscreen)
+ {
+ p_dispy -= BASEVIDHEIGHT/2;
+ if (splitscreen > 1)
+ p_dispy += 16;
+ }
+#endif
+ p_dispy -= (G_RingSlingerGametype() ? 16 : 0);
+
+ i = 0;
+ for(i=0; (i '9'))) || ((w_chat[4] != 0) && (((w_chat[4] < '0') || (w_chat[4] > '9'))))) && (w_chat[4] != ' '))
+ break;
+
+
+ nodenum = (char*) malloc(3);
+ strncpy(nodenum, w_chat+3, 3);
+ n = atoi((const char*) nodenum); // turn that into a number
+ free(nodenum);
+ // special cases:
+
+ if ((n == 0) && !(w_chat[4] == '0'))
+ {
+ if (!(i<10))
+ continue;
+ }
+ else if ((n == 1) && !(w_chat[3] == '0'))
+ {
+ if (!((i == 1) || ((i >= 10) && (i <= 19))))
+ continue;
+ }
+ else if ((n == 2) && !(w_chat[3] == '0'))
+ {
+ if (!((i == 2) || ((i >= 20) && (i <= 29))))
+ continue;
+ }
+ else if ((n == 3) && !(w_chat[3] == '0'))
+ {
+ if (!((i == 3) || ((i >= 30) && (i <= 31))))
+ continue;
+ }
+ else // general case.
+ {
+ if (i != n)
+ continue;
+ }
+ }
+
+ if (playeringame[i])
+ {
+ char name[MAXPLAYERNAME+1];
+ strlcpy(name, player_names[i], 7); // shorten name to 7 characters.
+ V_DrawFillConsoleMap(chatx+ boxw + 2, p_dispy- (6*count), 48, 6, 239 | V_SNAPTOBOTTOM | V_SNAPTOLEFT); // fill it like the chat so the text doesn't become hard to read because of the hud.
+ V_DrawSmallString(chatx+ boxw + 4, p_dispy- (6*count), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, va("\x82%d\x80 - %s", i, name));
+ count++;
+ }
+ }
+ if (count == 0) // no results.
+ {
+ V_DrawFillConsoleMap(chatx+boxw+2, p_dispy- (6*count), 48, 6, 239 | V_SNAPTOBOTTOM | V_SNAPTOLEFT); // fill it like the chat so the text doesn't become hard to read because of the hud.
+ V_DrawSmallString(chatx+boxw+4, p_dispy- (6*count), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, "NO RESULT.");
+ }
+ }
+
+ HU_drawChatLog(typelines-1); // typelines is the # of lines we're typing. If there's more than 1 then the log should scroll up to give us more space.
+
+}
+
+
+// For anyone who, for some godforsaken reason, likes oldchat.
+
+static void HU_DrawChat_Old(void)
{
INT32 t = 0, c = 0, y = HU_INPUTY;
size_t i = 0;
@@ -841,7 +1782,6 @@ static void HU_DrawChat(void)
const char *talk = ntalk;
INT32 charwidth = 8 * con_scalefactor; //SHORT(hu_font['A'-HU_FONTSTART]->width) * con_scalefactor;
INT32 charheight = 8 * con_scalefactor; //SHORT(hu_font['A'-HU_FONTSTART]->height) * con_scalefactor;
-
if (teamtalk)
{
talk = ttalk;
@@ -868,9 +1808,20 @@ static void HU_DrawChat(void)
c += charwidth;
}
+ if ((strlen(w_chat) == 0 || c_input == 0) && hu_tick < 4)
+ V_DrawCharacter(HU_INPUTX+c, y+2*con_scalefactor, '_' |cv_constextsize.value | V_NOSCALESTART|t, !cv_allcaps.value);
+
i = 0;
while (w_chat[i])
{
+
+ if (c_input == (i+1) && hu_tick < 4)
+ {
+ INT32 cursorx = (HU_INPUTX+c+charwidth < vid.width) ? (HU_INPUTX + c + charwidth) : (HU_INPUTX); // we may have to go down.
+ INT32 cursory = (cursorx != HU_INPUTX) ? (y) : (y+charheight);
+ V_DrawCharacter(cursorx, cursory+2*con_scalefactor, '_' |cv_constextsize.value | V_NOSCALESTART|t, !cv_allcaps.value);
+ }
+
//Hurdler: isn't it better like that?
if (w_chat[i] < HU_FONTSTART)
{
@@ -894,7 +1845,7 @@ static void HU_DrawChat(void)
if (hu_tick < 4)
V_DrawCharacter(HU_INPUTX + c, y, '_' | cv_constextsize.value |V_NOSCALESTART|t, true);
}
-
+#endif
// draw the Crosshair, at the exact center of the view.
//
@@ -1071,9 +2022,47 @@ static void HU_DrawDemoInfo(void)
//
void HU_Drawer(void)
{
+#ifndef NONET
// draw chat string plus cursor
if (chat_on)
- HU_DrawChat();
+ {
+ // count down the scroll timer.
+ if (chat_scrolltime > 0)
+ chat_scrolltime--;
+ if (!OLDCHAT)
+ HU_DrawChat();
+ else
+ HU_DrawChat_Old();
+ }
+ else
+ {
+ typelines = 1;
+ chat_scrolltime = 0;
+ if (!OLDCHAT && cv_consolechat.value < 2 && netgame) // Don't display minimized chat if you set the mode to Window (Hidden)
+ HU_drawMiniChat(); // draw messages in a cool fashion.
+ }
+
+ if (netgame) // would handle that in hu_drawminichat, but it's actually kinda awkward when you're typing a lot of messages. (only handle that in netgames duh)
+ {
+ size_t i = 0;
+
+ // handle spam while we're at it:
+ for(; (i 0)
+ stop_spamming[i]--;
+ }
+
+ // handle chat timers
+ for (i=0; (i 0)
+ chat_timers[i]--;
+ else
+ HU_removeChatText_Mini();
+ }
+ }
+#endif
if (cechotimer)
HU_DrawCEcho();
@@ -1194,9 +2183,9 @@ void HU_Erase(void)
// clear the message lines that go away, so use _oldclearlines_
bottomline = oldclearlines;
oldclearlines = con_clearlines;
- if (chat_on)
+ if (chat_on && OLDCHAT)
if (bottomline < 8)
- bottomline = 8;
+ bottomline = 8; // only do it for consolechat. consolechat is gay.
if (automapactive || viewwindowx == 0) // hud msgs don't need to be cleared
return;
@@ -1235,6 +2224,41 @@ void HU_Erase(void)
#define supercheckdef ((players[tab[i].num].powers[pw_super] && players[tab[i].num].mo && (players[tab[i].num].mo->state < &states[S_PLAY_SUPER_TRANS1] || players[tab[i].num].mo->state >= &states[S_PLAY_SUPER_TRANS6])) || (players[tab[i].num].powers[pw_carry] == CR_NIGHTSMODE && skins[players[tab[i].num].skin].flags & SF_SUPER))
#define greycheckdef ((players[tab[i].num].mo && players[tab[i].num].mo->health <= 0) || players[tab[i].num].spectator)
+//
+// HU_drawPing
+//
+void HU_drawPing(INT32 x, INT32 y, INT32 ping, boolean notext)
+{
+ UINT8 numbars = 1; // how many ping bars do we draw?
+ UINT8 barcolor = 128; // color we use for the bars (green, yellow or red)
+ SINT8 i = 0;
+ SINT8 yoffset = 6;
+ INT32 dx = x+1 - (V_SmallStringWidth(va("%dms", ping), V_ALLOWLOWERCASE)/2);
+
+ if (ping < 128)
+ {
+ numbars = 3;
+ barcolor = 184;
+ }
+ else if (ping < 256)
+ {
+ numbars = 2; // Apparently ternaries w/ multiple statements don't look good in C so I decided against it.
+ barcolor = 103;
+ }
+
+ if (!notext || vid.width >= 640) // how sad, we're using a shit resolution.
+ V_DrawSmallString(dx, y+4, V_ALLOWLOWERCASE, va("%dms", ping));
+
+ for (i=0; (i<3); i++) // Draw the ping bar
+ {
+ V_DrawFill(x+2 *(i-1), y+yoffset-4, 2, 8-yoffset, 31);
+ if (i < numbars)
+ V_DrawFill(x+2 *(i-1), y+yoffset-3, 1, 8-yoffset-1, barcolor);
+
+ yoffset -= 2;
+ }
+}
+
//
// HU_DrawTabRankings
//
@@ -1257,6 +2281,14 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
greycheck = greycheckdef;
supercheck = supercheckdef;
+ if (!splitscreen) // don't draw it on splitscreen,
+ {
+ if (!(tab[i].num == serverplayer))
+ HU_drawPing(x+ 253, y+2, playerpingtable[tab[i].num], false);
+ //else
+ // V_DrawSmallString(x+ 246, y+4, V_YELLOWMAP, "SERVER");
+ }
+
V_DrawString(x + 20, y,
((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0)
| (greycheck ? V_60TRANS : 0)
@@ -1336,6 +2368,113 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
}
}
+//
+// HU_Draw32Emeralds
+//
+static void HU_Draw32Emeralds(INT32 x, INT32 y, INT32 pemeralds)
+{
+ //Draw the emeralds, in the CORRECT order, using tiny emerald sprites.
+ if (pemeralds & EMERALD1)
+ V_DrawSmallScaledPatch(x , y, 0, tinyemeraldpics[0]);
+
+ if (pemeralds & EMERALD2)
+ V_DrawSmallScaledPatch(x+4, y, 0, tinyemeraldpics[1]);
+
+ if (pemeralds & EMERALD3)
+ V_DrawSmallScaledPatch(x+8, y, 0, tinyemeraldpics[2]);
+
+ if (pemeralds & EMERALD4)
+ V_DrawSmallScaledPatch(x+12 , y, 0, tinyemeraldpics[3]);
+
+ if (pemeralds & EMERALD5)
+ V_DrawSmallScaledPatch(x+16, y, 0, tinyemeraldpics[4]);
+
+ if (pemeralds & EMERALD6)
+ V_DrawSmallScaledPatch(x+20, y, 0, tinyemeraldpics[5]);
+
+ if (pemeralds & EMERALD7)
+ V_DrawSmallScaledPatch(x+24, y, 0, tinyemeraldpics[6]);
+}
+
+//
+// HU_Draw32TeamTabRankings
+//
+static void HU_Draw32TeamTabRankings(playersort_t *tab, INT32 whiteplayer)
+{
+ INT32 i,x,y;
+ INT32 redplayers = 0, blueplayers = 0;
+ const UINT8 *colormap;
+ char name[MAXPLAYERNAME+1];
+
+ V_DrawFill(160, 26, 1, 154, 0); //Draw a vertical line to separate the two teams.
+ V_DrawFill(1, 26, 318, 1, 0); //And a horizontal line to make a T.
+ V_DrawFill(1, 180, 318, 1, 0); //And a horizontal line near the bottom.
+
+ for (i = 0; i < MAXPLAYERS; i++)
+ {
+ if (players[tab[i].num].spectator)
+ continue; //ignore them.
+
+ if (tab[i].color == skincolor_redteam) //red
+ {
+ redplayers++;
+ x = 14 + (BASEVIDWIDTH/2);
+ y = (redplayers * 9) + 20;
+ }
+ else if (tab[i].color == skincolor_blueteam) //blue
+ {
+ blueplayers++;
+ x = 14;
+ y = (blueplayers * 9) + 20;
+ }
+ else //er? not on red or blue, so ignore them
+ continue;
+
+ strlcpy(name, tab[i].name, 8);
+ V_DrawString(x + 10, y,
+ ((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0)
+ | ((players[tab[i].num].health > 0) ? 0 : V_TRANSLUCENT)
+ | V_ALLOWLOWERCASE, name);
+
+ if (gametype == GT_CTF)
+ {
+ if (players[tab[i].num].gotflag & GF_REDFLAG) // Red
+ V_DrawFixedPatch((x-10)*FRACUNIT, (y)*FRACUNIT, FRACUNIT/4, 0, rflagico, 0);
+ else if (players[tab[i].num].gotflag & GF_BLUEFLAG) // Blue
+ V_DrawFixedPatch((x-10)*FRACUNIT, (y)*FRACUNIT, FRACUNIT/4, 0, bflagico, 0);
+ }
+
+ // Draw emeralds
+ if (!players[tab[i].num].powers[pw_super]
+ || ((leveltime/7) & 1))
+ {
+ HU_Draw32Emeralds(x+60, y+2, tab[i].emeralds);
+ }
+
+ if (players[tab[i].num].powers[pw_super])
+ {
+ colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo ? players[tab[i].num].mo->color : tab[i].color, GTC_CACHE);
+ V_DrawFixedPatch(x*FRACUNIT, y*FRACUNIT, FRACUNIT/4, 0, superprefix[players[tab[i].num].skin], colormap);
+ }
+ else
+ {
+ colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo ? players[tab[i].num].mo->color : tab[i].color, GTC_CACHE);
+ if (players[tab[i].num].health <= 0)
+ V_DrawFixedPatch(x*FRACUNIT, y*FRACUNIT, FRACUNIT/4, V_HUDTRANSHALF, faceprefix[players[tab[i].num].skin], colormap);
+ else
+ V_DrawFixedPatch(x*FRACUNIT, y*FRACUNIT, FRACUNIT/4, 0, faceprefix[players[tab[i].num].skin], colormap);
+ }
+ V_DrawRightAlignedThinString(x+128, y, ((players[tab[i].num].health > 0) ? 0 : V_TRANSLUCENT), va("%u", tab[i].count));
+ if (!splitscreen)
+ {
+ if (!(tab[i].num == serverplayer))
+ HU_drawPing(x+ 135, y+3, playerpingtable[tab[i].num], true);
+ //else
+ //V_DrawSmallString(x+ 129, y+4, V_YELLOWMAP, "HOST");
+ }
+ }
+}
+
//
// HU_DrawTeamTabRankings
//
@@ -1343,14 +2482,51 @@ void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer)
{
INT32 i,x,y;
INT32 redplayers = 0, blueplayers = 0;
+ boolean smol = false;
const UINT8 *colormap;
char name[MAXPLAYERNAME+1];
boolean greycheck, supercheck;
+ // before we draw, we must count how many players are in each team. It makes an additional loop, but we need to know if we have to draw a big or a small ranking.
+ for (i = 0; i < MAXPLAYERS; i++)
+ {
+ if (players[tab[i].num].spectator)
+ continue; //ignore them.
+
+ if (tab[i].color == skincolor_redteam) //red
+ {
+ if (redplayers++ > 8)
+ {
+ smol = true;
+ break; // don't make more loops than we need to.
+ }
+ }
+ else if (tab[i].color == skincolor_blueteam) //blue
+ {
+ if (blueplayers++ > 8)
+ {
+ smol = true;
+ break;
+ }
+ }
+ else //er? not on red or blue, so ignore them
+ continue;
+
+ }
+
+ // I'll be blunt with you, this may add more lines, but I'm not adding weird cases for this, so we're executing a separate function.
+ if (smol == true || cv_compactscoreboard.value)
+ {
+ HU_Draw32TeamTabRankings(tab, whiteplayer);
+ return;
+ }
+
V_DrawFill(160, 26, 1, 154, 0); //Draw a vertical line to separate the two teams.
V_DrawFill(1, 26, 318, 1, 0); //And a horizontal line to make a T.
V_DrawFill(1, 180, 318, 1, 0); //And a horizontal line near the bottom.
+ i=0, redplayers=0, blueplayers=0;
+
for (i = 0; i < MAXPLAYERS; i++)
{
if (players[tab[i].num].spectator)
@@ -1376,7 +2552,7 @@ void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer)
greycheck = greycheckdef;
supercheck = supercheckdef;
- strlcpy(name, tab[i].name, 9);
+ strlcpy(name, tab[i].name, 7);
V_DrawString(x + 20, y,
((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0)
| (greycheck ? V_TRANSLUCENT : 0)
@@ -1410,7 +2586,14 @@ void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer)
else
V_DrawSmallMappedPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin], colormap);
}
- V_DrawRightAlignedThinString(x+120, y, (greycheck ? V_TRANSLUCENT : 0), va("%u", tab[i].count));
+ V_DrawRightAlignedThinString(x+100, y, (greycheck ? V_TRANSLUCENT : 0), va("%u", tab[i].count));
+ if (!splitscreen)
+ {
+ if (!(tab[i].num == serverplayer))
+ HU_drawPing(x+ 113, y+2, playerpingtable[tab[i].num], false);
+ //else
+ // V_DrawSmallString(x+ 94, y+4, V_YELLOWMAP, "SERVER");
+ }
}
}
@@ -1436,7 +2619,12 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline
greycheck = greycheckdef;
supercheck = supercheckdef;
- strlcpy(name, tab[i].name, 9);
+ strlcpy(name, tab[i].name, 7);
+ if (!(tab[i].num == serverplayer))
+ HU_drawPing(x+ 113, y+2, playerpingtable[tab[i].num], false);
+ //else
+ // V_DrawSmallString(x+ 94, y+4, V_YELLOWMAP, "SERVER");
+
V_DrawString(x + 20, y,
((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0)
| (greycheck ? V_TRANSLUCENT : 0)
@@ -1494,15 +2682,15 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline
if (circuitmap)
{
if (players[tab[i].num].exiting)
- V_DrawRightAlignedThinString(x+156, y, 0, va("%i:%02i.%02i", G_TicsToMinutes(players[tab[i].num].realtime,true), G_TicsToSeconds(players[tab[i].num].realtime), G_TicsToCentiseconds(players[tab[i].num].realtime)));
+ V_DrawRightAlignedThinString(x+146, y, 0, va("%i:%02i.%02i", G_TicsToMinutes(players[tab[i].num].realtime,true), G_TicsToSeconds(players[tab[i].num].realtime), G_TicsToCentiseconds(players[tab[i].num].realtime)));
else
- V_DrawRightAlignedThinString(x+156, y, (greycheck ? V_TRANSLUCENT : 0), va("%u", tab[i].count));
+ V_DrawRightAlignedThinString(x+146, y, (greycheck ? V_TRANSLUCENT : 0), va("%u", tab[i].count));
}
else
- V_DrawRightAlignedThinString(x+156, y, (greycheck ? V_TRANSLUCENT : 0), va("%i:%02i.%02i", G_TicsToMinutes(tab[i].count,true), G_TicsToSeconds(tab[i].count), G_TicsToCentiseconds(tab[i].count)));
+ V_DrawRightAlignedThinString(x+146, y, (greycheck ? V_TRANSLUCENT : 0), va("%i:%02i.%02i", G_TicsToMinutes(tab[i].count,true), G_TicsToSeconds(tab[i].count), G_TicsToCentiseconds(tab[i].count)));
}
else
- V_DrawRightAlignedThinString(x+120, y, (greycheck ? V_TRANSLUCENT : 0), va("%u", tab[i].count));
+ V_DrawRightAlignedThinString(x+100, y, (greycheck ? V_TRANSLUCENT : 0), va("%u", tab[i].count));
y += 16;
if (y > 160)
@@ -1513,6 +2701,107 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline
}
}
+//
+// HU_Draw32TabRankings
+//
+static void HU_Draw32TabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer)
+{
+ INT32 i;
+ const UINT8 *colormap;
+ char name[MAXPLAYERNAME+1];
+
+ V_DrawFill(160, 26, 1, 154, 0); //Draw a vertical line to separate the two sides.
+ V_DrawFill(1, 26, 318, 1, 0); //And a horizontal line to make a T.
+ V_DrawFill(1, 180, 318, 1, 0); //And a horizontal line near the bottom.
+
+ for (i = 0; i < scorelines; i++)
+ {
+ if (players[tab[i].num].spectator)
+ continue; //ignore them.
+
+ strlcpy(name, tab[i].name, 7);
+ if (!splitscreen) // don't draw it on splitscreen,
+ {
+ if (!(tab[i].num == serverplayer))
+ HU_drawPing(x+ 135, y+3, playerpingtable[tab[i].num], true);
+ //else
+ // V_DrawSmallString(x+ 129, y+4, V_YELLOWMAP, "HOST");
+ }
+
+ V_DrawString(x + 10, y,
+ ((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0)
+ | ((players[tab[i].num].health > 0) ? 0 : V_TRANSLUCENT)
+ | V_ALLOWLOWERCASE, name);
+
+ if (G_GametypeUsesLives()) //show lives
+ V_DrawRightAlignedThinString(x-1, y, V_ALLOWLOWERCASE, va("%d", players[tab[i].num].lives));
+ else if (G_TagGametype() && players[tab[i].num].pflags & PF_TAGIT)
+ V_DrawFixedPatch((x-10)*FRACUNIT, (y)*FRACUNIT, FRACUNIT/4, 0, tagico, 0);
+
+ // Draw emeralds
+ if (!players[tab[i].num].powers[pw_super]
+ || ((leveltime/7) & 1))
+ {
+ HU_Draw32Emeralds(x+60, y+2, tab[i].emeralds);
+ //HU_DrawEmeralds(x-12,y+2,tab[i].emeralds);
+ }
+
+ //V_DrawSmallScaledPatch (x, y-4, 0, livesback);
+ if (tab[i].color == 0)
+ {
+ colormap = colormaps;
+ if (players[tab[i].num].powers[pw_super])
+ V_DrawFixedPatch(x*FRACUNIT, y*FRACUNIT, FRACUNIT/4, 0, superprefix[players[tab[i].num].skin], 0);
+ else
+ {
+ if (players[tab[i].num].health <= 0)
+ V_DrawFixedPatch(x*FRACUNIT, (y)*FRACUNIT, FRACUNIT/4, V_HUDTRANSHALF, faceprefix[players[tab[i].num].skin], 0);
+ else
+ V_DrawFixedPatch(x*FRACUNIT, (y)*FRACUNIT, FRACUNIT/4, 0, faceprefix[players[tab[i].num].skin], 0);
+ }
+ }
+ else
+ {
+ if (players[tab[i].num].powers[pw_super])
+ {
+ colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo ? players[tab[i].num].mo->color : tab[i].color, GTC_CACHE);
+ V_DrawFixedPatch(x*FRACUNIT, y*FRACUNIT, FRACUNIT/4, 0, superprefix[players[tab[i].num].skin], colormap);
+ }
+ else
+ {
+ colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo ? players[tab[i].num].mo->color : tab[i].color, GTC_CACHE);
+ if (players[tab[i].num].health <= 0)
+ V_DrawFixedPatch(x*FRACUNIT, (y)*FRACUNIT, FRACUNIT/4, V_HUDTRANSHALF, faceprefix[players[tab[i].num].skin], colormap);
+ else
+ V_DrawFixedPatch(x*FRACUNIT, (y)*FRACUNIT, FRACUNIT/4, 0, faceprefix[players[tab[i].num].skin], colormap);
+ }
+ }
+
+ // All data drawn with thin string for space.
+ if (gametype == GT_RACE)
+ {
+ if (circuitmap)
+ {
+ if (players[tab[i].num].exiting)
+ V_DrawRightAlignedThinString(x+128, y, 0, va("%i:%02i.%02i", G_TicsToMinutes(players[tab[i].num].realtime,true), G_TicsToSeconds(players[tab[i].num].realtime), G_TicsToCentiseconds(players[tab[i].num].realtime)));
+ else
+ V_DrawRightAlignedThinString(x+128, y, ((players[tab[i].num].health > 0) ? 0 : V_TRANSLUCENT), va("%u", tab[i].count));
+ }
+ else
+ V_DrawRightAlignedThinString(x+128, y, ((players[tab[i].num].health > 0) ? 0 : V_TRANSLUCENT), va("%i:%02i.%02i", G_TicsToMinutes(tab[i].count,true), G_TicsToSeconds(tab[i].count), G_TicsToCentiseconds(tab[i].count)));
+ }
+ else
+ V_DrawRightAlignedThinString(x+128, y, ((players[tab[i].num].health > 0) ? 0 : V_TRANSLUCENT), va("%u", tab[i].count));
+
+ y += 9;
+ if (i == 16)
+ {
+ y = 32;
+ x += BASEVIDWIDTH/2;
+ }
+ }
+}
+
//
// HU_DrawEmeralds
//
@@ -1733,15 +3022,18 @@ static void HU_DrawRankings(void)
scorelines++;
}
- if (scorelines > 20)
- scorelines = 20; //dont draw past bottom of screen, show the best only
+ //if (scorelines > 20)
+ // scorelines = 20; //dont draw past bottom of screen, show the best only
+ // shush, we'll do it anyway.
if (G_GametypeHasTeams())
HU_DrawTeamTabRankings(tab, whiteplayer); //separate function for Spazzo's silly request
- else if (scorelines <= 9)
+ else if (scorelines <= 9 && !cv_compactscoreboard.value)
HU_DrawTabRankings(40, 32, tab, scorelines, whiteplayer);
- else
+ else if (scorelines <= 20 && !cv_compactscoreboard.value)
HU_DrawDualTabRankings(32, 32, tab, scorelines, whiteplayer);
+ else
+ HU_Draw32TabRankings(14, 28, tab, scorelines, whiteplayer);
// draw spectators in a ticker across the bottom
if (!splitscreen && G_GametypeHasSpectators())
diff --git a/src/hu_stuff.h b/src/hu_stuff.h
index 46906dd73..ab77e67b6 100644
--- a/src/hu_stuff.h
+++ b/src/hu_stuff.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -57,6 +57,20 @@ typedef struct
// chat stuff
//------------------------------------
#define HU_MAXMSGLEN 224
+#define CHAT_BUFSIZE 64 // that's enough messages, right? We'll delete the older ones when that gets out of hand.
+#ifdef NETSPLITSCREEN
+#define OLDCHAT (cv_consolechat.value == 1 || dedicated || vid.width < 640)
+#else
+#define OLDCHAT (cv_consolechat.value == 1 || dedicated || vid.width < 640 || splitscreen)
+#endif
+#define CHAT_MUTE (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) // this still allows to open the chat but not to type. That's used for scrolling and whatnot.
+#define OLD_MUTE (OLDCHAT && cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) // this is used to prevent oldchat from opening when muted.
+
+// some functions
+void HU_AddChatText(const char *text, boolean playsound);
+
+// set true when entering a chat message
+extern boolean chat_on;
extern patch_t *hu_font[HU_FONTSIZE], *tny_font[HU_FONTSIZE];
extern patch_t *tallnum[10];
@@ -74,9 +88,6 @@ extern patch_t *tallminus;
extern patch_t *tallinfin;
extern patch_t *tokenicon;
-// set true when entering a chat message
-extern boolean chat_on;
-
// set true whenever the tab rankings are being shown for any reason
extern boolean hu_showscores;
@@ -89,12 +100,12 @@ void HU_LoadGraphics(void);
void HU_Start(void);
boolean HU_Responder(event_t *ev);
-
void HU_Ticker(void);
void HU_Drawer(void);
char HU_dequeueChatChar(void);
void HU_Erase(void);
void HU_clearChatChars(void);
+void HU_drawPing(INT32 x, INT32 y, INT32 ping, boolean notext); // Lat': Ping drawer for scoreboard.
void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer);
void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer);
void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer);
diff --git a/src/i_addrinfo.c b/src/i_addrinfo.c
index 208f470f4..375fd4845 100644
--- a/src/i_addrinfo.c
+++ b/src/i_addrinfo.c
@@ -1,6 +1,6 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
-// Copyright (C) 2011-2016 by Sonic Team Junior.
+// Copyright (C) 2011-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/i_addrinfo.h b/src/i_addrinfo.h
index 4cda8968b..7c3afc614 100644
--- a/src/i_addrinfo.h
+++ b/src/i_addrinfo.h
@@ -1,6 +1,6 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
-// Copyright (C) 2011-2016 by Sonic Team Junior.
+// Copyright (C) 2011-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/i_joy.h b/src/i_joy.h
index 5cba1af0a..27013f011 100644
--- a/src/i_joy.h
+++ b/src/i_joy.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/i_net.h b/src/i_net.h
index 2bfa5eac7..0e17077bb 100644
--- a/src/i_net.h
+++ b/src/i_net.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/i_sound.h b/src/i_sound.h
index bc9829fdd..fd73d1454 100644
--- a/src/i_sound.h
+++ b/src/i_sound.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/i_system.h b/src/i_system.h
index d61f2d16e..a8d707d16 100644
--- a/src/i_system.h
+++ b/src/i_system.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/i_tcp.c b/src/i_tcp.c
index c62adab06..3e6be339d 100644
--- a/src/i_tcp.c
+++ b/src/i_tcp.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -1256,7 +1256,7 @@ void I_ShutdownTcpDriver(void)
static SINT8 SOCK_NetMakeNodewPort(const char *address, const char *port)
{
SINT8 newnode = -1;
- struct my_addrinfo *ai, *runp, hints;
+ struct my_addrinfo *ai = NULL, *runp, hints;
int gaie;
if (!port || !port[0])
diff --git a/src/i_tcp.h b/src/i_tcp.h
index a084abb84..06680cd9b 100644
--- a/src/i_tcp.h
+++ b/src/i_tcp.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/i_video.h b/src/i_video.h
index 7ee07f000..4bb2c5829 100644
--- a/src/i_video.h
+++ b/src/i_video.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/info.c b/src/info.c
index 769d27e88..dc36747c7 100644
--- a/src/info.c
+++ b/src/info.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -18026,7 +18026,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
10, // mass
0, // damage
sfx_None, // activesound
- MF_NOTHINK|MF_NOBLOCKMAP|MF_NOGRAVITY, // flags
+ MF_SCENERY|MF_NOBLOCKMAP|MF_NOGRAVITY, // flags
S_NULL // raisestate
},
diff --git a/src/info.h b/src/info.h
index 8baafbd87..962a6be29 100644
--- a/src/info.h
+++ b/src/info.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/keys.h b/src/keys.h
index 654aa1d9d..cf3a0d060 100644
--- a/src/keys.h
+++ b/src/keys.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/locale/en.po b/src/locale/en.po
index 069930b81..5f4592079 100644
--- a/src/locale/en.po
+++ b/src/locale/en.po
@@ -3624,7 +3624,7 @@ msgid "another castle!"
msgstr ""
#: st_stuff.c:2328 st_stuff.c:2334 st_stuff.c:2356
-msgid "Press F12 to watch another player."
+msgid "Press Viewpoint Key to watch a player."
msgstr ""
#: st_stuff.c:2333
diff --git a/src/locale/srb2.pot b/src/locale/srb2.pot
index ced13bbe6..552e9edb1 100644
--- a/src/locale/srb2.pot
+++ b/src/locale/srb2.pot
@@ -3815,7 +3815,7 @@ msgid "another castle!"
msgstr ""
#: st_stuff.c:2092 st_stuff.c:2098 st_stuff.c:2120
-msgid "Press F12 to watch another player."
+msgid "Press Viewpoint Key to watch a player."
msgstr ""
#: st_stuff.c:2097
diff --git a/src/lua_baselib.c b/src/lua_baselib.c
index bb9e93edf..a8598582c 100644
--- a/src/lua_baselib.c
+++ b/src/lua_baselib.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2012-2016 by John "JTE" Muniz.
-// Copyright (C) 2012-2016 by Sonic Team Junior.
+// Copyright (C) 2012-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -23,6 +23,9 @@
#include "m_random.h"
#include "s_sound.h"
#include "g_game.h"
+#include "hu_stuff.h" // HU_AddChatText
+#include "console.h"
+#include "d_netcmd.h" // IsPlayerAdmin
#include "lua_script.h"
#include "lua_libs.h"
@@ -90,6 +93,51 @@ static int lib_print(lua_State *L)
return 0;
}
+// Print stuff in the chat, or in the console if we can't.
+static int lib_chatprint(lua_State *L)
+{
+ const char *str = luaL_checkstring(L, 1); // retrieve string
+ boolean sound = lua_optboolean(L, 2); // retrieve sound boolean
+ int len = strlen(str);
+
+ if (str == NULL) // error if we don't have a string!
+ return luaL_error(L, LUA_QL("tostring") " must return a string to " LUA_QL("chatprint"));
+
+ if (len > 255) // string is too long!!!
+ return luaL_error(L, "String exceeds the 255 characters limit of the chat buffer.");
+
+ HU_AddChatText(str, sound);
+ return 0;
+}
+
+// Same as above, but do it for only one player.
+static int lib_chatprintf(lua_State *L)
+{
+ int n = lua_gettop(L); /* number of arguments */
+ const char *str = luaL_checkstring(L, 2); // retrieve string
+ boolean sound = lua_optboolean(L, 3); // sound?
+ int len = strlen(str);
+ player_t *plr;
+
+ if (n < 2)
+ return luaL_error(L, "chatprintf requires at least two arguments: player and text.");
+
+ plr = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); // retrieve player
+ if (!plr)
+ return LUA_ErrInvalid(L, "player_t");
+ if (plr != &players[consoleplayer])
+ return 0;
+
+ if (str == NULL) // error if we don't have a string!
+ return luaL_error(L, LUA_QL("tostring") " must return a string to " LUA_QL("chatprintf"));
+
+ if (len > 255) // string is too long!!!
+ return luaL_error(L, "String exceeds the 255 characters limit of the chat buffer.");
+
+ HU_AddChatText(str, sound);
+ return 0;
+}
+
static const struct {
const char *meta;
const char *utype;
@@ -172,6 +220,16 @@ static int lib_userdataType(lua_State *L)
return 1;
}
+static int lib_isPlayerAdmin(lua_State *L)
+{
+ player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
+ //HUDSAFE
+ if (!player)
+ return LUA_ErrInvalid(L, "player_t");
+ lua_pushboolean(L, IsPlayerAdmin(player-players));
+ return 1;
+}
+
// M_RANDOM
//////////////
@@ -2132,6 +2190,25 @@ static int lib_rSetPlayerSkin(lua_State *L)
return 0;
}
+// R_DATA
+////////////
+
+static int lib_rCheckTextureNumForName(lua_State *L)
+{
+ const char *name = luaL_checkstring(L, 1);
+ //HUDSAFE
+ lua_pushinteger(L, R_CheckTextureNumForName(name));
+ return 1;
+}
+
+static int lib_rTextureNumForName(lua_State *L)
+{
+ const char *name = luaL_checkstring(L, 1);
+ //HUDSAFE
+ lua_pushinteger(L, R_TextureNumForName(name));
+ return 1;
+}
+
// S_SOUND
////////////
@@ -2140,7 +2217,7 @@ static int lib_sStartSound(lua_State *L)
const void *origin = NULL;
sfxenum_t sound_id = luaL_checkinteger(L, 2);
player_t *player = NULL;
- NOHUD
+ //NOHUD // kys @whoever did this.
if (sound_id >= NUMSFX)
return luaL_error(L, "sfx %d out of range (0 - %d)", sound_id, NUMSFX-1);
if (!lua_isnil(L, 1))
@@ -2156,7 +2233,12 @@ static int lib_sStartSound(lua_State *L)
return LUA_ErrInvalid(L, "player_t");
}
if (!player || P_IsLocalPlayer(player))
+ {
+ if (hud_running)
+ origin = NULL; // HUD rendering startsound shouldn't have an origin, just remove it instead of having a retarded error.
+
S_StartSound(origin, sound_id);
+ }
return 0;
}
@@ -2376,7 +2458,9 @@ static int lib_gDoReborn(lua_State *L)
return 0;
}
-static int lib_gExitLevel(lua_State *L)
+// Another Lua function that doesn't actually exist!
+// Sets nextmapoverride & skipstats without instantly ending the level, for instances where other sources should be exiting the level, like normal signposts.
+static int lib_gSetCustomExitVars(lua_State *L)
{
int n = lua_gettop(L); // Num arguments
NOHUD
@@ -2384,21 +2468,36 @@ static int lib_gExitLevel(lua_State *L)
// LUA EXTENSION: Custom exit like support
// Supported:
- // G_ExitLevel(); [no modifications]
- // G_ExitLevel(int) [nextmap override only]
- // G_ExitLevel(bool) [skipstats only]
- // G_ExitLevel(int, bool) [both of the above]
+ // G_SetCustomExitVars(); [reset to defaults]
+ // G_SetCustomExitVars(int) [nextmap override only]
+ // G_SetCustomExitVars(bool) [skipstats only]
+ // G_SetCustomExitVars(int, bool) [both of the above]
if (n >= 1)
{
if (lua_isnumber(L, 1) || n >= 2)
{
nextmapoverride = (INT16)luaL_checknumber(L, 1);
- lua_pop(L, 1); // pop nextmapoverride; skipstats now 1 if available
+ lua_remove(L, 1); // remove nextmapoverride; skipstats now 1 if available
}
skipstats = lua_optboolean(L, 1);
}
+ else
+ {
+ nextmapoverride = 0;
+ skipstats = false;
+ }
// ---
+ return 0;
+}
+
+static int lib_gExitLevel(lua_State *L)
+{
+ int n = lua_gettop(L); // Num arguments
+ NOHUD
+ // Moved this bit to G_SetCustomExitVars
+ if (n >= 1) // Don't run the reset to defaults option
+ lib_gSetCustomExitVars(L);
G_ExitLevel();
return 0;
}
@@ -2503,7 +2602,10 @@ static int lib_gTicsToMilliseconds(lua_State *L)
static luaL_Reg lib[] = {
{"print", lib_print},
+ {"chatprint", lib_chatprint},
+ {"chatprintf", lib_chatprintf},
{"userdataType", lib_userdataType},
+ {"IsPlayerAdmin", lib_isPlayerAdmin},
// m_random
{"P_RandomFixed",lib_pRandomFixed},
@@ -2669,6 +2771,10 @@ static luaL_Reg lib[] = {
{"R_Frame2Char",lib_rFrame2Char},
{"R_SetPlayerSkin",lib_rSetPlayerSkin},
+ // r_data
+ {"R_CheckTextureNumForName",lib_rCheckTextureNumForName},
+ {"R_TextureNumForName",lib_rTextureNumForName},
+
// s_sound
{"S_StartSound",lib_sStartSound},
{"S_StartSoundAtVolume",lib_sStartSoundAtVolume},
@@ -2684,6 +2790,7 @@ static luaL_Reg lib[] = {
// g_game
{"G_BuildMapName",lib_gBuildMapName},
{"G_DoReborn",lib_gDoReborn},
+ {"G_SetCustomExitVars",lib_gSetCustomExitVars},
{"G_ExitLevel",lib_gExitLevel},
{"G_IsSpecialStage",lib_gIsSpecialStage},
{"G_GametypeUsesLives",lib_gGametypeUsesLives},
diff --git a/src/lua_blockmaplib.c b/src/lua_blockmaplib.c
index ebfd6a2df..dabbdd9f6 100644
--- a/src/lua_blockmaplib.c
+++ b/src/lua_blockmaplib.c
@@ -186,9 +186,6 @@ static int lib_searchBlockmap(lua_State *L)
UINT8 funcret = 0;
blockmap_func searchFunc;
- if (gamestate != GS_LEVEL)
- return luaL_error(L, "This function can only be used in a level!");
-
lua_remove(L, 1); // remove searchtype, stack is now function, mobj, [x1, x2, y1, y2]
luaL_checktype(L, 1, LUA_TFUNCTION);
diff --git a/src/lua_consolelib.c b/src/lua_consolelib.c
index d576efb9a..98d18d8db 100644
--- a/src/lua_consolelib.c
+++ b/src/lua_consolelib.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2012-2016 by John "JTE" Muniz.
-// Copyright (C) 2012-2016 by Sonic Team Junior.
+// Copyright (C) 2012-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -63,7 +63,7 @@ void Got_Luacmd(UINT8 **cp, INT32 playernum)
lua_pop(gL, 1); // pop flags
// requires server/admin and the player is not one of them
- if ((flags & 1) && playernum != serverplayer && playernum != adminplayer)
+ if ((flags & 1) && playernum != serverplayer && !IsPlayerAdmin(playernum))
goto deny;
lua_rawgeti(gL, -1, 1); // push function from command info table
@@ -141,7 +141,7 @@ void COM_Lua_f(void)
UINT8 argc;
lua_pop(gL, 1); // pop command info table
- if (flags & 1 && !server && adminplayer != playernum) // flag 1: only server/admin can use this command.
+ if (flags & 1 && !server && !IsPlayerAdmin(playernum)) // flag 1: only server/admin can use this command.
{
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
return;
diff --git a/src/lua_hook.h b/src/lua_hook.h
index 2b113077c..9fcc36594 100644
--- a/src/lua_hook.h
+++ b/src/lua_hook.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2012-2016 by John "JTE" Muniz.
-// Copyright (C) 2012-2016 by Sonic Team Junior.
+// Copyright (C) 2012-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -54,7 +54,7 @@ enum hook {
};
extern const char *const hookNames[];
-void LUAh_MapChange(void); // Hook for map change (before load)
+void LUAh_MapChange(INT16 mapnumber); // Hook for map change (before load)
void LUAh_MapLoad(void); // Hook for map load
void LUAh_PlayerJoin(int playernum); // Hook for Got_AddPlayer
void LUAh_ThinkFrame(void); // Hook for frame (after mobj and player thinkers)
diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c
index 14c9b401c..d605499e2 100644
--- a/src/lua_hooklib.c
+++ b/src/lua_hooklib.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2012-2016 by John "JTE" Muniz.
-// Copyright (C) 2012-2016 by Sonic Team Junior.
+// Copyright (C) 2012-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -327,14 +327,14 @@ boolean LUAh_PlayerHook(player_t *plr, enum hook which)
}
// Hook for map change (before load)
-void LUAh_MapChange(void)
+void LUAh_MapChange(INT16 mapnumber)
{
hook_p hookp;
if (!gL || !(hooksAvailable[hook_MapChange/8] & (1<<(hook_MapChange%8))))
return;
lua_settop(gL, 0);
- lua_pushinteger(gL, gamemap);
+ lua_pushinteger(gL, mapnumber);
for (hookp = roothook; hookp; hookp = hookp->next)
if (hookp->type == hook_MapChange)
@@ -970,7 +970,7 @@ boolean LUAh_LinedefExecute(line_t *line, mobj_t *mo, sector_t *sector)
return hooked;
}
-// Hook for player chat
+
boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg)
{
hook_p hookp;
@@ -1023,6 +1023,7 @@ boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg)
return hooked;
}
+
// Hook for hurt messages
boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source, UINT8 damagetype)
{
diff --git a/src/lua_hud.h b/src/lua_hud.h
index c1479d5ef..7f928f7c4 100644
--- a/src/lua_hud.h
+++ b/src/lua_hud.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2014-2016 by John "JTE" Muniz.
-// Copyright (C) 2014-2016 by Sonic Team Junior.
+// Copyright (C) 2014-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c
index 9c5a21ec9..f3a1ba210 100644
--- a/src/lua_hudlib.c
+++ b/src/lua_hudlib.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2014-2016 by John "JTE" Muniz.
-// Copyright (C) 2014-2016 by Sonic Team Junior.
+// Copyright (C) 2014-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/lua_infolib.c b/src/lua_infolib.c
index 7d7aab750..55afa3874 100644
--- a/src/lua_infolib.c
+++ b/src/lua_infolib.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2012-2016 by John "JTE" Muniz.
-// Copyright (C) 2012-2016 by Sonic Team Junior.
+// Copyright (C) 2012-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/lua_libs.h b/src/lua_libs.h
index 3ffdd8078..827c1d798 100644
--- a/src/lua_libs.h
+++ b/src/lua_libs.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2012-2016 by John "JTE" Muniz.
-// Copyright (C) 2012-2016 by Sonic Team Junior.
+// Copyright (C) 2012-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/lua_maplib.c b/src/lua_maplib.c
index 66fbb22b3..2534e46ff 100644
--- a/src/lua_maplib.c
+++ b/src/lua_maplib.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2012-2016 by John "JTE" Muniz.
-// Copyright (C) 2012-2016 by Sonic Team Junior.
+// Copyright (C) 2012-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -905,16 +905,16 @@ static int side_set(lua_State *L)
side->rowoffset = luaL_checkfixed(L, 3);
break;
case side_toptexture:
- side->toptexture = luaL_checkinteger(L, 3);
+ side->toptexture = luaL_checkinteger(L, 3);
break;
case side_bottomtexture:
- side->bottomtexture = luaL_checkinteger(L, 3);
+ side->bottomtexture = luaL_checkinteger(L, 3);
break;
case side_midtexture:
- side->midtexture = luaL_checkinteger(L, 3);
+ side->midtexture = luaL_checkinteger(L, 3);
break;
case side_repeatcnt:
- side->repeatcnt = luaL_checkinteger(L, 3);
+ side->repeatcnt = luaL_checkinteger(L, 3);
break;
}
return 0;
@@ -1637,6 +1637,7 @@ static int ffloor_get(lua_State *L)
{
ffloor_t *ffloor = *((ffloor_t **)luaL_checkudata(L, 1, META_FFLOOR));
enum ffloor_e field = luaL_checkoption(L, 2, ffloor_opt[0], ffloor_opt);
+ INT16 i;
if (!ffloor)
{
@@ -1656,11 +1657,11 @@ static int ffloor_get(lua_State *L)
lua_pushfixed(L, *ffloor->topheight);
return 1;
case ffloor_toppic: { // toppic
- levelflat_t *levelflat;
- INT16 i;
- for (i = 0, levelflat = levelflats; i != *ffloor->toppic; i++, levelflat++)
- ;
- lua_pushlstring(L, levelflat->name, 8);
+ levelflat_t *levelflat = &levelflats[*ffloor->toppic];
+ for (i = 0; i < 8; i++)
+ if (!levelflat->name[i])
+ break;
+ lua_pushlstring(L, levelflat->name, i);
return 1;
}
case ffloor_toplightlevel:
@@ -1670,11 +1671,11 @@ static int ffloor_get(lua_State *L)
lua_pushfixed(L, *ffloor->bottomheight);
return 1;
case ffloor_bottompic: { // bottompic
- levelflat_t *levelflat;
- INT16 i;
- for (i = 0, levelflat = levelflats; i != *ffloor->bottompic; i++, levelflat++)
- ;
- lua_pushlstring(L, levelflat->name, 8);
+ levelflat_t *levelflat = &levelflats[*ffloor->bottompic];
+ for (i = 0; i < 8; i++)
+ if (!levelflat->name[i])
+ break;
+ lua_pushlstring(L, levelflat->name, i);
return 1;
}
#ifdef ESLOPE
@@ -2069,6 +2070,8 @@ static int mapheaderinfo_get(lua_State *L)
lua_pushinteger(L, header->bonustype);
else if (fastcmp(field,"maxbonuslives"))
lua_pushinteger(L, header->maxbonuslives);
+ else if (fastcmp(field,"saveoverride"))
+ lua_pushinteger(L, header->saveoverride);
else if (fastcmp(field,"levelflags"))
lua_pushinteger(L, header->levelflags);
else if (fastcmp(field,"menuflags"))
diff --git a/src/lua_mathlib.c b/src/lua_mathlib.c
index dd526a169..1f0d6e287 100644
--- a/src/lua_mathlib.c
+++ b/src/lua_mathlib.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2012-2016 by John "JTE" Muniz.
-// Copyright (C) 2012-2016 by Sonic Team Junior.
+// Copyright (C) 2012-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/lua_mobjlib.c b/src/lua_mobjlib.c
index a9db95d4b..0835e5cc0 100644
--- a/src/lua_mobjlib.c
+++ b/src/lua_mobjlib.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2012-2016 by John "JTE" Muniz.
-// Copyright (C) 2012-2016 by Sonic Team Junior.
+// Copyright (C) 2012-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c
index 4919883c4..f3eb978f6 100644
--- a/src/lua_playerlib.c
+++ b/src/lua_playerlib.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2012-2016 by John "JTE" Muniz.
-// Copyright (C) 2012-2016 by Sonic Team Junior.
+// Copyright (C) 2012-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/lua_script.c b/src/lua_script.c
index 69e275712..04aa55cf0 100644
--- a/src/lua_script.c
+++ b/src/lua_script.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2012-2016 by John "JTE" Muniz.
-// Copyright (C) 2012-2016 by Sonic Team Junior.
+// Copyright (C) 2012-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/lua_script.h b/src/lua_script.h
index 51f1eaeaa..b690e4fa7 100644
--- a/src/lua_script.h
+++ b/src/lua_script.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2012-2016 by John "JTE" Muniz.
-// Copyright (C) 2012-2016 by Sonic Team Junior.
+// Copyright (C) 2012-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/lua_skinlib.c b/src/lua_skinlib.c
index 1a70a82d9..a8f785c5a 100644
--- a/src/lua_skinlib.c
+++ b/src/lua_skinlib.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2014-2016 by John "JTE" Muniz.
-// Copyright (C) 2014-2016 by Sonic Team Junior.
+// Copyright (C) 2014-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/lua_thinkerlib.c b/src/lua_thinkerlib.c
index a661aaf04..ae648613a 100644
--- a/src/lua_thinkerlib.c
+++ b/src/lua_thinkerlib.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2012-2016 by John "JTE" Muniz.
-// Copyright (C) 2012-2016 by Sonic Team Junior.
+// Copyright (C) 2012-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/m_aatree.c b/src/m_aatree.c
index 6cb3a32cb..f19fa1dc0 100644
--- a/src/m_aatree.c
+++ b/src/m_aatree.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/m_aatree.h b/src/m_aatree.h
index eeaebca3b..e7f1eba05 100644
--- a/src/m_aatree.h
+++ b/src/m_aatree.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/m_anigif.c b/src/m_anigif.c
index 4ebf2aff3..901927fa1 100644
--- a/src/m_anigif.c
+++ b/src/m_anigif.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 2013-2016 by Matthew "Inuyasha" Walsh.
// Copyright (C) 2013 by "Ninji".
-// Copyright (C) 2013-2016 by Sonic Team Junior.
+// Copyright (C) 2013-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -497,8 +497,8 @@ static void GIF_framewrite(void)
// screen regions are handled in GIF_lzw
{
- int d1 = (int)((100.0/NEWTICRATE)*(gif_frames+1));
- int d2 = (int)((100.0/NEWTICRATE)*(gif_frames));
+ int d1 = (int)((100.0f/NEWTICRATE)*(gif_frames+1));
+ int d2 = (int)((100.0f/NEWTICRATE)*(gif_frames));
UINT16 delay = d1-d2;
INT32 startline;
diff --git a/src/m_anigif.h b/src/m_anigif.h
index dbf7b10a2..6d94ecf8c 100644
--- a/src/m_anigif.h
+++ b/src/m_anigif.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2013-2016 by Matthew "Inuyasha" Walsh.
-// Copyright (C) 2013-2016 by Sonic Team Junior.
+// Copyright (C) 2013-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/m_argv.c b/src/m_argv.c
index 213577e76..117ec7833 100644
--- a/src/m_argv.c
+++ b/src/m_argv.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -25,6 +25,10 @@ INT32 myargc;
*/
char **myargv;
+/** \brief did we alloc myargv ourselves?
+*/
+boolean myargmalloc = false;
+
/** \brief founded the parm
*/
static INT32 found;
@@ -171,6 +175,7 @@ void M_FindResponseFile(void)
free(file);
I_Error("Not enough memory to read response file");
}
+ myargmalloc = true; // mark as having been allocated by us
memset(myargv, 0, sizeof (char *) * MAXARGVS);
myargv[0] = firstargv;
@@ -193,14 +198,12 @@ void M_FindResponseFile(void)
k++;
} while (k < size);
- free(file);
-
for (k = 0; k < pindex; k++)
myargv[indexinfile++] = moreargs[k];
myargc = indexinfile;
// display arguments
- CONS_Printf(M_GetText("%d command-line args:\n"), myargc);
+ CONS_Printf(M_GetText("%d command-line args:\n"), myargc-1); // -1 so @ don't actually get counted for
for (k = 1; k < myargc; k++)
CONS_Printf("%s\n", myargv[k]);
diff --git a/src/m_argv.h b/src/m_argv.h
index 46ef9a2cf..d654dcc19 100644
--- a/src/m_argv.h
+++ b/src/m_argv.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -19,6 +19,7 @@
//
extern INT32 myargc;
extern char **myargv;
+extern boolean myargmalloc;
// Returns the position of the given parameter in the arg list (0 if not found).
INT32 M_CheckParm(const char *check);
diff --git a/src/m_bbox.c b/src/m_bbox.c
index fb44b853e..0c57de43e 100644
--- a/src/m_bbox.c
+++ b/src/m_bbox.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/m_bbox.h b/src/m_bbox.h
index a11257b8a..db5c2b4a7 100644
--- a/src/m_bbox.h
+++ b/src/m_bbox.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/m_cheat.c b/src/m_cheat.c
index 79a52fe9f..bee60087f 100644
--- a/src/m_cheat.c
+++ b/src/m_cheat.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/m_cheat.h b/src/m_cheat.h
index d50ddc119..aa9b0bfeb 100644
--- a/src/m_cheat.h
+++ b/src/m_cheat.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/m_cond.c b/src/m_cond.c
index e9d655694..b6d571fcc 100644
--- a/src/m_cond.c
+++ b/src/m_cond.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2012-2016 by Matthew "Inuyasha" Walsh.
-// Copyright (C) 2012-2016 by Sonic Team Junior.
+// Copyright (C) 2012-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/m_cond.h b/src/m_cond.h
index 00f633a8d..dac98b284 100644
--- a/src/m_cond.h
+++ b/src/m_cond.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2012-2016 by Matthew "Inuyasha" Walsh.
-// Copyright (C) 2012-2016 by Sonic Team Junior.
+// Copyright (C) 2012-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/m_dllist.h b/src/m_dllist.h
index f19659cca..18f351144 100644
--- a/src/m_dllist.h
+++ b/src/m_dllist.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2005 by James Haley
-// Copyright (C) 2005-2016 by Sonic Team Junior.
+// Copyright (C) 2005-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/m_fixed.c b/src/m_fixed.c
index 014457386..d45bb70bf 100644
--- a/src/m_fixed.c
+++ b/src/m_fixed.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -432,7 +432,7 @@ vector3_t *FV3_Cross(const vector3_t *a_1, const vector3_t *a_2, vector3_t *a_o)
//
vector3_t *FV3_ClosestPointOnLine(const vector3_t *Line, const vector3_t *p, vector3_t *out)
{
- // Determine t (the length of the vector from ‘Line[0]’ to ‘p’)
+ // Determine t (the length of the vector from �Line[0]� to �p�)
vector3_t c, V;
fixed_t t, d = 0;
FV3_SubEx(p, &Line[0], &c);
@@ -442,7 +442,7 @@ vector3_t *FV3_ClosestPointOnLine(const vector3_t *Line, const vector3_t *p, vec
d = FV3_Distance(&Line[0], &Line[1]);
t = FV3_Dot(&V, &c);
- // Check to see if ‘t’ is beyond the extents of the line segment
+ // Check to see if �t� is beyond the extents of the line segment
if (t < 0)
{
return FV3_Copy(out, &Line[0]);
@@ -452,7 +452,7 @@ vector3_t *FV3_ClosestPointOnLine(const vector3_t *Line, const vector3_t *p, vec
return FV3_Copy(out, &Line[1]);
}
- // Return the point between ‘Line[0]’ and ‘Line[1]’
+ // Return the point between �Line[0]� and �Line[1]�
FV3_Mul(&V, t);
return FV3_AddEx(&Line[0], &V, out);
diff --git a/src/m_fixed.h b/src/m_fixed.h
index 8050324db..d8e722b13 100644
--- a/src/m_fixed.h
+++ b/src/m_fixed.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -70,7 +70,7 @@ typedef INT32 fixed_t;
:"=a" (ret) // eax is always the result and the first operand (%0,%1)
:"0" (a), "r" (b) // and %2 is what we use imull on with what in %1
, "I" (FRACBITS) // %3 holds FRACBITS (normally 16)
- :"%cc", "%edx" // edx and condition codes clobbered
+ :"cc", "%edx" // edx and condition codes clobbered
);
return ret;
}
diff --git a/src/m_menu.c b/src/m_menu.c
index c44d74eb4..286d4ecde 100644
--- a/src/m_menu.c
+++ b/src/m_menu.c
@@ -3,7 +3,7 @@
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 2011-2016 by Matthew "Inuyasha" Walsh.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -58,6 +58,8 @@
#include "i_sound.h"
#include "fastcmp.h"
+#include "i_joy.h" // for joystick menu controls
+
// Condition Sets
#include "m_cond.h"
@@ -171,7 +173,7 @@ typedef enum
levellist_mode_t levellistmode = LLM_CREATESERVER;
UINT8 maplistoption = 0;
-static char joystickInfo[8][25];
+static char joystickInfo[8][29];
#ifndef NONET
static UINT32 serverlistpage;
#endif
@@ -328,6 +330,7 @@ menu_t OP_VideoOptionsDef, OP_VideoModeDef, OP_ColorOptionsDef;
menu_t OP_OpenGLOptionsDef, OP_OpenGLFogDef, OP_OpenGLColorDef;
#endif
menu_t OP_SoundOptionsDef;
+<<<<<<< HEAD
static void M_ToggleSFX(INT32 choice);
static void M_ToggleDigital(INT32 choice);
static void M_ToggleMIDI(INT32 choice);
@@ -335,18 +338,32 @@ static void M_ToggleMIDI(INT32 choice);
//Misc
menu_t OP_DataOptionsDef, OP_ScreenshotOptionsDef, OP_EraseDataDef;
menu_t OP_ServerOptionsDef;
+=======
+
+//Misc
+menu_t OP_DataOptionsDef, OP_ScreenshotOptionsDef, OP_EraseDataDef;
+menu_t OP_GameOptionsDef, OP_ChatOptionsDef, OP_ServerOptionsDef;
+menu_t OP_NetgameOptionsDef, OP_GametypeOptionsDef;
+>>>>>>> public_next-20190101
menu_t OP_MonitorToggleDef;
static void M_ScreenshotOptions(INT32 choice);
static void M_EraseData(INT32 choice);
static void M_Addons(INT32 choice);
static void M_AddonsOptions(INT32 choice);
+<<<<<<< HEAD
static patch_t *addonsp[NUM_EXT+6];
#define numaddonsshown 4
static void M_DrawLevelPlatterHeader(INT32 y, const char *header, boolean headerhighlight, boolean allowlowercase);
+=======
+static patch_t *addonsp[NUM_EXT+5];
+
+#define numaddonsshown 4
+
+>>>>>>> public_next-20190101
// Drawing functions
static void M_DrawGenericMenu(void);
static void M_DrawGenericScrollMenu(void);
@@ -388,7 +405,10 @@ static void M_DrawSetupMultiPlayerMenu(void);
static boolean M_ExitPandorasBox(void);
static boolean M_QuitMultiPlayerMenu(void);
static void M_HandleAddons(INT32 choice);
+<<<<<<< HEAD
static void M_HandleLevelPlatter(INT32 choice);
+=======
+>>>>>>> public_next-20190101
static void M_HandleSoundTest(INT32 choice);
static void M_HandleImageDef(INT32 choice);
static void M_HandleLoadSave(INT32 choice);
@@ -486,6 +506,7 @@ static consvar_t cv_dummymares = {"dummymares", "Overall", CV_HIDEN|CV_CALL, dum
// ---------
static menuitem_t MainMenu[] =
{
+<<<<<<< HEAD
{IT_STRING|IT_CALL, NULL, "Secrets", M_SecretsMenu, 76},
{IT_STRING|IT_CALL, NULL, "1 player", M_SinglePlayerMenu, 84},
#ifndef NONET
@@ -496,6 +517,14 @@ static menuitem_t MainMenu[] =
{IT_STRING|IT_CALL, NULL, "options", M_Options, 100},
{IT_CALL |IT_STRING, NULL, "addons", M_Addons, 108},
{IT_STRING|IT_CALL, NULL, "quit game", M_QuitSRB2, 116},
+=======
+ {IT_CALL |IT_STRING, NULL, "Secrets", M_SecretsMenu, 76},
+ {IT_CALL |IT_STRING, NULL, "1 player", M_SinglePlayerMenu, 84},
+ {IT_SUBMENU|IT_STRING, NULL, "multiplayer", &MP_MainDef, 92},
+ {IT_CALL |IT_STRING, NULL, "options", M_Options, 100},
+ {IT_CALL |IT_STRING, NULL, "Addons", M_Addons, 108},
+ {IT_CALL |IT_STRING, NULL, "quit game", M_QuitSRB2, 116},
+>>>>>>> public_next-20190101
};
typedef enum
@@ -535,9 +564,15 @@ typedef enum
// ---------------------
static menuitem_t MPauseMenu[] =
{
+<<<<<<< HEAD
{IT_STRING | IT_CALL, NULL, "Add-ons...", M_Addons, 8},
{IT_STRING | IT_SUBMENU, NULL, "Scramble Teams...", &MISC_ScrambleTeamDef, 16},
{IT_STRING | IT_CALL, NULL, "Switch Gametype/Level...", M_MapChange, 24},
+=======
+ {IT_STRING | IT_CALL, NULL, "Add-ons...", M_Addons, 8},
+ {IT_STRING | IT_SUBMENU, NULL, "Scramble Teams...", &MISC_ScrambleTeamDef, 16},
+ {IT_STRING | IT_CALL, NULL, "Switch Map..." , M_MapChange, 24},
+>>>>>>> public_next-20190101
{IT_STRING | IT_CALL, NULL, "Continue", M_SelectableClearMenus,40},
{IT_STRING | IT_CALL, NULL, "Player 1 Setup", M_SetupMultiPlayer, 48}, // splitscreen
@@ -1028,7 +1063,19 @@ static menuitem_t OP_MainMenu[] =
{IT_SUBMENU | IT_STRING, NULL, "Video Options...", &OP_VideoOptionsDef, 50},
{IT_CALL | IT_STRING, NULL, "Sound Options...", M_SoundMenu, 60},
+<<<<<<< HEAD
{IT_CALL | IT_STRING, NULL, "Server Options...", M_ServerOptions, 80},
+=======
+ {IT_SUBMENU | IT_STRING, NULL, "Game Options...", &OP_GameOptionsDef, 70},
+ {IT_SUBMENU | IT_STRING, NULL, "Server Options...", &OP_ServerOptionsDef, 80},
+ {IT_STRING | IT_CALL, NULL, "Add-on Options...", M_AddonsOptions, 90},
+};
+
+static menuitem_t OP_ControlsMenu[] =
+{
+ {IT_SUBMENU | IT_STRING, NULL, "Player 1 Controls...", &OP_P1ControlsDef, 10},
+ {IT_SUBMENU | IT_STRING, NULL, "Player 2 Controls...", &OP_P2ControlsDef, 20},
+>>>>>>> public_next-20190101
{IT_SUBMENU | IT_STRING, NULL, "Data Options...", &OP_DataOptionsDef, 100},
};
@@ -1052,12 +1099,53 @@ static menuitem_t OP_P2ControlsMenu[] =
{
{IT_CALL | IT_STRING, NULL, "Control Configuration...", M_Setup2PControlsMenu, 10},
{IT_SUBMENU | IT_STRING, NULL, "Second Mouse Options...", &OP_Mouse2OptionsDef, 20},
+<<<<<<< HEAD
{IT_SUBMENU | IT_STRING, NULL, "Second Gamepad Options...", &OP_Joystick2Def , 30},
+=======
+ {IT_SUBMENU | IT_STRING, NULL, "Second Joystick Options...", &OP_Joystick2Def , 30},
+
+ {IT_STRING | IT_CVAR, NULL, "Camera" , &cv_chasecam2 , 50},
+ {IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair2, 60},
+
+ {IT_STRING | IT_CVAR, NULL, "Analog Control", &cv_useranalog2, 80},
+};
+
+static menuitem_t OP_ControlListMenu[] =
+{
+ {IT_SUBMENU | IT_STRING, NULL, "Movement Controls...", &OP_MoveControlsDef, 10},
+ {IT_SUBMENU | IT_STRING, NULL, "Multiplayer Controls...", &OP_MPControlsDef, 20},
+ {IT_SUBMENU | IT_STRING, NULL, "Miscellaneous Controls...", &OP_MiscControlsDef, 30},
+};
+
+static menuitem_t OP_MoveControlsMenu[] =
+{
+ {IT_HEADER, NULL, " Movement", NULL, 0},
+ {IT_CALL | IT_STRING2, NULL, "Move Forward", M_ChangeControl, gc_forward },
+ {IT_CALL | IT_STRING2, NULL, "Move Backward", M_ChangeControl, gc_backward },
+ {IT_CALL | IT_STRING2, NULL, "Move Left", M_ChangeControl, gc_strafeleft },
+ {IT_CALL | IT_STRING2, NULL, "Move Right", M_ChangeControl, gc_straferight },
+ {IT_CALL | IT_STRING2, NULL, "Jump", M_ChangeControl, gc_jump },
+ {IT_CALL | IT_STRING2, NULL, "Spin", M_ChangeControl, gc_use },
+ {IT_HEADER, NULL, " Camera", NULL, 0},
+ {IT_CALL | IT_STRING2, NULL, "Look Up", M_ChangeControl, gc_lookup },
+ {IT_CALL | IT_STRING2, NULL, "Look Down", M_ChangeControl, gc_lookdown },
+ {IT_CALL | IT_STRING2, NULL, "Turn Left", M_ChangeControl, gc_turnleft },
+ {IT_CALL | IT_STRING2, NULL, "Turn Right", M_ChangeControl, gc_turnright },
+ {IT_CALL | IT_STRING2, NULL, "Center View", M_ChangeControl, gc_centerview },
+ {IT_CALL | IT_STRING2, NULL, "Toggle Mouselook", M_ChangeControl, gc_mouseaiming },
+ {IT_CALL | IT_STRING2, NULL, "Toggle Third-Person", M_ChangeControl, gc_camtoggle},
+ {IT_CALL | IT_STRING2, NULL, "Reset Camera", M_ChangeControl, gc_camreset },
+ {IT_HEADER, NULL, " Advanced", NULL, 0},
+ {IT_CALL | IT_STRING2, NULL, "Rotate Camera L", M_ChangeControl, gc_camleft },
+ {IT_CALL | IT_STRING2, NULL, "Rotate Camera R", M_ChangeControl, gc_camright },
+};
+>>>>>>> public_next-20190101
{IT_STRING | IT_CVAR, NULL, "Third-person Camera" , &cv_chasecam2 , 50},
{IT_STRING | IT_CVAR, NULL, "Flip Camera with Gravity" , &cv_flipcam2 , 60},
{IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair2, 70},
+<<<<<<< HEAD
//{IT_STRING | IT_CVAR, NULL, "Analog Control", &cv_useranalog2, 90},
{IT_STRING | IT_CVAR, NULL, "Character angle", &cv_directionchar2, 90},
{IT_STRING | IT_CVAR, NULL, "Automatic braking", &cv_autobrake2, 100},
@@ -1112,10 +1200,25 @@ static menuitem_t OP_ChangeControlsMenu[] =
{IT_CALL | IT_STRING2, NULL, "Custom Action 1", M_ChangeControl, gc_custom1 },
{IT_CALL | IT_STRING2, NULL, "Custom Action 2", M_ChangeControl, gc_custom2 },
{IT_CALL | IT_STRING2, NULL, "Custom Action 3", M_ChangeControl, gc_custom3 },
+=======
+static menuitem_t OP_MiscControlsMenu[] =
+{
+ {IT_CALL | IT_STRING2, NULL, "Custom Action 1", M_ChangeControl, gc_custom1 },
+ {IT_CALL | IT_STRING2, NULL, "Custom Action 2", M_ChangeControl, gc_custom2 },
+ {IT_CALL | IT_STRING2, NULL, "Custom Action 3", M_ChangeControl, gc_custom3 },
+
+ {IT_CALL | IT_STRING2, NULL, "Pause", M_ChangeControl, gc_pause },
+ {IT_CALL | IT_STRING2, NULL, "Screenshot", M_ChangeControl, gc_screenshot },
+ {IT_CALL | IT_STRING2, NULL, "Toggle GIF Recording", M_ChangeControl, gc_recordgif },
+ {IT_CALL | IT_STRING2, NULL, "Open/Close Menu (ESC)", M_ChangeControl, gc_systemmenu },
+ {IT_CALL | IT_STRING2, NULL, "Change Viewpoint", M_ChangeControl, gc_viewpoint },
+ {IT_CALL | IT_STRING2, NULL, "Console", M_ChangeControl, gc_console },
+>>>>>>> public_next-20190101
};
static menuitem_t OP_Joystick1Menu[] =
{
+<<<<<<< HEAD
{IT_STRING | IT_CALL, NULL, "Select Gamepad...", M_Setup1PJoystickMenu, 10},
{IT_STRING | IT_CVAR, NULL, "Move \x17 Axis" , &cv_moveaxis , 30},
{IT_STRING | IT_CVAR, NULL, "Move \x18 Axis" , &cv_sideaxis , 40},
@@ -1125,10 +1228,25 @@ static menuitem_t OP_Joystick1Menu[] =
{IT_STRING | IT_CVAR, NULL, "Spin Axis" , &cv_spinaxis , 80},
{IT_STRING | IT_CVAR, NULL, "Fire Axis" , &cv_fireaxis , 90},
{IT_STRING | IT_CVAR, NULL, "Fire Normal Axis" , &cv_firenaxis ,100},
+=======
+ {IT_STRING | IT_CALL, NULL, "Select Joystick...", M_Setup1PJoystickMenu, 10},
+ {IT_STRING | IT_CVAR, NULL, "Axis For Turning" , &cv_turnaxis , 30},
+ {IT_STRING | IT_CVAR, NULL, "Axis For Moving" , &cv_moveaxis , 40},
+ {IT_STRING | IT_CVAR, NULL, "Axis For Strafe" , &cv_sideaxis , 50},
+ {IT_STRING | IT_CVAR, NULL, "Axis For Looking" , &cv_lookaxis , 60},
+ {IT_STRING | IT_CVAR, NULL, "Axis For Jumping" , &cv_jumpaxis , 70},
+ {IT_STRING | IT_CVAR, NULL, "Axis For Spinning" , &cv_spinaxis , 80},
+ {IT_STRING | IT_CVAR, NULL, "Axis For Firing" , &cv_fireaxis , 90},
+ {IT_STRING | IT_CVAR, NULL, "Axis For NFiring" , &cv_firenaxis , 100},
+
+ {IT_STRING | IT_CVAR, NULL, "First-Person Vert-Look", &cv_alwaysfreelook, 120},
+ {IT_STRING | IT_CVAR, NULL, "Third-Person Vert-Look", &cv_chasefreelook, 130},
+>>>>>>> public_next-20190101
};
static menuitem_t OP_Joystick2Menu[] =
{
+<<<<<<< HEAD
{IT_STRING | IT_CALL, NULL, "Select Gamepad...", M_Setup2PJoystickMenu, 10},
{IT_STRING | IT_CVAR, NULL, "Move \x17 Axis" , &cv_moveaxis2 , 30},
{IT_STRING | IT_CVAR, NULL, "Move \x18 Axis" , &cv_sideaxis2 , 40},
@@ -1138,6 +1256,20 @@ static menuitem_t OP_Joystick2Menu[] =
{IT_STRING | IT_CVAR, NULL, "Spin Axis" , &cv_spinaxis2 , 80},
{IT_STRING | IT_CVAR, NULL, "Fire Axis" , &cv_fireaxis2 , 90},
{IT_STRING | IT_CVAR, NULL, "Fire Normal Axis" , &cv_firenaxis2 ,100},
+=======
+ {IT_STRING | IT_CALL, NULL, "Select Joystick...", M_Setup2PJoystickMenu, 10},
+ {IT_STRING | IT_CVAR, NULL, "Axis For Turning" , &cv_turnaxis2 , 30},
+ {IT_STRING | IT_CVAR, NULL, "Axis For Moving" , &cv_moveaxis2 , 40},
+ {IT_STRING | IT_CVAR, NULL, "Axis For Strafe" , &cv_sideaxis2 , 50},
+ {IT_STRING | IT_CVAR, NULL, "Axis For Looking" , &cv_lookaxis2 , 60},
+ {IT_STRING | IT_CVAR, NULL, "Axis For Jumping" , &cv_jumpaxis2 , 70},
+ {IT_STRING | IT_CVAR, NULL, "Axis For Spinning" , &cv_spinaxis2 , 80},
+ {IT_STRING | IT_CVAR, NULL, "Axis For Firing" , &cv_fireaxis2 , 90},
+ {IT_STRING | IT_CVAR, NULL, "Axis For NFiring" , &cv_firenaxis2 , 100},
+
+ {IT_STRING | IT_CVAR, NULL, "First-Person Vert-Look", &cv_alwaysfreelook2,120},
+ {IT_STRING | IT_CVAR, NULL, "Third-Person Vert-Look", &cv_chasefreelook2, 130},
+>>>>>>> public_next-20190101
};
static menuitem_t OP_JoystickSetMenu[] =
@@ -1154,6 +1286,7 @@ static menuitem_t OP_MouseOptionsMenu[] =
{IT_STRING | IT_CVAR, NULL, "Use Mouse", &cv_usemouse, 10},
+<<<<<<< HEAD
{IT_STRING | IT_CVAR, NULL, "Always Mouselook", &cv_alwaysfreelook, 30},
{IT_STRING | IT_CVAR, NULL, "Mouse Move", &cv_mousemove, 40},
{IT_STRING | IT_CVAR, NULL, "Invert Y Axis", &cv_invertmouse, 50},
@@ -1161,6 +1294,16 @@ static menuitem_t OP_MouseOptionsMenu[] =
NULL, "Mouse X Sensitivity", &cv_mousesens, 60},
{IT_STRING | IT_CVAR | IT_CV_SLIDER,
NULL, "Mouse Y Sensitivity", &cv_mouseysens, 70},
+=======
+ {IT_STRING | IT_CVAR, NULL, "First-Person MouseLook", &cv_alwaysfreelook, 30},
+ {IT_STRING | IT_CVAR, NULL, "Third-Person MouseLook", &cv_chasefreelook, 40},
+ {IT_STRING | IT_CVAR, NULL, "Mouse Move", &cv_mousemove, 50},
+ {IT_STRING | IT_CVAR, NULL, "Invert Mouse", &cv_invertmouse, 60},
+ {IT_STRING | IT_CVAR | IT_CV_SLIDER,
+ NULL, "Mouse X Speed", &cv_mousesens, 70},
+ {IT_STRING | IT_CVAR | IT_CV_SLIDER,
+ NULL, "Mouse Y Speed", &cv_mouseysens, 80},
+>>>>>>> public_next-20190101
};
static menuitem_t OP_Mouse2OptionsMenu[] =
@@ -1168,6 +1311,7 @@ static menuitem_t OP_Mouse2OptionsMenu[] =
{IT_STRING | IT_CVAR, NULL, "Use Mouse 2", &cv_usemouse2, 10},
{IT_STRING | IT_CVAR, NULL, "Second Mouse Serial Port",
&cv_mouse2port, 20},
+<<<<<<< HEAD
{IT_STRING | IT_CVAR, NULL, "Always Mouselook", &cv_alwaysfreelook2, 30},
{IT_STRING | IT_CVAR, NULL, "Mouse Move", &cv_mousemove2, 40},
{IT_STRING | IT_CVAR, NULL, "Invert Y Axis", &cv_invertmouse2, 50},
@@ -1175,6 +1319,16 @@ static menuitem_t OP_Mouse2OptionsMenu[] =
NULL, "Mouse X Sensitivity", &cv_mousesens2, 60},
{IT_STRING | IT_CVAR | IT_CV_SLIDER,
NULL, "Mouse Y Sensitivity", &cv_mouseysens2, 70},
+=======
+ {IT_STRING | IT_CVAR, NULL, "First-Person MouseLook", &cv_alwaysfreelook2, 30},
+ {IT_STRING | IT_CVAR, NULL, "Third-Person MouseLook", &cv_chasefreelook2, 40},
+ {IT_STRING | IT_CVAR, NULL, "Mouse Move", &cv_mousemove2, 50},
+ {IT_STRING | IT_CVAR, NULL, "Invert Mouse", &cv_invertmouse2, 60},
+ {IT_STRING | IT_CVAR | IT_CV_SLIDER,
+ NULL, "Mouse X Speed", &cv_mousesens2, 70},
+ {IT_STRING | IT_CVAR | IT_CV_SLIDER,
+ NULL, "Mouse Y Speed", &cv_mouseysens2, 80},
+>>>>>>> public_next-20190101
};
static menuitem_t OP_VideoOptionsMenu[] =
@@ -1318,10 +1472,16 @@ static menuitem_t OP_SoundOptionsMenu[] =
{IT_STRING | IT_KEYHANDLER, NULL, "Digital Music", M_ToggleDigital, 40},
{IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Digital Music Volume", &cv_digmusicvolume, 50},
+<<<<<<< HEAD
{IT_STRING | IT_KEYHANDLER, NULL, "MIDI Music", M_ToggleMIDI, 70},
{IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "MIDI Music Volume", &cv_midimusicvolume, 80},
{IT_STRING | IT_CVAR, NULL, "Closed Captioning", &cv_closedcaptioning, 100},
+=======
+ {IT_STRING | IT_CVAR, NULL, "SFX" , &cv_gamesounds, 50},
+ {IT_STRING | IT_CVAR, NULL, "Digital Music", &cv_gamedigimusic, 60},
+ {IT_STRING | IT_CVAR, NULL, "MIDI Music", &cv_gamemidimusic, 70},
+>>>>>>> public_next-20190101
};
static menuitem_t OP_DataOptionsMenu[] =
@@ -1377,6 +1537,7 @@ static menuitem_t OP_EraseDataMenu[] =
};
static menuitem_t OP_AddonsOptionsMenu[] =
+<<<<<<< HEAD
{
{IT_HEADER, NULL, "Menu", NULL, 0},
{IT_STRING|IT_CVAR, NULL, "Location", &cv_addons_option, 12},
@@ -1388,12 +1549,63 @@ static menuitem_t OP_AddonsOptionsMenu[] =
{IT_STRING|IT_CVAR, NULL, "Matching", &cv_addons_search_type, 90},
{IT_STRING|IT_CVAR, NULL, "Case-sensitive", &cv_addons_search_case, 100},
};
+=======
+{
+ {IT_HEADER, NULL, "Menu", NULL, 0},
+ {IT_STRING|IT_CVAR, NULL, "Location", &cv_addons_option, 10},
+ {IT_STRING|IT_CVAR|IT_CV_STRING, NULL, "Custom Folder", &cv_addons_folder, 20},
+ {IT_STRING|IT_CVAR, NULL, "Identify add-ons via", &cv_addons_md5, 48},
+ {IT_STRING|IT_CVAR, NULL, "Show unsupported file types", &cv_addons_showall, 58},
+
+ {IT_HEADER, NULL, "Search", NULL, 76},
+ {IT_STRING|IT_CVAR, NULL, "Matching", &cv_addons_search_type, 86},
+ {IT_STRING|IT_CVAR, NULL, "Case-sensitive", &cv_addons_search_case, 96},
+};
enum
{
op_addons_folder = 2,
};
+static menuitem_t OP_GameOptionsMenu[] =
+{
+#ifndef NONET
+ {IT_STRING | IT_CVAR | IT_CV_STRING,
+ NULL, "Master server", &cv_masterserver, 10},
+ {IT_STRING | IT_SUBMENU, NULL, "Chat Options...", &OP_ChatOptionsDef, 40},
+#endif
+ {IT_STRING | IT_CVAR, NULL, "Show HUD", &cv_showhud, 50},
+ {IT_STRING | IT_CVAR | IT_CV_SLIDER,
+ NULL, "HUD Visibility", &cv_translucenthud, 60},
+ {IT_STRING | IT_CVAR, NULL, "Timer Display", &cv_timetic, 70},
+ {IT_STRING | IT_CVAR, NULL, "Always Compact Rankings", &cv_compactscoreboard, 80},
+#ifdef SEENAMES
+ {IT_STRING | IT_CVAR, NULL, "HUD Player Names", &cv_seenames, 90},
+#endif
+ {IT_STRING | IT_CVAR, NULL, "Log Hazard Damage", &cv_hazardlog, 100},
+
+ {IT_STRING | IT_CVAR, NULL, "Console Back Color", &cons_backcolor, 110},
+ {IT_STRING | IT_CVAR, NULL, "Console Text Size", &cv_constextsize,120},
+ {IT_STRING | IT_CVAR, NULL, "Uppercase Console", &cv_allcaps, 130},
+>>>>>>> public_next-20190101
+
+enum
+{
+ op_addons_folder = 2,
+};
+
+static menuitem_t OP_ChatOptionsMenu[] =
+{
+ {IT_STRING | IT_CVAR, NULL, "Chat Mode", &cv_consolechat, 10},
+
+ {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Chat Box Width", &cv_chatwidth, 30},
+ {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Chat Box Height", &cv_chatheight, 40},
+ {IT_STRING | IT_CVAR, NULL, "Message Fadeout Time", &cv_chattime, 50},
+ {IT_STRING | IT_CVAR, NULL, "Chat Notifications", &cv_chatnotifications, 60},
+ {IT_STRING | IT_CVAR, NULL, "Spam Protection", &cv_chatspamprotection, 70},
+ {IT_STRING | IT_CVAR, NULL, "Chat background tint", &cv_chatbacktint, 80},
+};
+
static menuitem_t OP_ServerOptionsMenu[] =
{
{IT_HEADER, NULL, "General", NULL, 0},
@@ -1508,6 +1720,9 @@ menu_t MISC_ChangeLevelDef =
menu_t MISC_HelpDef = IMAGEDEF(MISC_HelpMenu);
+static INT32 highlightflags, recommendedflags, warningflags;
+
+
// Sky Room
menu_t SR_PandoraDef =
{
@@ -1785,6 +2000,7 @@ menu_t MP_PlayerSetupDef =
};
// Options
+<<<<<<< HEAD
menu_t OP_MainDef = DEFAULTMENUSTYLE("M_OPTTTL", OP_MainMenu, &MainDef, 50, 30);
menu_t OP_ChangeControlsDef = CONTROLMENUSTYLE(OP_ChangeControlsMenu, &OP_MainDef);
menu_t OP_P1ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_P1ControlsMenu, &OP_MainDef, 50, 30);
@@ -1793,6 +2009,20 @@ menu_t OP_MouseOptionsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_MouseOptionsMenu, &O
menu_t OP_Mouse2OptionsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_Mouse2OptionsMenu, &OP_P2ControlsDef, 35, 30);
menu_t OP_Joystick1Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick1Menu, &OP_P1ControlsDef, 50, 30);
menu_t OP_Joystick2Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick2Menu, &OP_P2ControlsDef, 50, 30);
+=======
+menu_t OP_MainDef = DEFAULTMENUSTYLE("M_OPTTTL", OP_MainMenu, &MainDef, 60, 30);
+menu_t OP_ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_ControlsMenu, &OP_MainDef, 60, 30);
+menu_t OP_ControlListDef = DEFAULTMENUSTYLE("M_CONTRO", OP_ControlListMenu, &OP_ControlsDef, 60, 30);
+menu_t OP_MoveControlsDef = CONTROLMENUSTYLE(OP_MoveControlsMenu, &OP_ControlListDef);
+menu_t OP_MPControlsDef = CONTROLMENUSTYLE(OP_MPControlsMenu, &OP_ControlListDef);
+menu_t OP_MiscControlsDef = CONTROLMENUSTYLE(OP_MiscControlsMenu, &OP_ControlListDef);
+menu_t OP_P1ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_P1ControlsMenu, &OP_ControlsDef, 60, 30);
+menu_t OP_P2ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_P2ControlsMenu, &OP_ControlsDef, 60, 30);
+menu_t OP_MouseOptionsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_MouseOptionsMenu, &OP_P1ControlsDef, 60, 30);
+menu_t OP_Mouse2OptionsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_Mouse2OptionsMenu, &OP_P2ControlsDef, 60, 30);
+menu_t OP_Joystick1Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick1Menu, &OP_P1ControlsDef, 60, 30);
+menu_t OP_Joystick2Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick2Menu, &OP_P2ControlsDef, 60, 30);
+>>>>>>> public_next-20190101
menu_t OP_JoystickSetDef =
{
"M_CONTRO",
@@ -1852,6 +2082,12 @@ menu_t OP_SoundOptionsDef =
menu_t OP_ServerOptionsDef = DEFAULTSCROLLMENUSTYLE("M_SERVER", OP_ServerOptionsMenu, &OP_MainDef, 30, 30);
+<<<<<<< HEAD
+=======
+menu_t OP_NetgameOptionsDef = DEFAULTMENUSTYLE("M_SERVER", OP_NetgameOptionsMenu, &OP_ServerOptionsDef, 30, 30);
+menu_t OP_GametypeOptionsDef = DEFAULTMENUSTYLE("M_SERVER", OP_GametypeOptionsMenu, &OP_ServerOptionsDef, 30, 30);
+menu_t OP_ChatOptionsDef = DEFAULTMENUSTYLE("M_GAME", OP_ChatOptionsMenu, &OP_GameOptionsDef, 30, 30);
+>>>>>>> public_next-20190101
menu_t OP_MonitorToggleDef =
{
"M_SERVER",
@@ -1893,6 +2129,7 @@ menu_t OP_OpenGLColorDef =
};
#endif
menu_t OP_DataOptionsDef = DEFAULTMENUSTYLE("M_DATA", OP_DataOptionsMenu, &OP_MainDef, 60, 30);
+<<<<<<< HEAD
menu_t OP_ScreenshotOptionsDef =
{
@@ -1908,6 +2145,10 @@ menu_t OP_ScreenshotOptionsDef =
menu_t OP_AddonsOptionsDef = DEFAULTMENUSTYLE("M_ADDONS", OP_AddonsOptionsMenu, &OP_DataOptionsDef, 30, 30);
+=======
+menu_t OP_ScreenshotOptionsDef = DEFAULTMENUSTYLE("M_DATA", OP_ScreenshotOptionsMenu, &OP_DataOptionsDef, 30, 30);
+menu_t OP_AddonsOptionsDef = DEFAULTMENUSTYLE("M_ADDONS", OP_AddonsOptionsMenu, &OP_MainDef, 30, 30);
+>>>>>>> public_next-20190101
menu_t OP_EraseDataDef = DEFAULTMENUSTYLE("M_DATA", OP_EraseDataMenu, &OP_DataOptionsDef, 60, 30);
// ==========================================================================
@@ -2256,6 +2497,7 @@ boolean M_Responder(event_t *ev)
INT32 ch = -1;
// INT32 i;
static tic_t joywait = 0, mousewait = 0;
+ static INT32 pjoyx = 0, pjoyy = 0;
static INT32 pmousex = 0, pmousey = 0;
static INT32 lastx = 0, lasty = 0;
void (*routine)(INT32 choice); // for some casting problem
@@ -2271,63 +2513,84 @@ boolean M_Responder(event_t *ev)
// (but still allow shift keyup so caps doesn't get stuck)
return false;
}
- else if (ev->type == ev_keydown)
- {
- ch = ev->data1;
-
- // added 5-2-98 remap virtual keys (mouse & joystick buttons)
- switch (ch)
- {
- case KEY_MOUSE1:
- case KEY_JOY1:
- case KEY_JOY1 + 2:
- ch = KEY_ENTER;
- break;
- case KEY_JOY1 + 3:
- ch = 'n';
- break;
- case KEY_MOUSE1 + 1:
- case KEY_JOY1 + 1:
- ch = KEY_BACKSPACE;
- break;
- case KEY_HAT1:
- ch = KEY_UPARROW;
- break;
- case KEY_HAT1 + 1:
- ch = KEY_DOWNARROW;
- break;
- case KEY_HAT1 + 2:
- ch = KEY_LEFTARROW;
- break;
- case KEY_HAT1 + 3:
- ch = KEY_RIGHTARROW;
- break;
- }
- }
else if (menuactive)
{
- if (ev->type == ev_joystick && ev->data1 == 0 && joywait < I_GetTime())
+ if (ev->type == ev_keydown)
{
- if (ev->data3 == -1)
+ ch = ev->data1;
+
+ // added 5-2-98 remap virtual keys (mouse & joystick buttons)
+ switch (ch)
{
- ch = KEY_UPARROW;
- joywait = I_GetTime() + NEWTICRATE/7;
+ case KEY_MOUSE1:
+ case KEY_JOY1:
+ ch = KEY_ENTER;
+ break;
+ case KEY_JOY1 + 3:
+ ch = 'n';
+ break;
+ case KEY_MOUSE1 + 1:
+ case KEY_JOY1 + 1:
+ ch = KEY_ESCAPE;
+ break;
+ case KEY_JOY1 + 2:
+ ch = KEY_BACKSPACE;
+ break;
+ case KEY_HAT1:
+ ch = KEY_UPARROW;
+ break;
+ case KEY_HAT1 + 1:
+ ch = KEY_DOWNARROW;
+ break;
+ case KEY_HAT1 + 2:
+ ch = KEY_LEFTARROW;
+ break;
+ case KEY_HAT1 + 3:
+ ch = KEY_RIGHTARROW;
+ break;
}
- else if (ev->data3 == 1)
+ }
+ else if (ev->type == ev_joystick && ev->data1 == 0 && joywait < I_GetTime())
+ {
+ const INT32 jdeadzone = JOYAXISRANGE/4;
+ if (ev->data3 != INT32_MAX)
{
- ch = KEY_DOWNARROW;
- joywait = I_GetTime() + NEWTICRATE/7;
+ if (Joystick.bGamepadStyle || abs(ev->data3) > jdeadzone)
+ {
+ if (ev->data3 < 0 && pjoyy >= 0)
+ {
+ ch = KEY_UPARROW;
+ joywait = I_GetTime() + NEWTICRATE/7;
+ }
+ else if (ev->data3 > 0 && pjoyy <= 0)
+ {
+ ch = KEY_DOWNARROW;
+ joywait = I_GetTime() + NEWTICRATE/7;
+ }
+ pjoyy = ev->data3;
+ }
+ else
+ pjoyy = 0;
}
- if (ev->data2 == -1)
+ if (ev->data2 != INT32_MAX)
{
- ch = KEY_LEFTARROW;
- joywait = I_GetTime() + NEWTICRATE/17;
- }
- else if (ev->data2 == 1)
- {
- ch = KEY_RIGHTARROW;
- joywait = I_GetTime() + NEWTICRATE/17;
+ if (Joystick.bGamepadStyle || abs(ev->data2) > jdeadzone)
+ {
+ if (ev->data2 < 0 && pjoyx >= 0)
+ {
+ ch = KEY_LEFTARROW;
+ joywait = I_GetTime() + NEWTICRATE/17;
+ }
+ else if (ev->data2 > 0 && pjoyx <= 0)
+ {
+ ch = KEY_RIGHTARROW;
+ joywait = I_GetTime() + NEWTICRATE/17;
+ }
+ pjoyx = ev->data2;
+ }
+ else
+ pjoyx = 0;
}
}
else if (ev->type == ev_mouse && mousewait < I_GetTime())
@@ -2361,9 +2624,13 @@ boolean M_Responder(event_t *ev)
}
}
}
+ else if (ev->type == ev_keydown) // Preserve event for other responders
+ ch = ev->data1;
if (ch == -1)
return false;
+ else if (ch == gamecontrol[gc_systemmenu][0] || ch == gamecontrol[gc_systemmenu][1]) // allow remappable ESC key
+ ch = KEY_ESCAPE;
// F-Keys
if (!menuactive)
@@ -2730,7 +2997,7 @@ void M_StartControlPanel(void)
MPauseMenu[mpause_switchteam].status = IT_DISABLED;
MPauseMenu[mpause_psetup].status = IT_DISABLED;
- if ((server || adminplayer == consoleplayer))
+ if ((server || IsPlayerAdmin(consoleplayer)))
{
MPauseMenu[mpause_switchmap].status = IT_STRING | IT_CALL;
MPauseMenu[mpause_addons].status = IT_STRING | IT_CALL;
@@ -4771,7 +5038,12 @@ static void M_AddonsOptions(INT32 choice)
M_SetupNextMenu(&OP_AddonsOptionsDef);
}
+<<<<<<< HEAD
#define LOCATIONSTRING "Visit \x83SRB2.ORG/MODS\x80 to get & make add-ons!"
+=======
+#define LOCATIONSTRING1 "Visit \x83SRB2.ORG/MODS\x80 to get & make add-ons!"
+//#define LOCATIONSTRING2 "Visit \x88SRB2.ORG/MODS\x80 to get & make add-ons!"
+>>>>>>> public_next-20190101
static void M_Addons(INT32 choice)
{
@@ -4779,6 +5051,14 @@ static void M_Addons(INT32 choice)
(void)choice;
+<<<<<<< HEAD
+=======
+ // If M_GetGameypeColor() is ever ported from Kart, then remove this.
+ highlightflags = V_YELLOWMAP;
+ recommendedflags = V_GREENMAP;
+ warningflags = V_REDMAP;
+
+>>>>>>> public_next-20190101
#if 1
if (cv_addons_option.value == 0)
pathname = usehome ? srb2home : srb2path;
@@ -4804,7 +5084,12 @@ static void M_Addons(INT32 choice)
if (!preparefilemenu(false))
{
+<<<<<<< HEAD
M_StartMessage(M_GetText("No files/folders found.\n\n"LOCATIONSTRING"\n\n(Press a key)\n"),NULL,MM_NOTHING);
+=======
+ M_StartMessage(va("No files/folders found.\n\n%s\n\n(Press a key)\n",LOCATIONSTRING1),NULL,MM_NOTHING);
+ // (recommendedflags == V_SKYMAP ? LOCATIONSTRING2 : LOCATIONSTRING1))
+>>>>>>> public_next-20190101
return;
}
else
@@ -4813,7 +5098,11 @@ static void M_Addons(INT32 choice)
if (addonsp[0]) // never going to have some provided but not all, saves individually checking
{
size_t i;
+<<<<<<< HEAD
for (i = 0; i < NUM_EXT+6; i++)
+=======
+ for (i = 0; i < NUM_EXT+5; i++)
+>>>>>>> public_next-20190101
W_UnlockCachedPatch(addonsp[i]);
}
@@ -4823,15 +5112,28 @@ static void M_Addons(INT32 choice)
addonsp[EXT_TXT] = W_CachePatchName("M_FTXT", PU_STATIC);
addonsp[EXT_CFG] = W_CachePatchName("M_FCFG", PU_STATIC);
addonsp[EXT_WAD] = W_CachePatchName("M_FWAD", PU_STATIC);
+<<<<<<< HEAD
+=======
+#ifdef USE_KART
+ addonsp[EXT_KART] = W_CachePatchName("M_FKART", PU_STATIC);
+#endif
+>>>>>>> public_next-20190101
addonsp[EXT_PK3] = W_CachePatchName("M_FPK3", PU_STATIC);
addonsp[EXT_SOC] = W_CachePatchName("M_FSOC", PU_STATIC);
addonsp[EXT_LUA] = W_CachePatchName("M_FLUA", PU_STATIC);
addonsp[NUM_EXT] = W_CachePatchName("M_FUNKN", PU_STATIC);
+<<<<<<< HEAD
addonsp[NUM_EXT+1] = W_CachePatchName("M_FSEL1", PU_STATIC);
addonsp[NUM_EXT+2] = W_CachePatchName("M_FSEL2", PU_STATIC);
addonsp[NUM_EXT+3] = W_CachePatchName("M_FLOAD", PU_STATIC);
addonsp[NUM_EXT+4] = W_CachePatchName("M_FSRCH", PU_STATIC);
addonsp[NUM_EXT+5] = W_CachePatchName("M_FSAVE", PU_STATIC);
+=======
+ addonsp[NUM_EXT+1] = W_CachePatchName("M_FSEL", PU_STATIC);
+ addonsp[NUM_EXT+2] = W_CachePatchName("M_FLOAD", PU_STATIC);
+ addonsp[NUM_EXT+3] = W_CachePatchName("M_FSRCH", PU_STATIC);
+ addonsp[NUM_EXT+4] = W_CachePatchName("M_FSAVE", PU_STATIC);
+>>>>>>> public_next-20190101
MISC_AddonsDef.prevMenu = currentMenu;
M_SetupNextMenu(&MISC_AddonsDef);
@@ -4856,21 +5158,36 @@ static void M_DrawTemperature(INT32 x, fixed_t t)
t = (FixedMul(h<>FRACBITS);
// border
+<<<<<<< HEAD
V_DrawFill(x - 1, vpadding, 1, h, 3);
V_DrawFill(x + width, vpadding, 1, h, 3);
V_DrawFill(x - 1, vpadding-1, width+2, 1, 3);
V_DrawFill(x - 1, vpadding+h, width+2, 1, 3);
+=======
+ V_DrawFill(x - 1, vpadding, 1, h, 120);
+ V_DrawFill(x + width, vpadding, 1, h, 120);
+ V_DrawFill(x - 1, vpadding-1, width+2, 1, 120);
+ V_DrawFill(x - 1, vpadding+h, width+2, 1, 120);
+>>>>>>> public_next-20190101
// bar itself
y = h;
if (t)
for (t = h - t; y > 0; y--)
{
+<<<<<<< HEAD
UINT8 colours[NUMCOLOURS] = {42, 40, 58, 222, 65, 90, 97, 98};
UINT8 c;
if (y <= t) break;
if (y+vpadding >= BASEVIDHEIGHT/2)
c = 113;
+=======
+ UINT8 colours[NUMCOLOURS] = {135, 133, 92, 77, 114, 178, 161, 162};
+ UINT8 c;
+ if (y <= t) break;
+ if (y+vpadding >= BASEVIDHEIGHT/2)
+ c = 185;
+>>>>>>> public_next-20190101
else
c = colours[(NUMCOLOURS*(y-1))/(h/2)];
V_DrawFill(x, y-1 + vpadding, width, 1, c);
@@ -4878,7 +5195,11 @@ static void M_DrawTemperature(INT32 x, fixed_t t)
// fill the rest of the backing
if (y)
+<<<<<<< HEAD
V_DrawFill(x, vpadding, width, y, 27);
+=======
+ V_DrawFill(x, vpadding, width, y, 30);
+>>>>>>> public_next-20190101
}
#undef width
#undef vpadding
@@ -4933,14 +5254,24 @@ static boolean M_AddonsRefresh(void)
{
S_StartSound(NULL, sfx_lose);
if (refreshdirmenu & REFRESHDIR_MAX)
+<<<<<<< HEAD
message = va("\x82%s\x80\nMaximum number of add-ons reached.\nA file could not be loaded.\nIf you want to play with this add-on, restart the game to clear existing ones.\n\n(Press a key)\n", refreshdirname);
else
message = va("\x82%s\x80\nA file was not loaded.\nCheck the console log for more information.\n\n(Press a key)\n", refreshdirname);
+=======
+ message = va("%c%s\x80\nMaximum number of add-ons reached.\nA file could not be loaded.\nIf you want to play with this add-on, restart the game to clear existing ones.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), refreshdirname);
+ else
+ message = va("%c%s\x80\nA file was not loaded.\nCheck the console log for more information.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), refreshdirname);
+>>>>>>> public_next-20190101
}
else if (refreshdirmenu & (REFRESHDIR_WARNING|REFRESHDIR_ERROR))
{
S_StartSound(NULL, sfx_skid);
+<<<<<<< HEAD
message = va("\x82%s\x80\nA file was loaded with %s.\nCheck the console log for more information.\n\n(Press a key)\n", refreshdirname, ((refreshdirmenu & REFRESHDIR_ERROR) ? "errors" : "warnings"));
+=======
+ message = va("%c%s\x80\nA file was loaded with %s.\nCheck the console log for more information.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), refreshdirname, ((refreshdirmenu & REFRESHDIR_ERROR) ? "errors" : "warnings"));
+>>>>>>> public_next-20190101
}
if (message)
@@ -4956,6 +5287,7 @@ static boolean M_AddonsRefresh(void)
return false;
}
+<<<<<<< HEAD
#ifdef FIXUPO0
#pragma GCC optimize ("0")
#endif
@@ -4965,6 +5297,14 @@ static void M_DrawAddons(void)
INT32 x, y;
ssize_t i, max;
const char* topstr;
+=======
+static void M_DrawAddons(void)
+{
+ INT32 x, y;
+ ssize_t i, m;
+ const UINT8 *flashcol = NULL;
+ UINT8 hilicol;
+>>>>>>> public_next-20190101
// hack - need to refresh at end of frame to handle addfile...
if (refreshdirmenu & M_AddonsRefresh())
@@ -4974,6 +5314,7 @@ static void M_DrawAddons(void)
}
if (Playing())
+<<<<<<< HEAD
topstr = "\x85""Adding files mid-game may cause problems.";
else if (savemoddata)
topstr = "\x83""Add-on has its own data, saving enabled.";
@@ -4983,6 +5324,12 @@ static void M_DrawAddons(void)
topstr = LOCATIONSTRING;
V_DrawCenteredString(BASEVIDWIDTH/2, 5, 0, topstr);
+=======
+ V_DrawCenteredString(BASEVIDWIDTH/2, 5, warningflags, "Adding files mid-game may cause problems.");
+ else
+ V_DrawCenteredString(BASEVIDWIDTH/2, 5, 0, LOCATIONSTRING1);
+ // (recommendedflags == V_SKYMAP ? LOCATIONSTRING2 : LOCATIONSTRING1)
+>>>>>>> public_next-20190101
if (numwadfiles <= mainwads+1)
y = 0;
@@ -4990,8 +5337,13 @@ static void M_DrawAddons(void)
y = FRACUNIT;
else
{
+<<<<<<< HEAD
x = FixedDiv((numwadfiles - mainwads+1)<>>>>>> public_next-20190101
if (x > y)
y = x;
if (y > FRACUNIT) // happens because of how we're shrinkin' it a little
@@ -5004,6 +5356,7 @@ static void M_DrawAddons(void)
x = currentMenu->x;
y = currentMenu->y + 1;
+<<<<<<< HEAD
//M_DrawLevelPlatterHeader(y - 16, M_AddonsHeaderPath(), true, true); -- wanted different width
V_DrawString(x-21, (y - 16) + (lsheadingheight - 12), V_YELLOWMAP|V_ALLOWLOWERCASE, M_AddonsHeaderPath());
V_DrawFill(x-21, (y - 16) + (lsheadingheight - 3), (MAXSTRINGLENGTH*8+6 - 1), 1, yellowmap[3]);
@@ -5032,6 +5385,55 @@ static void M_DrawAddons(void)
V_DrawString(19, y+4 - (skullAnimCounter/5), V_YELLOWMAP, "\x1A");
for (; i < max; i++)
+=======
+ hilicol = V_GetStringColormap(highlightflags)[120];
+
+ V_DrawString(x-21, (y - 16) + (lsheadingheight - 12), highlightflags|V_ALLOWLOWERCASE, M_AddonsHeaderPath());
+ V_DrawFill(x-21, (y - 16) + (lsheadingheight - 3), MAXSTRINGLENGTH*8+6, 1, hilicol);
+ V_DrawFill(x-21, (y - 16) + (lsheadingheight - 2), MAXSTRINGLENGTH*8+6, 1, 30);
+
+ m = (BASEVIDHEIGHT - currentMenu->y + 2) - (y - 1);
+ V_DrawFill(x - 21, y - 1, MAXSTRINGLENGTH*8+6, m, 239);
+
+ // scrollbar!
+ if (sizedirmenu <= (2*numaddonsshown + 1))
+ i = 0;
+ else
+ {
+ ssize_t q = m;
+ m = ((2*numaddonsshown + 1) * m)/sizedirmenu;
+ if (dir_on[menudepthleft] <= numaddonsshown) // all the way up
+ i = 0;
+ else if (sizedirmenu <= (dir_on[menudepthleft] + numaddonsshown + 1)) // all the way down
+ i = q-m;
+ else
+ i = ((dir_on[menudepthleft] - numaddonsshown) * (q-m))/(sizedirmenu - (2*numaddonsshown + 1));
+ }
+
+ V_DrawFill(x + MAXSTRINGLENGTH*8+5 - 21, (y - 1) + i, 1, m, hilicol);
+
+ // get bottom...
+ m = dir_on[menudepthleft] + numaddonsshown + 1;
+ if (m > (ssize_t)sizedirmenu)
+ m = sizedirmenu;
+
+ // then compute top and adjust bottom if needed!
+ if (m < (2*numaddonsshown + 1))
+ {
+ m = min(sizedirmenu, 2*numaddonsshown + 1);
+ i = 0;
+ }
+ else
+ i = m - (2*numaddonsshown + 1);
+
+ if (i != 0)
+ V_DrawString(19, y+4 - (skullAnimCounter/5), highlightflags, "\x1A");
+
+ if (skullAnimCounter < 4)
+ flashcol = V_GetStringColormap(highlightflags);
+
+ for (; i < m; i++)
+>>>>>>> public_next-20190101
{
UINT32 flags = V_ALLOWLOWERCASE;
if (y > BASEVIDHEIGHT) break;
@@ -5039,6 +5441,7 @@ static void M_DrawAddons(void)
#define type (UINT8)(dirmenu[i][DIR_TYPE])
{
if (type & EXT_LOADED)
+<<<<<<< HEAD
flags |= V_TRANSLUCENT;
V_DrawSmallScaledPatch(x-(16+4), y, (flags & V_TRANSLUCENT), addonsp[((UINT8)(dirmenu[i][DIR_TYPE]) & ~EXT_LOADED)]);
@@ -5050,6 +5453,20 @@ static void M_DrawAddons(void)
{
V_DrawSmallScaledPatch(x-(16+4), y, 0, addonsp[NUM_EXT+1+((skullAnimCounter/4) ? 1 : 0)]);
flags = V_ALLOWLOWERCASE|V_YELLOWMAP;
+=======
+ {
+ flags |= V_TRANSLUCENT;
+ V_DrawSmallScaledPatch(x-(16+4), y, V_TRANSLUCENT, addonsp[(type & ~EXT_LOADED)]);
+ V_DrawSmallScaledPatch(x-(16+4), y, 0, addonsp[NUM_EXT+2]);
+ }
+ else
+ V_DrawSmallScaledPatch(x-(16+4), y, 0, addonsp[(type & ~EXT_LOADED)]);
+
+ if ((size_t)i == dir_on[menudepthleft])
+ {
+ V_DrawFixedPatch((x-(16+4))<>>>>>> public_next-20190101
}
#define charsonside 14
@@ -5063,8 +5480,13 @@ static void M_DrawAddons(void)
y += 16;
}
+<<<<<<< HEAD
if (max != (ssize_t)sizedirmenu)
V_DrawString(19, y-12 + (skullAnimCounter/5), V_YELLOWMAP, "\x1B");
+=======
+ if (m != (ssize_t)sizedirmenu)
+ V_DrawString(19, y-12 + (skullAnimCounter/5), highlightflags, "\x1B");
+>>>>>>> public_next-20190101
y = BASEVIDHEIGHT - currentMenu->y + 1;
@@ -5078,6 +5500,7 @@ static void M_DrawAddons(void)
'_' | 0x80, false);
x -= (21 + 5 + 16);
+<<<<<<< HEAD
V_DrawSmallScaledPatch(x, y + 4, (menusearch[0] ? 0 : V_TRANSLUCENT), addonsp[NUM_EXT+4]);
x = BASEVIDWIDTH - x - 16;
@@ -5091,13 +5514,28 @@ static void M_DrawAddons(void)
#pragma GCC reset_options
#endif
+=======
+ V_DrawSmallScaledPatch(x, y + 4, (menusearch[0] ? 0 : V_TRANSLUCENT), addonsp[NUM_EXT+3]);
+
+ x = BASEVIDWIDTH - x - 16;
+ V_DrawSmallScaledPatch(x, y + 4, ((!modifiedgame || savemoddata) ? 0 : V_TRANSLUCENT), addonsp[NUM_EXT+4]);
+
+ if (modifiedgame)
+ V_DrawSmallScaledPatch(x, y + 4, 0, addonsp[NUM_EXT+2]);
+}
+
+>>>>>>> public_next-20190101
static void M_AddonExec(INT32 ch)
{
if (ch != 'y' && ch != KEY_ENTER)
return;
S_StartSound(NULL, sfx_zoom);
+<<<<<<< HEAD
COM_BufAddText(va("exec %s%s", menupath, dirmenu[dir_on[menudepthleft]]+DIR_STRING));
+=======
+ COM_BufAddText(va("exec \"%s%s\"", menupath, dirmenu[dir_on[menudepthleft]]+DIR_STRING));
+>>>>>>> public_next-20190101
}
#define len menusearch[0]
@@ -5147,12 +5585,24 @@ static void M_HandleAddons(INT32 choice)
char *tempname = NULL;
if (dirmenu && dirmenu[dir_on[menudepthleft]])
tempname = Z_StrDup(dirmenu[dir_on[menudepthleft]]+DIR_STRING); // don't need to I_Error if can't make - not important, just QoL
+<<<<<<< HEAD
searchfilemenu(tempname);
/*if (!preparefilemenu(true))
{
UNEXIST;
return;
}*/
+=======
+#if 0 // much slower
+ if (!preparefilemenu(true))
+ {
+ UNEXIST;
+ return;
+ }
+#else // streamlined
+ searchfilemenu(tempname);
+#endif
+>>>>>>> public_next-20190101
}
switch (choice)
@@ -5202,7 +5652,11 @@ static void M_HandleAddons(INT32 choice)
if (!preparefilemenu(false))
{
S_StartSound(NULL, sfx_skid);
+<<<<<<< HEAD
M_StartMessage(va("\x82%s\x80\nThis folder is empty.\n\n(Press a key)\n", M_AddonsHeaderPath()),NULL,MM_NOTHING);
+=======
+ M_StartMessage(va("%c%s\x80\nThis folder is empty.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), M_AddonsHeaderPath()),NULL,MM_NOTHING);
+>>>>>>> public_next-20190101
menupath[menupathindex[++menudepthleft]] = 0;
if (!preparefilemenu(true))
@@ -5221,7 +5675,11 @@ static void M_HandleAddons(INT32 choice)
else
{
S_StartSound(NULL, sfx_lose);
+<<<<<<< HEAD
M_StartMessage(va("\x82%s\x80\nThis folder is too deep to navigate to!\n\n(Press a key)\n", M_AddonsHeaderPath()),NULL,MM_NOTHING);
+=======
+ M_StartMessage(va("%c%s\x80\nThis folder is too deep to navigate to!\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), M_AddonsHeaderPath()),NULL,MM_NOTHING);
+>>>>>>> public_next-20190101
menupath[menupathindex[menudepthleft]] = 0;
}
break;
@@ -5235,7 +5693,11 @@ static void M_HandleAddons(INT32 choice)
}
break;
case EXT_TXT:
+<<<<<<< HEAD
M_StartMessage(va("\x82%s\x80\nThis file may not be a console script.\nAttempt to run anyways? \n\n(Press 'Y' to confirm)\n", dirmenu[dir_on[menudepthleft]]+DIR_STRING),M_AddonExec,MM_YESNO);
+=======
+ M_StartMessage(va("%c%s\x80\nThis file may not be a console script.\nAttempt to run anyways? \n\n(Press 'Y' to confirm)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), dirmenu[dir_on[menudepthleft]]+DIR_STRING),M_AddonExec,MM_YESNO);
+>>>>>>> public_next-20190101
break;
case EXT_CFG:
M_AddonExec(KEY_ENTER);
@@ -5243,12 +5705,22 @@ static void M_HandleAddons(INT32 choice)
case EXT_LUA:
#ifndef HAVE_BLUA
S_StartSound(NULL, sfx_lose);
+<<<<<<< HEAD
M_StartMessage(va("\x82%s\x80\nThis copy of SRB2 was compiled\nwithout support for .lua files.\n\n(Press a key)\n", dirmenu[dir_on[menudepthleft]]+DIR_STRING),NULL,MM_NOTHING);
+=======
+ M_StartMessage(va("%c%s\x80\nThis copy of SRB2 was compiled\nwithout support for .lua files.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), dirmenu[dir_on[menudepthleft]]+DIR_STRING),NULL,MM_NOTHING);
+>>>>>>> public_next-20190101
break;
#endif
// else intentional fallthrough
case EXT_SOC:
case EXT_WAD:
+<<<<<<< HEAD
+=======
+#ifdef USE_KART
+ case EXT_KART:
+#endif
+>>>>>>> public_next-20190101
case EXT_PK3:
COM_BufAddText(va("addfile \"%s%s\"", menupath, dirmenu[dir_on[menudepthleft]]+DIR_STRING));
break;
@@ -5272,7 +5744,11 @@ static void M_HandleAddons(INT32 choice)
{
closefilemenu(true);
+<<<<<<< HEAD
// secrets disabled by addfile...
+=======
+ // Secret menu!
+>>>>>>> public_next-20190101
MainMenu[secrets].status = (M_AnySecretUnlocked()) ? (IT_STRING | IT_CALL) : (IT_DISABLED);
if (currentMenu->prevMenu)
@@ -5398,7 +5874,11 @@ static void M_Options(INT32 choice)
(void)choice;
// if the player is not admin or server, disable server options
+<<<<<<< HEAD
OP_MainMenu[5].status = (Playing() && !(server || adminplayer == consoleplayer)) ? (IT_GRAYEDOUT) : (IT_STRING|IT_CALL);
+=======
+ OP_MainMenu[5].status = (Playing() && !(server || IsPlayerAdmin(consoleplayer))) ? (IT_GRAYEDOUT) : (IT_STRING|IT_SUBMENU);
+>>>>>>> public_next-20190101
// if the player is playing _at all_, disable the erase data options
OP_DataOptionsMenu[2].status = (Playing()) ? (IT_GRAYEDOUT) : (IT_STRING|IT_SUBMENU);
@@ -8287,7 +8767,7 @@ void M_SortServerList(void)
#ifndef NONET
#ifdef UPDATE_ALERT
-static int M_CheckMODVersion(void)
+static boolean M_CheckMODVersion(void)
{
char updatestring[500];
const char *updatecheck = GetMODVersion();
@@ -9142,13 +9622,14 @@ static void M_DrawJoystick(void)
for (i = 0; i <= 4; i++) // See MAX_JOYSTICKS
{
- M_DrawSaveLoadBorder(OP_JoystickSetDef.x+4, OP_JoystickSetDef.y+1+LINEHEIGHT*i);
+ M_DrawTextBox(OP_JoystickSetDef.x-8, OP_JoystickSetDef.y+LINEHEIGHT*i-12, 28, 1);
+ //M_DrawSaveLoadBorder(OP_JoystickSetDef.x+4, OP_JoystickSetDef.y+1+LINEHEIGHT*i);
if ((setupcontrols_secondaryplayer && (i == cv_usejoystick2.value))
|| (!setupcontrols_secondaryplayer && (i == cv_usejoystick.value)))
- V_DrawString(OP_JoystickSetDef.x, OP_JoystickSetDef.y+LINEHEIGHT*i,V_GREENMAP,joystickInfo[i]);
+ V_DrawString(OP_JoystickSetDef.x, OP_JoystickSetDef.y+LINEHEIGHT*i-4,V_GREENMAP,joystickInfo[i]);
else
- V_DrawString(OP_JoystickSetDef.x, OP_JoystickSetDef.y+LINEHEIGHT*i,0,joystickInfo[i]);
+ V_DrawString(OP_JoystickSetDef.x, OP_JoystickSetDef.y+LINEHEIGHT*i-4,0,joystickInfo[i]);
if (i == itemOn)
{
@@ -9161,20 +9642,16 @@ static void M_DrawJoystick(void)
static void M_SetupJoystickMenu(INT32 choice)
{
INT32 i = 0;
- const char *joyname = "None";
const char *joyNA = "Unavailable";
INT32 n = I_NumJoys();
(void)choice;
- strcpy(joystickInfo[i], joyname);
+ strcpy(joystickInfo[i], "None");
for (i = 1; i < 8; i++)
{
- if (i <= n && (joyname = I_GetJoyName(i)) != NULL)
- {
- strncpy(joystickInfo[i], joyname, 24);
- joystickInfo[i][24] = '\0';
- }
+ if (i <= n && (I_GetJoyName(i)) != NULL)
+ strncpy(joystickInfo[i], I_GetJoyName(i), 28);
else
strcpy(joystickInfo[i], joyNA);
}
@@ -9240,6 +9717,7 @@ static void M_Setup2PControlsMenu(INT32 choice)
setupcontrols = gamecontrolbis;
currentMenu->lastOn = itemOn;
+<<<<<<< HEAD
// Hide the five non-P2 controls and their headers
OP_ChangeControlsMenu[18+0].status = IT_GRAYEDOUT2;
OP_ChangeControlsMenu[18+1].status = IT_GRAYEDOUT2;
@@ -9253,6 +9731,16 @@ static void M_Setup2PControlsMenu(INT32 choice)
// ...
OP_ChangeControlsMenu[23+2].status = IT_GRAYEDOUT2;
OP_ChangeControlsMenu[23+3].status = IT_GRAYEDOUT2;
+=======
+ // Hide the three non-P2 controls
+ OP_MPControlsMenu[0].status = IT_GRAYEDOUT2;
+ OP_MPControlsMenu[1].status = IT_GRAYEDOUT2;
+ OP_MPControlsMenu[2].status = IT_GRAYEDOUT2;
+ // Hide the pause/console and system menu controls too
+ OP_MiscControlsMenu[3].status = IT_GRAYEDOUT2;
+ OP_MiscControlsMenu[6].status = IT_GRAYEDOUT2;
+ OP_MiscControlsMenu[8].status = IT_GRAYEDOUT2;
+>>>>>>> public_next-20190101
OP_ChangeControlsDef.prevMenu = &OP_P2ControlsDef;
M_SetupNextMenu(&OP_ChangeControlsDef);
@@ -9445,14 +9933,14 @@ static void M_ChangecontrolResponse(event_t *ev)
found = 0;
setupcontrols[control][1] = KEY_NULL; //replace key 1,clear key2
}
- G_CheckDoubleUsage(ch);
+ (void)G_CheckDoubleUsage(ch, true);
setupcontrols[control][found] = ch;
}
S_StartSound(NULL, sfx_strpst);
}
else if (ch == KEY_PAUSE)
{
- static char tmp[155];
+ static char tmp[158]; // 125 char message + 32 char control name
menu_t *prev = currentMenu->prevMenu;
if (controltochange == gc_pause)
@@ -9489,6 +9977,7 @@ static void M_ChangeControl(INT32 choice)
M_StartMessage(tmp, M_ChangecontrolResponse, MM_EVENTHANDLER);
}
+<<<<<<< HEAD
// =====
// SOUND
// =====
@@ -9706,6 +10195,8 @@ static void M_ToggleMIDI(INT32 choice)
}
}
+=======
+>>>>>>> public_next-20190101
// ===============
// VIDEO MODE MENU
// ===============
diff --git a/src/m_menu.h b/src/m_menu.h
index 894abbe74..5f55d0701 100644
--- a/src/m_menu.h
+++ b/src/m_menu.h
@@ -3,7 +3,7 @@
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 2011-2016 by Matthew "Inuyasha" Walsh.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/m_misc.c b/src/m_misc.c
index fb3ffa5a7..50131f45e 100644
--- a/src/m_misc.c
+++ b/src/m_misc.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -37,6 +37,7 @@
#include "d_main.h"
#include "m_argv.h"
#include "i_system.h"
+#include "command.h" // cv_execversion
#include "m_anigif.h"
@@ -440,7 +441,22 @@ void Command_LoadConfig_f(void)
strcpy(configfile, COM_Argv(1));
FIL_ForceExtension(configfile, ".cfg");
+
+ // load default control
+ G_ClearAllControlKeys();
+ G_Controldefault();
+
+ // temporarily reset execversion to default
+ CV_ToggleExecVersion(true);
+ COM_BufInsertText(va("%s \"%s\"\n", cv_execversion.name, cv_execversion.defaultvalue));
+ CV_InitFilterVar();
+
+ // exec the config
COM_BufInsertText(va("exec \"%s\"\n", configfile));
+
+ // don't filter anymore vars and don't let this convsvar be changed
+ COM_BufInsertText(va("%s \"%d\"\n", cv_execversion.name, EXECVERSION));
+ CV_ToggleExecVersion(false);
}
/** Saves the current configuration and loads another.
@@ -477,11 +493,25 @@ void M_FirstLoadConfig(void)
// load default control
G_DefineDefaultControls();
G_CopyControls(gamecontrol, gamecontroldefault[gcs_fps], NULL, 0);
+ G_CopyControls(gamecontrolbis, gamecontrolbisdefault[gcs_fps], NULL, 0);
+
+ // register execversion here before we load any configs
+ CV_RegisterVar(&cv_execversion);
+
+ // temporarily reset execversion to default
+ // we shouldn't need to do this, but JUST in case...
+ CV_ToggleExecVersion(true);
+ COM_BufInsertText(va("%s \"%s\"\n", cv_execversion.name, cv_execversion.defaultvalue));
+ CV_InitFilterVar();
// load config, make sure those commands doesnt require the screen...
COM_BufInsertText(va("exec \"%s\"\n", configfile));
// no COM_BufExecute() needed; that does it right away
+ // don't filter anymore vars and don't let this convsvar be changed
+ COM_BufInsertText(va("%s \"%d\"\n", cv_execversion.name, EXECVERSION));
+ CV_ToggleExecVersion(false);
+
// make sure I_Quit() will write back the correct config
// (do not write back the config if it crash before)
gameconfig_loaded = true;
@@ -494,6 +524,7 @@ void M_FirstLoadConfig(void)
void M_SaveConfig(const char *filename)
{
FILE *f;
+ char *filepath;
// make sure not to write back the config until it's been correctly loaded
if (!gameconfig_loaded)
@@ -508,13 +539,20 @@ void M_SaveConfig(const char *filename)
return;
}
- f = fopen(filename, "w");
+ // append srb2home to beginning of filename
+ // but check if srb2home isn't already there, first
+ if (!strstr(filename, srb2home))
+ filepath = va(pandf,srb2home, filename);
+ else
+ filepath = Z_StrDup(filename);
+
+ f = fopen(filepath, "w");
// change it only if valid
if (f)
- strcpy(configfile, filename);
+ strcpy(configfile, filepath);
else
{
- CONS_Alert(CONS_ERROR, M_GetText("Couldn't save game config file %s\n"), filename);
+ CONS_Alert(CONS_ERROR, M_GetText("Couldn't save game config file %s\n"), filepath);
return;
}
}
@@ -537,6 +575,10 @@ void M_SaveConfig(const char *filename)
// header message
fprintf(f, "// SRB2 configuration file.\n");
+ // print execversion FIRST, because subsequent consvars need to be filtered
+ // always print current EXECVERSION
+ fprintf(f, "%s \"%d\"\n", cv_execversion.name, EXECVERSION);
+
// FIXME: save key aliases if ever implemented..
if (tutorialmode && tutorialgcs)
@@ -1529,9 +1571,13 @@ boolean M_ScreenshotResponder(event_t *ev)
return false;
ch = ev->data1;
- if (ch == KEY_F8)
+
+ if (ch >= KEY_MOUSE1 && menuactive) // If it's not a keyboard key, then don't allow it in the menus!
+ return false;
+
+ if (ch == KEY_F8 || ch == gamecontrol[gc_screenshot][0] || ch == gamecontrol[gc_screenshot][1]) // remappable F8
M_ScreenShot();
- else if (ch == KEY_F9)
+ else if (ch == KEY_F9 || ch == gamecontrol[gc_recordgif][0] || ch == gamecontrol[gc_recordgif][1]) // remappable F9
((moviemode) ? M_StopMovie : M_StartMovie)();
else
return false;
diff --git a/src/m_misc.h b/src/m_misc.h
index 14f590516..28d9cd5a5 100644
--- a/src/m_misc.h
+++ b/src/m_misc.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/m_queue.c b/src/m_queue.c
index daa7d7a24..a3aa04871 100644
--- a/src/m_queue.c
+++ b/src/m_queue.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2003 by James Haley
-// Copyright (C) 2003-2016 by Sonic Team Junior.
+// Copyright (C) 2003-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/m_queue.h b/src/m_queue.h
index 7e0d58d39..eebb21468 100644
--- a/src/m_queue.h
+++ b/src/m_queue.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2003 by James Haley
-// Copyright (C) 2003-2016 by Sonic Team Junior.
+// Copyright (C) 2003-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/m_random.c b/src/m_random.c
index 839b06e40..3d46f76b7 100644
--- a/src/m_random.c
+++ b/src/m_random.c
@@ -3,7 +3,7 @@
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 2012-2016 by Matthew "Inuyasha" Walsh.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/m_random.h b/src/m_random.h
index 76dd9f1db..6187bcf1c 100644
--- a/src/m_random.h
+++ b/src/m_random.h
@@ -3,7 +3,7 @@
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 2012-2016 by Matthew "Inuyasha" Walsh.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/m_swap.h b/src/m_swap.h
index 2352a0b23..2d42f6138 100644
--- a/src/m_swap.h
+++ b/src/m_swap.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/mserv.c b/src/mserv.c
index 76383ac35..cf636dfdf 100644
--- a/src/mserv.c
+++ b/src/mserv.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -177,7 +177,7 @@ static void ServerName_OnChange(void);
#define DEF_PORT "28900"
consvar_t cv_masterserver = {"masterserver", "ms.srb2.org:"DEF_PORT, CV_SAVE, NULL, MasterServer_OnChange, 0, NULL, NULL, 0, 0, NULL};
-consvar_t cv_servername = {"servername", "SRB2 server", CV_SAVE, NULL, ServerName_OnChange, 0, NULL, NULL, 0, 0, NULL};
+consvar_t cv_servername = {"servername", "SRB2 server", CV_SAVE|CV_CALL|CV_NOINIT, NULL, ServerName_OnChange, 0, NULL, NULL, 0, 0, NULL};
INT16 ms_RoomId = -1;
@@ -528,9 +528,21 @@ const char *GetMODVersion(void)
msg.room = MODID; // Might as well use it for something.
sprintf(msg.buffer,"%d",MODVERSION);
if (MS_Write(&msg) < 0)
+ {
+ CONS_Alert(CONS_ERROR, M_GetText("Could not send to the Master Server\n"));
+ M_StartMessage(M_GetText("Could not send to the Master Server\n"), NULL, MM_NOTHING);
+ CloseConnection();
return NULL;
+ }
+
+ if (MS_Read(&msg) < 0)
+ {
+ CONS_Alert(CONS_ERROR, M_GetText("No reply from the Master Server\n"));
+ M_StartMessage(M_GetText("No reply from the Master Server\n"), NULL, MM_NOTHING);
+ CloseConnection();
+ return NULL;
+ }
- MS_Read(&msg);
CloseConnection();
if(strcmp(msg.buffer,"NULL") != 0)
@@ -558,9 +570,19 @@ void GetMODVersion_Console(void)
msg.room = MODID; // Might as well use it for something.
sprintf(msg.buffer,"%d",MODVERSION);
if (MS_Write(&msg) < 0)
+ {
+ CONS_Alert(CONS_ERROR, M_GetText("Could not send to the Master Server\n"));
+ CloseConnection();
return;
+ }
+
+ if (MS_Read(&msg) < 0)
+ {
+ CONS_Alert(CONS_ERROR, M_GetText("No reply from the Master Server\n"));
+ CloseConnection();
+ return;
+ }
- MS_Read(&msg);
CloseConnection();
if(strcmp(msg.buffer,"NULL") != 0)
@@ -927,8 +949,8 @@ void MasterClient_Ticker(void)
static void ServerName_OnChange(void)
{
- UnregisterServer();
- RegisterServer();
+ if (con_state == MSCS_REGISTERED)
+ AddToMasterServer(false);
}
static void MasterServer_OnChange(void)
diff --git a/src/mserv.h b/src/mserv.h
index c28ece264..09cd4f089 100644
--- a/src/mserv.h
+++ b/src/mserv.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/p_ceilng.c b/src/p_ceilng.c
index 27d739414..757edebae 100644
--- a/src/p_ceilng.c
+++ b/src/p_ceilng.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/p_enemy.c b/src/p_enemy.c
index 0c2e0b482..9d2425e53 100644
--- a/src/p_enemy.c
+++ b/src/p_enemy.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/p_floor.c b/src/p_floor.c
index 65e4b9537..a1b1c45fc 100644
--- a/src/p_floor.c
+++ b/src/p_floor.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/p_inter.c b/src/p_inter.c
index 5f2875252..c46ef407d 100644
--- a/src/p_inter.c
+++ b/src/p_inter.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/p_lights.c b/src/p_lights.c
index c0b46f74c..67ec55e80 100644
--- a/src/p_lights.c
+++ b/src/p_lights.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/p_local.h b/src/p_local.h
index b98eeae1c..b686b9f09 100644
--- a/src/p_local.h
+++ b/src/p_local.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -39,9 +39,6 @@
// Convenience macro to fix issue with collision along bottom/left edges of blockmap -Red
#define BMBOUNDFIX(xl, xh, yl, yh) {if (xl > xh) xl = 0; if (yl > yh) yl = 0;}
-// player radius used only in am_map.c
-#define PLAYERRADIUS (16*FRACUNIT)
-
// MAXRADIUS is for precalculated sector block boxes
// the spider demon is larger,
// but we do not have any moving sectors nearby
diff --git a/src/p_map.c b/src/p_map.c
index b4ace61c7..ceaa6ca24 100644
--- a/src/p_map.c
+++ b/src/p_map.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -2183,18 +2183,6 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam)
return true;
}
-//
-// CheckMissileImpact
-//
-static void CheckMissileImpact(mobj_t *mobj)
-{
- if (!(mobj->flags & MF_MISSILE) || !mobj->target)
- return;
-
- if (!mobj->target->player)
- return;
-}
-
// The highest the camera will "step up" onto another floor.
#define MAXCAMERASTEPMOVE MAXSTEPMOVE
@@ -2419,11 +2407,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
}
if (!P_CheckPosition(thing, tryx, tryy))
- {
- if (!P_MobjWasRemoved(thing))
- CheckMissileImpact(thing);
return false; // solid wall or thing
- }
if (!(thing->flags & MF_NOCLIP))
{
@@ -2449,7 +2433,6 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
if (tmceilingz - tmfloorz < thing->height)
{
- CheckMissileImpact(thing);
if (tmfloorthing)
tmhitthing = tmfloorthing;
return false; // doesn't fit
@@ -2460,16 +2443,10 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
if (thing->eflags & MFE_VERTICALFLIP)
{
if (thing->z < tmfloorz)
- {
- CheckMissileImpact(thing);
return false; // mobj must raise itself to fit
- }
}
else if (tmceilingz < thingtop)
- {
- CheckMissileImpact(thing);
return false; // mobj must lower itself to fit
- }
// Ramp test
if (maxstep > 0 && !(
@@ -2521,7 +2498,6 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
{
if (thingtop - tmceilingz > maxstep)
{
- CheckMissileImpact(thing);
if (tmfloorthing)
tmhitthing = tmfloorthing;
return false; // too big a step up
@@ -2529,18 +2505,11 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
}
else if (tmfloorz - thing->z > maxstep)
{
- CheckMissileImpact(thing);
if (tmfloorthing)
tmhitthing = tmfloorthing;
return false; // too big a step up
}
- if (tmfloorz > thing->z)
- {
- if (thing->flags & MF_MISSILE)
- CheckMissileImpact(thing);
- }
-
if (!allowdropoff && !(thing->flags & MF_FLOAT) && thing->type != MT_SKIM && !tmfloorthing)
{
if (thing->eflags & MFE_VERTICALFLIP)
diff --git a/src/p_maputl.c b/src/p_maputl.c
index 46b033386..1be57399c 100644
--- a/src/p_maputl.c
+++ b/src/p_maputl.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/p_maputl.h b/src/p_maputl.h
index 3d74e927b..1fcb68d4c 100644
--- a/src/p_maputl.h
+++ b/src/p_maputl.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/p_mobj.c b/src/p_mobj.c
index 2a00660a3..044f2942b 100644
--- a/src/p_mobj.c
+++ b/src/p_mobj.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -3729,7 +3729,7 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled
if (player->pflags & PF_FLIPCAM && !(player->powers[pw_carry] == CR_NIGHTSMODE) && player->mo->eflags & MFE_VERTICALFLIP)
postimg = postimg_flip;
- else if (player->awayviewtics && player->awayviewmobj != NULL) // Camera must obviously exist
+ else if (player->awayviewtics && player->awayviewmobj && !P_MobjWasRemoved(player->awayviewmobj)) // Camera must obviously exist
{
camera_t dummycam;
dummycam.subsector = player->awayviewmobj->subsector;
@@ -8476,6 +8476,8 @@ for (i = ((mobj->flags2 & MF2_STRONGBOX) ? strongboxamt : weakboxamt); i; --i) s
// Assumedly in splitscreen players will be on opposing teams
if (players[consoleplayer].ctfteam == 1 || splitscreen)
S_StartSound(NULL, sfx_hoop1);
+ else if (players[consoleplayer].ctfteam == 2)
+ S_StartSound(NULL, sfx_hoop3);
redflag = flagmo;
}
@@ -8487,6 +8489,8 @@ for (i = ((mobj->flags2 & MF2_STRONGBOX) ? strongboxamt : weakboxamt); i; --i) s
// Assumedly in splitscreen players will be on opposing teams
if (players[consoleplayer].ctfteam == 2 || splitscreen)
S_StartSound(NULL, sfx_hoop1);
+ else if (players[consoleplayer].ctfteam == 1)
+ S_StartSound(NULL, sfx_hoop3);
blueflag = flagmo;
}
diff --git a/src/p_mobj.h b/src/p_mobj.h
index eac5118b8..936be3bb0 100644
--- a/src/p_mobj.h
+++ b/src/p_mobj.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/p_polyobj.c b/src/p_polyobj.c
index 875210435..eaa8d7449 100644
--- a/src/p_polyobj.c
+++ b/src/p_polyobj.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2006 by James Haley
-// Copyright (C) 2006-2016 by Sonic Team Junior.
+// Copyright (C) 2006-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -1866,6 +1866,9 @@ void T_PolyObjWaypoint(polywaypoint_t *th)
diffz = po->lines[0]->backsector->floorheight - (target->z - amtz);
po->lines[0]->backsector->floorheight = target->z - amtz;
po->lines[0]->backsector->ceilingheight = target->z + amtz;
+ // Sal: Remember to check your sectors!
+ P_CheckSector(po->lines[0]->frontsector, (boolean)(po->damage));
+ P_CheckSector(po->lines[0]->backsector, (boolean)(po->damage));
// Apply action to mirroring polyobjects as well
start = 0;
while ((po = Polyobj_GetChild(oldpo, &start)))
@@ -1877,6 +1880,9 @@ void T_PolyObjWaypoint(polywaypoint_t *th)
// TODO: use T_MovePlane
po->lines[0]->backsector->floorheight += diffz; // move up/down by same amount as the parent did
po->lines[0]->backsector->ceilingheight += diffz;
+ // Sal: Remember to check your sectors!
+ P_CheckSector(po->lines[0]->frontsector, (boolean)(po->damage));
+ P_CheckSector(po->lines[0]->backsector, (boolean)(po->damage));
}
po = oldpo;
@@ -2037,6 +2043,9 @@ void T_PolyObjWaypoint(polywaypoint_t *th)
// TODO: use T_MovePlane
po->lines[0]->backsector->floorheight += momz;
po->lines[0]->backsector->ceilingheight += momz;
+ // Sal: Remember to check your sectors!
+ P_CheckSector(po->lines[0]->frontsector, (boolean)(po->damage)); // frontsector is NEEDED for crushing
+ P_CheckSector(po->lines[0]->backsector, (boolean)(po->damage)); // backsector may not be necessary, but just in case
// Apply action to mirroring polyobjects as well
start = 0;
@@ -2049,6 +2058,9 @@ void T_PolyObjWaypoint(polywaypoint_t *th)
// TODO: use T_MovePlane
po->lines[0]->backsector->floorheight += momz;
po->lines[0]->backsector->ceilingheight += momz;
+ // Sal: Remember to check your sectors!
+ P_CheckSector(po->lines[0]->frontsector, (boolean)(po->damage));
+ P_CheckSector(po->lines[0]->backsector, (boolean)(po->damage));
}
}
diff --git a/src/p_polyobj.h b/src/p_polyobj.h
index 524518f2a..b871ec837 100644
--- a/src/p_polyobj.h
+++ b/src/p_polyobj.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2006 by James Haley
-// Copyright (C) 2006-2016 by Sonic Team Junior.
+// Copyright (C) 2006-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/p_pspr.h b/src/p_pspr.h
index 0734b78ec..c9c66b961 100644
--- a/src/p_pspr.h
+++ b/src/p_pspr.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/p_saveg.c b/src/p_saveg.c
index 10ed68ddf..7a31fecfc 100644
--- a/src/p_saveg.c
+++ b/src/p_saveg.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/p_saveg.h b/src/p_saveg.h
index 5960660ab..2f5e88046 100644
--- a/src/p_saveg.h
+++ b/src/p_saveg.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/p_setup.c b/src/p_setup.c
index f31121fdc..a28aa7761 100644
--- a/src/p_setup.c
+++ b/src/p_setup.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -230,6 +230,7 @@ static void P_ClearSingleMapHeaderInfo(INT16 i)
mapheaderinfo[num]->levelselect = 0;
mapheaderinfo[num]->bonustype = 0;
mapheaderinfo[num]->maxbonuslives = -1;
+ mapheaderinfo[num]->saveoverride = SAVE_DEFAULT;
mapheaderinfo[num]->levelflags = 0;
mapheaderinfo[num]->menuflags = 0;
#if 1 // equivalent to "FlickyList = DEMO"
@@ -391,30 +392,26 @@ static inline void P_LoadVertexes(lumpnum_t lumpnum)
Z_Free(data);
}
-
-//
-// Computes the line length in fracunits, the OpenGL render needs this
-//
-
/** Computes the length of a seg in fracunits.
- * This is needed for splats.
*
* \param seg Seg to compute length for.
* \return Length in fracunits.
*/
fixed_t P_SegLength(seg_t *seg)
{
- fixed_t dx, dy;
-
- // make a vector (start at origin)
- dx = seg->v2->x - seg->v1->x;
- dy = seg->v2->y - seg->v1->y;
-
- return FixedHypot(dx, dy);
+ INT64 dx = (seg->v2->x - seg->v1->x)>>1;
+ INT64 dy = (seg->v2->y - seg->v1->y)>>1;
+ return FixedHypot(dx, dy)<<1;
}
#ifdef HWRENDER
-static inline float P_SegLengthf(seg_t *seg)
+/** Computes the length of a seg as a float.
+ * This is needed for OpenGL.
+ *
+ * \param seg Seg to compute length for.
+ * \return Length as a float.
+ */
+static inline float P_SegLengthFloat(seg_t *seg)
{
float dx, dy;
@@ -450,11 +447,11 @@ static void P_LoadRawSegs(UINT8 *data, size_t i)
li->v1 = &vertexes[SHORT(ml->v1)];
li->v2 = &vertexes[SHORT(ml->v2)];
-#ifdef HWRENDER // not win32 only 19990829 by Kin
- // used for the hardware render
- if (rendermode != render_soft && rendermode != render_none)
+ li->length = P_SegLength(li);
+#ifdef HWRENDER
+ if (rendermode == render_opengl)
{
- li->flength = P_SegLengthf(li);
+ li->flength = P_SegLengthFloat(li);
//Hurdler: 04/12/2000: for now, only used in hardware mode
li->lightmaps = NULL; // list of static lightmap for this seg
}
@@ -1966,7 +1963,7 @@ static boolean P_LoadRawBlockMap(UINT8 *data, size_t count, const char *lumpname
if (!count || count >= 0x20000)
return false;
- CONS_Printf("Reading blockmap lump for pk3...\n");
+ //CONS_Printf("Reading blockmap lump for pk3...\n");
// no need to malloc anything, assume the data is uncompressed for now
count /= 2;
@@ -2368,7 +2365,6 @@ void P_LoadThingsOnly(void)
}
else // phew it's just a WAD
P_PrepareThings(lastloadedmaplumpnum + ML_THINGS);
-
P_LoadThings();
@@ -2636,19 +2632,26 @@ static void P_SetupCamera(void)
}
}
-static boolean CanSaveLevel(INT32 mapnum)
+static boolean P_CanSave(void)
{
- if (ultimatemode) // never save in ultimate (probably redundant with cursaveslot also being checked)
+ // Saving is completely ignored under these conditions:
+ if ((cursaveslot < 0) // Playing without saving
+ || (modifiedgame && !savemoddata) // Game is modified
+ || (netgame || multiplayer) // Not in single-player
+ || (demoplayback || demorecording || metalrecording) // Currently in demo
+ || (players[consoleplayer].lives <= 0) // Completely dead
+ || (modeattacking || ultimatemode || G_IsSpecialStage(gamemap))) // Specialized instances
return false;
- if (G_IsSpecialStage(mapnum) // don't save in special stages
- || mapnum == lastmaploaded) // don't save if the last map loaded was this one
- return false;
+ if (mapheaderinfo[gamemap-1]->saveoverride == SAVE_ALWAYS)
+ return true; // Saving should ALWAYS happen!
+ else if (mapheaderinfo[gamemap-1]->saveoverride == SAVE_NEVER)
+ return false; // Saving should NEVER happen!
- // Any levels that have the savegame flag can save normally.
- // If the game is complete for this save slot, then any level can save!
- // On the other side of the spectrum, if lastmaploaded is 0, then the save file has only just been created and needs to save ASAP!
- return (mapheaderinfo[mapnum-1]->levelflags & LF_SAVEGAME || gamecomplete || !lastmaploaded);
+ // Default condition: In a non-hidden map, at the beginning of a zone or on a completed save-file, and not on save reload.
+ return (!(mapheaderinfo[gamemap-1]->menuflags & LF2_HIDEINMENU)
+ && (mapheaderinfo[gamemap-1]->actnum < 2 || gamecomplete)
+ && (gamemap != lastmapsaved));
}
/** Loads a level from a lump or external wad.
@@ -2858,7 +2861,6 @@ boolean P_SetupLevel(boolean skipprecip)
P_MakeMapMD5(lastloadedmaplumpnum, &mapmd5);
-
// HACK ALERT: Cache the WAD, get the map data into the tables, free memory.
// As it is implemented right now, we're assuming an uncompressed WAD.
// (As in, a normal PWAD, not ZWAD or anything. The lump itself can be compressed.)
@@ -2870,6 +2872,7 @@ boolean P_SetupLevel(boolean skipprecip)
//filelump_t *fileinfo = wadData + ((wadinfo_t *)wadData)->infotableofs;
filelump_t *fileinfo = (filelump_t *)(wadData + ((wadinfo_t *)wadData)->infotableofs);
UINT32 numlumps = ((wadinfo_t *)wadData)->numlumps;
+<<<<<<< HEAD
if (numlumps < ML_REJECT) // at least 9 lumps should be in the wad for a map to be loaded
{
@@ -2916,6 +2919,49 @@ boolean P_SetupLevel(boolean skipprecip)
for (i = 0; i < 16; i++)
skyboxviewpnts[i] = skyboxcenterpnts[i] = NULL;
+=======
+
+ if (numlumps < ML_REJECT) // at least 9 lumps should be in the wad for a map to be loaded
+ {
+ I_Error("Bad WAD file for map %s!\n", maplumpname);
+ }
+
+ if (numlumps > ML_BLOCKMAP) // enough room for a BLOCKMAP lump at least
+ {
+ loadedbm = P_LoadRawBlockMap(
+ wadData + (fileinfo + ML_BLOCKMAP)->filepos,
+ (fileinfo + ML_BLOCKMAP)->size,
+ (fileinfo + ML_BLOCKMAP)->name);
+ }
+ P_LoadRawVertexes(wadData + (fileinfo + ML_VERTEXES)->filepos, (fileinfo + ML_VERTEXES)->size);
+ P_LoadRawSectors(wadData + (fileinfo + ML_SECTORS)->filepos, (fileinfo + ML_SECTORS)->size);
+ P_LoadRawSideDefs((fileinfo + ML_SIDEDEFS)->size);
+ P_LoadRawLineDefs(wadData + (fileinfo + ML_LINEDEFS)->filepos, (fileinfo + ML_LINEDEFS)->size);
+ P_LoadRawSideDefs2(wadData + (fileinfo + ML_SIDEDEFS)->filepos);
+ P_LoadRawSubsectors(wadData + (fileinfo + ML_SSECTORS)->filepos, (fileinfo + ML_SSECTORS)->size);
+ P_LoadRawNodes(wadData + (fileinfo + ML_NODES)->filepos, (fileinfo + ML_NODES)->size);
+ P_LoadRawSegs(wadData + (fileinfo + ML_SEGS)->filepos, (fileinfo + ML_SEGS)->size);
+ if (numlumps > ML_REJECT) // enough room for a REJECT lump at least
+ {
+ P_LoadRawReject(
+ wadData + (fileinfo + ML_REJECT)->filepos,
+ (fileinfo + ML_REJECT)->size,
+ (fileinfo + ML_REJECT)->name);
+ }
+
+ // Important: take care of the ordering of the next functions.
+ if (!loadedbm)
+ P_CreateBlockMap(); // Graue 02-29-2004
+ P_LoadLineDefs2();
+ P_GroupLines();
+ numdmstarts = numredctfstarts = numbluectfstarts = 0;
+
+ // reset the player starts
+ for (i = 0; i < MAXPLAYERS; i++)
+ playerstarts[i] = NULL;
+ for (i = 0; i < 2; i++)
+ skyboxmo[i] = NULL;
+>>>>>>> public_next-20190101
P_MapStart();
P_PrepareRawThings(wadData + (fileinfo + ML_THINGS)->filepos, (fileinfo + ML_THINGS)->size);
@@ -2945,6 +2991,7 @@ boolean P_SetupLevel(boolean skipprecip)
// reset the player starts
for (i = 0; i < MAXPLAYERS; i++)
playerstarts[i] = NULL;
+<<<<<<< HEAD
for (i = 0; i < 2; i++)
skyboxmo[i] = NULL;
@@ -2960,6 +3007,13 @@ boolean P_SetupLevel(boolean skipprecip)
// init gravity, tag lists,
// anything that P_ResetDynamicSlopes/P_LoadThings needs to know
P_InitSpecials();
+=======
+ for (i = 0; i < 2; i++)
+ skyboxmo[i] = NULL;
+ P_MapStart();
+ P_PrepareThings(lastloadedmaplumpnum + ML_THINGS);
+ }
+>>>>>>> public_next-20190101
#ifdef ESLOPE
P_ResetDynamicSlopes();
@@ -3105,9 +3159,22 @@ boolean P_SetupLevel(boolean skipprecip)
if (!cv_cam2_dist.changed)
CV_Set(&cv_cam2_dist, cv_cam2_dist.defaultvalue);*/
+<<<<<<< HEAD
// Though, I don't think anyone would care about cam_rotate being reset back to the only value that makes sense :P
if (!cv_cam_rotate.changed)
CV_Set(&cv_cam_rotate, cv_cam_rotate.defaultvalue);
+=======
+ if (!cv_cam2_height.changed)
+ CV_Set(&cv_cam2_height, cv_cam2_height.defaultvalue);
+
+ if (!cv_cam2_dist.changed)
+ CV_Set(&cv_cam2_dist, cv_cam2_dist.defaultvalue);*/
+
+ // Though, I don't think anyone would care about cam_rotate being reset back to the only value that makes sense :P
+ if (!cv_cam_rotate.changed)
+ CV_Set(&cv_cam_rotate, cv_cam_rotate.defaultvalue);
+
+>>>>>>> public_next-20190101
if (!cv_cam2_rotate.changed)
CV_Set(&cv_cam2_rotate, cv_cam2_rotate.defaultvalue);
@@ -3173,8 +3240,7 @@ boolean P_SetupLevel(boolean skipprecip)
P_RunCachedActions();
- if (!(netgame || multiplayer || demoplayback || demorecording || metalrecording || modeattacking || players[consoleplayer].lives <= 0)
- && (!modifiedgame || savemoddata) && cursaveslot > 0 && CanSaveLevel(gamemap))
+ if (P_CanSave())
G_SaveGame((UINT32)cursaveslot);
lastmaploaded = gamemap; // HAS to be set after saving!!
@@ -3346,6 +3412,7 @@ boolean P_AddWadFile(const char *wadfilename)
UINT16 numlumps, wadnum;
char *name;
lumpinfo_t *lumpinfo;
+<<<<<<< HEAD
boolean mapsadded = false;
boolean replacedcurrentmap = false;
@@ -3363,6 +3430,12 @@ boolean P_AddWadFile(const char *wadfilename)
// UINT16 mapPos, mapNum = 0;
// Init file.
+=======
+ boolean texturechange = false;
+ boolean mapsadded = false;
+ boolean replacedcurrentmap = false;
+
+>>>>>>> public_next-20190101
if ((numlumps = W_InitFile(wadfilename)) == INT16_MAX)
{
refreshdirmenu |= REFRESHDIR_NOTLOADED;
@@ -3454,7 +3527,10 @@ boolean P_AddWadFile(const char *wadfilename)
if (!devparm && digmreplaces)
CONS_Printf(M_GetText("%s digital musics replaced\n"), sizeu1(digmreplaces));
- // Search for sprite replacements.
+
+ //
+ // search for sprite replacements
+ //
R_AddSpriteDefs(wadnum);
// Reload it all anyway, just in case they
diff --git a/src/p_setup.h b/src/p_setup.h
index 158e0110b..7e8a5d7e6 100644
--- a/src/p_setup.h
+++ b/src/p_setup.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/p_sight.c b/src/p_sight.c
index 132f993cf..556041585 100644
--- a/src/p_sight.c
+++ b/src/p_sight.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/p_slopes.c b/src/p_slopes.c
index b7cd597aa..0689f0807 100644
--- a/src/p_slopes.c
+++ b/src/p_slopes.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2004 by Stephen McGranahan
-// Copyright (C) 2015-2016 by Sonic Team Junior.
+// Copyright (C) 2015-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/p_slopes.h b/src/p_slopes.h
index 252bbdb3c..b802ec25f 100644
--- a/src/p_slopes.h
+++ b/src/p_slopes.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2004 by Stephen McGranahan
-// Copyright (C) 2015-2016 by Sonic Team Junior.
+// Copyright (C) 2015-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/p_spec.c b/src/p_spec.c
index 18a831073..44808a641 100644
--- a/src/p_spec.c
+++ b/src/p_spec.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -169,10 +169,20 @@ void P_InitPicAnims(void)
// Find ANIMDEFS lump in the WAD
animdefsLumpNum = W_CheckNumForNamePwad("ANIMDEFS", w, 0);
+<<<<<<< HEAD
while (animdefsLumpNum != INT16_MAX)
{
P_ParseANIMDEFSLump(w, animdefsLumpNum);
animdefsLumpNum = W_CheckNumForNamePwad("ANIMDEFS", (UINT16)w, animdefsLumpNum + 1);
+=======
+ // Find ANIMDEFS lump in the WAD
+ animdefsLumpNum = W_CheckNumForNamePwad("ANIMDEFS", w, 0);
+ while (animdefsLumpNum != INT16_MAX)
+ {
+ P_ParseANIMDEFSLump(w, animdefsLumpNum);
+ animdefsLumpNum = W_CheckNumForNamePwad("ANIMDEFS", (UINT16)w, animdefsLumpNum + 1);
+ }
+>>>>>>> public_next-20190101
}
}
diff --git a/src/p_spec.h b/src/p_spec.h
index f04e6590f..d7176afee 100644
--- a/src/p_spec.h
+++ b/src/p_spec.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/p_telept.c b/src/p_telept.c
index f70c4664c..2e070d14b 100644
--- a/src/p_telept.c
+++ b/src/p_telept.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/p_tick.c b/src/p_tick.c
index eb47e0c36..6f7c96ead 100644
--- a/src/p_tick.c
+++ b/src/p_tick.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/p_tick.h b/src/p_tick.h
index 75868fdd8..169c54c8e 100644
--- a/src/p_tick.h
+++ b/src/p_tick.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/p_user.c b/src/p_user.c
index 3a8b09c76..5a44b8a04 100644
--- a/src/p_user.c
+++ b/src/p_user.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -8689,6 +8689,9 @@ static void P_DeathThink(player_t *player)
if (player->deadtimer < INT32_MAX)
player->deadtimer++;
+ if (player->bot) // don't allow bots to do any of the below, B_CheckRespawn does all they need for respawning already
+ goto notrealplayer;
+
// continue logic
if (!(netgame || multiplayer) && player->lives <= 0)
{
@@ -8815,6 +8818,8 @@ static void P_DeathThink(player_t *player)
P_RestoreMultiMusic(player);
}
+notrealplayer:
+
if (!player->mo)
return;
@@ -8912,7 +8917,7 @@ void P_ResetCamera(player_t *player, camera_t *thiscam)
boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcalled)
{
angle_t angle = 0, focusangle = 0, focusaiming = 0;
- fixed_t x, y, z, dist, height, checkdist, viewpointx, viewpointy, camspeed, camdist, camheight, pviewheight;
+ fixed_t x, y, z, dist, checkdist, viewpointx, viewpointy, camspeed, camdist, camheight, pviewheight;
INT32 camrotate;
boolean camstill, cameranoclip;
mobj_t *mo;
@@ -9108,14 +9113,14 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
if (splitscreen)
{
dist = FixedMul(dist, 3*FRACUNIT/2);
- height = FixedMul(height, 3*FRACUNIT/2);
+ camheight = FixedMul(camheight, 3*FRACUNIT/2);
}
// x1.2 dist for analog
if (P_AnalogMove(player))
{
dist = FixedMul(dist, 6*FRACUNIT/5);
- height = FixedMul(height, 6*FRACUNIT/5);
+ camheight = FixedMul(camheight, 6*FRACUNIT/5);
}
if (player->climbing || player->exiting || player->playerstate == PST_DEAD || (player->powers[pw_carry] == CR_ROPEHANG || player->powers[pw_carry] == CR_GENERIC || player->powers[pw_carry] == CR_MACESPIN))
@@ -9165,9 +9170,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
pviewheight = FixedMul(41*player->height/48, mo->scale);
if (mo->eflags & MFE_VERTICALFLIP)
- z = mo->z + mo->height - pviewheight - height;
+ z = mo->z + mo->height - pviewheight - camheight;
else
- z = mo->z + pviewheight + height;
+ z = mo->z + pviewheight + camheight;
// move camera down to move under lower ceilings
newsubsec = R_IsPointInSubsector(((mo->x>>FRACBITS) + (thiscam->x>>FRACBITS))<<(FRACBITS-1), ((mo->y>>FRACBITS) + (thiscam->y>>FRACBITS))<<(FRACBITS-1));
@@ -9442,7 +9447,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
if (!(multiplayer || netgame) && !splitscreen)
{
fixed_t vx = thiscam->x, vy = thiscam->y;
- if (player->awayviewtics && player->awayviewmobj != NULL) // Camera must obviously exist
+ if (player->awayviewtics && player->awayviewmobj != NULL && !P_MobjWasRemoved(player->awayviewmobj)) // Camera must obviously exist
{
vx = player->awayviewmobj->x;
vy = player->awayviewmobj->y;
@@ -9598,7 +9603,7 @@ static void P_CalcPostImg(player_t *player)
else
pviewheight = player->mo->z + player->viewheight;
- if (player->awayviewtics)
+ if (player->awayviewtics && player->awayviewmobj && !P_MobjWasRemoved(player->awayviewmobj))
{
sector = player->awayviewmobj->subsector->sector;
pviewheight = player->awayviewmobj->z + 20*FRACUNIT;
@@ -9766,12 +9771,23 @@ void P_PlayerThink(player_t *player)
}
#endif
+ if (player->awayviewmobj && P_MobjWasRemoved(player->awayviewmobj))
+ {
+ P_SetTarget(&player->awayviewmobj, NULL); // remove awayviewmobj asap if invalid
+ player->awayviewtics = 0; // reset to zero
+ }
+
if (player->flashcount)
player->flashcount--;
- // By the time P_MoveChaseCamera is called, this might be zero. Do not do it here.
- //if (player->awayviewtics)
- // player->awayviewtics--;
+ // Re-fixed by Jimita (11-12-2018)
+ if (player->awayviewtics)
+ {
+ player->awayviewtics--;
+ if (!player->awayviewtics)
+ player->awayviewtics = -1;
+ // The timer might've reached zero, but we'll run the remote view camera anyway by setting it to -1.
+ }
/// \note do this in the cheat code
if (player->pflags & PF_NOCLIP)
@@ -10744,8 +10760,8 @@ void P_PlayerAfterThink(player_t *player)
}
}
- if (player->awayviewtics)
- player->awayviewtics--;
+ if (player->awayviewtics < 0)
+ player->awayviewtics = 0;
// spectator invisibility and nogravity.
if ((netgame || multiplayer) && player->spectator)
diff --git a/src/r_bsp.c b/src/r_bsp.c
index cbb012b28..22abaeb88 100644
--- a/src/r_bsp.c
+++ b/src/r_bsp.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -388,18 +388,18 @@ static void R_AddLine(seg_t *line)
{
INT32 x1, x2;
angle_t angle1, angle2, span, tspan;
- static sector_t tempsec; // ceiling/water hack
+ static sector_t tempsec;
boolean bothceilingssky = false, bothfloorssky = false;
+ portalline = false;
+
if (line->polyseg && !(line->polyseg->flags & POF_RENDERSIDES))
return;
+ // big room fix
+ angle1 = R_PointToAngleEx(viewx, viewy, line->v1->x, line->v1->y);
+ angle2 = R_PointToAngleEx(viewx, viewy, line->v2->x, line->v2->y);
curline = line;
- portalline = false;
-
- // OPTIMIZE: quickly reject orthogonal back sides.
- angle1 = R_PointToAngle(line->v1->x, line->v1->y);
- angle2 = R_PointToAngle(line->v2->x, line->v2->y);
// Clip to view edges.
span = angle1 - angle2;
@@ -608,69 +608,35 @@ INT32 checkcoord[12][4] =
{2, 1, 3, 0}
};
-static boolean R_CheckBBox(fixed_t *bspcoord)
+static boolean R_CheckBBox(const fixed_t *bspcoord)
{
- INT32 boxpos, sx1, sx2;
- fixed_t px1, py1, px2, py2;
- angle_t angle1, angle2, span, tspan;
+ angle_t angle1, angle2;
+ INT32 sx1, sx2, boxpos;
+ const INT32* check;
cliprange_t *start;
// Find the corners of the box that define the edges from current viewpoint.
- if (viewx <= bspcoord[BOXLEFT])
- boxpos = 0;
- else if (viewx < bspcoord[BOXRIGHT])
- boxpos = 1;
- else
- boxpos = 2;
-
- if (viewy >= bspcoord[BOXTOP])
- boxpos |= 0;
- else if (viewy > bspcoord[BOXBOTTOM])
- boxpos |= 1<<2;
- else
- boxpos |= 2<<2;
-
- if (boxpos == 5)
+ if ((boxpos = (viewx <= bspcoord[BOXLEFT] ? 0 : viewx < bspcoord[BOXRIGHT] ? 1 : 2) + (viewy >= bspcoord[BOXTOP] ? 0 : viewy > bspcoord[BOXBOTTOM] ? 4 : 8)) == 5)
return true;
- px1 = bspcoord[checkcoord[boxpos][0]];
- py1 = bspcoord[checkcoord[boxpos][1]];
- px2 = bspcoord[checkcoord[boxpos][2]];
- py2 = bspcoord[checkcoord[boxpos][3]];
+ check = checkcoord[boxpos];
- // check clip list for an open space
- angle1 = R_PointToAngle2(viewx>>1, viewy>>1, px1>>1, py1>>1) - viewangle;
- angle2 = R_PointToAngle2(viewx>>1, viewy>>1, px2>>1, py2>>1) - viewangle;
+ // big room fix
+ angle1 = R_PointToAngleEx(viewx, viewy, bspcoord[check[0]], bspcoord[check[1]]) - viewangle;
+ angle2 = R_PointToAngleEx(viewx, viewy, bspcoord[check[2]], bspcoord[check[3]]) - viewangle;
- span = angle1 - angle2;
-
- // Sitting on a line?
- if (span >= ANGLE_180)
- return true;
-
- tspan = angle1 + clipangle;
-
- if (tspan > doubleclipangle)
+ if ((signed)angle1 < (signed)angle2)
{
- tspan -= doubleclipangle;
-
- // Totally off the left edge?
- if (tspan >= span)
- return false;
-
- angle1 = clipangle;
+ if ((angle1 >= ANGLE_180) && (angle1 < ANGLE_270))
+ angle1 = ANGLE_180-1;
+ else
+ angle2 = ANGLE_180;
}
- tspan = clipangle - angle2;
- if (tspan > doubleclipangle)
- {
- tspan -= doubleclipangle;
- // Totally off the left edge?
- if (tspan >= span)
- return false;
-
- angle2 = -(signed)clipangle;
- }
+ if ((signed)angle2 >= (signed)clipangle) return false;
+ if ((signed)angle1 <= -(signed)clipangle) return false;
+ if ((signed)angle1 >= (signed)clipangle) angle1 = clipangle;
+ if ((signed)angle2 <= -(signed)clipangle) angle2 = 0-clipangle;
// Find the first clippost that touches the source post (adjacent pixels are touching).
angle1 = (angle1+ANGLE_90)>>ANGLETOFINESHIFT;
@@ -679,9 +645,7 @@ static boolean R_CheckBBox(fixed_t *bspcoord)
sx2 = viewangletox[angle2];
// Does not cross a pixel.
- if (sx1 == sx2)
- return false;
- sx2--;
+ if (sx1 >= sx2) return false;
start = solidsegs;
while (start->last < sx2)
@@ -1122,7 +1086,6 @@ static void R_Subsector(size_t num)
&& (viewz < polysec->floorheight))
{
light = R_GetPlaneLight(frontsector, polysec->floorheight, viewz < polysec->floorheight);
- light = 0;
ffloor[numffloors].plane = R_FindPlane(polysec->floorheight, polysec->floorpic,
polysec->lightlevel, polysec->floor_xoffs, polysec->floor_yoffs,
polysec->floorpic_angle-po->angle,
@@ -1152,7 +1115,6 @@ static void R_Subsector(size_t num)
&& (viewz > polysec->ceilingheight))
{
light = R_GetPlaneLight(frontsector, polysec->ceilingheight, viewz < polysec->ceilingheight);
- light = 0;
ffloor[numffloors].plane = R_FindPlane(polysec->ceilingheight, polysec->ceilingpic,
polysec->lightlevel, polysec->ceiling_xoffs, polysec->ceiling_yoffs, polysec->ceilingpic_angle-po->angle,
NULL, NULL, po
diff --git a/src/r_bsp.h b/src/r_bsp.h
index 80824831b..e3662e2e6 100644
--- a/src/r_bsp.h
+++ b/src/r_bsp.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/r_data.c b/src/r_data.c
index 08e3d91b6..b80773dc6 100644
--- a/src/r_data.c
+++ b/src/r_data.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -1198,7 +1198,11 @@ static void R_InitExtraColormaps(void)
}
#endif
+<<<<<<< HEAD
// Search for flat name through all
+=======
+// Search for flat name.
+>>>>>>> public_next-20190101
lumpnum_t R_GetFlatNumForName(const char *name)
{
INT32 i;
@@ -1209,6 +1213,7 @@ lumpnum_t R_GetFlatNumForName(const char *name)
// Scan wad files backwards so patched flats take preference.
for (i = numwadfiles - 1; i >= 0; i--)
{
+<<<<<<< HEAD
if (wadfiles[i]->type == RET_PK3)
{
@@ -1242,6 +1247,32 @@ lumpnum_t R_GetFlatNumForName(const char *name)
continue;
}
}
+=======
+ switch (wadfiles[i]->type)
+ {
+ case RET_WAD:
+ if ((start = W_CheckNumForNamePwad("F_START", (UINT16)i, 0)) == INT16_MAX)
+ {
+ if ((start = W_CheckNumForNamePwad("FF_START", (UINT16)i, 0)) == INT16_MAX)
+ continue;
+ else if ((end = W_CheckNumForNamePwad("FF_END", (UINT16)i, start)) == INT16_MAX)
+ continue;
+ }
+ else
+ if ((end = W_CheckNumForNamePwad("F_END", (UINT16)i, start)) == INT16_MAX)
+ continue;
+ break;
+ case RET_PK3:
+ if ((start = W_CheckNumForFolderStartPK3("Flats/", i, 0)) == INT16_MAX)
+ continue;
+ if ((end = W_CheckNumForFolderEndPK3("Flats/", i, start)) == INT16_MAX)
+ continue;
+ break;
+ default:
+ continue;
+ }
+
+>>>>>>> public_next-20190101
// Now find lump with specified name in that range.
lump = W_CheckNumForNamePwad(name, (UINT16)i, start);
if (lump < end)
@@ -1611,8 +1642,67 @@ lighttable_t *R_CreateLightTable(extracolormap_t *extra_colormap)
UINT8 fadestart = extra_colormap->fadestart,
fadedist = extra_colormap->fadeend - extra_colormap->fadestart;
+<<<<<<< HEAD
lighttable_t *lighttable = NULL;
size_t i;
+=======
+#define NUMFROMCHAR(c) (c >= '0' && c <= '9' ? c - '0' : 0)
+ if (p2[0] == '#')
+ {
+ // Get parameters like fadestart, fadeend, and the fogflag
+ fadestart = NUMFROMCHAR(p2[3]) + (NUMFROMCHAR(p2[2]) * 10);
+ fadeend = NUMFROMCHAR(p2[5]) + (NUMFROMCHAR(p2[4]) * 10);
+ if (fadestart > 30)
+ fadestart = 0;
+ if (fadeend > 31 || fadeend < 1)
+ fadeend = 31;
+ fadedist = fadeend - fadestart;
+ fog = NUMFROMCHAR(p2[1]);
+ }
+#undef NUMFROMCHAR
+
+ if (p3[0] == '#')
+ {
+ cdestr = cr = ((HEX2INT(p3[1]) * 16) + HEX2INT(p3[2]));
+ cdestg = cg = ((HEX2INT(p3[3]) * 16) + HEX2INT(p3[4]));
+ cdestb = cb = ((HEX2INT(p3[5]) * 16) + HEX2INT(p3[6]));
+ fadecolor = (((cb) >> 3) + (((cg) >> 2) << 5) + (((cr) >> 3) << 11));
+ }
+ else
+ cdestr = cdestg = cdestb = fadecolor = 0;
+#undef HEX2INT
+
+ for (i = 0; i < num_extra_colormaps; i++)
+ {
+ if (foundcolormaps[i] != LUMPERROR)
+ continue;
+ if (maskcolor == extra_colormaps[i].maskcolor
+ && fadecolor == extra_colormaps[i].fadecolor
+ && fabs(maskamt - extra_colormaps[i].maskamt) < DBL_EPSILON
+ && fadestart == extra_colormaps[i].fadestart
+ && fadeend == extra_colormaps[i].fadeend
+ && fog == extra_colormaps[i].fog)
+ {
+ return (INT32)i;
+ }
+ }
+
+ if (num_extra_colormaps == MAXCOLORMAPS)
+ I_Error("R_CreateColormap: Too many colormaps! the limit is %d\n", MAXCOLORMAPS);
+
+ num_extra_colormaps++;
+
+ foundcolormaps[mapnum] = LUMPERROR;
+
+ // aligned on 8 bit for asm code
+ extra_colormaps[mapnum].colormap = NULL;
+ extra_colormaps[mapnum].maskcolor = (UINT16)maskcolor;
+ extra_colormaps[mapnum].fadecolor = (UINT16)fadecolor;
+ extra_colormaps[mapnum].maskamt = maskamt;
+ extra_colormaps[mapnum].fadestart = (UINT16)fadestart;
+ extra_colormaps[mapnum].fadeend = (UINT16)fadeend;
+ extra_colormaps[mapnum].fog = fog;
+>>>>>>> public_next-20190101
/////////////////////
// Calc the RGBA mask
diff --git a/src/r_data.h b/src/r_data.h
index 54857661a..b6b0a16a1 100644
--- a/src/r_data.h
+++ b/src/r_data.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/r_defs.h b/src/r_defs.h
index 0e63eec64..e7315b35c 100644
--- a/src/r_defs.h
+++ b/src/r_defs.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -589,6 +589,7 @@ typedef struct seg_s
sector_t *frontsector;
sector_t *backsector;
+ fixed_t length; // precalculated seg length
#ifdef HWRENDER
// new pointers so that AdjustSegs doesn't mess with v1/v2
void *pv1; // polyvertex_t
diff --git a/src/r_draw.c b/src/r_draw.c
index 40945f4e0..13ac691d5 100644
--- a/src/r_draw.c
+++ b/src/r_draw.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/r_draw.h b/src/r_draw.h
index 4a105b5b0..0c04fee2a 100644
--- a/src/r_draw.h
+++ b/src/r_draw.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/r_draw16.c b/src/r_draw16.c
index a922f4d0a..918dd356c 100644
--- a/src/r_draw16.c
+++ b/src/r_draw16.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/r_draw8.c b/src/r_draw8.c
index bda146546..8a2d37fb3 100644
--- a/src/r_draw8.c
+++ b/src/r_draw8.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/r_local.h b/src/r_local.h
index a3dfe7df6..1d3187750 100644
--- a/src/r_local.h
+++ b/src/r_local.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/r_main.c b/src/r_main.c
index ab5993c5b..aed657506 100644
--- a/src/r_main.c
+++ b/src/r_main.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -353,6 +353,29 @@ fixed_t R_PointToDist(fixed_t x, fixed_t y)
return R_PointToDist2(viewx, viewy, x, y);
}
+angle_t R_PointToAngleEx(INT32 x2, INT32 y2, INT32 x1, INT32 y1)
+{
+ INT64 dx = x1-x2;
+ INT64 dy = y1-y2;
+ if (dx < INT32_MIN || dx > INT32_MAX || dy < INT32_MIN || dy > INT32_MAX)
+ {
+ x1 = (int)(dx / 2 + x2);
+ y1 = (int)(dy / 2 + y2);
+ }
+ return (y1 -= y2, (x1 -= x2) || y1) ?
+ x1 >= 0 ?
+ y1 >= 0 ?
+ (x1 > y1) ? tantoangle[SlopeDivEx(y1,x1)] : // octant 0
+ ANGLE_90-tantoangle[SlopeDivEx(x1,y1)] : // octant 1
+ x1 > (y1 = -y1) ? 0-tantoangle[SlopeDivEx(y1,x1)] : // octant 8
+ ANGLE_270+tantoangle[SlopeDivEx(x1,y1)] : // octant 7
+ y1 >= 0 ? (x1 = -x1) > y1 ? ANGLE_180-tantoangle[SlopeDivEx(y1,x1)] : // octant 3
+ ANGLE_90 + tantoangle[SlopeDivEx(x1,y1)] : // octant 2
+ (x1 = -x1) > (y1 = -y1) ? ANGLE_180+tantoangle[SlopeDivEx(y1,x1)] : // octant 4
+ ANGLE_270-tantoangle[SlopeDivEx(x1,y1)] : // octant 5
+ 0;
+}
+
//
// R_ScaleFromGlobalAngle
// Returns the texture mapping scale for the current line (horizontal span)
@@ -549,13 +572,11 @@ void R_SetViewSize(void)
//
void R_ExecuteSetViewSize(void)
{
- fixed_t cosadj;
fixed_t dy;
INT32 i;
INT32 j;
INT32 level;
INT32 startmapl;
- INT32 aspectx; //added : 02-02-98 : for aspect ratio calc. below...
setsizeneeded = false;
@@ -595,31 +616,22 @@ void R_ExecuteSetViewSize(void)
for (i = 0; i < viewwidth; i++)
screenheightarray[i] = (INT16)viewheight;
- // setup sky scaling (uses pspriteyscale)
+ // setup sky scaling
R_SetSkyScale();
// planes
- //aspectx = (((vid.height*centerx*BASEVIDWIDTH)/BASEVIDHEIGHT)/vid.width);
- aspectx = centerx;
-
if (rendermode == render_soft)
{
// this is only used for planes rendering in software mode
- j = viewheight*4;
+ j = viewheight*16;
for (i = 0; i < j; i++)
{
- dy = ((i - viewheight*2)<>ANGLETOFINESHIFT));
- distscale[i] = FixedDiv(FRACUNIT, cosadj);
- }
-
memset(scalelight, 0xFF, sizeof(scalelight));
// Calculate the light levels to use for each level/scale combination.
@@ -732,9 +744,136 @@ static mobj_t *viewmobj;
// WARNING: a should be unsigned but to add with 2048, it isn't!
#define AIMINGTODY(a) ((FINETANGENT((2048+(((INT32)a)>>ANGLETOFINESHIFT)) & FINEMASK)*160)>>FRACBITS)
-void R_SkyboxFrame(player_t *player)
+// recalc necessary stuff for mouseaiming
+// slopes are already calculated for the full possible view (which is 4*viewheight).
+// 18/08/18: (No it's actually 16*viewheight, thanks Jimita for finding this out)
+static void R_SetupFreelook(void)
{
INT32 dy = 0;
+ if (rendermode == render_soft)
+ {
+ // clip it in the case we are looking a hardware 90 degrees full aiming
+ // (lmps, network and use F12...)
+ G_SoftwareClipAimingPitch((INT32 *)&aimingangle);
+ dy = AIMINGTODY(aimingangle) * viewwidth/BASEVIDWIDTH;
+ yslope = &yslopetab[viewheight*8 - (viewheight/2 + dy)];
+ }
+ centery = (viewheight/2) + dy;
+ centeryfrac = centery<climbing || (player->pflags & PF_NIGHTSMODE) || player->playerstate == PST_DEAD)
+ chasecam = true; // force chasecam on
+ else if (player->spectator) // no spectator chasecam
+ chasecam = false; // force chasecam off
+
+ if (chasecam && !thiscam->chase)
+ {
+ P_ResetCamera(player, thiscam);
+ thiscam->chase = true;
+ }
+ else if (!chasecam)
+ thiscam->chase = false;
+
+ viewsky = !skybox;
+ if (player->awayviewtics)
+ {
+ // cut-away view stuff
+ viewmobj = player->awayviewmobj; // should be a MT_ALTVIEWMAN
+ I_Assert(viewmobj != NULL);
+ viewz = viewmobj->z + 20*FRACUNIT;
+ aimingangle = player->awayviewaiming;
+ viewangle = viewmobj->angle;
+ }
+ else if (!player->spectator && chasecam)
+ // use outside cam view
+ {
+ viewmobj = NULL;
+ viewz = thiscam->z + (thiscam->height>>1);
+ aimingangle = thiscam->aiming;
+ viewangle = thiscam->angle;
+ }
+ else
+ // use the player's eyes view
+ {
+ viewz = player->viewz;
+
+ viewmobj = player->mo;
+ I_Assert(viewmobj != NULL);
+
+ aimingangle = player->aiming;
+ viewangle = viewmobj->angle;
+
+ if (!demoplayback && player->playerstate != PST_DEAD)
+ {
+ if (player == &players[consoleplayer])
+ {
+ viewangle = localangle; // WARNING: camera uses this
+ aimingangle = localaiming;
+ }
+ else if (player == &players[secondarydisplayplayer])
+ {
+ viewangle = localangle2;
+ aimingangle = localaiming2;
+ }
+ }
+ }
+ viewz += quake.z;
+
+ viewplayer = player;
+
+ if (chasecam && !player->awayviewtics && !player->spectator)
+ {
+ viewx = thiscam->x;
+ viewy = thiscam->y;
+ viewx += quake.x;
+ viewy += quake.y;
+
+ if (thiscam->subsector)
+ viewsector = thiscam->subsector->sector;
+ else
+ viewsector = R_PointInSubsector(viewx, viewy)->sector;
+ }
+ else
+ {
+ viewx = viewmobj->x;
+ viewy = viewmobj->y;
+ viewx += quake.x;
+ viewy += quake.y;
+
+ if (viewmobj->subsector)
+ viewsector = viewmobj->subsector->sector;
+ else
+ viewsector = R_PointInSubsector(viewx, viewy)->sector;
+ }
+
+ viewsin = FINESINE(viewangle>>ANGLETOFINESHIFT);
+ viewcos = FINECOSINE(viewangle>>ANGLETOFINESHIFT);
+
+ R_SetupFreelook();
+}
+
+void R_SkyboxFrame(player_t *player)
+{
camera_t *thiscam;
if (splitscreen && player == &players[secondarydisplayplayer]
@@ -868,6 +1007,7 @@ void R_SkyboxFrame(player_t *player)
viewsin = FINESINE(viewangle>>ANGLETOFINESHIFT);
viewcos = FINECOSINE(viewangle>>ANGLETOFINESHIFT);
+<<<<<<< HEAD
// recalc necessary stuff for mouseaiming
// slopes are already calculated for the full possible view (which is 4*viewheight).
@@ -1006,6 +1146,9 @@ void R_SetupFrame(player_t *player, boolean skybox)
}
centery = (viewheight/2) + dy;
centeryfrac = centery<>>>>>> public_next-20190101
}
#define ANGLED_PORTALS
diff --git a/src/r_main.h b/src/r_main.h
index 2e768cb9c..6ae5aa221 100644
--- a/src/r_main.h
+++ b/src/r_main.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -58,6 +58,7 @@ INT32 R_PointOnSide(fixed_t x, fixed_t y, node_t *node);
INT32 R_PointOnSegSide(fixed_t x, fixed_t y, seg_t *line);
angle_t R_PointToAngle(fixed_t x, fixed_t y);
angle_t R_PointToAngle2(fixed_t px2, fixed_t py2, fixed_t px1, fixed_t py1);
+angle_t R_PointToAngleEx(INT32 x2, INT32 y2, INT32 x1, INT32 y1);
fixed_t R_PointToDist(fixed_t x, fixed_t y);
fixed_t R_PointToDist2(fixed_t px2, fixed_t py2, fixed_t px1, fixed_t py1);
diff --git a/src/r_plane.c b/src/r_plane.c
index 620ef90d1..e36c34aa4 100644
--- a/src/r_plane.c
+++ b/src/r_plane.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -16,6 +16,8 @@
#include "doomdef.h"
#include "console.h"
#include "g_game.h"
+#include "p_setup.h" // levelflats
+#include "p_slopes.h"
#include "r_data.h"
#include "r_local.h"
#include "r_state.h"
@@ -26,9 +28,12 @@
#include "z_zone.h"
#include "p_tick.h"
-#include "p_setup.h" // levelflats
-
-#include "p_slopes.h"
+#ifdef TIMING
+#include "p5prof.h"
+ INT64 mycount;
+ INT64 mytotal = 0;
+ UINT32 nombre = 100000;
+#endif
//
// opening
@@ -51,7 +56,7 @@ visplane_t *floorplane;
visplane_t *ceilingplane;
static visplane_t *currentplane;
-planemgr_t ffloor[MAXFFLOORS];
+visffloor_t ffloor[MAXFFLOORS];
INT32 numffloors;
//SoM: 3/23/2000: Boom visplane hashing routine.
@@ -89,10 +94,9 @@ static fixed_t planeheight;
// (this is to calculate yslopes only when really needed)
// (when mouselookin', yslope is moving into yslopetab)
// Check R_SetupFrame, R_SetViewSize for more...
-fixed_t yslopetab[MAXVIDHEIGHT*4];
+fixed_t yslopetab[MAXVIDHEIGHT*16];
fixed_t *yslope;
-fixed_t distscale[MAXVIDWIDTH];
fixed_t basexscale, baseyscale;
fixed_t cachedheight[MAXVIDHEIGHT];
@@ -155,34 +159,19 @@ void R_PortalRestoreClipValues(INT32 start, INT32 end, INT16 *ceil, INT16 *floor
}
}
-
-//profile stuff ---------------------------------------------------------
-//#define TIMING
-#ifdef TIMING
-#include "p5prof.h"
- INT64 mycount;
- INT64 mytotal = 0;
- UINT32 nombre = 100000;
-#endif
-//profile stuff ---------------------------------------------------------
-
-
//
// R_MapPlane
//
// Uses global vars:
-// planeheight
-// ds_source
// basexscale
// baseyscale
+// centerx
// viewx
// viewy
-// xoffs
-// yoffs
-// planeangle
-//
-// BASIC PRIMITIVE
-//
+// viewsin
+// viewcos
+// viewheight
+
#ifndef NOWATER
static INT32 bgofs;
static INT32 wtofs=0;
@@ -190,10 +179,6 @@ static INT32 waterofs;
static boolean itswater;
#endif
-#ifdef __mips__
-//#define NOWATER
-#endif
-
#ifndef NOWATER
static void R_DrawTranslucentWaterSpan_8(void)
{
@@ -275,8 +260,8 @@ static void R_DrawTranslucentWaterSpan_8(void)
void R_MapPlane(INT32 y, INT32 x1, INT32 x2)
{
- angle_t angle;
- fixed_t distance, length;
+ angle_t angle, planecos, planesin;
+ fixed_t distance, span;
size_t pindex;
#ifdef RANGECHECK
@@ -287,12 +272,22 @@ void R_MapPlane(INT32 y, INT32 x1, INT32 x2)
// from r_splats's R_RenderFloorSplat
if (x1 >= vid.width) x1 = vid.width - 1;
+ angle = (currentplane->viewangle + currentplane->plangle)>>ANGLETOFINESHIFT;
+ planecos = FINECOSINE(angle);
+ planesin = FINESINE(angle);
+
if (planeheight != cachedheight[y])
{
cachedheight[y] = planeheight;
distance = cacheddistance[y] = FixedMul(planeheight, yslope[y]);
ds_xstep = cachedxstep[y] = FixedMul(distance, basexscale);
ds_ystep = cachedystep[y] = FixedMul(distance, baseyscale);
+
+ if ((span = abs(centery-y)))
+ {
+ ds_xstep = cachedxstep[y] = FixedMul(planesin, planeheight) / span;
+ ds_ystep = cachedystep[y] = FixedMul(planecos, planeheight) / span;
+ }
}
else
{
@@ -301,13 +296,8 @@ void R_MapPlane(INT32 y, INT32 x1, INT32 x2)
ds_ystep = cachedystep[y];
}
- length = FixedMul (distance,distscale[x1]);
- angle = (currentplane->viewangle + currentplane->plangle + xtoviewangle[x1])>>ANGLETOFINESHIFT;
- /// \note Wouldn't it be faster just to add viewx and viewy
- // to the plane's x/yoffs anyway??
-
- ds_xfrac = FixedMul(FINECOSINE(angle), length) + xoffs;
- ds_yfrac = yoffs - FixedMul(FINESINE(angle), length);
+ ds_xfrac = xoffs + FixedMul(planecos, distance) + (x1 - centerx) * ds_xstep;
+ ds_yfrac = yoffs - FixedMul(planesin, distance) + (x1 - centerx) * ds_ystep;
#ifndef NOWATER
if (itswater)
@@ -315,8 +305,9 @@ void R_MapPlane(INT32 y, INT32 x1, INT32 x2)
const INT32 yay = (wtofs + (distance>>9) ) & 8191;
// ripples da water texture
bgofs = FixedDiv(FINESINE(yay), (1<<12) + (distance>>11))>>FRACBITS;
+ angle = (currentplane->viewangle + currentplane->plangle + xtoviewangle[x1])>>ANGLETOFINESHIFT;
- angle = (angle + 2048) & 8191; //90�
+ angle = (angle + 2048) & 8191; // 90 degrees
ds_xfrac += FixedMul(FINECOSINE(angle), (bgofs<> LIGHTZSHIFT;
-
if (pindex >= MAXLIGHTZ)
pindex = MAXLIGHTZ - 1;
@@ -365,8 +355,6 @@ void R_MapPlane(INT32 y, INT32 x1, INT32 x2)
// R_ClearPlanes
// At begining of frame.
//
-// NOTE: Uses con_clipviewtop, so that when console is on,
-// we don't draw the part of the view hidden under the console.
void R_ClearPlanes(void)
{
INT32 i, p;
@@ -376,12 +364,12 @@ void R_ClearPlanes(void)
for (i = 0; i < viewwidth; i++)
{
floorclip[i] = (INT16)viewheight;
- ceilingclip[i] = (INT16)con_clipviewtop;
+ ceilingclip[i] = -1;
frontscale[i] = INT32_MAX;
for (p = 0; p < MAXFFLOORS; p++)
{
ffloor[p].f_clip[i] = (INT16)viewheight;
- ffloor[p].c_clip[i] = (INT16)con_clipviewtop;
+ ffloor[p].c_clip[i] = -1;
}
}
diff --git a/src/r_plane.h b/src/r_plane.h
index dff58669a..6e6a6d49d 100644
--- a/src/r_plane.h
+++ b/src/r_plane.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -21,7 +21,6 @@
//
// Now what is a visplane, anyway?
// Simple: kinda floor/ceiling polygon optimised for SRB2 rendering.
-// 7764 bytes! (for win32, anyway)
//
typedef struct visplane_s
{
@@ -39,25 +38,12 @@ typedef struct visplane_s
extracolormap_t *extra_colormap;
// leave pads for [minx-1]/[maxx+1]
-
- // words sucks .. should get rid of that.. but eats memory
- // THIS IS UNSIGNED! VERY IMPORTANT!!
- UINT16 pad1;
- UINT16 top[MAXVIDWIDTH];
- UINT16 pad2;
- UINT16 pad3;
- UINT16 bottom[MAXVIDWIDTH];
- UINT16 pad4;
-
+ UINT16 padtopstart, top[MAXVIDWIDTH], padtopend;
+ UINT16 padbottomstart, bottom[MAXVIDWIDTH], padbottomend;
INT32 high, low; // R_PlaneBounds should set these.
fixed_t xoffs, yoffs; // Scrolling flats.
- // SoM: frontscale should be stored in the first seg of the subsector
- // where the planes themselves are stored. I'm doing this now because
- // the old way caused trouble with the drawseg array was re-sized.
- INT32 scaleseg;
-
struct ffloor_s *ffloor;
#ifdef POLYOBJECTS_PLANES
polyobj_t *polyobj;
@@ -75,17 +61,15 @@ extern INT16 *lastopening, *openings;
extern size_t maxopenings;
extern INT16 floorclip[MAXVIDWIDTH], ceilingclip[MAXVIDWIDTH];
-extern fixed_t frontscale[MAXVIDWIDTH], yslopetab[MAXVIDHEIGHT*4];
+extern fixed_t frontscale[MAXVIDWIDTH], yslopetab[MAXVIDHEIGHT*16];
extern fixed_t cachedheight[MAXVIDHEIGHT];
extern fixed_t cacheddistance[MAXVIDHEIGHT];
extern fixed_t cachedxstep[MAXVIDHEIGHT];
extern fixed_t cachedystep[MAXVIDHEIGHT];
extern fixed_t basexscale, baseyscale;
-extern lighttable_t **planezlight;
-
extern fixed_t *yslope;
-extern fixed_t distscale[MAXVIDWIDTH];
+extern lighttable_t **planezlight;
void R_InitPlanes(void);
void R_PortalStoreClipValues(INT32 start, INT32 end, INT16 *ceil, INT16 *floor, fixed_t *scale);
@@ -134,8 +118,8 @@ typedef struct planemgr_s
#ifdef POLYOBJECTS_PLANES
polyobj_t *polyobj;
#endif
-} planemgr_t;
+} visffloor_t;
-extern planemgr_t ffloor[MAXFFLOORS];
+extern visffloor_t ffloor[MAXFFLOORS];
extern INT32 numffloors;
#endif
diff --git a/src/r_segs.c b/src/r_segs.c
index d33696729..5506b8c12 100644
--- a/src/r_segs.c
+++ b/src/r_segs.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -1669,26 +1669,11 @@ static void R_RenderSegLoop (void)
}
for (i = 0; i < numffloors; i++)
- {
-#ifdef POLYOBJECTS_PLANES
- if (ffloor[i].polyobj && (!curline->polyseg || ffloor[i].polyobj != curline->polyseg))
- continue;
-#endif
-
ffloor[i].f_frac += ffloor[i].f_step;
- }
for (i = 0; i < numbackffloors; i++)
{
- INT32 y_w;
-
-#ifdef POLYOBJECTS_PLANES
- if (ffloor[i].polyobj && (!curline->polyseg || ffloor[i].polyobj != curline->polyseg))
- continue;
-#endif
- y_w = ffloor[i].b_frac >> HEIGHTBITS;
-
- ffloor[i].f_clip[rw_x] = ffloor[i].c_clip[rw_x] = (INT16)(y_w & 0xFFFF);
+ ffloor[i].f_clip[rw_x] = ffloor[i].c_clip[rw_x] = (INT16)((ffloor[i].b_frac >> HEIGHTBITS) & 0xFFFF);
ffloor[i].b_frac += ffloor[i].b_step;
}
@@ -1698,6 +1683,23 @@ static void R_RenderSegLoop (void)
}
}
+// Uses precalculated seg->length
+static INT64 R_CalcSegDist(seg_t* seg, INT64 x2, INT64 y2)
+{
+ if (!seg->linedef->dy)
+ return llabs(y2 - seg->v1->y);
+ else if (!seg->linedef->dx)
+ return llabs(x2 - seg->v1->x);
+ else
+ {
+ INT64 dx = (seg->v2->x)-(seg->v1->x);
+ INT64 dy = (seg->v2->y)-(seg->v1->y);
+ INT64 vdx = x2-(seg->v1->x);
+ INT64 vdy = y2-(seg->v1->y);
+ return ((dy*vdx)-(dx*vdy))/(seg->length);
+ }
+}
+
//
// R_StoreWallRange
// A wall segment will be drawn
@@ -1708,6 +1710,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
fixed_t hyp;
fixed_t sineval;
angle_t distangle, offsetangle;
+ boolean longboi;
#ifndef ESLOPE
fixed_t vtop;
#endif
@@ -1753,10 +1756,15 @@ void R_StoreWallRange(INT32 start, INT32 stop)
offsetangle = ANGLE_90;
distangle = ANGLE_90 - offsetangle;
- hyp = R_PointToDist (curline->v1->x, curline->v1->y);
sineval = FINESINE(distangle>>ANGLETOFINESHIFT);
- rw_distance = FixedMul (hyp, sineval);
+ hyp = R_PointToDist(curline->v1->x, curline->v1->y);
+ rw_distance = FixedMul(hyp, sineval);
+ longboi = (hyp >= INT32_MAX);
+
+ // big room fix
+ if (longboi)
+ rw_distance = (fixed_t)R_CalcSegDist(curline,viewx,viewy);
ds_p->x1 = rw_x = start;
ds_p->x2 = stop;
@@ -2604,8 +2612,18 @@ void R_StoreWallRange(INT32 start, INT32 stop)
if (offsetangle > ANGLE_90)
offsetangle = ANGLE_90;
- sineval = FINESINE(offsetangle >>ANGLETOFINESHIFT);
- rw_offset = FixedMul (hyp, sineval);
+ sineval = FINESINE(offsetangle>>ANGLETOFINESHIFT);
+ rw_offset = FixedMul(hyp, sineval);
+
+ // big room fix
+ if (longboi)
+ {
+ INT64 dx = (curline->v2->x)-(curline->v1->x);
+ INT64 dy = (curline->v2->y)-(curline->v1->y);
+ INT64 vdx = viewx-(curline->v1->x);
+ INT64 vdy = viewy-(curline->v1->y);
+ rw_offset = ((dx*vdx-dy*vdy))/(curline->length);
+ }
if (rw_normalangle-rw_angle1 < ANGLE_180)
rw_offset = -rw_offset;
@@ -2797,11 +2815,6 @@ void R_StoreWallRange(INT32 start, INT32 stop)
{
for (i = 0; i < numffloors; i++)
{
-#ifdef POLYOBJECTS_PLANES
- if (ffloor[i].polyobj && (!curline->polyseg || ffloor[i].polyobj != curline->polyseg))
- continue;
-#endif
-
ffloor[i].f_pos >>= 4;
#ifdef ESLOPE
ffloor[i].f_pos_slope >>= 4;
@@ -3082,7 +3095,11 @@ void R_StoreWallRange(INT32 start, INT32 stop)
if (ceilingplane) //SoM: 3/29/2000: Check for null ceiling planes
ceilingplane = R_CheckPlane (ceilingplane, rw_x, rw_stopx-1);
else
- markceiling = 0;
+ markceiling = false;
+
+ // Don't render the ceiling again when rendering polyobjects
+ if (curline->polyseg)
+ markceiling = false;
}
// get a new or use the same visplane
@@ -3091,7 +3108,11 @@ void R_StoreWallRange(INT32 start, INT32 stop)
if (floorplane) //SoM: 3/29/2000: Check for null planes
floorplane = R_CheckPlane (floorplane, rw_x, rw_stopx-1);
else
- markfloor = 0;
+ markfloor = false;
+
+ // Don't render the floor again when rendering polyobjects
+ if (curline->polyseg)
+ markfloor = false;
}
ds_p->numffloorplanes = 0;
diff --git a/src/r_segs.h b/src/r_segs.h
index 4187d36e0..92d0100e2 100644
--- a/src/r_segs.h
+++ b/src/r_segs.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/r_sky.c b/src/r_sky.c
index 898424a99..817e8368a 100644
--- a/src/r_sky.c
+++ b/src/r_sky.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/r_sky.h b/src/r_sky.h
index aa4bda375..86b615595 100644
--- a/src/r_sky.h
+++ b/src/r_sky.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/r_splats.c b/src/r_splats.c
index f6d7e78f3..9ab671274 100644
--- a/src/r_splats.c
+++ b/src/r_splats.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -365,9 +365,8 @@ static void R_RenderFloorSplat(floorsplat_t *pSplat, vertex_t *verts, UINT8 *pTe
#else
lighttable_t **planezlight;
fixed_t planeheight;
- angle_t angle;
- fixed_t distance;
- fixed_t length;
+ angle_t angle, planecos, planesin;
+ fixed_t distance, span;
size_t indexr;
INT32 light;
#endif
@@ -473,12 +472,22 @@ static void R_RenderFloorSplat(floorsplat_t *pSplat, vertex_t *verts, UINT8 *pTe
if (x2 >= vid.width)
x2 = vid.width - 1;
+ angle = (currentplane->viewangle + currentplane->plangle)>>ANGLETOFINESHIFT;
+ planecos = FINECOSINE(angle);
+ planesin = FINESINE(angle);
+
if (planeheight != cachedheight[y])
{
cachedheight[y] = planeheight;
distance = cacheddistance[y] = FixedMul(planeheight, yslope[y]);
ds_xstep = cachedxstep[y] = FixedMul(distance,basexscale);
ds_ystep = cachedystep[y] = FixedMul(distance,baseyscale);
+
+ if ((span = abs(centery-y)))
+ {
+ ds_xstep = cachedxstep[y] = FixedMul(planesin, planeheight) / span;
+ ds_ystep = cachedystep[y] = FixedMul(planecos, planeheight) / span;
+ }
}
else
{
@@ -486,10 +495,9 @@ static void R_RenderFloorSplat(floorsplat_t *pSplat, vertex_t *verts, UINT8 *pTe
ds_xstep = cachedxstep[y];
ds_ystep = cachedystep[y];
}
- length = FixedMul(distance, distscale[x1]);
- angle = (viewangle + xtoviewangle[x1])>>ANGLETOFINESHIFT;
- ds_xfrac = viewx + FixedMul(FINECOSINE(angle), length);
- ds_yfrac = -viewy - FixedMul(FINESINE(angle), length);
+
+ ds_xfrac = xoffs + FixedMul(planecos, distance) + (x1 - centerx) * ds_xstep;
+ ds_yfrac = yoffs - FixedMul(planesin, distance) + (x1 - centerx) * ds_ystep;
ds_xfrac -= offsetx;
ds_yfrac += offsety;
diff --git a/src/r_splats.h b/src/r_splats.h
index 349d8fa7a..387b29582 100644
--- a/src/r_splats.h
+++ b/src/r_splats.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/r_state.h b/src/r_state.h
index 91c2092e9..9c8ce51d6 100644
--- a/src/r_state.h
+++ b/src/r_state.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/r_things.c b/src/r_things.c
index e2f1a896b..7a9569c2b 100644
--- a/src/r_things.c
+++ b/src/r_things.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -379,11 +379,17 @@ void R_AddSpriteDefs(UINT16 wadnum)
UINT16 start, end;
char wadname[MAX_WADPATH];
+<<<<<<< HEAD
// Find the sprites section in this resource file.
if (wadfiles[wadnum]->type == RET_PK3)
start = W_CheckNumForFolderStartPK3("Sprites/", wadnum, 0);
else
{
+=======
+ switch (wadfiles[wadnum]->type)
+ {
+ case RET_WAD:
+>>>>>>> public_next-20190101
start = W_CheckNumForNamePwad("S_START", wadnum, 0);
if (start == INT16_MAX)
start = W_CheckNumForNamePwad("SS_START", wadnum, 0); //deutex compatib.
@@ -391,6 +397,7 @@ void R_AddSpriteDefs(UINT16 wadnum)
start = 0; //let say S_START is lump 0
else
start++; // just after S_START
+<<<<<<< HEAD
}
// ignore skin wads (we don't want skin sprites interfering with vanilla sprites)
@@ -404,6 +411,18 @@ void R_AddSpriteDefs(UINT16 wadnum)
end = W_CheckNumForNamePwad("S_END",wadnum,start);
if (end == INT16_MAX)
end = W_CheckNumForNamePwad("SS_END",wadnum,start); //deutex compatib.
+=======
+ end = W_CheckNumForNamePwad("S_END",wadnum,start);
+ if (end == INT16_MAX)
+ end = W_CheckNumForNamePwad("SS_END",wadnum,start); //deutex compatib.
+ break;
+ case RET_PK3:
+ start = W_CheckNumForFolderStartPK3("Sprites/", wadnum, 0);
+ end = W_CheckNumForFolderEndPK3("Sprites/", wadnum, start);
+ break;
+ default:
+ return;
+>>>>>>> public_next-20190101
}
if (end == INT16_MAX)
@@ -1868,7 +1887,7 @@ static void R_CreateDrawNodes(void)
plane = ds->curline->polyseg->visplane;
R_PlaneBounds(plane);
- if (plane->low < con_clipviewtop || plane->high > vid.height || plane->high > plane->low)
+ if (plane->low < 0 || plane->high > vid.height || plane->high > plane->low)
;
else {
// Put it in!
@@ -1897,7 +1916,7 @@ static void R_CreateDrawNodes(void)
plane = ds->ffloorplanes[p];
R_PlaneBounds(plane);
- if (plane->low < con_clipviewtop || plane->high > vid.height || plane->high > plane->low || plane->polyobj)
+ if (plane->low < 0 || plane->high > vid.height || plane->high > plane->low || plane->polyobj)
{
ds->ffloorplanes[p] = NULL;
continue;
@@ -1934,7 +1953,7 @@ static void R_CreateDrawNodes(void)
plane = PolyObjects[i].visplane;
R_PlaneBounds(plane);
- if (plane->low < con_clipviewtop || plane->high > vid.height || plane->high > plane->low)
+ if (plane->low < 0 || plane->high > vid.height || plane->high > plane->low)
{
PolyObjects[i].visplane = NULL;
continue;
@@ -2631,7 +2650,7 @@ void SetPlayerSkin(INT32 playernum, const char *skinname)
if (P_IsLocalPlayer(player))
CONS_Alert(CONS_WARNING, M_GetText("Skin '%s' not found.\n"), skinname);
- else if(server || adminplayer == consoleplayer)
+ else if(server || IsPlayerAdmin(consoleplayer))
CONS_Alert(CONS_WARNING, M_GetText("Player %d (%s) skin '%s' not found\n"), playernum, player_names[playernum], skinname);
SetPlayerSkinByNum(playernum, 0);
@@ -2714,9 +2733,15 @@ void SetPlayerSkinByNum(INT32 playernum, INT32 skinnum)
}
if (P_IsLocalPlayer(player))
+<<<<<<< HEAD
CONS_Alert(CONS_WARNING, M_GetText("Requested skin not found\n"));
else if(server || adminplayer == consoleplayer)
CONS_Alert(CONS_WARNING, "Player %d (%s) skin not found\n", playernum, player_names[playernum]);
+=======
+ CONS_Alert(CONS_WARNING, M_GetText("Skin %d not found\n"), skinnum);
+ else if(server || IsPlayerAdmin(consoleplayer))
+ CONS_Alert(CONS_WARNING, "Player %d (%s) skin %d not found\n", playernum, player_names[playernum], skinnum);
+>>>>>>> public_next-20190101
SetPlayerSkinByNum(playernum, 0); // not found put the sonic skin
}
diff --git a/src/r_things.h b/src/r_things.h
index 508da6a54..b810cd4ab 100644
--- a/src/r_things.h
+++ b/src/r_things.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -246,6 +246,7 @@ FUNCMATH FUNCINLINE static ATTRINLINE char R_Frame2Char(UINT8 frame)
FUNCMATH FUNCINLINE static ATTRINLINE UINT8 R_Char2Frame(char cn)
{
#if 0 // 2.1 compat
+ if (cn == '+') return '\\' - 'A'; // PK3 can't use backslash, so use + instead
return cn - 'A';
#else
if (cn >= 'A' && cn <= 'Z') return cn - 'A';
diff --git a/src/s_sound.c b/src/s_sound.c
index ada4be6df..2aa8ad554 100644
--- a/src/s_sound.c
+++ b/src/s_sound.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -51,6 +51,11 @@ static void SetChannelsNum(void);
static void Command_Tunes_f(void);
static void Command_RestartAudio_f(void);
+// Sound system toggles
+static void GameMIDIMusic_OnChange(void);
+static void GameSounds_OnChange(void);
+static void GameDigiMusic_OnChange(void);
+
// commands for music and sound servers
#ifdef MUSSERV
consvar_t musserver_cmd = {"musserver_cmd", "musserver", CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
@@ -97,6 +102,11 @@ consvar_t cv_numChannels = {"snd_channels", "32", CV_SAVE|CV_CALL, CV_Unsigned,
static consvar_t surround = {"surround", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_resetmusic = {"resetmusic", "No", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
+// Sound system toggles, saved into the config
+consvar_t cv_gamedigimusic = {"digimusic", "On", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, GameDigiMusic_OnChange, 0, NULL, NULL, 0, 0, NULL};
+consvar_t cv_gamemidimusic = {"midimusic", "On", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, GameMIDIMusic_OnChange, 0, NULL, NULL, 0, 0, NULL};
+consvar_t cv_gamesounds = {"sounds", "On", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, GameSounds_OnChange, 0, NULL, NULL, 0, 0, NULL};
+
#define S_MAX_VOLUME 127
// when to clip out sounds
@@ -252,6 +262,9 @@ void S_RegisterSoundStuff(void)
CV_RegisterVar(&surround);
CV_RegisterVar(&cv_samplerate);
CV_RegisterVar(&cv_resetmusic);
+ CV_RegisterVar(&cv_gamesounds);
+ CV_RegisterVar(&cv_gamedigimusic);
+ CV_RegisterVar(&cv_gamemidimusic);
COM_AddCommand("tunes", Command_Tunes_f);
COM_AddCommand("restartaudio", Command_RestartAudio_f);
@@ -1731,3 +1744,104 @@ static void Command_RestartAudio_f(void)
if (Playing()) // Gotta make sure the player is in a level
P_RestoreMusic(&players[consoleplayer]);
}
+
+void GameSounds_OnChange(void)
+{
+ if (M_CheckParm("-nosound"))
+ return;
+
+ if (sound_disabled)
+ {
+ sound_disabled = false;
+ S_InitSfxChannels(cv_soundvolume.value);
+ S_StartSound(NULL, sfx_strpst);
+ }
+ else
+ {
+ sound_disabled = true;
+ S_StopSounds();
+ }
+}
+
+void GameDigiMusic_OnChange(void)
+{
+ if (M_CheckParm("-nomusic"))
+ return;
+ else if (M_CheckParm("-nodigmusic"))
+ return;
+
+ if (digital_disabled)
+ {
+ digital_disabled = false;
+ I_InitMusic();
+ S_StopMusic();
+ if (Playing())
+ P_RestoreMusic(&players[consoleplayer]);
+ else
+ S_ChangeMusicInternal("lclear", false);
+ }
+ else
+ {
+ digital_disabled = true;
+ if (S_MusicType() != MU_MID)
+ {
+ if (midi_disabled)
+ S_StopMusic();
+ else
+ {
+ char mmusic[7];
+ UINT16 mflags;
+ boolean looping;
+
+ if (S_MusicInfo(mmusic, &mflags, &looping) && S_MIDIExists(mmusic))
+ {
+ S_StopMusic();
+ S_ChangeMusic(mmusic, mflags, looping);
+ }
+ else
+ S_StopMusic();
+ }
+ }
+ }
+}
+
+void GameMIDIMusic_OnChange(void)
+{
+ if (M_CheckParm("-nomusic"))
+ return;
+ else if (M_CheckParm("-nomidimusic"))
+ return;
+
+ if (midi_disabled)
+ {
+ midi_disabled = false;
+ I_InitMusic();
+ if (Playing())
+ P_RestoreMusic(&players[consoleplayer]);
+ else
+ S_ChangeMusicInternal("lclear", false);
+ }
+ else
+ {
+ midi_disabled = true;
+ if (S_MusicType() == MU_MID)
+ {
+ if (digital_disabled)
+ S_StopMusic();
+ else
+ {
+ char mmusic[7];
+ UINT16 mflags;
+ boolean looping;
+
+ if (S_MusicInfo(mmusic, &mflags, &looping) && S_DigExists(mmusic))
+ {
+ S_StopMusic();
+ S_ChangeMusic(mmusic, mflags, looping);
+ }
+ else
+ S_StopMusic();
+ }
+ }
+ }
+}
diff --git a/src/s_sound.h b/src/s_sound.h
index 0fcaace5e..8c03820f1 100644
--- a/src/s_sound.h
+++ b/src/s_sound.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -27,6 +27,9 @@ extern consvar_t stereoreverse;
extern consvar_t cv_soundvolume, cv_closedcaptioning, cv_digmusicvolume, cv_midimusicvolume;
extern consvar_t cv_numChannels;
extern consvar_t cv_resetmusic;
+extern consvar_t cv_gamedigimusic;
+extern consvar_t cv_gamemidimusic;
+extern consvar_t cv_gamesounds;
#ifdef SNDSERV
extern consvar_t sndserver_cmd, sndserver_arg;
diff --git a/src/screen.c b/src/screen.c
index 9ea996bf9..ac7878c4a 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -310,14 +310,6 @@ void SCR_Recalc(void)
if (automapactive)
AM_Stop();
- // r_plane stuff: visplanes, openings, floorclip, ceilingclip, spanstart,
- // spanstop, yslope, distscale, cachedheight, cacheddistance,
- // cachedxstep, cachedystep
- // -> allocated at the maximum vidsize, static.
-
- // r_main: xtoviewangle, allocated at the maximum size.
- // r_things: negonearray, screenheightarray allocated max. size.
-
// set the screen[x] ptrs on the new vidbuffers
V_Init();
diff --git a/src/screen.h b/src/screen.h
index 4d4fbb88b..7aa6fdb63 100644
--- a/src/screen.h
+++ b/src/screen.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt
index 7f6771262..f7b7c7ba4 100644
--- a/src/sdl/CMakeLists.txt
+++ b/src/sdl/CMakeLists.txt
@@ -3,7 +3,18 @@
set(SRB2_CONFIG_SDL2_USEMIXER ON CACHE BOOL "Use SDL2_mixer or regular sdl sound")
if(${SRB2_CONFIG_SDL2_USEMIXER})
- find_package(SDL2_mixer)
+ if(${SRB2_CONFIG_USE_INTERNAL_LIBRARIES})
+ set(SDL2_MIXER_FOUND ON)
+ if(${SRB2_SYSTEM_BITS} EQUAL 64)
+ set(SDL2_MIXER_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/libs/SDL2_mixer/x86_64-w64-mingw32/include/SDL2)
+ set(SDL2_MIXER_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/SDL2_mixer/x86_64-w64-mingw32/lib -lSDL2_mixer")
+ else() # 32-bit
+ set(SDL2_MIXER_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/libs/SDL2_mixer/i686-w64-mingw32/include/SDL2)
+ set(SDL2_MIXER_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/SDL2_mixer/i686-w64-mingw32/lib -lSDL2_mixer")
+ endif()
+ else()
+ find_package(SDL2_mixer)
+ endif()
if(${SDL2_MIXER_FOUND})
set(SRB2_HAVE_MIXER ON)
set(SRB2_SDL2_SOUNDIMPL mixer_sound.c)
@@ -42,7 +53,18 @@ set(SRB2_SDL2_HEADERS
source_group("Interface Code" FILES ${SRB2_SDL2_SOURCES} ${SRB2_SDL2_HEADERS})
# Dependency
-find_package(SDL2)
+if(${SRB2_CONFIG_USE_INTERNAL_LIBRARIES})
+ set(SDL2_FOUND ON)
+ if(${SRB2_SYSTEM_BITS} EQUAL 64)
+ set(SDL2_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/libs/SDL2/x86_64-w64-mingw32/include/SDL2)
+ set(SDL2_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/SDL2/x86_64-w64-mingw32/lib -lSDL2")
+ else() # 32-bit
+ set(SDL2_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/libs/SDL2/i686-w64-mingw32/include/SDL2)
+ set(SDL2_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/SDL2/i686-w64-mingw32/lib -lSDL2")
+ endif()
+else()
+ find_package(SDL2)
+endif()
if(${SDL2_FOUND})
set(SRB2_SDL2_TOTAL_SOURCES
@@ -185,7 +207,18 @@ if(${SDL2_FOUND})
endif()
if(MSVC)
- find_package(SDL2_MAIN REQUIRED)
+ if(${SRB2_CONFIG_USE_INTERNAL_LIBRARIES})
+ set(SDL2_MAIN_FOUND ON)
+ if(${SRB2_SYSTEM_BITS} EQUAL 64)
+ set(SDL2_MAIN_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/libs/SDL2/x86_64-w64-mingw32/include/SDL2)
+ set(SDL2_MAIN_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/SDL2/x86_64-w64-mingw32/lib -lSDL2main")
+ else() # 32-bit
+ set(SDL2_MAIN_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/libs/SDL2/i686-w64-mingw32/include/SDL2)
+ set(SDL2_MAIN_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/SDL2/i686-w64-mingw32/lib -lSDL2main")
+ endif()
+ else()
+ find_package(SDL2_MAIN REQUIRED)
+ endif()
target_link_libraries(SRB2SDL2 PRIVATE
${SDL2_MAIN_LIBRARIES}
)
@@ -241,17 +274,49 @@ if(${SDL2_FOUND})
if(${CMAKE_SYSTEM} MATCHES Windows)
set(win_extra_dll_list "")
macro(getwinlib dllname defaultname)
- find_library(SRB2_SDL2_DLL_${dllname} "${defaultname}")
- list(APPEND win_extra_dll_list ${SRB2_SDL2_DLL_${dllname}})
+ if(${SRB2_CONFIG_USE_INTERNAL_LIBRARIES})
+ if (${CMAKE_GENERATOR} STREQUAL "MinGW Makefiles")
+ if(${SRB2_SYSTEM_BITS} EQUAL 64)
+ find_library(SRB2_SDL2_DLL_${dllname} "${defaultname}"
+ HINTS ${CMAKE_SOURCE_DIR}/libs/dll-binaries/x86_64
+ HINTS ${CMAKE_SOURCE_DIR}/libs/SDL2/x86_64-w64-mingw32/bin
+ HINTS ${CMAKE_SOURCE_DIR}/libs/SDL2_mixer/x86_64-w64-mingw32/bin
+ )
+ else()
+ find_library(SRB2_SDL2_DLL_${dllname} "${defaultname}"
+ HINTS ${CMAKE_SOURCE_DIR}/libs/dll-binaries/i686
+ HINTS ${CMAKE_SOURCE_DIR}/libs/SDL2/i686-w64-mingw32/bin
+ HINTS ${CMAKE_SOURCE_DIR}/libs/SDL2_mixer/i686-w64-mingw32/bin
+ )
+ endif()
+ else()
+ if(${SRB2_SYSTEM_BITS} EQUAL 64)
+ find_library(SRB2_SDL2_DLL_${dllname} "${defaultname}"
+ HINTS ${CMAKE_SOURCE_DIR}/libs/dll-binaries/x86_64
+ HINTS ${CMAKE_SOURCE_DIR}/libs/SDL2/lib/x64
+ HINTS ${CMAKE_SOURCE_DIR}/libs/SDL2_mixer/lib/x64
+ )
+ else()
+ find_library(SRB2_SDL2_DLL_${dllname} "${defaultname}"
+ HINTS ${CMAKE_SOURCE_DIR}/libs/dll-binaries/i686
+ HINTS ${CMAKE_SOURCE_DIR}/libs/SDL2/lib/x86
+ HINTS ${CMAKE_SOURCE_DIR}/libs/SDL2_mixer/lib/x86
+ )
+ endif()
+ endif()
+
+ list(APPEND win_extra_dll_list ${SRB2_SDL2_DLL_${dllname}})
+ else()
+ find_library(SRB2_SDL2_DLL_${dllname} "${defaultname}")
+ list(APPEND win_extra_dll_list ${SRB2_SDL2_DLL_${dllname}})
+ endif()
endmacro()
getwinlib(SDL2 "SDL2.dll")
if(${SRB2_CONFIG_SDL2_USEMIXER})
getwinlib(SDL2_mixer "SDL2_mixer.dll")
- getwinlib(libmikmod-2 "libmikmod-2.dll")
getwinlib(libogg_0 "libogg-0.dll")
getwinlib(libvorbis_0 "libvorbis-0.dll")
getwinlib(libvorbisfile_3 "libvorbisfile-3.dll")
- getwinlib(smpeg2 "smpeg2.dll")
endif()
if(${SRB2_CONFIG_HAVE_GME})
getwinlib(libgme "libgme.dll")
diff --git a/src/sdl/Srb2SDL-vc10.vcxproj b/src/sdl/Srb2SDL-vc10.vcxproj
index 00ed0db39..04af6a8e1 100644
--- a/src/sdl/Srb2SDL-vc10.vcxproj
+++ b/src/sdl/Srb2SDL-vc10.vcxproj
@@ -1,10 +1,26 @@

+
+ Debug
+ ARM
+
+
+ Debug
+ ARM64
+
Debug
Win32
+
+ Release
+ ARM
+
+
+ Release
+ ARM64
+
Release
Win32
@@ -23,27 +39,50 @@
{61BA7D3C-F77D-4D31-B718-1177FE482CF2}
Win32Proj
Srb2SDL
- 8.1
+ 10.0.16299.0
Srb2Win
-
- v140
-
+ v140
true
+
+ v141
+ true
+ true
+
+ v140
false
true
+
+ v141
+ false
+ true
+ true
+
+ v140
true
+
+ v141
+ true
+ true
+
+ v140
false
true
+
+ v141
+ false
+ true
+ true
+
@@ -60,23 +99,59 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
<_ProjectFileVersion>10.0.30319.1
false
+
+
+ ProgramDatabase
+ false
+
+
+ setupapi.lib;winmm.lib;imm32.lib;version.lib;ole32.lib;advapi32.lib;shell32.lib;gdi32.lib;oleaut32.lib;uuid.lib;%(AdditionalDependencies)
+
+
+
+
+ ProgramDatabase
+ false
+
+
+
+
+ setupapi.lib;winmm.lib;imm32.lib;version.lib;ole32.lib;advapi32.lib;shell32.lib;gdi32.lib;oleaut32.lib;uuid.lib;%(AdditionalDependencies)
+
+
{72b01aca-7a1a-4f7b-acef-2607299cf052}
diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c
index 0963cc288..0f7f82e84 100644
--- a/src/sdl/i_system.c
+++ b/src/sdl/i_system.c
@@ -893,8 +893,8 @@ void I_GetJoystickEvents(void)
UINT64 joyhats = 0;
#if 0
UINT64 joybuttons = 0;
-#endif
Sint16 axisx, axisy;
+#endif
if (!joystick_started) return;
@@ -962,6 +962,7 @@ void I_GetJoystickEvents(void)
}
}
+#if 0
// send joystick axis positions
event.type = ev_joystick;
@@ -1012,6 +1013,7 @@ void I_GetJoystickEvents(void)
}
D_PostEvent(&event);
}
+#endif
}
/** \brief Open joystick handle
@@ -1175,8 +1177,8 @@ void I_GetJoystick2Events(void)
UINT64 joyhats = 0;
#if 0
INT64 joybuttons = 0;
-#endif
INT32 axisx, axisy;
+#endif
if (!joystick2_started)
return;
@@ -1246,6 +1248,7 @@ void I_GetJoystick2Events(void)
}
}
+#if 0
// send joystick axis positions
event.type = ev_joystick2;
@@ -1296,7 +1299,7 @@ void I_GetJoystick2Events(void)
}
D_PostEvent(&event);
}
-
+#endif
}
/** \brief Open joystick handle
@@ -1452,18 +1455,28 @@ INT32 I_NumJoys(void)
return numjoy;
}
+static char joyname[255]; // MAX_PATH; joystick name is straight from the driver
+
const char *I_GetJoyName(INT32 joyindex)
{
- const char *joyname = "NA";
+ const char *tempname = NULL;
joyindex--; //SDL's Joystick System starts at 0, not 1
if (SDL_WasInit(SDL_INIT_JOYSTICK) == 0)
{
if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) != -1)
- joyname = SDL_JoystickNameForIndex(joyindex);
+ {
+ tempname = SDL_JoystickNameForIndex(joyindex);
+ if (tempname)
+ strncpy(joyname, tempname, 255);
+ }
SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
}
else
- joyname = SDL_JoystickNameForIndex(joyindex);
+ {
+ tempname = SDL_JoystickNameForIndex(joyindex);
+ if (tempname)
+ strncpy(joyname, tempname, 255);
+ }
return joyname;
}
@@ -2138,6 +2151,8 @@ void I_Quit(void)
printf("\r");
ShowEndTxt();
}
+ if (myargmalloc)
+ free(myargv); // Deallocate allocated memory
death:
W_Shutdown();
exit(0);
diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c
index 05ed527de..2c8deddb4 100644
--- a/src/sdl/i_video.c
+++ b/src/sdl/i_video.c
@@ -200,7 +200,10 @@ static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen)
}
// Reposition window only in windowed mode
SDL_SetWindowSize(window, width, height);
- SDL_SetWindowPosition(window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED);
+ SDL_SetWindowPosition(window,
+ SDL_WINDOWPOS_CENTERED_DISPLAY(SDL_GetWindowDisplayIndex(window)),
+ SDL_WINDOWPOS_CENTERED_DISPLAY(SDL_GetWindowDisplayIndex(window))
+ );
}
}
else
@@ -357,6 +360,7 @@ static INT32 Impl_SDL_Scancode_To_Keycode(SDL_Scancode code)
static void SDLdoUngrabMouse(void)
{
+ SDL_ShowCursor(SDL_ENABLE);
SDL_SetWindowGrab(window, SDL_FALSE);
wrapmouseok = SDL_FALSE;
SDL_SetRelativeMouseMode(SDL_FALSE);
@@ -366,6 +370,7 @@ void SDLforceUngrabMouse(void)
{
if (SDL_WasInit(SDL_INIT_VIDEO)==SDL_INIT_VIDEO && window != NULL)
{
+ SDL_ShowCursor(SDL_ENABLE);
SDL_SetWindowGrab(window, SDL_FALSE);
wrapmouseok = SDL_FALSE;
SDL_SetRelativeMouseMode(SDL_FALSE);
@@ -575,6 +580,8 @@ static void Impl_HandleWindowEvent(SDL_WindowEvent evt)
if (cv_usemouse.value) I_StartupMouse();
}
//else firsttimeonmouse = SDL_FALSE;
+
+ capslock = !!( SDL_GetModState() & KMOD_CAPS );// in case CL changes
}
else if (!mousefocus && !kbfocus)
{
@@ -767,6 +774,33 @@ static void Impl_HandleJoystickAxisEvent(SDL_JoyAxisEvent evt)
D_PostEvent(&event);
}
+#if 0
+static void Impl_HandleJoystickHatEvent(SDL_JoyHatEvent evt)
+{
+ event_t event;
+ SDL_JoystickID joyid[2];
+
+ // Determine the Joystick IDs for each current open joystick
+ joyid[0] = SDL_JoystickInstanceID(JoyInfo.dev);
+ joyid[1] = SDL_JoystickInstanceID(JoyInfo2.dev);
+
+ if (evt.hat >= JOYHATS)
+ return; // ignore hats with too high an index
+
+ if (evt.which == joyid[0])
+ {
+ event.data1 = KEY_HAT1 + (evt.hat*4);
+ }
+ else if (evt.which == joyid[1])
+ {
+ event.data1 = KEY_2HAT1 + (evt.hat*4);
+ }
+ else return;
+
+ // NOTE: UNFINISHED
+}
+#endif
+
static void Impl_HandleJoystickButtonEvent(SDL_JoyButtonEvent evt, Uint32 type)
{
event_t event;
@@ -804,6 +838,8 @@ static void Impl_HandleJoystickButtonEvent(SDL_JoyButtonEvent evt, Uint32 type)
if (event.type != ev_console) D_PostEvent(&event);
}
+
+
void I_GetEvent(void)
{
SDL_Event evt;
@@ -844,6 +880,11 @@ void I_GetEvent(void)
case SDL_JOYAXISMOTION:
Impl_HandleJoystickAxisEvent(evt.jaxis);
break;
+#if 0
+ case SDL_JOYHATMOTION:
+ Impl_HandleJoystickHatEvent(evt.jhat)
+ break;
+#endif
case SDL_JOYBUTTONUP:
case SDL_JOYBUTTONDOWN:
Impl_HandleJoystickButtonEvent(evt.jbutton, evt.type);
@@ -1520,9 +1561,18 @@ void I_StartupGraphics(void)
realheight = (Uint16)vid.height;
VID_Command_Info_f();
- if (!disable_mouse) SDL_ShowCursor(SDL_DISABLE);
SDLdoUngrabMouse();
+ SDL_RaiseWindow(window);
+
+ if (mousegrabok && !disable_mouse)
+ {
+ SDL_ShowCursor(SDL_DISABLE);
+ SDL_SetRelativeMouseMode(SDL_TRUE);
+ wrapmouseok = SDL_TRUE;
+ SDL_SetWindowGrab(window, SDL_TRUE);
+ }
+
graphics_started = true;
}
diff --git a/src/sdl/macosx/Srb2mac.icns b/src/sdl/macosx/Srb2mac.icns
index 4baedc1c5..96cb8a36d 100644
Binary files a/src/sdl/macosx/Srb2mac.icns and b/src/sdl/macosx/Srb2mac.icns differ
diff --git a/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj b/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj
index eaac87deb..94a3fbb63 100644
--- a/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj
+++ b/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj
@@ -1214,7 +1214,7 @@
C01FCF4B08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- CURRENT_PROJECT_VERSION = 2.1.20;
+ CURRENT_PROJECT_VERSION = 2.1.23;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
NORMALSRB2,
@@ -1226,7 +1226,7 @@
C01FCF4C08A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- CURRENT_PROJECT_VERSION = 2.1.20;
+ CURRENT_PROJECT_VERSION = 2.1.23;
GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_PREPROCESSOR_DEFINITIONS = (
diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c
index a3c421991..6e90a6e06 100644
--- a/src/sdl/mixer_sound.c
+++ b/src/sdl/mixer_sound.c
@@ -50,8 +50,8 @@
#ifdef HAVE_LIBGME
#include "gme/gme.h"
-#define GME_TREBLE 5.0
-#define GME_BASS 1.0
+#define GME_TREBLE 5.0f
+#define GME_BASS 1.0f
#ifdef HAVE_ZLIB
#ifndef _MSC_VER
@@ -92,6 +92,12 @@ void I_StartupSound(void)
{
I_Assert(!sound_started);
+#ifdef _WIN32
+ // Force DirectSound instead of WASAPI
+ // SDL 2.0.6+ defaults to the latter and it screws up our sound effects
+ SDL_setenv("SDL_AUDIODRIVER", "directsound", 1);
+#endif
+
// EE inits audio first so we're following along.
if (SDL_WasInit(SDL_INIT_AUDIO) == SDL_INIT_AUDIO)
{
@@ -759,6 +765,7 @@ void I_UnloadSong(void)
boolean I_PlaySong(boolean looping)
{
+ boolean lpz = fpclassify(loop_point) == FP_ZERO;
#ifdef HAVE_LIBGME
if (gme)
{
@@ -772,14 +779,15 @@ boolean I_PlaySong(boolean looping)
if (!music)
return false;
- if (Mix_PlayMusic(music, looping && loop_point == 0.0f ? -1 : 0) == -1)
+
+ if (Mix_PlayMusic(music, looping && lpz ? -1 : 0) == -1)
{
CONS_Alert(CONS_ERROR, "Mix_PlayMusic: %s\n", Mix_GetError());
return false;
}
Mix_VolumeMusic((UINT32)music_volume*128/31);
- if (loop_point != 0.0f)
+ if (!lpz)
Mix_HookMusicFinished(music_loop);
return true;
}
diff --git a/src/sdl/sdl_sound.c b/src/sdl/sdl_sound.c
index ebd615de2..9ff1dd0b2 100644
--- a/src/sdl/sdl_sound.c
+++ b/src/sdl/sdl_sound.c
@@ -1186,6 +1186,12 @@ void I_StartupSound(void)
// Configure sound device
CONS_Printf("I_StartupSound:\n");
+#ifdef _WIN32
+ // Force DirectSound instead of WASAPI
+ // SDL 2.0.6+ defaults to the latter and it screws up our sound effects
+ SDL_setenv("SDL_AUDIODRIVER", "directsound", 1);
+#endif
+
// EE inits audio first so we're following along.
if (SDL_WasInit(SDL_INIT_AUDIO) == SDL_INIT_AUDIO)
CONS_Printf("SDL Audio already started\n");
diff --git a/src/sdl/sdlmain.h b/src/sdl/sdlmain.h
index fea1e1648..d12daaa8a 100644
--- a/src/sdl/sdlmain.h
+++ b/src/sdl/sdlmain.h
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// Copyright (C) 2006 by Sonic Team Jr.
+// Copyright (C) 2006-2018 by Sonic Team Jr.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
diff --git a/src/sounds.c b/src/sounds.c
index 35b21e590..7408dec42 100644
--- a/src/sounds.c
+++ b/src/sounds.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/sounds.h b/src/sounds.h
index 5fffc7b2e..f4847b226 100644
--- a/src/sounds.h
+++ b/src/sounds.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/st_stuff.c b/src/st_stuff.c
index 5728419f1..9ad04b5ce 100644
--- a/src/st_stuff.c
+++ b/src/st_stuff.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -2085,7 +2085,7 @@ static void ST_drawTextHUD(void)
}
if (!splitscreen && dof12)
- textHUDdraw(M_GetText("\x82""F12:""\x80 Switch view"))
+ textHUDdraw(M_GetText("\x82""VIEWPOINT:""\x80 Switch view"))
if (circuitmap)
{
diff --git a/src/st_stuff.h b/src/st_stuff.h
index 9c48a38af..e1d8a8a92 100644
--- a/src/st_stuff.h
+++ b/src/st_stuff.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/string.c b/src/string.c
index d7f8b3679..2a03e8729 100644
--- a/src/string.c
+++ b/src/string.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2006 by Graue.
-// Copyright (C) 2006-2016 by Sonic Team Junior.
+// Copyright (C) 2006-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/tables.c b/src/tables.c
index e181b9aa8..a31572d70 100644
--- a/src/tables.c
+++ b/src/tables.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -37,6 +37,15 @@ unsigned SlopeDiv(unsigned num, unsigned den)
return ans <= SLOPERANGE ? ans : SLOPERANGE;
}
+UINT64 SlopeDivEx(unsigned int num, unsigned int den)
+{
+ UINT64 ans;
+ if (den < 512)
+ return SLOPERANGE;
+ ans = ((UINT64)num<<3)/(den>>8);
+ return ans <= SLOPERANGE ? ans : SLOPERANGE;
+}
+
fixed_t AngleFixed(angle_t af)
{
angle_t wa = ANGLE_180;
diff --git a/src/tables.h b/src/tables.h
index 03e80788a..60db2b5a6 100644
--- a/src/tables.h
+++ b/src/tables.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -81,6 +81,8 @@ extern angle_t tantoangle[SLOPERANGE+1];
// Utility function, called by R_PointToAngle.
FUNCMATH unsigned SlopeDiv(unsigned num, unsigned den);
+// Only called by R_PointToAngleEx
+UINT64 SlopeDivEx(unsigned int num, unsigned int den);
// 360 - angle_t(ANGLE_45) = ANGLE_315
FUNCMATH FUNCINLINE static ATTRINLINE angle_t InvAngle(angle_t a)
diff --git a/src/tmap.nas b/src/tmap.nas
index bb4a8c672..c72c1890a 100644
--- a/src/tmap.nas
+++ b/src/tmap.nas
@@ -1,7 +1,7 @@
;; SONIC ROBO BLAST 2
;;-----------------------------------------------------------------------------
;; Copyright (C) 1998-2000 by DooM Legacy Team.
-;; Copyright (C) 1999-2016 by Sonic Team Junior.
+;; Copyright (C) 1999-2018 by Sonic Team Junior.
;;
;; This program is free software distributed under the
;; terms of the GNU General Public License, version 2.
diff --git a/src/tmap.s b/src/tmap.s
index ea1f1c26c..05c644798 100644
--- a/src/tmap.s
+++ b/src/tmap.s
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -13,7 +13,7 @@
// structures, must match the C structures!
#include "asm_defs.inc"
-// Rappel: seuls EAX, ECX, EDX peuvent ˆtre ‚cras‚s librement.
+// Rappel: seuls EAX, ECX, EDX peuvent �tre �cras�s librement.
// il faut sauver esi,edi, cd...gs
/* Attention aux comparaisons! */
@@ -28,7 +28,7 @@
/* cmp A,B // B-A , set flags */
/* jg B_greater_than_A */
/* */
-/* (soustrait l'op‚rande source DE l'op‚rande destination, */
+/* (soustrait l'op�rande source DE l'op�rande destination, */
/* comme sur Motorola! ) */
// RAPPEL: Intel
@@ -66,7 +66,7 @@ C(vidwidth): .long 0 //use this one out of the inner loops
.globl C(ASM_PatchRowBytes)
C(ASM_PatchRowBytes):
pushl %ebp
- movl %esp, %ebp // assure l'"adressabilit‚ du stack"
+ movl %esp, %ebp // assure l'"adressabilit� du stack"
movl ARG1, %edx // read first arg
movl %edx, C(vidwidth)
diff --git a/src/tmap_asm.s b/src/tmap_asm.s
index e8b7af1cd..99cb0b627 100644
--- a/src/tmap_asm.s
+++ b/src/tmap_asm.s
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/tmap_mmx.nas b/src/tmap_mmx.nas
index 011b2a062..c512de8e9 100644
--- a/src/tmap_mmx.nas
+++ b/src/tmap_mmx.nas
@@ -1,7 +1,7 @@
;; SONIC ROBO BLAST 2
;;-----------------------------------------------------------------------------
;; Copyright (C) 1998-2000 by DOSDOOM.
-;; Copyright (C) 2010-2016 by Sonic Team Junior.
+;; Copyright (C) 2010-2018 by Sonic Team Junior.
;;
;; This program is free software distributed under the
;; terms of the GNU General Public License, version 2.
diff --git a/src/tmap_vc.nas b/src/tmap_vc.nas
index 8fe39ec89..e943d48d8 100644
--- a/src/tmap_vc.nas
+++ b/src/tmap_vc.nas
@@ -1,7 +1,7 @@
;; SONIC ROBO BLAST 2
;;-----------------------------------------------------------------------------
;; Copyright (C) 1998-2000 by DooM Legacy Team.
-;; Copyright (C) 1999-2016 by Sonic Team Junior.
+;; Copyright (C) 1999-2018 by Sonic Team Junior.
;;
;; This program is free software distributed under the
;; terms of the GNU General Public License, version 2.
diff --git a/src/v_video.c b/src/v_video.c
index ae7c08511..6476374ce 100644
--- a/src/v_video.c
+++ b/src/v_video.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -547,8 +547,8 @@ void V_DrawFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_t
return;
#ifdef HWRENDER
- // oh please
- if (rendermode != render_soft && !con_startup)
+ //if (rendermode != render_soft && !con_startup) // Why?
+ if (rendermode != render_soft)
{
HWR_DrawFixedPatch((GLPatch_t *)patch, x, y, pscale, scrn, colormap);
return;
@@ -1311,6 +1311,145 @@ void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c)
memset(dest, c, w * vid.bpp);
}
+#ifdef HWRENDER
+// This is now a function since it's otherwise repeated 2 times and honestly looks retarded:
+static UINT32 V_GetHWConsBackColor(void)
+{
+ UINT32 hwcolor;
+ switch (cons_backcolor.value)
+ {
+ case 0: hwcolor = 0xffffff00; break; // White
+ case 1: hwcolor = 0x80808000; break; // Gray
+ case 2: hwcolor = 0xdeb88700; break; // Sepia
+ case 3: hwcolor = 0x40201000; break; // Brown
+ case 4: hwcolor = 0xfa807200; break; // Pink
+ case 5: hwcolor = 0xff69b400; break; // Raspberry
+ case 6: hwcolor = 0xff000000; break; // Red
+ case 7: hwcolor = 0xffd68300; break; // Creamsicle
+ case 8: hwcolor = 0xff800000; break; // Orange
+ case 9: hwcolor = 0xdaa52000; break; // Gold
+ case 10: hwcolor = 0x80800000; break; // Yellow
+ case 11: hwcolor = 0x00ff0000; break; // Emerald
+ case 12: hwcolor = 0x00800000; break; // Green
+ case 13: hwcolor = 0x4080ff00; break; // Cyan
+ case 14: hwcolor = 0x4682b400; break; // Steel
+ case 15: hwcolor = 0x1e90ff00; break; // Periwinkle
+ case 16: hwcolor = 0x0000ff00; break; // Blue
+ case 17: hwcolor = 0xff00ff00; break; // Purple
+ case 18: hwcolor = 0xee82ee00; break; // Lavender
+ // Default green
+ default: hwcolor = 0x00800000; break;
+ }
+ return hwcolor;
+}
+#endif
+
+
+// THANK YOU MPC!!!
+
+void V_DrawFillConsoleMap(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c)
+{
+ UINT8 *dest;
+ INT32 u, v;
+ UINT8 *fadetable;
+ UINT32 alphalevel = 0;
+
+ if (rendermode == render_none)
+ return;
+
+#ifdef HWRENDER
+ if (rendermode != render_soft && rendermode != render_none)
+ {
+ UINT32 hwcolor = V_GetHWConsBackColor();
+ HWR_DrawConsoleFill(x, y, w, h, hwcolor, c); // we still use the regular color stuff but only for flags. actual draw color is "hwcolor" for this.
+ return;
+ }
+#endif
+
+ if (!(c & V_NOSCALESTART))
+ {
+ INT32 dupx = vid.dupx, dupy = vid.dupy;
+
+ if (x == 0 && y == 0 && w == BASEVIDWIDTH && h == BASEVIDHEIGHT)
+ { // Clear the entire screen, from dest to deststop. Yes, this really works.
+ memset(screens[0], (UINT8)(c&255), vid.width * vid.height * vid.bpp);
+ return;
+ }
+
+ x *= dupx;
+ y *= dupy;
+ w *= dupx;
+ h *= dupy;
+
+ // Center it if necessary
+ if (vid.width != BASEVIDWIDTH * dupx)
+ {
+ // dupx adjustments pretend that screen width is BASEVIDWIDTH * dupx,
+ // so center this imaginary screen
+ if (c & V_SNAPTORIGHT)
+ x += (vid.width - (BASEVIDWIDTH * dupx));
+ else if (!(c & V_SNAPTOLEFT))
+ x += (vid.width - (BASEVIDWIDTH * dupx)) / 2;
+ }
+ if (vid.height != BASEVIDHEIGHT * dupy)
+ {
+ // same thing here
+ if (c & V_SNAPTOBOTTOM)
+ y += (vid.height - (BASEVIDHEIGHT * dupy));
+ else if (!(c & V_SNAPTOTOP))
+ y += (vid.height - (BASEVIDHEIGHT * dupy)) / 2;
+ }
+ }
+
+ if (x >= vid.width || y >= vid.height)
+ return; // off the screen
+ if (x < 0) {
+ w += x;
+ x = 0;
+ }
+ if (y < 0) {
+ h += y;
+ y = 0;
+ }
+
+ if (w <= 0 || h <= 0)
+ return; // zero width/height wouldn't draw anything
+ if (x + w > vid.width)
+ w = vid.width-x;
+ if (y + h > vid.height)
+ h = vid.height-y;
+
+ dest = screens[0] + y*vid.width + x;
+
+ if ((alphalevel = ((c & V_ALPHAMASK) >> V_ALPHASHIFT)))
+ {
+ if (alphalevel == 13)
+ alphalevel = hudminusalpha[cv_translucenthud.value];
+ else if (alphalevel == 14)
+ alphalevel = 10 - cv_translucenthud.value;
+ else if (alphalevel == 15)
+ alphalevel = hudplusalpha[cv_translucenthud.value];
+
+ if (alphalevel >= 10)
+ return; // invis
+ }
+
+ c &= 255;
+
+ // Jimita (12-04-2018)
+ w = min(w, vid.width);
+ h = min(h, vid.height);
+ fadetable = ((UINT8 *)transtables + ((alphalevel-1)<> V_CHARCOLORSHIFT)
{
@@ -1599,6 +1724,32 @@ void V_DrawCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed)
V_DrawScaledPatch(x, y, flags, hu_font[c]);
}
+// Writes a single character for the chat. (draw WHITE if bit 7 set)
+// Essentially the same as the above but it's small or big depending on what resolution you've chosen to huge..
+//
+void V_DrawChatCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed, UINT8 *colormap)
+{
+ INT32 w, flags;
+ //const UINT8 *colormap = V_GetStringColormap(c);
+
+ flags = c & ~(V_CHARCOLORMASK | V_PARAMMASK);
+ c &= 0x7f;
+ if (lowercaseallowed)
+ c -= HU_FONTSTART;
+ else
+ c = toupper(c) - HU_FONTSTART;
+ if (c < 0 || c >= HU_FONTSIZE || !hu_font[c])
+ return;
+
+ w = (vid.width < 640 ) ? (SHORT(hu_font[c]->width)/2) : (SHORT(hu_font[c]->width)); // use normal sized characters if we're using a terribly low resolution.
+ if (x + w > vid.width)
+ return;
+
+ V_DrawFixedPatch(x*FRACUNIT, y*FRACUNIT, (vid.width < 640) ? (FRACUNIT) : (FRACUNIT/2), flags, hu_font[c], colormap);
+
+
+}
+
// Precompile a wordwrapped string to any given width.
// This is a muuuch better method than V_WORDWRAP.
char *V_WordWrap(INT32 x, INT32 w, INT32 option, const char *string)
diff --git a/src/v_video.h b/src/v_video.h
index 84a027963..b0f50d5cb 100644
--- a/src/v_video.h
+++ b/src/v_video.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -151,6 +151,7 @@ void V_DrawScaledPic (INT32 px1, INT32 py1, INT32 scrn, INT32 lumpnum);
// fill a box with a single color
void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c);
+void V_DrawFillConsoleMap(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c);
// fill a box with a flat as a pattern
void V_DrawFlatFill(INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatnum);
@@ -162,11 +163,16 @@ void V_DrawPromptBack(INT32 boxheight, INT32 color);
// draw a single character
void V_DrawCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed);
+// draw a single character, but for the chat
+void V_DrawChatCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed, UINT8 *colormap);
+
+UINT8 *V_GetStringColormap(INT32 colorflags);
void V_DrawLevelTitle(INT32 x, INT32 y, INT32 option, const char *string);
// wordwrap a string using the hu_font
char *V_WordWrap(INT32 x, INT32 w, INT32 option, const char *string);
+UINT8 *V_GetStringColormap(INT32 colorflags);
// draw a string using the hu_font
void V_DrawString(INT32 x, INT32 y, INT32 option, const char *string);
diff --git a/src/vid_copy.s b/src/vid_copy.s
index 9d8e7d4e0..050a80999 100644
--- a/src/vid_copy.s
+++ b/src/vid_copy.s
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/w_wad.c b/src/w_wad.c
index 258552950..536e07a7a 100644
--- a/src/w_wad.c
+++ b/src/w_wad.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -77,14 +77,30 @@ int snprintf(char *str, size_t n, const char *fmt, ...);
#define O_BINARY 0
#endif
-#if defined(_MSC_VER)
-#pragma pack(1)
+#ifdef HAVE_ZLIB
+#ifndef _MSC_VER
+#ifndef _LARGEFILE64_SOURCE
+#define _LARGEFILE64_SOURCE
+#endif
#endif
+<<<<<<< HEAD
#if defined(_MSC_VER)
#pragma pack()
+=======
+#ifndef _LFS64_LARGEFILE
+#define _LFS64_LARGEFILE
#endif
+#ifndef _FILE_OFFSET_BITS
+#define _FILE_OFFSET_BITS 0
+#endif
+
+#include "zlib.h"
+>>>>>>> public_next-20190101
+#endif
+
+
typedef struct
{
const char *name;
@@ -119,10 +135,13 @@ void W_Shutdown(void)
while (numwadfiles--)
{
fclose(wadfiles[numwadfiles]->handle);
- Z_Free(wadfiles[numwadfiles]->lumpinfo);
Z_Free(wadfiles[numwadfiles]->filename);
while (wadfiles[numwadfiles]->numlumps--)
Z_Free(wadfiles[numwadfiles]->lumpinfo[wadfiles[numwadfiles]->numlumps].name2);
+<<<<<<< HEAD
+=======
+ Z_Free(wadfiles[numwadfiles]->lumpinfo);
+>>>>>>> public_next-20190101
Z_Free(wadfiles[numwadfiles]);
}
}
@@ -190,7 +209,11 @@ static inline void W_LoadDehackedLumpsPK3(UINT16 wadnum)
if (posStart != INT16_MAX)
{
posEnd = W_CheckNumForFolderEndPK3("Lua/", wadnum, posStart);
+<<<<<<< HEAD
posStart++; // first "lump" will be "Lua/" folder itself, so ignore it
+=======
+ posStart++;
+>>>>>>> public_next-20190101
for (; posStart < posEnd; posStart++)
LUA_LoadLump(wadnum, posStart);
}
@@ -198,7 +221,11 @@ static inline void W_LoadDehackedLumpsPK3(UINT16 wadnum)
if (posStart != INT16_MAX)
{
posEnd = W_CheckNumForFolderEndPK3("SOC/", wadnum, posStart);
+<<<<<<< HEAD
posStart++; // first "lump" will be "SOC/" folder itself, so ignore it
+=======
+ posStart++;
+>>>>>>> public_next-20190101
for(; posStart < posEnd; posStart++)
{
lumpinfo_t *lump_p = &wadfiles[wadnum]->lumpinfo[posStart];
@@ -206,11 +233,18 @@ static inline void W_LoadDehackedLumpsPK3(UINT16 wadnum)
char *name = malloc(length + 1);
sprintf(name, "%s|%s", wadfiles[wadnum]->filename, lump_p->name2);
name[length] = '\0';
+<<<<<<< HEAD
+=======
+>>>>>>> public_next-20190101
CONS_Printf(M_GetText("Loading SOC from %s\n"), name);
DEH_LoadDehackedLumpPwad(wadnum, posStart);
free(name);
}
+<<<<<<< HEAD
+=======
+
+>>>>>>> public_next-20190101
}
}
@@ -234,10 +268,17 @@ static inline void W_LoadDehackedLumps(UINT16 wadnum)
for (lump = 0; lump < wadfiles[wadnum]->numlumps; lump++, lump_p++)
if (memcmp(lump_p->name,"SOC_",4)==0) // Check for generic SOC lump
{ // shameless copy+paste of code from LUA_LoadLump
+<<<<<<< HEAD
size_t len = strlen(wadfiles[wadnum]->filename) + 1 + strlen(lump_p->name2); // length of file name, '|', and lump name
char *name = malloc(len+1);
sprintf(name, "%s|%s", wadfiles[wadnum]->filename, lump_p->name2);
name[len] = '\0';
+=======
+ size_t length = strlen(wadfiles[wadnum]->filename) + 1 + strlen(lump_p->name2); // length of file name, '|', and lump name
+ char *name = malloc(length + 1);
+ sprintf(name, "%s|%s", wadfiles[wadnum]->filename, lump_p->name2);
+ name[length] = '\0';
+>>>>>>> public_next-20190101
CONS_Printf(M_GetText("Loading SOC from %s\n"), name);
DEH_LoadDehackedLumpPwad(wadnum, lump);
@@ -313,6 +354,324 @@ static void W_InvalidateLumpnumCache(void)
memset(lumpnumcache, 0, sizeof (lumpnumcache));
}
+/** Detect a file type.
+ * \todo Actually detect the wad/pkzip headers and whatnot, instead of just checking the extensions.
+ */
+static restype_t ResourceFileDetect (const char* filename)
+{
+ if (!stricmp(&filename[strlen(filename) - 4], ".pk3"))
+ return RET_PK3;
+ if (!stricmp(&filename[strlen(filename) - 4], ".soc"))
+ return RET_SOC;
+ if (!stricmp(&filename[strlen(filename) - 4], ".lua"))
+ return RET_LUA;
+
+ return RET_WAD;
+}
+
+/** Create a 1-lump lumpinfo_t for standalone files.
+ */
+static lumpinfo_t* ResGetLumpsStandalone (FILE* handle, UINT16* numlumps, const char* lumpname)
+{
+ lumpinfo_t* lumpinfo = Z_Calloc(sizeof (*lumpinfo), PU_STATIC, NULL);
+ lumpinfo = Z_Calloc(sizeof (*lumpinfo), PU_STATIC, NULL);
+ lumpinfo->position = 0;
+ fseek(handle, 0, SEEK_END);
+ lumpinfo->size = ftell(handle);
+ fseek(handle, 0, SEEK_SET);
+ strcpy(lumpinfo->name, lumpname);
+ // Allocate the lump's full name.
+ lumpinfo->name2 = Z_Malloc(9 * sizeof(char), PU_STATIC, NULL);
+ strcpy(lumpinfo->name2, lumpname);
+ lumpinfo->name2[8] = '\0';
+ *numlumps = 1;
+ return lumpinfo;
+}
+
+/** Create a lumpinfo_t array for a WAD file.
+ */
+static lumpinfo_t* ResGetLumpsWad (FILE* handle, UINT16* nlmp, const char* filename)
+{
+ UINT16 numlumps = *nlmp;
+ lumpinfo_t* lumpinfo;
+ size_t i;
+ INT32 compressed = 0;
+
+ wadinfo_t header;
+ lumpinfo_t *lump_p;
+ filelump_t *fileinfo;
+ void *fileinfov;
+
+ // read the header
+ if (fread(&header, 1, sizeof header, handle) < sizeof header)
+ {
+ CONS_Alert(CONS_ERROR, M_GetText("Can't read wad header because %s\n"), strerror(ferror(handle)));
+ return NULL;
+ }
+
+ if (memcmp(header.identification, "ZWAD", 4) == 0)
+ compressed = 1;
+ else if (memcmp(header.identification, "IWAD", 4) != 0
+ && memcmp(header.identification, "PWAD", 4) != 0
+ && memcmp(header.identification, "SDLL", 4) != 0)
+ {
+ CONS_Alert(CONS_ERROR, M_GetText("Invalid WAD header\n"));
+ return NULL;
+ }
+
+ header.numlumps = LONG(header.numlumps);
+ header.infotableofs = LONG(header.infotableofs);
+
+ // read wad file directory
+ i = header.numlumps * sizeof (*fileinfo);
+ fileinfov = fileinfo = malloc(i);
+ if (fseek(handle, header.infotableofs, SEEK_SET) == -1
+ || fread(fileinfo, 1, i, handle) < i)
+ {
+ CONS_Alert(CONS_ERROR, M_GetText("Corrupt wadfile directory (%s)\n"), strerror(ferror(handle)));
+ free(fileinfov);
+ return NULL;
+ }
+
+ numlumps = header.numlumps;
+
+ // fill in lumpinfo for this wad
+ lump_p = lumpinfo = Z_Malloc(numlumps * sizeof (*lumpinfo), PU_STATIC, NULL);
+ for (i = 0; i < numlumps; i++, lump_p++, fileinfo++)
+ {
+ lump_p->position = LONG(fileinfo->filepos);
+ lump_p->size = lump_p->disksize = LONG(fileinfo->size);
+ if (compressed) // wad is compressed, lump might be
+ {
+ UINT32 realsize = 0;
+ if (fseek(handle, lump_p->position, SEEK_SET)
+ == -1 || fread(&realsize, 1, sizeof realsize,
+ handle) < sizeof realsize)
+ {
+ I_Error("corrupt compressed file: %s; maybe %s", /// \todo Avoid the bailout?
+ filename, strerror(ferror(handle)));
+ }
+ realsize = LONG(realsize);
+ if (realsize != 0)
+ {
+ lump_p->size = realsize;
+ lump_p->compression = CM_LZF;
+ }
+ else
+ {
+ lump_p->size -= 4;
+ lump_p->compression = CM_NOCOMPRESSION;
+ }
+
+ lump_p->position += 4;
+ lump_p->disksize -= 4;
+ }
+ else
+ lump_p->compression = CM_NOCOMPRESSION;
+ memset(lump_p->name, 0x00, 9);
+ strncpy(lump_p->name, fileinfo->name, 8);
+ // Allocate the lump's full name.
+ lump_p->name2 = Z_Malloc(9 * sizeof(char), PU_STATIC, NULL);
+ strncpy(lump_p->name2, fileinfo->name, 8);
+ lump_p->name2[8] = '\0';
+ }
+ free(fileinfov);
+ *nlmp = numlumps;
+ return lumpinfo;
+}
+
+/** Optimized pattern search in a file.
+ */
+static boolean ResFindSignature (FILE* handle, char endPat[], UINT32 startpos)
+{
+ char *s;
+ int c;
+
+ fseek(handle, startpos, SEEK_SET);
+ s = endPat;
+ while((c = fgetc(handle)) != EOF)
+ {
+ if (*s != c && s > endPat) // No match?
+ s = endPat; // We "reset" the counter by sending the s pointer back to the start of the array.
+ if (*s == c)
+ {
+ s++;
+ if (*s == 0x00) // The array pointer has reached the key char which marks the end. It means we have matched the signature.
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+#if defined(_MSC_VER)
+#pragma pack(1)
+#endif
+typedef struct zend_s
+{
+ char signature[4];
+ UINT16 diskpos;
+ UINT16 cdirdisk;
+ UINT16 diskentries;
+ UINT16 entries;
+ UINT32 cdirsize;
+ UINT32 cdiroffset;
+ UINT16 commentlen;
+} ATTRPACK zend_t;
+
+typedef struct zentry_s
+{
+ char signature[4];
+ UINT16 version;
+ UINT16 versionneeded;
+ UINT16 flags;
+ UINT16 compression;
+ UINT16 modtime;
+ UINT16 moddate;
+ UINT32 CRC32;
+ UINT32 compsize;
+ UINT32 size;
+ UINT16 namelen;
+ UINT16 xtralen;
+ UINT16 commlen;
+ UINT16 diskstart;
+ UINT16 attrint;
+ UINT32 attrext;
+ UINT32 offset;
+} ATTRPACK zentry_t;
+
+typedef struct zlentry_s
+{
+ char signature[4];
+ UINT16 versionneeded;
+ UINT16 flags;
+ UINT16 compression;
+ UINT16 modtime;
+ UINT16 moddate;
+ UINT32 CRC32;
+ UINT32 compsize;
+ UINT32 size;
+ UINT16 namelen;
+ UINT16 xtralen;
+} ATTRPACK zlentry_t;
+#if defined(_MSC_VER)
+#pragma pack()
+#endif
+
+/** Create a lumpinfo_t array for a PKZip file.
+ */
+static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp)
+{
+ zend_t zend;
+ zentry_t* zentries;
+ zentry_t* zentry;
+
+ UINT16 numlumps = *nlmp;
+ lumpinfo_t* lumpinfo;
+ lumpinfo_t *lump_p;
+ size_t i;
+
+ char pat_central[] = {0x50, 0x4b, 0x01, 0x02, 0x00};
+ char pat_end[] = {0x50, 0x4b, 0x05, 0x06, 0x00};
+
+ // Look for central directory end signature near end of file.
+ // Contains entry number (number of lumps), and central directory start offset.
+ fseek(handle, 0, SEEK_END);
+ if (!ResFindSignature(handle, pat_end, max(0, ftell(handle) - (22 + 65536))))
+ {
+ CONS_Alert(CONS_ERROR, "Missing central directory\n");
+ return NULL;
+ }
+
+ fseek(handle, -4, SEEK_CUR);
+ if (fread(&zend, 1, sizeof zend, handle) < sizeof zend)
+ {
+ CONS_Alert(CONS_ERROR, "Corrupt central directory (%s)\n", strerror(ferror(handle)));
+ return NULL;
+ }
+ numlumps = zend.entries;
+
+ lump_p = lumpinfo = Z_Malloc(numlumps * sizeof (*lumpinfo), PU_STATIC, NULL);
+ zentry = zentries = malloc(numlumps * sizeof (*zentries));
+
+ fseek(handle, zend.cdiroffset, SEEK_SET);
+ for (i = 0; i < numlumps; i++, zentry++, lump_p++)
+ {
+ char* fullname;
+ char* trimname;
+ char* dotpos;
+
+ if (fread(zentry, 1, sizeof(zentry_t), handle) < sizeof(zentry_t))
+ {
+ CONS_Alert(CONS_ERROR, "Failed to read central directory (%s)\n", strerror(ferror(handle)));
+ Z_Free(lumpinfo);
+ free(zentry);
+ return NULL;
+ }
+ if (memcmp(zentry->signature, pat_central, 4))
+ {
+ CONS_Alert(CONS_ERROR, "Central directory is corrupt\n");
+ Z_Free(lumpinfo);
+ free(zentry);
+ return NULL;
+ }
+
+ lump_p->position = zentry->offset + zentry->namelen + zentry->xtralen + sizeof(zlentry_t);
+ lump_p->disksize = zentry->compsize;
+ lump_p->size = zentry->size;
+
+ fullname = malloc(zentry->namelen + 1);
+ if (fgets(fullname, zentry->namelen + 1, handle) != fullname)
+ {
+ CONS_Alert(CONS_ERROR, "Unable to read lumpname (%s)\n", strerror(ferror(handle)));
+ Z_Free(lumpinfo);
+ free(zentry);
+ free(fullname);
+ return NULL;
+ }
+
+ // Strip away file address and extension for the 8char name.
+ if ((trimname = strrchr(fullname, '/')) != 0)
+ trimname++;
+ else
+ trimname = fullname; // Care taken for root files.
+
+ if ((dotpos = strrchr(trimname, '.')) == 0)
+ dotpos = fullname + strlen(fullname); // Watch for files without extension.
+
+ memset(lump_p->name, '\0', 9); // Making sure they're initialized to 0. Is it necessary?
+ strncpy(lump_p->name, trimname, min(8, dotpos - trimname));
+
+ lump_p->name2 = Z_Calloc(zentry->namelen + 1, PU_STATIC, NULL);
+ strncpy(lump_p->name2, fullname, zentry->namelen);
+
+ free(fullname);
+
+ switch(zentry->compression)
+ {
+ case 0:
+ lump_p->compression = CM_NOCOMPRESSION;
+ break;
+#ifdef HAVE_ZLIB
+ case 8:
+ lump_p->compression = CM_DEFLATE;
+ break;
+#endif
+ case 14:
+ lump_p->compression = CM_LZF;
+ break;
+ default:
+ CONS_Alert(CONS_WARNING, "%s: Unsupported compression method\n", fullname);
+ lump_p->compression = CM_UNSUPPORTED;
+ break;
+ }
+ }
+
+ *nlmp = numlumps;
+ return lumpinfo;
+}
+
// Allocate a wadfile, setup the lumpinfo (directory) and
// lumpcache, add the wadfile to the current active wadfiles
//
@@ -327,12 +686,17 @@ static void W_InvalidateLumpnumCache(void)
UINT16 W_InitFile(const char *filename)
{
FILE *handle;
- lumpinfo_t *lumpinfo;
+ lumpinfo_t *lumpinfo = NULL;
wadfile_t *wadfile;
restype_t type;
+<<<<<<< HEAD
UINT16 numlumps;
size_t i;
INT32 compressed = 0;
+=======
+ UINT16 numlumps = 0;
+ size_t i;
+>>>>>>> public_next-20190101
size_t packetsize;
UINT8 md5sum[16];
boolean important;
@@ -371,6 +735,7 @@ UINT16 W_InitFile(const char *filename)
if ((important = !W_VerifyNMUSlumps(filename)))
{
packetsize = packetsizetally + nameonlylength(filename) + 22;
+<<<<<<< HEAD
if (packetsize > MAXFILENEEDED*sizeof(UINT8))
{
@@ -663,20 +1028,19 @@ UINT16 W_InitFile(const char *filename)
header.numlumps = LONG(header.numlumps);
header.infotableofs = LONG(header.infotableofs);
+=======
+>>>>>>> public_next-20190101
- // read wad file directory
- i = header.numlumps * sizeof (*fileinfo);
- fileinfov = fileinfo = malloc(i);
- if (fseek(handle, header.infotableofs, SEEK_SET) == -1
- || fread(fileinfo, 1, i, handle) < i)
+ if (packetsize > MAXFILENEEDED*sizeof(UINT8))
{
- CONS_Alert(CONS_ERROR, M_GetText("Wadfile directory in %s is corrupted (%s)\n"), filename, strerror(ferror(handle)));
- free(fileinfov);
+ CONS_Alert(CONS_ERROR, M_GetText("Maximum wad files reached\n"));
+ refreshdirmenu |= REFRESHDIR_MAX;
if (handle)
fclose(handle);
return INT16_MAX;
}
+<<<<<<< HEAD
numlumps = header.numlumps;
// fill in lumpinfo for this wad
@@ -725,6 +1089,57 @@ UINT16 W_InitFile(const char *filename)
free(fileinfov);
}
+=======
+ packetsizetally = packetsize;
+ }
+
+#ifndef NOMD5
+ //
+ // w-waiiiit!
+ // Let's not add a wad file if the MD5 matches
+ // an MD5 of an already added WAD file!
+ //
+ W_MakeFileMD5(filename, md5sum);
+
+ for (i = 0; i < numwadfiles; i++)
+ {
+ if (!memcmp(wadfiles[i]->md5sum, md5sum, 16))
+ {
+ CONS_Alert(CONS_ERROR, M_GetText("%s is already loaded\n"), filename);
+ if (handle)
+ fclose(handle);
+ return INT16_MAX;
+ }
+ }
+#endif
+
+ switch(type = ResourceFileDetect(filename))
+ {
+ case RET_SOC:
+ lumpinfo = ResGetLumpsStandalone(handle, &numlumps, "OBJCTCFG");
+ break;
+#ifdef HAVE_BLUA
+ case RET_LUA:
+ lumpinfo = ResGetLumpsStandalone(handle, &numlumps, "LUA_INIT");
+ break;
+#endif
+ case RET_PK3:
+ lumpinfo = ResGetLumpsZip(handle, &numlumps);
+ break;
+ case RET_WAD:
+ lumpinfo = ResGetLumpsWad(handle, &numlumps, filename);
+ break;
+ default:
+ CONS_Alert(CONS_ERROR, "Unsupported file format\n");
+ }
+
+ if (lumpinfo == NULL)
+ {
+ fclose(handle);
+ return INT16_MAX;
+ }
+
+>>>>>>> public_next-20190101
//
// link wad file to search files
//
@@ -737,6 +1152,7 @@ UINT16 W_InitFile(const char *filename)
wadfile->important = important;
fseek(handle, 0, SEEK_END);
wadfile->filesize = (unsigned)ftell(handle);
+ wadfile->type = type;
// already generated, just copy it over
M_Memcpy(&wadfile->md5sum, &md5sum, 16);
@@ -757,6 +1173,7 @@ UINT16 W_InitFile(const char *filename)
CONS_Printf(M_GetText("Added file %s (%u lumps)\n"), filename, numlumps);
wadfiles[numwadfiles] = wadfile;
numwadfiles++; // must come BEFORE W_LoadDehackedLumps, so any addfile called by COM_BufInsertText called by Lua doesn't overwrite what we just loaded
+<<<<<<< HEAD
// TODO: HACK ALERT - Load Lua & SOC stuff right here. I feel like this should be out of this place, but... Let's stick with this for now.
switch (wadfile->type)
@@ -777,9 +1194,30 @@ UINT16 W_InitFile(const char *filename)
default:
break;
}
+=======
+>>>>>>> public_next-20190101
+
+ // TODO: HACK ALERT - Load Lua & SOC stuff right here. I feel like this should be out of this place, but... Let's stick with this for now.
+ switch (wadfile->type)
+ {
+ case RET_WAD:
+ W_LoadDehackedLumps(numwadfiles - 1);
+ break;
+ case RET_PK3:
+ W_LoadDehackedLumpsPK3(numwadfiles - 1);
+ break;
+ case RET_SOC:
+ CONS_Printf(M_GetText("Loading SOC from %s\n"), wadfile->filename);
+ DEH_LoadDehackedLumpPwad(numwadfiles - 1, 0);
+ break;
+ case RET_LUA:
+ LUA_LoadLump(numwadfiles - 1, 0);
+ break;
+ default:
+ break;
+ }
W_InvalidateLumpnumCache();
-
return wadfile->numlumps;
}
@@ -1040,7 +1478,10 @@ lumpnum_t W_CheckNumForNameInBlock(const char *name, const char *blockstart, con
if (check < beid)
return (i<<16)+check; // found it, in our constraints
}
+<<<<<<< HEAD
+=======
+>>>>>>> public_next-20190101
}
return LUMPERROR;
}
@@ -1095,10 +1536,18 @@ boolean W_IsLumpWad(lumpnum_t lumpnum)
return false; // WADs should never be inside non-PK3s as far as SRB2 is concerned
}
+<<<<<<< HEAD
/* report a zlib or i/o error */
void zerr(int ret)
{
CONS_Printf("zpipe: ");
+=======
+#ifdef HAVE_ZLIB
+/* report a zlib or i/o error */
+void zerr(int ret)
+{
+ CONS_Printf("zpipe: ");
+>>>>>>> public_next-20190101
switch (ret) {
case Z_ERRNO:
if (ferror(stdin))
@@ -1119,6 +1568,7 @@ void zerr(int ret)
CONS_Printf("zlib version mismatch!\n");
}
}
+#endif
/** Reads bytes from the head of a lump.
* Note: If the lump is compressed, the whole thing has to be read anyway.
@@ -1188,6 +1638,10 @@ size_t W_ReadLumpHeaderPwad(UINT16 wad, UINT16 lump, void *dest, size_t size, si
{
I_Error("wad %d, lump %d: decompressed to wrong number of bytes (expected %s, got %s)", wad, lump, sizeu1(l->size), sizeu2(retval));
}
+<<<<<<< HEAD
+=======
+
+>>>>>>> public_next-20190101
if (!decData) // Did we get no data at all?
return 0;
M_Memcpy(dest, decData + offset, size);
@@ -1199,10 +1653,18 @@ size_t W_ReadLumpHeaderPwad(UINT16 wad, UINT16 lump, void *dest, size_t size, si
return 0;
#endif
}
+<<<<<<< HEAD
case CM_DEFLATE: // Is it compressed via DEFLATE? Very common in ZIPs/PK3s, also what most doom-related editors support.
{
z_const Bytef *rawData; // The lump's raw data.
Bytef *decData; // Lump's decompressed real data.
+=======
+#ifdef HAVE_ZLIB
+ case CM_DEFLATE: // Is it compressed via DEFLATE? Very common in ZIPs/PK3s, also what most doom-related editors support.
+ {
+ UINT8 *rawData; // The lump's raw data.
+ UINT8 *decData; // Lump's decompressed real data.
+>>>>>>> public_next-20190101
int zErr; // Helper var.
z_stream strm;
@@ -1252,10 +1714,18 @@ size_t W_ReadLumpHeaderPwad(UINT16 wad, UINT16 lump, void *dest, size_t size, si
return size;
}
+<<<<<<< HEAD
default:
I_Error("wad %d, lump %d: unsupported compression type!", wad, lump);
}
return 0;
+=======
+#endif
+ default:
+ I_Error("wad %d, lump %d: unsupported compression type!", wad, lump);
+ }
+ return -1;
+>>>>>>> public_next-20190101
}
size_t W_ReadLumpHeader(lumpnum_t lumpnum, void *dest, size_t size, size_t offset)
@@ -1639,7 +2109,12 @@ int W_VerifyNMUSlumps(const char *filename)
{"TTL", 3}, // Act number changes
{"STCFN", 5}, // Console font changes
{"TNYFN", 5}, // Tiny console font changes
+<<<<<<< HEAD
{"STT", 3}, // Acceptable HUD changes (Score Time Rings)
+=======
+ {"SBO", 3}, // Acceptable HUD changes (Score Time Rings)
+ {"RRINGS", 6}, // Rings HUD (not named as SBO)
+>>>>>>> public_next-20190101
{"YB_", 3}, // Intermission graphics, goes with the above
{"M_", 2}, // As does menu stuff
diff --git a/src/w_wad.h b/src/w_wad.h
index 16d97dd4c..0c95fc599 100644
--- a/src/w_wad.h
+++ b/src/w_wad.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -22,6 +22,22 @@
#pragma interface
#endif
+// a raw entry of the wad directory
+// NOTE: This sits here and not in w_wad.c because p_setup.c makes use of it to load map WADs inside PK3s.
+#if defined(_MSC_VER)
+#pragma pack(1)
+#endif
+typedef struct
+{
+ UINT32 filepos; // file offset of the resource
+ UINT32 size; // size of the resource
+ char name[8]; // name of the resource
+} ATTRPACK filelump_t;
+#if defined(_MSC_VER)
+#pragma pack()
+#endif
+
+
// ==============================================================
// WAD FILE STRUCTURE DEFINITIONS
// ==============================================================
@@ -34,6 +50,7 @@ typedef struct
UINT32 infotableofs; // the 'directory' of resources
} wadinfo_t;
+<<<<<<< HEAD
// a raw entry of the wad directory
typedef struct
{
@@ -42,11 +59,19 @@ typedef struct
char name[8]; // name of the resource
} ATTRPACK filelump_t;
+=======
+>>>>>>> public_next-20190101
// Available compression methods for lumps.
typedef enum
{
CM_NOCOMPRESSION,
+<<<<<<< HEAD
CM_DEFLATE,
+=======
+#ifdef HAVE_ZLIB
+ CM_DEFLATE,
+#endif
+>>>>>>> public_next-20190101
CM_LZF,
CM_UNSUPPORTED
} compmethod;
@@ -59,7 +84,10 @@ typedef struct
char name[9]; // filelump_t name[]
char *name2; // Used by PK3s. Dynamically allocated name.
size_t size; // real (uncompressed) size
+<<<<<<< HEAD
INT32 compressed; // i
+=======
+>>>>>>> public_next-20190101
compmethod compression; // lump compression method
} lumpinfo_t;
@@ -83,9 +111,17 @@ typedef enum restype
RET_WAD,
RET_SOC,
RET_LUA,
+<<<<<<< HEAD
RET_PK3
} restype_t;
+=======
+ RET_PK3,
+ RET_UNKNOWN,
+} restype_t;
+
+
+>>>>>>> public_next-20190101
typedef struct wadfile_s
{
char *filename;
@@ -99,7 +135,11 @@ typedef struct wadfile_s
FILE *handle;
UINT32 filesize; // for network
UINT8 md5sum[16];
+<<<<<<< HEAD
boolean important; // also network - !W_VerifyNMUSlumps
+=======
+ boolean important;
+>>>>>>> public_next-20190101
} wadfile_t;
#define WADFILENUM(lumpnum) (UINT16)((lumpnum)>>16) // wad flumpnum>>16) // wad file number in upper word
@@ -116,6 +156,12 @@ void W_Shutdown(void);
FILE *W_OpenWadFile(const char **filename, boolean useerrors);
// Load and add a wadfile to the active wad files, returns numbers of lumps, INT16_MAX on error
UINT16 W_InitFile(const char *filename);
+<<<<<<< HEAD
+=======
+#ifdef DELFILE
+void W_UnloadWadFile(UINT16 num);
+#endif
+>>>>>>> public_next-20190101
// W_InitMultipleFiles returns 1 if all is okay, 0 otherwise,
// so that it stops with a message if a file was not found, but not if all is okay.
@@ -141,7 +187,13 @@ size_t W_LumpLength(lumpnum_t lumpnum);
boolean W_IsLumpWad(lumpnum_t lumpnum); // for loading maps from WADs in PK3s
+<<<<<<< HEAD
void zerr(int ret); // zlib error checking
+=======
+#ifdef HAVE_ZLIB
+void zerr(int ret); // zlib error checking
+#endif
+>>>>>>> public_next-20190101
size_t W_ReadLumpHeaderPwad(UINT16 wad, UINT16 lump, void *dest, size_t size, size_t offset);
size_t W_ReadLumpHeader(lumpnum_t lump, void *dest, size_t size, size_t offest); // read all or a part of a lump
diff --git a/src/win32/Makefile.cfg b/src/win32/Makefile.cfg
index a73858bd4..def2fe682 100644
--- a/src/win32/Makefile.cfg
+++ b/src/win32/Makefile.cfg
@@ -7,8 +7,6 @@
#
ifdef MINGW64
- NOASM=1
- NONX86=1
HAVE_LIBGME=1
LIBGME_CFLAGS=-I../libs/gme/include
LIBGME_LDFLAGS=-L../libs/gme/win64 -lgme
diff --git a/src/win32/Srb2win-vc10.vcxproj b/src/win32/Srb2win-vc10.vcxproj
index ed6b46b8f..ca73b1293 100644
--- a/src/win32/Srb2win-vc10.vcxproj
+++ b/src/win32/Srb2win-vc10.vcxproj
@@ -1,10 +1,26 @@

+
+ Debug
+ ARM
+
+
+ Debug
+ ARM64
+
Debug
Win32
+
+ Release
+ ARM
+
+
+ Release
+ ARM64
+
Release
Win32
@@ -23,26 +39,49 @@
{0F554F1D-ED49-4D65-A9A7-F63C57F277BE}
Win32Proj
Srb2win
- 8.1
+ 10.0.17763.0
-
- v140
-
+ v140
true
+
+ true
+ true
+ v141
+
+ v140
false
true
+
+ false
+ true
+ true
+ v141
+
+ v140
true
+
+ true
+ true
+ v141
+
+ v140
false
true
+
+ false
+ true
+ true
+ v141
+
@@ -58,23 +97,89 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
<_ProjectFileVersion>10.0.30319.1
false
+
+
+ true
+ gdi32.lib;%(AdditionalDependencies)
+
+
+ ProgramDatabase
+ false
+
+
+
+
+ true
+ gdi32.lib;%(AdditionalDependencies)
+
+
+
+
+ ProgramDatabase
+ false
+
+
+ gdi32.lib;%(AdditionalDependencies)
+
+
+
+
+ gdi32.lib;%(AdditionalDependencies)
+
+
+
+
+ gdi32.lib;%(AdditionalDependencies)
+
+
+
+
+ gdi32.lib;%(AdditionalDependencies)
+
+
+
+
+ gdi32.lib;%(AdditionalDependencies)
+
+
+
+
+ gdi32.lib;%(AdditionalDependencies)
+
+
diff --git a/src/win32/Srb2win.rc b/src/win32/Srb2win.rc
index 426a5e013..b60ba750d 100644
--- a/src/win32/Srb2win.rc
+++ b/src/win32/Srb2win.rc
@@ -36,18 +36,18 @@ IDI_ICON1 ICON DISCARDABLE "Srb2win.ico"
// TEXTINCLUDE
//
-1 TEXTINCLUDE DISCARDABLE
+1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
-2 TEXTINCLUDE DISCARDABLE
+2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
-3 TEXTINCLUDE DISCARDABLE
+3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
@@ -84,7 +84,7 @@ BEGIN
VALUE "FileDescription", "Sonic Robo Blast 2\0"
VALUE "FileVersion", "1, 09\0"
VALUE "InternalName", "srb2\0"
- VALUE "LegalCopyright", "Copyright © 1998-2005 Sonic Team Junior\0"
+ VALUE "LegalCopyright", "Copyright � 1998-2018 by Sonic Team Junior\0"
VALUE "LegalTrademarks", "Sonic the Hedgehog and related characters are trademarks of Sega.\0"
VALUE "OriginalFilename", "srb2win.exe\0"
VALUE "PrivateBuild", "\0"
diff --git a/src/win32/win_sys.c b/src/win32/win_sys.c
index 316da61d4..77a21f7f3 100644
--- a/src/win32/win_sys.c
+++ b/src/win32/win_sys.c
@@ -771,6 +771,8 @@ void I_Quit(void)
ShowEndTxt(co);
}
fflush(stderr);
+ if (myargmalloc)
+ free(myargv); // Deallocate allocated memory
W_Shutdown();
exit(0);
}
diff --git a/src/win32/win_vid.c b/src/win32/win_vid.c
index e9b5d7e9f..e2f32fa61 100644
--- a/src/win32/win_vid.c
+++ b/src/win32/win_vid.c
@@ -1000,7 +1000,7 @@ static INT32 WINAPI VID_SetDirectDrawMode(viddef_t *lvid, vmode_t *currentmode)
// but rather render to memory bitmap buffer
lvid->direct = NULL;
- if (!cv_stretch.value && (float)vid.width/vid.height != ((float)BASEVIDWIDTH/BASEVIDHEIGHT))
+ if (!cv_stretch.value && fabsf((float)vid.width/vid.height - ((float)BASEVIDWIDTH/BASEVIDHEIGHT)) > 1.0E-36f)
vid.height = (int)(vid.width * ((float)BASEVIDHEIGHT/BASEVIDWIDTH));// Adjust the height to match
return 1;
diff --git a/src/y_inter.c b/src/y_inter.c
index 1a1675fdd..a36a9815d 100644
--- a/src/y_inter.c
+++ b/src/y_inter.c
@@ -1,6 +1,6 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
-// Copyright (C) 2004-2016 by Sonic Team Junior.
+// Copyright (C) 2004-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/y_inter.h b/src/y_inter.h
index 26f7dc390..4c6ad2bdf 100644
--- a/src/y_inter.h
+++ b/src/y_inter.h
@@ -1,6 +1,6 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
-// Copyright (C) 2004-2016 by Sonic Team Junior.
+// Copyright (C) 2004-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/z_zone.c b/src/z_zone.c
index b5799b583..001c69bb3 100644
--- a/src/z_zone.c
+++ b/src/z_zone.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2006 by Graue.
-// Copyright (C) 2006-2016 by Sonic Team Junior.
+// Copyright (C) 2006-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/z_zone.h b/src/z_zone.h
index 205c9ed79..8d32e74f1 100644
--- a/src/z_zone.h
+++ b/src/z_zone.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2016 by Sonic Team Junior.
+// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/tools/masterserver/structure.sql b/tools/masterserver/structure.sql
new file mode 100644
index 000000000..3cc2cb15b
--- /dev/null
+++ b/tools/masterserver/structure.sql
@@ -0,0 +1,117 @@
+SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
+SET AUTOCOMMIT = 0;
+START TRANSACTION;
+SET time_zone = "+00:00";
+
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8mb4 */;
+
+--
+-- Database: `srb2ms`
+--
+
+CREATE DATABASE IF NOT EXISTS `srb2ms` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
+USE `srb2ms`;
+
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `ms_bans`
+--
+
+CREATE TABLE `ms_bans` (
+ `bid` int(11) DEFAULT NULL,
+ `ipstart` int(11) DEFAULT NULL,
+ `ipend` int(11) DEFAULT NULL,
+ `full_endtime` int(11) DEFAULT NULL,
+ `permanent` tinyint(1) DEFAULT NULL,
+ `hostonly` tinyint(1) DEFAULT NULL,
+ `reason` text COLLATE utf8mb4_unicode_ci
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `ms_rooms`
+--
+
+CREATE TABLE `ms_rooms` (
+ `room_id` int(11) NOT NULL,
+ `title` text COLLATE utf8mb4_unicode_ci NOT NULL,
+ `motd` text COLLATE utf8mb4_unicode_ci NOT NULL,
+ `visible` tinyint(1) NOT NULL,
+ `order` int(11) NOT NULL,
+ `private` tinyint(1) NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+
+--
+-- Dumping data for table `ms_rooms`
+--
+
+INSERT INTO `ms_rooms` (`room_id`, `title`, `motd`, `visible`, `order`, `private`) VALUES
+(10, 'Example', 'Example Room', 1, 0, 0),
+(0, 'All', 'View all of the servers currently being hosted.', 1, 1, 1);
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `ms_servers`
+--
+
+CREATE TABLE `ms_servers` (
+ `sid` int(11) NOT NULL,
+ `name` text COLLATE utf8mb4_unicode_ci NOT NULL,
+ `ip` text COLLATE utf8mb4_unicode_ci NOT NULL,
+ `port` int(11) NOT NULL,
+ `version` text COLLATE utf8mb4_unicode_ci NOT NULL,
+ `timestamp` int(11) NOT NULL,
+ `room` int(11) NOT NULL,
+ `key` text COLLATE utf8mb4_unicode_ci NOT NULL,
+ `room_override` int(11) NOT NULL,
+ `upnow` tinyint(1) NOT NULL,
+ `permanent` tinyint(1) NOT NULL,
+ `delisted` tinyint(1) NOT NULL,
+ `sticky` int(11) NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `ms_versions`
+--
+
+CREATE TABLE `ms_versions` (
+ `mod_id` int(11) NOT NULL,
+ `mod_version` int(11) NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+
+--
+-- Dumping data for table `ms_versions`
+--
+
+INSERT INTO `ms_versions` (`mod_id`, `mod_version`) VALUES
+(12, 25);
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `user`
+--
+
+CREATE TABLE `user` (
+ `userid` int(11) NOT NULL,
+ `username` text COLLATE utf8mb4_unicode_ci NOT NULL,
+ `live_authkey` blob NOT NULL,
+ `live_publickey` blob NOT NULL,
+ `salt` blob NOT NULL,
+ `password` blob NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+COMMIT;
+
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;