doxyfile crlf=input
Doxyfile crlf=input
*.doxygen crlf=input
+*.dpk -diff -crlf
*.dpm -diff -crlf
*.dsp -crlf
*.dsw -crlf
*.code-workspace
.ccls-cache
*.gch
+/.vs
+/build
+/.cache
+*.kdev4
--- /dev/null
+éh3ì§\88#\99|E\7fR÷;\ 1ð\98jì^®\94¢Ïa°÷Ëûö\87\ eZ)\ 1l\90÷\9f\93z\88\ 4\91I\11º\16î}²\98V\r\ 4ãgçD(À\8f5²Í/tV¤
+n\93/\83rvðºw\96h\8f¡$ÝÏÙ\11T1\9b\80¨èU\8e±Ú¢\1c\8f\9bYFK¨Õý)¿\17CM\9c\19\12£¡R\84Óg\91íÖÓi£\\8a X\90ïvxÃ\96Ò\8dLXBm%¨aÍ/k"\vúHÊ\ 2㽿\8f{ \7f ¤C\13½µ6¦{Õ\82\ 2\97|%\eåÌ\8emOþý\1e¹\95a\84þ '\13X8ñÝ\92Þk0ne·\91§»0ðá\12!\ f\14£×Ðí\13r¤¬¸\90¿<Î@Ä\ 5}[?`Ðc\fl· ]å\13>>©\10YÉæ\rs-cîcäÚ×\87\87%[°æÍÝÅÊ\8bû1×2é¢\10¸U°_\ 2î\8d\17·B8Öj0Ç\8b1´áp]Ï\rGH\11$©\ 5ð\b\v<r \87\9e:e¢ÿ3\aM3\ 6\r"ß3Op\18ªa¡ä9¡f,زa\95\99ÿpå\83§t\80½û"O\ 2;
+Ú*\89º_\81\131:\11eMn3¯q\ 4.ïÊç\18¤º\17\9a<£©r\ 5¿bÒÎqæ».áV
\ No newline at end of file
set -e
-openssl aes-256-cbc -K $encrypted_eeb6f7a14a8e_key -iv $encrypted_eeb6f7a14a8e_iv -in .travis-id_rsa-xonotic -out id_rsa-xonotic -d
+openssl aes-256-cbc -K $encrypted_29b4419ace44_key -iv $encrypted_29b4419ace44_iv -in .travis-id_xonotic.enc -out /tmp/id_xonotic -d
set -x
-chmod 0600 id_rsa-xonotic
-# ssh-keygen -y -f id_rsa-xonotic
+chmod 0600 /tmp/id_xonotic
export USRLOCAL="$PWD"/usrlocal
rev=`git rev-parse HEAD`
-sftp -oStrictHostKeyChecking=no -i id_rsa-xonotic -P 2222 -b - autobuild-bin-uploader@beta.xonotic.org <<EOF || true
+sftp -oStrictHostKeyChecking=no -i /tmp/id_xonotic -P 2342 -b - autobuild-bin-uploader@srv04.xonotic.org <<EOF || true
mkdir ${rev}
EOF
for o in $outputs; do
src=${o%%:*}
dst=${o#*:}
- sftp -oStrictHostKeyChecking=no -i id_rsa-xonotic -P 2222 -b - autobuild-bin-uploader@beta.xonotic.org <<EOF
+ sftp -oStrictHostKeyChecking=no -i /tmp/id_xonotic -P 2342 -b - autobuild-bin-uploader@srv04.xonotic.org <<EOF
put ${src} ${rev}/${dst}
EOF
done
# Link options
DP_LINK_ZLIB?=shared
DP_LINK_JPEG?=shared
-DP_LINK_ODE?=dlopen
+DP_LINK_ODE?=
DP_LINK_CRYPTO?=dlopen
DP_LINK_CRYPTO_RIJNDAEL?=dlopen
DP_LINK_XMP?=dlopen
The precise terms and conditions for copying, distribution and
modification follow.
-\f
+
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
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.)
-\f
+
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
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.
-\f
+
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
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
-\f
+
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
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
-\f
+
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
--- /dev/null
+Credits
+===============================================================================
+
+Sorted by alphanumeric order by last name, and pseudonym if not available. Active contributors are in bold.
+
+**Quake 1 engine**
+-------------------------------------------------------------------------------
+
+* **id Software**
+ * Michael Abrash
+ * John Carmack
+ * John Cash
+
+**DarkPlaces Engine**
+-------------------------------------------------------------------------------
+
+* **Project Leader**
+ * **Ashley Rose Hale (LadyHavoc)**
+
+* **Core Developers/Maintainers**
+ * **Ashley Rose Hale (LadyHavoc)**
+ * **David Knapp (Cloudwalk)**
+ * **Rudolf Polzer (divVerent)**
+
+* **Major Contributors**
+ * [515]
+ * Blub\0
+ * eihrul
+ * Zephaniah Hull (Mercury)
+ * Andreas Kirsch (BlackHC)
+ * Mathieu Olivier (Elric)
+ * Dale Weiler (graphitemaster)
+
+* **Contributors**
+ * Akari
+ * **bones_was_here**
+ * Matthias Buecher (Maddes)
+ * Thomas Joseph Carter (knghtbrd)
+ * coderjo
+ * Diablo-D3
+ * EvilTypeGuy
+ * fleeky
+ * GreEn`mArine
+ * **Terence Hill (terencehill)**
+ * incognico
+ * Tomas Jakobsson (Tomaz)
+ * KillPixel
+ * KrimZon
+ * kristus
+ * (R.I.P.) Christopher Robert Lais (zinx)
+ * MarioSMB
+ * Patrick McKeever (Dresk)
+ * Chris Page
+ * parasti
+ * Marko Permanto (Urre/ImUnreal)
+ * Qantourisc
+ * Res2k
+ * Sajt
+ * Samual
+ * taniwha
+ * TimePath
+ * tZork
+ * VorteX
+ * David Walton (Spoike)
+ * Alexander Zubov (motorsep)
+
+**In Memory Of**
+-------------------------------------------------------------------------------
+* [Christopher Robert Lais (zinx)](http://obits.al.com/obituaries/birmingham/obituary.aspx?n=christopher-robert-lais&pid=186080667)
\ No newline at end of file
-# Doxyfile 1.5.9
+# Doxyfile 1.9.2
# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project
+# doxygen (www.doxygen.org) for a project.
#
-# All text after a hash (#) is considered a comment and will be ignored
+# All text after a double hash (##) is considered a comment and is placed in
+# front of the TAG it is preceding.
+#
+# All text after a single hash (#) is considered a comment and will be ignored.
# The format is:
-# TAG = value [value, ...]
-# For lists items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ")
+# TAG = value [value, ...]
+# For lists, items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (\" \").
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
-# This tag specifies the encoding used for all characters in the config file
-# that follow. The default is UTF-8 which is also the encoding used for all
-# text before the first occurrence of this tag. Doxygen uses libiconv (or the
-# iconv built into libc) for the transcoding. See
-# http://www.gnu.org/software/libiconv for the list of possible encodings.
+# This tag specifies the encoding used for all characters in the configuration
+# file that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# https://www.gnu.org/software/libiconv/ for the list of possible encodings.
+# The default value is: UTF-8.
DOXYFILE_ENCODING = UTF-8
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
-# by quotes) that should identify the project.
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
+# double-quotes, unless you are using Doxywizard) that should identify the
+# project for which the documentation is generated. This name is used in the
+# title of most generated pages and in a few other places.
+# The default value is: My Project.
+
+PROJECT_NAME = "DarkPlaces"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
+# could be handy for archiving the generated documentation or if some version
+# control system is used.
+
+PROJECT_NUMBER =
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer a
+# quick idea about the purpose of the project. Keep the description short.
-PROJECT_NAME = darkplaces
+PROJECT_BRIEF = "Game engine based on the Quake 1 engine by id Software, developed by LadyHavoc"
-# The PROJECT_NUMBER tag can be used to enter a project or revision number.
-# This could be handy for archiving the generated documentation or
-# if some version control system is used.
+# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
+# in the documentation. The maximum height of the logo should not exceed 55
+# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
+# the logo to the output directory.
-PROJECT_NUMBER =
+PROJECT_LOGO = "darkplaces48x48.png"
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
-# base path where the generated documentation will be put.
-# If a relative path is entered, it will be relative to the location
-# where doxygen was started. If left blank the current directory will be used.
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
+# into which the generated documentation will be written. If a relative path is
+# entered, it will be relative to the location where doxygen was started. If
+# left blank the current directory will be used.
-OUTPUT_DIRECTORY = docs
+OUTPUT_DIRECTORY =
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
-# 4096 sub-directories (in 2 levels) under the output directory of each output
-# format and will distribute the generated files over these directories.
-# Enabling this option can be useful when feeding doxygen a huge amount of
-# source files, where putting all generated files in the same directory would
-# otherwise cause performance problems for the file system.
+# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
+# directories (in 2 levels) under the output directory of each output format and
+# will distribute the generated files over these directories. Enabling this
+# option can be useful when feeding doxygen a huge amount of source files, where
+# putting all generated files in the same directory would otherwise causes
+# performance problems for the file system.
+# The default value is: NO.
CREATE_SUBDIRS = NO
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# The default language is English, other supported languages are:
-# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
-# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
-# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
-# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
-# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
-# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
+# characters to appear in the names of generated files. If set to NO, non-ASCII
+# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
+# U+3044.
+# The default value is: NO.
+
+ALLOW_UNICODE_NAMES = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
+# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
+# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
+# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
+# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
+# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
+# Ukrainian and Vietnamese.
+# The default value is: English.
OUTPUT_LANGUAGE = English
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
-# include brief member descriptions after the members that are listed in
-# the file and class documentation (similar to JavaDoc).
-# Set to NO to disable this.
+# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
+# descriptions after the members that are listed in the file and class
+# documentation (similar to Javadoc). Set to NO to disable this.
+# The default value is: YES.
BRIEF_MEMBER_DESC = YES
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
-# the brief description of a member or function before the detailed description.
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief
+# description of a member or function before the detailed description
+#
+# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
# brief descriptions will be completely suppressed.
+# The default value is: YES.
REPEAT_BRIEF = YES
-# This tag implements a quasi-intelligent brief description abbreviator
-# that is used to form the text in various listings. Each string
-# in this list, if found as the leading text of the brief description, will be
-# stripped from the text and the result after processing the whole list, is
-# used as the annotated text. Otherwise, the brief description is used as-is.
-# If left blank, the following values are used ("$name" is automatically
-# replaced with the name of the entity): "The $name class" "The $name widget"
-# "The $name file" "is" "provides" "specifies" "contains"
-# "represents" "a" "an" "the"
+# This tag implements a quasi-intelligent brief description abbreviator that is
+# used to form the text in various listings. Each string in this list, if found
+# as the leading text of the brief description, will be stripped from the text
+# and the result, after processing the whole list, is used as the annotated
+# text. Otherwise, the brief description is used as-is. If left blank, the
+# following values are used ($name is automatically replaced with the name of
+# the entity):The $name class, The $name widget, The $name file, is, provides,
+# specifies, contains, represents, a, an and the.
-ABBREVIATE_BRIEF =
+ABBREVIATE_BRIEF = "The $name class" "The $name widget" "The $name file" is provides specifies contains represents a an the
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# Doxygen will generate a detailed section even if there is only a brief
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# doxygen will generate a detailed section even if there is only a brief
# description.
+# The default value is: NO.
-ALWAYS_DETAILED_SEC = NO
+ALWAYS_DETAILED_SEC = YES
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
-# inherited members of a class in the documentation of that class as if those
-# members were ordinary class members. Constructors, destructors and assignment
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
# operators of the base classes will not be shown.
+# The default value is: NO.
-INLINE_INHERITED_MEMB = NO
+INLINE_INHERITED_MEMB = YES
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
-# path before files name in the file list and in the header files. If set
-# to NO the shortest path that makes the file name unique will be used.
+# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path
+# before files name in the file list and in the header files. If set to NO the
+# shortest path that makes the file name unique will be used
+# The default value is: YES.
FULL_PATH_NAMES = YES
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
-# can be used to strip a user-defined part of the path. Stripping is
-# only done if one of the specified strings matches the left-hand part of
-# the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the
-# path to strip.
+# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
+# Stripping is only done if one of the specified strings matches the left-hand
+# part of the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the path to
+# strip.
+#
+# Note that you can specify absolute paths here, but also relative paths, which
+# will be relative from the directory where doxygen is started.
+# This tag requires that the tag FULL_PATH_NAMES is set to YES.
-STRIP_FROM_PATH =
+STRIP_FROM_PATH =
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
-# the path mentioned in the documentation of a class, which tells
-# the reader which header file to include in order to use a class.
-# If left blank only the name of the header file containing the class
-# definition is used. Otherwise one should specify the include paths that
-# are normally passed to the compiler using the -I flag.
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
+# path mentioned in the documentation of a class, which tells the reader which
+# header file to include in order to use a class. If left blank only the name of
+# the header file containing the class definition is used. Otherwise one should
+# specify the list of include paths that are normally passed to the compiler
+# using the -I flag.
-STRIP_FROM_INC_PATH =
+STRIP_FROM_INC_PATH =
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
-# (but less readable) file names. This can be useful is your file systems
-# doesn't support long names like on DOS, Mac, or CD-ROM.
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
+# less readable) file names. This can be useful is your file systems doesn't
+# support long names like on DOS, Mac, or CD-ROM.
+# The default value is: NO.
SHORT_NAMES = NO
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
-# will interpret the first line (until the first dot) of a JavaDoc-style
-# comment as the brief description. If set to NO, the JavaDoc
-# comments will behave just like regular Qt-style comments
-# (thus requiring an explicit @brief command for a brief description.)
-
-JAVADOC_AUTOBRIEF = NO
-
-# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
-# interpret the first line (until the first dot) of a Qt-style
-# comment as the brief description. If set to NO, the comments
-# will behave just like regular Qt-style comments (thus requiring
-# an explicit \brief command for a brief description.)
+# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
+# first line (until the first dot) of a Javadoc-style comment as the brief
+# description. If set to NO, the Javadoc-style will behave just like regular Qt-
+# style comments (thus requiring an explicit @brief command for a brief
+# description.)
+# The default value is: NO.
+
+JAVADOC_AUTOBRIEF = YES
+
+# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line
+# such as
+# /***************
+# as being the beginning of a Javadoc-style comment "banner". If set to NO, the
+# Javadoc-style will behave just like regular comments and it will not be
+# interpreted by doxygen.
+# The default value is: NO.
+
+JAVADOC_BANNER = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
+# line (until the first dot) of a Qt-style comment as the brief description. If
+# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
+# requiring an explicit \brief command for a brief description.)
+# The default value is: NO.
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
+# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
+# a brief description. This used to be the default behavior. The new default is
+# to treat a multi-line C++ comment block as a detailed description. Set this
+# tag to YES if you prefer the old behavior instead.
+#
+# Note that setting this tag to YES also means that rational rose comments are
+# not recognized any more.
+# The default value is: NO.
-QT_AUTOBRIEF = YES
+MULTILINE_CPP_IS_BRIEF = NO
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
-# treat a multi-line C++ special comment block (i.e. a block of //! or ///
-# comments) as a brief description. This used to be the default behaviour.
-# The new default is to treat a multi-line C++ comment block as a detailed
-# description. Set this tag to YES if you prefer the old behaviour instead.
+# By default Python docstrings are displayed as preformatted text and doxygen's
+# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the
+# doxygen's special commands can be used and the contents of the docstring
+# documentation blocks is shown as doxygen documentation.
+# The default value is: YES.
-MULTILINE_CPP_IS_BRIEF = NO
+PYTHON_DOCSTRING = YES
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
-# member inherits the documentation from any documented member that it
-# re-implements.
+# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
+# documentation from any documented member that it re-implements.
+# The default value is: YES.
INHERIT_DOCS = YES
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
-# a new page for each member. If set to NO, the documentation of a member will
-# be part of the file/class/namespace that contains it.
+# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new
+# page for each member. If set to NO, the documentation of a member will be part
+# of the file/class/namespace that contains it.
+# The default value is: NO.
SEPARATE_MEMBER_PAGES = NO
-# The TAB_SIZE tag can be used to set the number of spaces in a tab.
-# Doxygen uses this value to replace tabs by spaces in code fragments.
-
-TAB_SIZE = 8
-
-# This tag can be used to specify a number of aliases that acts
-# as commands in the documentation. An alias has the form "name=value".
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to
-# put the command \sideeffect (or @sideeffect) in the documentation, which
-# will result in a user-defined paragraph with heading "Side Effects:".
-# You can put \n's in the value part of an alias to insert newlines.
-
-ALIASES =
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
-# sources only. Doxygen will then generate output that is more tailored for C.
-# For instance, some of the names that are used will be different. The list
-# of all members will be omitted, etc.
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
+# uses this value to replace tabs by spaces in code fragments.
+# Minimum value: 1, maximum value: 16, default value: 4.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that act as commands in
+# the documentation. An alias has the form:
+# name=value
+# For example adding
+# "sideeffect=@par Side Effects:^^"
+# will allow you to put the command \sideeffect (or @sideeffect) in the
+# documentation, which will result in a user-defined paragraph with heading
+# "Side Effects:". Note that you cannot put \n's in the value part of an alias
+# to insert newlines (in the resulting output). You can put ^^ in the value part
+# of an alias to insert a newline as if a physical newline was in the original
+# file. When you need a literal { or } or , in the value part of an alias you
+# have to escape them by means of a backslash (\), this can lead to conflicts
+# with the commands \{ and \} for these it is advised to use the version @{ and
+# @} or use a double escape (\\{ and \\})
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C. For
+# instance, some of the names that are used will be different. The list of all
+# members will be omitted, etc.
+# The default value is: NO.
OPTIMIZE_OUTPUT_FOR_C = YES
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
-# sources only. Doxygen will then generate output that is more tailored for
-# Java. For instance, namespaces will be presented as packages, qualified
-# scopes will look different, etc.
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
+# Python sources only. Doxygen will then generate output that is more tailored
+# for that language. For instance, namespaces will be presented as packages,
+# qualified scopes will look different, etc.
+# The default value is: NO.
OPTIMIZE_OUTPUT_JAVA = NO
-# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
-# sources only. Doxygen will then generate output that is more tailored for
-# Fortran.
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources. Doxygen will then generate output that is tailored for Fortran.
+# The default value is: NO.
OPTIMIZE_FOR_FORTRAN = NO
-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
-# sources. Doxygen will then generate output that is tailored for
-# VHDL.
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for VHDL.
+# The default value is: NO.
OPTIMIZE_OUTPUT_VHDL = NO
-# Doxygen selects the parser to use depending on the extension of the files it parses.
-# With this tag you can assign which parser to use for a given extension.
-# Doxygen has a built-in mapping, but you can override or extend it using this tag.
-# The format is ext=language, where ext is a file extension, and language is one of
-# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP,
-# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat
-# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran),
-# use: inc=Fortran f=C. Note that for custom extensions you also need to set
-# FILE_PATTERNS otherwise the files are not read by doxygen.
-
-EXTENSION_MAPPING =
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
-# to include (a tag file for) the STL sources as input, then you should
-# set this tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
-# func(std::string) {}). This also make the inheritance and collaboration
+# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice
+# sources only. Doxygen will then generate output that is more tailored for that
+# language. For instance, namespaces will be presented as modules, types will be
+# separated into more groups, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_SLICE = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given
+# extension. Doxygen has a built-in mapping, but you can override or extend it
+# using this tag. The format is ext=language, where ext is a file extension, and
+# language is one of the parsers supported by doxygen: IDL, Java, JavaScript,
+# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice,
+# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran:
+# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser
+# tries to guess whether the code is fixed or free formatted code, this is the
+# default for Fortran type files). For instance to make doxygen treat .inc files
+# as Fortran files (default is PHP), and .f files as C (default is Fortran),
+# use: inc=Fortran f=C.
+#
+# Note: For files without extension you can use no_extension as a placeholder.
+#
+# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
+# the files are not read by doxygen. When specifying no_extension you should add
+# * to the FILE_PATTERNS.
+#
+# Note see also the list of default file extension mappings.
+
+EXTENSION_MAPPING = qc=C qh=C inc=C
+
+# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
+# according to the Markdown format, which allows for more readable
+# documentation. See https://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you can
+# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
+# case of backward compatibilities issues.
+# The default value is: YES.
+
+MARKDOWN_SUPPORT = YES
+
+# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up
+# to that level are automatically included in the table of contents, even if
+# they do not have an id attribute.
+# Note: This feature currently applies only to Markdown headings.
+# Minimum value: 0, maximum value: 99, default value: 5.
+# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
+
+TOC_INCLUDE_HEADINGS = 5
+
+# When enabled doxygen tries to link words that correspond to documented
+# classes, or namespaces to their corresponding documentation. Such a link can
+# be prevented in individual cases by putting a % sign in front of the word or
+# globally by setting AUTOLINK_SUPPORT to NO.
+# The default value is: YES.
+
+AUTOLINK_SUPPORT = YES
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should set this
+# tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string);
+# versus func(std::string) {}). This also make the inheritance and collaboration
# diagrams that involve STL classes more complete and accurate.
+# The default value is: NO.
BUILTIN_STL_SUPPORT = NO
-# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
# enable parsing support.
+# The default value is: NO.
CPP_CLI_SUPPORT = NO
-# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
-# Doxygen will parse them like normal C++ but will assume all classes use public
-# instead of private inheritance when no explicit protection keyword is present.
+# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
+# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen
+# will parse them like normal C++ but will assume all classes use public instead
+# of private inheritance when no explicit protection keyword is present.
+# The default value is: NO.
SIP_SUPPORT = NO
-# For Microsoft's IDL there are propget and propput attributes to indicate getter
-# and setter methods for a property. Setting this option to YES (the default)
-# will make doxygen to replace the get and set methods by a property in the
-# documentation. This will only work if the methods are indeed getting or
-# setting a simple type. If this is not the case, or you want to show the
-# methods anyway, you should set this option to NO.
+# For Microsoft's IDL there are propget and propput attributes to indicate
+# getter and setter methods for a property. Setting this option to YES will make
+# doxygen to replace the get and set methods by a property in the documentation.
+# This will only work if the methods are indeed getting or setting a simple
+# type. If this is not the case, or you want to show the methods anyway, you
+# should set this option to NO.
+# The default value is: YES.
IDL_PROPERTY_SUPPORT = YES
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES, then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
+# The default value is: NO.
DISTRIBUTE_GROUP_DOC = NO
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
-# the same type (for instance a group of public functions) to be put as a
-# subgroup of that type (e.g. under the Public Functions section). Set it to
-# NO to prevent subgrouping. Alternatively, this can be done per class using
-# the \nosubgrouping command.
+# If one adds a struct or class to a group and this option is enabled, then also
+# any nested class or struct is added to the same group. By default this option
+# is disabled and one has to add nested compounds explicitly via \ingroup.
+# The default value is: NO.
-SUBGROUPING = YES
+GROUP_NESTED_COMPOUNDS = NO
-# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
-# is documented as struct, union, or enum with the name of the typedef. So
-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
-# with name TypeT. When disabled the typedef will appear as a member of a file,
-# namespace, or class. And the struct will be named TypeS. This can typically
-# be useful for C code in case the coding convention dictates that all compound
-# types are typedef'ed and only the typedef is referenced, never the tag name.
-
-TYPEDEF_HIDES_STRUCT = NO
+# Set the SUBGROUPING tag to YES to allow class member groups of the same type
+# (for instance a group of public functions) to be put as a subgroup of that
+# type (e.g. under the Public Functions section). Set it to NO to prevent
+# subgrouping. Alternatively, this can be done per class using the
+# \nosubgrouping command.
+# The default value is: YES.
-# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
-# determine which symbols to keep in memory and which to flush to disk.
-# When the cache is full, less often used symbols will be written to disk.
-# For small to medium size projects (<1000 input files) the default value is
-# probably good enough. For larger projects a too small cache size can cause
-# doxygen to be busy swapping symbols to and from disk most of the time
-# causing a significant performance penality.
-# If the system has enough physical memory increasing the cache will improve the
-# performance by keeping more symbols in memory. Note that the value works on
-# a logarithmic scale so increasing the size by one will rougly double the
-# memory usage. The cache size is given by this formula:
-# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
-# corresponding to a cache size of 2^16 = 65536 symbols
+SUBGROUPING = YES
-SYMBOL_CACHE_SIZE = 0
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
+# are shown inside the group in which they are included (e.g. using \ingroup)
+# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
+# and RTF).
+#
+# Note that this feature does not work in combination with
+# SEPARATE_MEMBER_PAGES.
+# The default value is: NO.
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
+# with only public data fields or simple typedef fields will be shown inline in
+# the documentation of the scope in which they are defined (i.e. file,
+# namespace, or group documentation), provided this scope is documented. If set
+# to NO, structs, classes, and unions are shown on a separate page (for HTML and
+# Man pages) or section (for LaTeX and RTF).
+# The default value is: NO.
+
+INLINE_SIMPLE_STRUCTS = NO
+
+# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
+# enum is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically be
+# useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+# The default value is: NO.
+
+TYPEDEF_HIDES_STRUCT = YES
+
+# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
+# cache is used to resolve symbols given their name and scope. Since this can be
+# an expensive process and often the same symbol appears multiple times in the
+# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
+# doxygen will become slower. If the cache is too large, memory is wasted. The
+# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
+# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
+# symbols. At the end of a run doxygen will report the cache usage and suggest
+# the optimal cache size from a speed point of view.
+# Minimum value: 0, maximum value: 9, default value: 0.
+
+LOOKUP_CACHE_SIZE = 0
+
+# The NUM_PROC_THREADS specifies the number threads doxygen is allowed to use
+# during processing. When set to 0 doxygen will based this on the number of
+# cores available in the system. You can set it explicitly to a value larger
+# than 0 to get more control over the balance between CPU load and processing
+# speed. At this moment only the input processing can be done using multiple
+# threads. Since this is still an experimental feature the default is set to 1,
+# which effectively disables parallel processing. Please report any issues you
+# encounter. Generating dot graphs in parallel is controlled by the
+# DOT_NUM_THREADS setting.
+# Minimum value: 0, maximum value: 32, default value: 1.
+
+NUM_PROC_THREADS = 1
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available.
-# Private class members and static file members will be hidden unless
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in
+# documentation are documented, even if no documentation was available. Private
+# class members and static file members will be hidden unless the
+# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
+# Note: This will also disable the warnings about undocumented members that are
+# normally produced when WARNINGS is set to YES.
+# The default value is: NO.
EXTRACT_ALL = YES
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
-# will be included in the documentation.
+# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
+# be included in the documentation.
+# The default value is: NO.
-EXTRACT_PRIVATE = NO
+EXTRACT_PRIVATE = YES
-# If the EXTRACT_STATIC tag is set to YES all static members of a file
-# will be included in the documentation.
+# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual
+# methods of a class will be included in the documentation.
+# The default value is: NO.
-EXTRACT_STATIC = NO
+EXTRACT_PRIV_VIRTUAL = YES
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
-# defined locally in source files will be included in the documentation.
-# If set to NO only classes defined in header files are included.
+# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
+# scope will be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PACKAGE = YES
+
+# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
+# included in the documentation.
+# The default value is: NO.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
+# locally in source files will be included in the documentation. If set to NO,
+# only classes defined in header files are included. Does not have any effect
+# for Java sources.
+# The default value is: YES.
EXTRACT_LOCAL_CLASSES = YES
-# This flag is only useful for Objective-C code. When set to YES local
-# methods, which are defined in the implementation section but not in
-# the interface are included in the documentation.
-# If set to NO (the default) only methods in the interface are included.
+# This flag is only useful for Objective-C code. If set to YES, local methods,
+# which are defined in the implementation section but not in the interface are
+# included in the documentation. If set to NO, only methods in the interface are
+# included.
+# The default value is: NO.
+
+EXTRACT_LOCAL_METHODS = YES
-EXTRACT_LOCAL_METHODS = NO
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base name of
+# the file that contains the anonymous namespace. By default anonymous namespace
+# are hidden.
+# The default value is: NO.
-# If this flag is set to YES, the members of anonymous namespaces will be
-# extracted and appear in the documentation as a namespace called
-# 'anonymous_namespace{file}', where file will be replaced with the base
-# name of the file that contains the anonymous namespace. By default
-# anonymous namespace are hidden.
+EXTRACT_ANON_NSPACES = YES
-EXTRACT_ANON_NSPACES = NO
+# If this flag is set to YES, the name of an unnamed parameter in a declaration
+# will be determined by the corresponding definition. By default unnamed
+# parameters remain unnamed in the output.
+# The default value is: YES.
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
-# undocumented members of documented classes, files or namespaces.
-# If set to NO (the default) these members will be included in the
-# various overviews, but no documentation section is generated.
-# This option has no effect if EXTRACT_ALL is enabled.
+RESOLVE_UNNAMED_PARAMS = YES
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
+# undocumented members inside documented classes or files. If set to NO these
+# members will be included in the various overviews, but no documentation
+# section is generated. This option has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
HIDE_UNDOC_MEMBERS = NO
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy.
-# If set to NO (the default) these classes will be included in the various
-# overviews. This option has no effect if EXTRACT_ALL is enabled.
+# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy. If set
+# to NO, these classes will be included in the various overviews. This option
+# has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
HIDE_UNDOC_CLASSES = NO
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
-# friend (class|struct|union) declarations.
-# If set to NO (the default) these declarations will be included in the
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
+# declarations. If set to NO, these declarations will be included in the
# documentation.
+# The default value is: NO.
HIDE_FRIEND_COMPOUNDS = NO
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
-# documentation blocks found inside the body of a function.
-# If set to NO (the default) these blocks will be appended to the
-# function's detailed documentation block.
+# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
+# documentation blocks found inside the body of a function. If set to NO, these
+# blocks will be appended to the function's detailed documentation block.
+# The default value is: NO.
HIDE_IN_BODY_DOCS = NO
-# The INTERNAL_DOCS tag determines if documentation
-# that is typed after a \internal command is included. If the tag is set
-# to NO (the default) then the documentation will be excluded.
-# Set it to YES to include the internal documentation.
+# The INTERNAL_DOCS tag determines if documentation that is typed after a
+# \internal command is included. If the tag is set to NO then the documentation
+# will be excluded. Set it to YES to include the internal documentation.
+# The default value is: NO.
+
+INTERNAL_DOCS = YES
+
+# With the correct setting of option CASE_SENSE_NAMES doxygen will better be
+# able to match the capabilities of the underlying filesystem. In case the
+# filesystem is case sensitive (i.e. it supports files in the same directory
+# whose names only differ in casing), the option must be set to YES to properly
+# deal with such files in case they appear in the input. For filesystems that
+# are not case sensitive the option should be be set to NO to properly deal with
+# output files written for symbols that only differ in casing, such as for two
+# classes, one named CLASS and the other named Class, and to also support
+# references to files without having to specify the exact matching casing. On
+# Windows (including Cygwin) and MacOS, users should typically set this option
+# to NO, whereas on Linux or other Unix flavors it should typically be set to
+# YES.
+# The default value is: system dependent.
-INTERNAL_DOCS = NO
+CASE_SENSE_NAMES = YES
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
-# file names in lower-case letters. If set to YES upper-case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
-# and Mac users are advised to set this option to NO.
+# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
+# their full class and namespace scopes in the documentation. If set to YES, the
+# scope will be hidden.
+# The default value is: NO.
-CASE_SENSE_NAMES = YES
+HIDE_SCOPE_NAMES = NO
+
+# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will
+# append additional text to a page's title, such as Class Reference. If set to
+# YES the compound reference will be hidden.
+# The default value is: NO.
+
+HIDE_COMPOUND_REFERENCE= NO
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
-# will show members with their full class and namespace scopes in the
-# documentation. If set to YES the scope will be hidden.
+# If the SHOW_HEADERFILE tag is set to YES then the documentation for a class
+# will show which file needs to be included to use the class.
+# The default value is: YES.
-HIDE_SCOPE_NAMES = YES
+SHOW_HEADERFILE = YES
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
-# will put a list of the files that are included by a file in the documentation
-# of that file.
+# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
+# the files that are included by a file in the documentation of that file.
+# The default value is: YES.
SHOW_INCLUDE_FILES = YES
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
-# is inserted in the documentation for inline members.
+# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
+# grouped member an include statement to the documentation, telling the reader
+# which file to include in order to use the member.
+# The default value is: NO.
+
+SHOW_GROUPED_MEMB_INC = YES
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
+# files with double quotes in the documentation rather than with sharp brackets.
+# The default value is: NO.
+
+FORCE_LOCAL_INCLUDES = NO
+
+# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
+# documentation for inline members.
+# The default value is: YES.
INLINE_INFO = YES
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
-# will sort the (detailed) documentation of file and class members
-# alphabetically by member name. If set to NO the members will appear in
-# declaration order.
+# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
+# (detailed) documentation of file and class members alphabetically by member
+# name. If set to NO, the members will appear in declaration order.
+# The default value is: YES.
SORT_MEMBER_DOCS = YES
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
-# brief documentation of file, namespace and class members alphabetically
-# by member name. If set to NO (the default) the members will appear in
-# declaration order.
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
+# descriptions of file, namespace and class members alphabetically by member
+# name. If set to NO, the members will appear in declaration order. Note that
+# this will also influence the order of the classes in the class list.
+# The default value is: NO.
-SORT_BRIEF_DOCS = NO
+SORT_BRIEF_DOCS = YES
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
-# hierarchy of group names into alphabetical order. If set to NO (the default)
-# the group names will appear in their defined order.
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
+# (brief and detailed) documentation of class members so that constructors and
+# destructors are listed first. If set to NO the constructors will appear in the
+# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
+# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
+# member documentation.
+# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
+# detailed member documentation.
+# The default value is: NO.
+
+SORT_MEMBERS_CTORS_1ST = YES
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
+# of group names into alphabetical order. If set to NO the group names will
+# appear in their defined order.
+# The default value is: NO.
SORT_GROUP_NAMES = NO
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
-# sorted by fully-qualified names, including namespaces. If set to
-# NO (the default), the class list will be sorted only by class name,
-# not including the namespace part.
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the
-# alphabetical list.
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
+# fully-qualified names, including namespaces. If set to NO, the class list will
+# be sorted only by class name, not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the alphabetical
+# list.
+# The default value is: NO.
SORT_BY_SCOPE_NAME = NO
-# The GENERATE_TODOLIST tag can be used to enable (YES) or
-# disable (NO) the todo list. This list is created by putting \todo
-# commands in the documentation.
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
+# type resolution of all parameters of a function it will reject a match between
+# the prototype and the implementation of a member function even if there is
+# only one candidate or it is obvious which candidate to choose by doing a
+# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
+# accept a match between prototype and implementation in such cases.
+# The default value is: NO.
+
+STRICT_PROTO_MATCHING = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo
+# list. This list is created by putting \todo commands in the documentation.
+# The default value is: YES.
GENERATE_TODOLIST = YES
-# The GENERATE_TESTLIST tag can be used to enable (YES) or
-# disable (NO) the test list. This list is created by putting \test
-# commands in the documentation.
+# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test
+# list. This list is created by putting \test commands in the documentation.
+# The default value is: YES.
GENERATE_TESTLIST = YES
-# The GENERATE_BUGLIST tag can be used to enable (YES) or
-# disable (NO) the bug list. This list is created by putting \bug
-# commands in the documentation.
+# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug
+# list. This list is created by putting \bug commands in the documentation.
+# The default value is: YES.
GENERATE_BUGLIST = YES
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
-# disable (NO) the deprecated list. This list is created by putting
-# \deprecated commands in the documentation.
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)
+# the deprecated list. This list is created by putting \deprecated commands in
+# the documentation.
+# The default value is: YES.
GENERATE_DEPRECATEDLIST= YES
-# The ENABLED_SECTIONS tag can be used to enable conditional
-# documentation sections, marked by \if sectionname ... \endif.
+# The ENABLED_SECTIONS tag can be used to enable conditional documentation
+# sections, marked by \if <section_label> ... \endif and \cond <section_label>
+# ... \endcond blocks.
-ENABLED_SECTIONS =
+ENABLED_SECTIONS =
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
-# the initial value of a variable or define consists of for it to appear in
-# the documentation. If the initializer consists of more lines than specified
-# here it will be hidden. Use a value of 0 to hide initializers completely.
-# The appearance of the initializer of individual variables and defines in the
-# documentation can be controlled using \showinitializer or \hideinitializer
-# command in the documentation regardless of this setting.
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
+# initial value of a variable or macro / define can have for it to appear in the
+# documentation. If the initializer consists of more lines than specified here
+# it will be hidden. Use a value of 0 to hide initializers completely. The
+# appearance of the value of individual variables and macros / defines can be
+# controlled using \showinitializer or \hideinitializer command in the
+# documentation regardless of this setting.
+# Minimum value: 0, maximum value: 10000, default value: 30.
MAX_INITIALIZER_LINES = 30
-# If the sources in your project are distributed over multiple directories
-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
-# in the documentation. The default is NO.
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
+# the bottom of the documentation of classes and structs. If set to YES, the
+# list will mention the files that were used to generate the documentation.
+# The default value is: YES.
-SHOW_DIRECTORIES = NO
+SHOW_USED_FILES = YES
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
-# This will remove the Files entry from the Quick Index and from the
-# Folder Tree View (if specified). The default is YES.
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
+# will remove the Files entry from the Quick Index and from the Folder Tree View
+# (if specified).
+# The default value is: YES.
SHOW_FILES = YES
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
-# Namespaces page. This will remove the Namespaces entry from the Quick Index
-# and from the Folder Tree View (if specified). The default is YES.
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
+# page. This will remove the Namespaces entry from the Quick Index and from the
+# Folder Tree View (if specified).
+# The default value is: YES.
SHOW_NAMESPACES = YES
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
-# doxygen should invoke to get the current version for each file (typically from
-# the version control system). Doxygen will invoke the program by executing (via
-# popen()) the command <command> <input-file>, where <command> is the value of
-# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
-# provided by doxygen. Whatever the program writes to standard output
-# is used as the file version. See the manual for examples.
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command command input-file, where command is the value of the
+# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
+# by doxygen. Whatever the program writes to standard output is used as the file
+# version. For an example see the documentation.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. To create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option. You can
+# optionally specify a file name after the option, if omitted DoxygenLayout.xml
+# will be used as the name of the layout file. See also section "Changing the
+# layout of pages" for information.
+#
+# Note that if you run doxygen from a directory containing a file called
+# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
+# tag is left empty.
-FILE_VERSION_FILTER =
+LAYOUT_FILE =
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
-# doxygen. The layout file controls the global structure of the generated output files
-# in an output format independent way. The create the layout file that represents
-# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
-# file name after the option, if omitted DoxygenLayout.xml will be used as the name
-# of the layout file.
+# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
+# the reference definitions. This must be a list of .bib files. The .bib
+# extension is automatically appended if omitted. This requires the bibtex tool
+# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info.
+# For LaTeX the style of the bibliography can be controlled using
+# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
+# search path. See also \cite for info how to create references.
-LAYOUT_FILE =
+CITE_BIB_FILES =
#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
+# Configuration options related to warning and progress messages
#---------------------------------------------------------------------------
-# The QUIET tag can be used to turn on/off the messages that are generated
-# by doxygen. Possible values are YES and NO. If left blank NO is used.
+# The QUIET tag can be used to turn on/off the messages that are generated to
+# standard output by doxygen. If QUIET is set to YES this implies that the
+# messages are off.
+# The default value is: NO.
QUIET = NO
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated by doxygen. Possible values are YES and NO. If left blank
-# NO is used.
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES
+# this implies that the warnings are on.
+#
+# Tip: Turn warnings on while writing the documentation.
+# The default value is: YES.
WARNINGS = YES
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
-# automatically be disabled.
+# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate
+# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
+# will automatically be disabled.
+# The default value is: YES.
WARN_IF_UNDOCUMENTED = YES
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some
-# parameters in a documented function, or documenting parameters that
-# don't exist or using markup commands wrongly.
+# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as documenting some parameters in
+# a documented function twice, or documenting parameters that don't exist or
+# using markup commands wrongly.
+# The default value is: YES.
WARN_IF_DOC_ERROR = YES
-# This WARN_NO_PARAMDOC option can be abled to get warnings for
-# functions that are documented, but have no documentation for their parameters
-# or return value. If set to NO (the default) doxygen will only warn about
-# wrong or incomplete parameter documentation, but not about the absence of
-# documentation.
+# If WARN_IF_INCOMPLETE_DOC is set to YES, doxygen will warn about incomplete
+# function parameter documentation. If set to NO, doxygen will accept that some
+# parameters have no documentation without warning.
+# The default value is: YES.
+
+WARN_IF_INCOMPLETE_DOC = YES
+
+# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
+# are documented, but have no documentation for their parameters or return
+# value. If set to NO, doxygen will only warn about wrong parameter
+# documentation, but not about the absence of documentation. If EXTRACT_ALL is
+# set to YES then this flag will automatically be disabled. See also
+# WARN_IF_INCOMPLETE_DOC
+# The default value is: NO.
WARN_NO_PARAMDOC = NO
-# The WARN_FORMAT tag determines the format of the warning messages that
-# doxygen can produce. The string should contain the $file, $line, and $text
-# tags, which will be replaced by the file and line number from which the
-# warning originated and the warning text. Optionally the format may contain
-# $version, which will be replaced by the version of the file (if it could
-# be obtained via FILE_VERSION_FILTER)
+# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
+# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS
+# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but
+# at the end of the doxygen process doxygen will return with a non-zero status.
+# Possible values are: NO, YES and FAIL_ON_WARNINGS.
+# The default value is: NO.
+
+WARN_AS_ERROR = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that doxygen
+# can produce. The string should contain the $file, $line, and $text tags, which
+# will be replaced by the file and line number from which the warning originated
+# and the warning text. Optionally the format may contain $version, which will
+# be replaced by the version of the file (if it could be obtained via
+# FILE_VERSION_FILTER)
+# The default value is: $file:$line: $text.
WARN_FORMAT = "$file:$line: $text"
-# The WARN_LOGFILE tag can be used to specify a file to which warning
-# and error messages should be written. If left blank the output is written
-# to stderr.
+# The WARN_LOGFILE tag can be used to specify a file to which warning and error
+# messages should be written. If left blank the output is written to standard
+# error (stderr).
-WARN_LOGFILE =
+WARN_LOGFILE =
#---------------------------------------------------------------------------
-# configuration options related to the input files
+# Configuration options related to the input files
#---------------------------------------------------------------------------
-# The INPUT tag can be used to specify the files and/or directories that contain
-# documented source files. You may enter file names like "myfile.cpp" or
-# directories like "/usr/src/myproject". Separate the files or directories
-# with spaces.
+# The INPUT tag is used to specify the files and/or directories that contain
+# documented source files. You may enter file names like myfile.cpp or
+# directories like /usr/src/myproject. Separate the files or directories with
+# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
+# Note: If this tag is empty the current directory is searched.
-INPUT = .
+INPUT =
-# This tag can be used to specify the character encoding of the source files
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
-# also the default input encoding. Doxygen uses libiconv (or the iconv built
-# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
-# the list of possible encodings.
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
+# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
+# documentation (see:
+# https://www.gnu.org/software/libiconv/) for the list of possible encodings.
+# The default value is: UTF-8.
INPUT_ENCODING = UTF-8
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank the following patterns are tested:
-# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
-# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
+# *.h) to filter out the source-files in the directories.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# read by doxygen.
+#
+# Note the list of default checked file patterns might differ from the list of
+# default file extension mappings.
+#
+# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
+# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
+# *.hh, *.hxx, *.hpp, *.h++, *.l, *.cs, *.d, *.php, *.php4, *.php5, *.phtml,
+# *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C
+# comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd,
+# *.vhdl, *.ucf, *.qsf and *.ice.
-FILE_PATTERNS =
+FILE_PATTERNS = *.c *.cc *.cxx *.cpp *.c++ *.h *.hh *.hxx *.hpp *.h++ *.qc *.qh *.inc *.md
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories
-# should be searched for input files as well. Possible values are YES and NO.
-# If left blank NO is used.
+# The RECURSIVE tag can be used to specify whether or not subdirectories should
+# be searched for input files as well.
+# The default value is: NO.
RECURSIVE = YES
-# The EXCLUDE tag can be used to specify files and/or directories that should
-# excluded from the INPUT source files. This way you can easily exclude a
+# The EXCLUDE tag can be used to specify files and/or directories that should be
+# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
+#
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
-EXCLUDE =
+EXCLUDE =
-# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
-# directories that are symbolic links (a Unix filesystem feature) are excluded
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
# from the input.
+# The default value is: NO.
EXCLUDE_SYMLINKS = NO
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories. Note that the wildcards are matched
-# against the file with absolute path, so to exclude all test directories
-# for example use the pattern */test/*
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories.
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories for example use the pattern */test/*
-EXCLUDE_PATTERNS =
+EXCLUDE_PATTERNS =
-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
-# (namespaces, classes, functions, etc.) that should be excluded from the
-# output. The symbol name can be a fully qualified name, a word, or if the
-# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
# AClass::ANamespace, ANamespace::*Test
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories use the pattern */test/*
-EXCLUDE_SYMBOLS =
+EXCLUDE_SYMBOLS =
-# The EXAMPLE_PATH tag can be used to specify one or more files or
-# directories that contain example code fragments that are included (see
-# the \include command).
+# The EXAMPLE_PATH tag can be used to specify one or more files or directories
+# that contain example code fragments that are included (see the \include
+# command).
-EXAMPLE_PATH =
+EXAMPLE_PATH =
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank all files are included.
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank all
+# files are included.
-EXAMPLE_PATTERNS =
+EXAMPLE_PATTERNS =
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude
-# commands irrespective of the value of the RECURSIVE tag.
-# Possible values are YES and NO. If left blank NO is used.
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude commands
+# irrespective of the value of the RECURSIVE tag.
+# The default value is: NO.
EXAMPLE_RECURSIVE = NO
-# The IMAGE_PATH tag can be used to specify one or more files or
-# directories that contain image that are included in the documentation (see
-# the \image command).
+# The IMAGE_PATH tag can be used to specify one or more files or directories
+# that contain images that are to be included in the documentation (see the
+# \image command).
-IMAGE_PATH =
+IMAGE_PATH =
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command <filter> <input-file>, where <filter>
-# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
-# input file. Doxygen will then use the output that the filter program writes
-# to standard output. If FILTER_PATTERNS is specified, this tag will be
-# ignored.
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command:
+#
+# <filter> <input-file>
+#
+# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
+# name of an input file. Doxygen will then use the output that the filter
+# program writes to standard output. If FILTER_PATTERNS is specified, this tag
+# will be ignored.
+#
+# Note that the filter must not add or remove lines; it is applied before the
+# code is scanned, but not when the output code is generated. If lines are added
+# or removed, the anchors will not be placed correctly.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# properly processed by doxygen.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form: pattern=filter
+# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
+# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
+# patterns match the file name, INPUT_FILTER is applied.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# properly processed by doxygen.
-INPUT_FILTER =
+FILTER_PATTERNS =
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis. Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match. The filters are a list of the form:
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
-# is applied to all files.
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will also be used to filter the input files that are used for
+# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
+# The default value is: NO.
-FILTER_PATTERNS =
+FILTER_SOURCE_FILES = NO
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will be used to filter the input files when producing source
-# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
+# it is also possible to disable source filtering for a specific pattern using
+# *.ext= (so without naming a filter).
+# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
-FILTER_SOURCE_FILES = NO
+FILTER_SOURCE_PATTERNS =
+
+# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
+# is part of the input, its contents will be placed on the main page
+# (index.html). This can be useful if you have a project on for instance GitHub
+# and want to reuse the introduction page also for the doxygen output.
+
+USE_MDFILE_AS_MAINPAGE = README.md
#---------------------------------------------------------------------------
-# configuration options related to source browsing
+# Configuration options related to source browsing
#---------------------------------------------------------------------------
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will
-# be generated. Documented entities will be cross-referenced with these sources.
-# Note: To get rid of all source code in the generated output, make sure also
-# VERBATIM_HEADERS is set to NO.
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
+# generated. Documented entities will be cross-referenced with these sources.
+#
+# Note: To get rid of all source code in the generated output, make sure that
+# also VERBATIM_HEADERS is set to NO.
+# The default value is: NO.
SOURCE_BROWSER = YES
-# Setting the INLINE_SOURCES tag to YES will include the body
-# of functions and classes directly in the documentation.
+# Setting the INLINE_SOURCES tag to YES will include the body of functions,
+# classes and enums directly into the documentation.
+# The default value is: NO.
-INLINE_SOURCES = NO
+INLINE_SOURCES = YES
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
-# doxygen to hide any special comment blocks from generated source code
-# fragments. Normal C and C++ comments will always remain visible.
+# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
+# special comment blocks from generated source code fragments. Normal C, C++ and
+# Fortran comments will always remain visible.
+# The default value is: YES.
STRIP_CODE_COMMENTS = YES
-# If the REFERENCED_BY_RELATION tag is set to YES
-# then for each documented function all documented
-# functions referencing it will be listed.
+# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
+# entity all documented functions referencing it will be listed.
+# The default value is: NO.
-REFERENCED_BY_RELATION = NO
+REFERENCED_BY_RELATION = YES
-# If the REFERENCES_RELATION tag is set to YES
-# then for each documented function all documented entities
-# called/used by that function will be listed.
+# If the REFERENCES_RELATION tag is set to YES then for each documented function
+# all documented entities called/used by that function will be listed.
+# The default value is: NO.
-REFERENCES_RELATION = NO
+REFERENCES_RELATION = YES
-# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
-# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
-# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
-# link to the source code. Otherwise they will link to the documentation.
+# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
+# to YES then the hyperlinks from functions in REFERENCES_RELATION and
+# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
+# link to the documentation.
+# The default value is: YES.
REFERENCES_LINK_SOURCE = YES
-# If the USE_HTAGS tag is set to YES then the references to source code
-# will point to the HTML generated by the htags(1) tool instead of doxygen
-# built-in source browser. The htags tool is part of GNU's global source
-# tagging system (see http://www.gnu.org/software/global/global.html). You
-# will need version 4.8.6 or higher.
+# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
+# source code will show a tooltip with additional information such as prototype,
+# brief description and links to the definition and documentation. Since this
+# will make the HTML file larger and loading of large files a bit slower, you
+# can opt to disable this feature.
+# The default value is: YES.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+SOURCE_TOOLTIPS = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code will
+# point to the HTML generated by the htags(1) tool instead of doxygen built-in
+# source browser. The htags tool is part of GNU's global source tagging system
+# (see https://www.gnu.org/software/global/global.html). You will need version
+# 4.8.6 or higher.
+#
+# To use it do the following:
+# - Install the latest version of global
+# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file
+# - Make sure the INPUT points to the root of the source tree
+# - Run doxygen as normal
+#
+# Doxygen will invoke htags (and that will in turn invoke gtags), so these
+# tools must be available from the command line (i.e. in the search path).
+#
+# The result: instead of the source browser generated by doxygen, the links to
+# source code will now point to the output of htags.
+# The default value is: NO.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
USE_HTAGS = NO
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
-# will generate a verbatim copy of the header file for each class for
-# which an include is specified. Set to NO to disable this.
+# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
+# verbatim copy of the header file for each class for which an include is
+# specified. Set to NO to disable this.
+# See also: Section \class.
+# The default value is: YES.
VERBATIM_HEADERS = YES
+# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the
+# clang parser (see:
+# http://clang.llvm.org/) for more accurate parsing at the cost of reduced
+# performance. This can be particularly helpful with template rich C++ code for
+# which doxygen's built-in parser lacks the necessary type information.
+# Note: The availability of this option depends on whether or not doxygen was
+# generated with the -Duse_libclang=ON option for CMake.
+# The default value is: NO.
+
+CLANG_ASSISTED_PARSING = NO
+
+# If the CLANG_ASSISTED_PARSING tag is set to YES and the CLANG_ADD_INC_PATHS
+# tag is set to YES then doxygen will add the directory of each input to the
+# include path.
+# The default value is: YES.
+# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.
+
+CLANG_ADD_INC_PATHS = YES
+
+# If clang assisted parsing is enabled you can provide the compiler with command
+# line options that you would normally use when invoking the compiler. Note that
+# the include paths will already be set by doxygen for the files and directories
+# specified with INPUT and INCLUDE_PATH.
+# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.
+
+CLANG_OPTIONS =
+
+# If clang assisted parsing is enabled you can provide the clang parser with the
+# path to the directory containing a file called compile_commands.json. This
+# file is the compilation database (see:
+# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) containing the
+# options used when the source files were built. This is equivalent to
+# specifying the -p option to a clang tool, such as clang-check. These options
+# will then be passed to the parser. Any options specified with CLANG_OPTIONS
+# will be added as well.
+# Note: The availability of this option depends on whether or not doxygen was
+# generated with the -Duse_libclang=ON option for CMake.
+
+CLANG_DATABASE_PATH =
+
#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
+# Configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
-# of all compounds will be generated. Enable this if the project
-# contains a lot of classes, structs, unions or interfaces.
-
-ALPHABETICAL_INDEX = NO
-
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
-# in which this list will be split (can be a number in the range [1..20])
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
+# compounds will be generated. Enable this if the project contains a lot of
+# classes, structs, unions or interfaces.
+# The default value is: YES.
-COLS_IN_ALPHA_INDEX = 5
+ALPHABETICAL_INDEX = YES
-# In case all classes in a project start with a common prefix, all
-# classes will be put under the same header in the alphabetical index.
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
-# should be ignored while generating the index headers.
+# In case all classes in a project start with a common prefix, all classes will
+# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
+# can be used to specify a prefix (or a list of prefixes) that should be ignored
+# while generating the index headers.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
-IGNORE_PREFIX =
+IGNORE_PREFIX =
#---------------------------------------------------------------------------
-# configuration options related to the HTML output
+# Configuration options related to the HTML output
#---------------------------------------------------------------------------
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
-# generate HTML output.
+# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
+# The default value is: YES.
GENERATE_HTML = YES
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `html' will be used as the default path.
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_OUTPUT = html
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
-# doxygen will generate files with .html extension.
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
+# generated HTML page (for example: .htm, .php, .asp).
+# The default value is: .html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_FILE_EXTENSION = .html
-# The HTML_HEADER tag can be used to specify a personal HTML header for
-# each generated HTML page. If it is left blank doxygen will generate a
+# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
+# each generated HTML page. If the tag is left blank doxygen will generate a
# standard header.
-
-HTML_HEADER =
-
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard footer.
-
-HTML_FOOTER =
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
-# style sheet that is used by each HTML page. It can be used to
-# fine-tune the look of the HTML output. If the tag is left blank doxygen
-# will generate a default style sheet. Note that doxygen will try to copy
-# the style sheet file to the HTML output directory, so don't put your own
-# stylesheet in the HTML output directory as well, or it will be erased!
-
-HTML_STYLESHEET =
-
-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
-# files or namespaces will be aligned in HTML using tables. If set to
-# NO a bullet list will be used.
-
-HTML_ALIGN_MEMBERS = YES
-
-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
-# documentation will contain sections that can be hidden and shown after the
-# page has loaded. For this to work a browser that supports
-# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
-# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
-
-HTML_DYNAMIC_SECTIONS = NO
-
-# If the GENERATE_DOCSET tag is set to YES, additional index files
-# will be generated that can be used as input for Apple's Xcode 3
-# integrated development environment, introduced with OSX 10.5 (Leopard).
-# To create a documentation set, doxygen will generate a Makefile in the
-# HTML output directory. Running make will produce the docset in that
-# directory and running "make install" will install the docset in
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
-# it at startup.
-# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+#
+# To get valid HTML the header file that includes any scripts and style sheets
+# that doxygen needs, which is dependent on the configuration options used (e.g.
+# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
+# default header using
+# doxygen -w html new_header.html new_footer.html new_stylesheet.css
+# YourConfigFile
+# and then modify the file new_header.html. See also section "Doxygen usage"
+# for information on how to generate the default header that doxygen normally
+# uses.
+# Note: The header is subject to change so you typically have to regenerate the
+# default header when upgrading to a newer version of doxygen. For a description
+# of the possible markers and block names see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
+# generated HTML page. If the tag is left blank doxygen will generate a standard
+# footer. See HTML_HEADER for more information on how to generate a default
+# footer and what special commands can be used inside the footer. See also
+# section "Doxygen usage" for information on how to generate the default footer
+# that doxygen normally uses.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
+# sheet that is used by each HTML page. It can be used to fine-tune the look of
+# the HTML output. If left blank doxygen will generate a default style sheet.
+# See also section "Doxygen usage" for information on how to generate the style
+# sheet that doxygen normally uses.
+# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
+# it is more robust and this tag (HTML_STYLESHEET) will in the future become
+# obsolete.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_STYLESHEET =
+
+# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# cascading style sheets that are included after the standard style sheets
+# created by doxygen. Using this option one can overrule certain style aspects.
+# This is preferred over using HTML_STYLESHEET since it does not replace the
+# standard style sheet and is therefore more robust against future updates.
+# Doxygen will copy the style sheet files to the output directory.
+# Note: The order of the extra style sheet files is of importance (e.g. the last
+# style sheet in the list overrules the setting of the previous ones in the
+# list). For an example see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_STYLESHEET =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
+# files will be copied as-is; there are no commands or markers available.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_FILES =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
+# will adjust the colors in the style sheet and background images according to
+# this color. Hue is specified as an angle on a color-wheel, see
+# https://en.wikipedia.org/wiki/Hue for more information. For instance the value
+# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
+# purple, and 360 is red again.
+# Minimum value: 0, maximum value: 359, default value: 220.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_HUE = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
+# in the HTML output. For a value of 0 the output will use gray-scales only. A
+# value of 255 will produce the most vivid colors.
+# Minimum value: 0, maximum value: 255, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_SAT = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
+# luminance component of the colors in the HTML output. Values below 100
+# gradually make the output lighter, whereas values above 100 make the output
+# darker. The value divided by 100 is the actual gamma applied, so 80 represents
+# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
+# change the gamma.
+# Minimum value: 40, maximum value: 240, default value: 80.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_GAMMA = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting this
+# to YES can help to show when doxygen was last run and thus if the
+# documentation is up to date.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_TIMESTAMP = YES
+
+# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML
+# documentation will contain a main index with vertical navigation menus that
+# are dynamically created via JavaScript. If disabled, the navigation index will
+# consists of multiple levels of tabs that are statically embedded in every HTML
+# page. Disable this option to support browsers that do not have JavaScript,
+# like the Qt help browser.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_DYNAMIC_MENUS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
+# shown in the various tree structured indices initially; the user can expand
+# and collapse entries dynamically later on. Doxygen will expand the tree to
+# such a level that at most the specified number of entries are visible (unless
+# a fully collapsed tree already exceeds this amount). So setting the number of
+# entries 1 will produce a full collapsed tree by default. 0 is a special value
+# representing an infinite number of entries and will result in a full expanded
+# tree by default.
+# Minimum value: 0, maximum value: 9999, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_INDEX_NUM_ENTRIES = 100
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files will be
+# generated that can be used as input for Apple's Xcode 3 integrated development
+# environment (see:
+# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To
+# create a documentation set, doxygen will generate a Makefile in the HTML
+# output directory. Running make will produce the docset in that directory and
+# running make install will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
+# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy
+# genXcode/_index.html for more information.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_DOCSET = NO
-# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
-# feed. A documentation feed provides an umbrella under which multiple
-# documentation sets from a single provider (such as a company or product suite)
-# can be grouped.
+# This tag determines the name of the docset feed. A documentation feed provides
+# an umbrella under which multiple documentation sets from a single provider
+# (such as a company or product suite) can be grouped.
+# The default value is: Doxygen generated docs.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_FEEDNAME = "Doxygen generated docs"
-# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
-# should uniquely identify the documentation set bundle. This should be a
-# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
-# will append .docset to the name.
+# This tag specifies a string that should uniquely identify the documentation
+# set bundle. This should be a reverse domain-name style string, e.g.
+# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_BUNDLE_ID = org.doxygen.Project
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files
-# will be generated that can be used as input for tools like the
-# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
-# of the generated HTML documentation.
+# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+# The default value is: org.doxygen.Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_ID = org.doxygen.Publisher
+
+# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
+# The default value is: Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_NAME = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
+# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
+# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
+# on Windows. In the beginning of 2021 Microsoft took the original page, with
+# a.o. the download links, offline the HTML help workshop was already many years
+# in maintenance mode). You can download the HTML help workshop from the web
+# archives at Installation executable (see:
+# http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo
+# ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe).
+#
+# The HTML Help Workshop contains a compiler that can convert all HTML output
+# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
+# files are now used as the Windows 98 help format, and will replace the old
+# Windows help format (.hlp) on all Windows platforms in the future. Compressed
+# HTML files also contain an index, a table of contents, and you can search for
+# words in the documentation. The HTML workshop also contains a viewer for
+# compressed HTML files.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_HTMLHELP = NO
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
-# be used to specify the file name of the resulting .chm file. You
-# can add a path in front of the file if the result should not be
+# The CHM_FILE tag can be used to specify the file name of the resulting .chm
+# file. You can add a path in front of the file if the result should not be
# written to the html output directory.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-CHM_FILE =
+CHM_FILE =
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
-# be used to specify the location (absolute path including file name) of
-# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
-# the HTML help compiler on the generated index.hhp.
+# The HHC_LOCATION tag can be used to specify the location (absolute path
+# including file name) of the HTML help compiler (hhc.exe). If non-empty,
+# doxygen will try to run the HTML help compiler on the generated index.hhp.
+# The file has to be specified with full path.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-HHC_LOCATION =
+HHC_LOCATION =
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
-# controls if a separate .chi index file is generated (YES) or that
-# it should be included in the master .chm file (NO).
+# The GENERATE_CHI flag controls if a separate .chi index file is generated
+# (YES) or that it should be included in the main .chm file (NO).
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
GENERATE_CHI = NO
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
-# is used to encode HtmlHelp index (hhk), content (hhc) and project file
-# content.
+# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc)
+# and project file content.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-CHM_INDEX_ENCODING =
+CHM_INDEX_ENCODING =
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
-# controls whether a binary table of contents is generated (YES) or a
-# normal table of contents (NO) in the .chm file.
+# The BINARY_TOC flag controls whether a binary table of contents is generated
+# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it
+# enables the Previous and Next buttons.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
BINARY_TOC = NO
-# The TOC_EXPAND flag can be set to YES to add extra items for group members
-# to the contents of the HTML help documentation and to the tree view.
+# The TOC_EXPAND flag can be set to YES to add extra items for group members to
+# the table of contents of the HTML help documentation and to the tree view.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
TOC_EXPAND = NO
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
-# are set, an additional index file will be generated that can be used as input for
-# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
-# HTML documentation.
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
+# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
+# (.qch) of the generated HTML documentation.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_QHP = NO
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
-# be used to specify the file name of the resulting .qch file.
-# The path specified is relative to the HTML output folder.
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
+# the file name of the resulting .qch file. The path specified is relative to
+# the HTML output folder.
+# This tag requires that the tag GENERATE_QHP is set to YES.
-QCH_FILE =
+QCH_FILE =
-# The QHP_NAMESPACE tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#namespace
+# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
+# Project output. For more information please see Qt Help Project / Namespace
+# (see:
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace).
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_QHP is set to YES.
-QHP_NAMESPACE =
+QHP_NAMESPACE = org.doxygen.Project
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
+# Help Project output. For more information please see Qt Help Project / Virtual
+# Folders (see:
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders).
+# The default value is: doc.
+# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_VIRTUAL_FOLDER = doc
-# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add.
-# For more information please see
-# http://doc.trolltech.com/qthelpproject.html#custom-filters
+# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
+# filter to add. For more information please see Qt Help Project / Custom
+# Filters (see:
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_NAME =
+
+# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see Qt Help Project / Custom
+# Filters (see:
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_ATTRS =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's filter section matches. Qt Help Project / Filter Attributes (see:
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_SECT_FILTER_ATTRS =
+
+# The QHG_LOCATION tag can be used to specify the location (absolute path
+# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to
+# run qhelpgenerator on the generated .qhp file.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHG_LOCATION =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
+# generated, together with the HTML files, they form an Eclipse help plugin. To
+# install this plugin and make it available under the help contents menu in
+# Eclipse, the contents of the directory containing the HTML and XML files needs
+# to be copied into the plugins directory of eclipse. The name of the directory
+# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
+# After copying Eclipse needs to be restarted before the help appears.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_ECLIPSEHELP = NO
+
+# A unique identifier for the Eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have this
+# name. Each documentation set should have its own identifier.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
+
+ECLIPSE_DOC_ID = org.doxygen.Project
+
+# If you want full control over the layout of the generated HTML pages it might
+# be necessary to disable the index and replace it with your own. The
+# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
+# of each HTML page. A value of NO enables the index and the value YES disables
+# it. Since the tabs in the index contain the same information as the navigation
+# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+DISABLE_INDEX = YES
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information. If the tag
+# value is set to YES, a side panel will be generated containing a tree-like
+# index structure (just like the one that is generated for HTML Help). For this
+# to work a browser that supports JavaScript, DHTML, CSS and frames is required
+# (i.e. any modern browser). Windows users are probably better off using the
+# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can
+# further fine tune the look of the index (see "Fine-tuning the output"). As an
+# example, the default style sheet generated by doxygen has an example that
+# shows how to put an image at the root of the tree instead of the PROJECT_NAME.
+# Since the tree basically has the same information as the tab index, you could
+# consider setting DISABLE_INDEX to YES when enabling this option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_TREEVIEW = YES
+
+# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the
+# FULL_SIDEBAR option determines if the side bar is limited to only the treeview
+# area (value NO) or if it should extend to the full height of the window (value
+# YES). Setting this to YES gives a layout similar to
+# https://docs.readthedocs.io with more room for contents, but less room for the
+# project logo, title, and description. If either GENERATOR_TREEVIEW or
+# DISABLE_INDEX is set to NO, this option has no effect.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FULL_SIDEBAR = NO
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
+# doxygen will group on one line in the generated HTML documentation.
+#
+# Note that a value of 0 will completely suppress the enum values from appearing
+# in the overview section.
+# Minimum value: 0, maximum value: 20, default value: 4.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+ENUM_VALUES_PER_LINE = 4
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
+# to set the initial width (in pixels) of the frame in which the tree is shown.
+# Minimum value: 0, maximum value: 1500, default value: 250.
+# This tag requires that the tag GENERATE_HTML is set to YES.
-QHP_CUST_FILTER_NAME =
+TREEVIEW_WIDTH = 250
+
+# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to
+# external symbols imported via tag files in a separate window.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
-# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see
-# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">Qt Help Project / Custom Filters</a>.
+EXT_LINKS_IN_WINDOW = NO
-QHP_CUST_FILTER_ATTRS =
+# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg
+# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see
+# https://inkscape.org) to generate formulas as SVG images instead of PNGs for
+# the HTML output. These images will generally look nicer at scaled resolutions.
+# Possible values are: png (the default) and svg (looks nicer but requires the
+# pdf2svg or inkscape tool).
+# The default value is: png.
+# This tag requires that the tag GENERATE_HTML is set to YES.
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's
-# filter section matches.
-# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">Qt Help Project / Filter Attributes</a>.
+HTML_FORMULA_FORMAT = svg
-QHP_SECT_FILTER_ATTRS =
+# Use this tag to change the font size of LaTeX formulas included as images in
+# the HTML documentation. When you change the font size after a successful
+# doxygen run you need to manually remove any form_*.png images from the HTML
+# output directory to force them to be regenerated.
+# Minimum value: 8, maximum value: 50, default value: 10.
+# This tag requires that the tag GENERATE_HTML is set to YES.
-# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
-# be used to specify the location of Qt's qhelpgenerator.
-# If non-empty doxygen will try to run qhelpgenerator on the generated
-# .qhp file.
+FORMULA_FONTSIZE = 10
-QHG_LOCATION =
+# Use the FORMULA_TRANSPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are not
+# supported properly for IE 6.0, but are supported on all modern browsers.
+#
+# Note that when changing this option you need to delete any form_*.png files in
+# the HTML output directory before the changes have effect.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_TRANSPARENT = YES
+
+# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands
+# to create new LaTeX commands to be used in formulas as building blocks. See
+# the section "Including formulas" for details.
+
+FORMULA_MACROFILE =
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
+# https://www.mathjax.org) which uses client side JavaScript for the rendering
+# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
+# installed or if you want to formulas look prettier in the HTML output. When
+# enabled you may also need to install MathJax separately and configure the path
+# to it using the MATHJAX_RELPATH option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+USE_MATHJAX = NO
+
+# With MATHJAX_VERSION it is possible to specify the MathJax version to be used.
+# Note that the different versions of MathJax have different requirements with
+# regards to the different settings, so it is possible that also other MathJax
+# settings have to be changed when switching between the different MathJax
+# versions.
+# Possible values are: MathJax_2 and MathJax_3.
+# The default value is: MathJax_2.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_VERSION = MathJax_2
+
+# When MathJax is enabled you can set the default output format to be used for
+# the MathJax output. For more details about the output format see MathJax
+# version 2 (see:
+# http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3
+# (see:
+# http://docs.mathjax.org/en/latest/web/components/output.html).
+# Possible values are: HTML-CSS (which is slower, but has the best
+# compatibility. This is the name for Mathjax version 2, for MathJax version 3
+# this will be translated into chtml), NativeMML (i.e. MathML. Only supported
+# for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This
+# is the name for Mathjax version 3, for MathJax version 2 this will be
+# translated into HTML-CSS) and SVG.
+# The default value is: HTML-CSS.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_FORMAT = HTML-CSS
+
+# When MathJax is enabled you need to specify the location relative to the HTML
+# output directory using the MATHJAX_RELPATH option. The destination directory
+# should contain the MathJax.js script. For instance, if the mathjax directory
+# is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
+# Content Delivery Network so you can quickly see the result without installing
+# MathJax. However, it is strongly recommended to install a local copy of
+# MathJax from https://www.mathjax.org before deployment. The default value is:
+# - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2
+# - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
+# extension names that should be enabled during MathJax rendering. For example
+# for MathJax version 2 (see
+# https://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions):
+# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
+# For example for MathJax version 3 (see
+# http://docs.mathjax.org/en/latest/input/tex/extensions/index.html):
+# MATHJAX_EXTENSIONS = ams
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_EXTENSIONS =
+
+# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
+# of code that will be used on startup of the MathJax code. See the MathJax site
+# (see:
+# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an
+# example see the documentation.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_CODEFILE =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
+# the HTML output. The underlying search engine uses javascript and DHTML and
+# should work on any modern browser. Note that when using HTML help
+# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
+# there is already a search function so this one should typically be disabled.
+# For large projects the javascript based search engine can be slow, then
+# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
+# search using the keyboard; to jump to the search box use <access key> + S
+# (what the <access key> is depends on the OS and browser, but it is typically
+# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
+# key> to jump into the search results window, the results can be navigated
+# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
+# the search. The filter options can be selected when the cursor is inside the
+# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
+# to select a filter and <Enter> or <escape> to activate or cancel the filter
+# option.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+SEARCHENGINE = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a web server instead of a web client using JavaScript. There
+# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
+# setting. When disabled, doxygen will generate a PHP script for searching and
+# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
+# and searching needs to be provided by external tools. See the section
+# "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SERVER_BASED_SEARCH = YES
+
+# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
+# script for searching. Instead the search results are written to an XML file
+# which needs to be processed by an external indexer. Doxygen will invoke an
+# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
+# search results.
+#
+# Doxygen ships with an example indexer (doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see:
+# https://xapian.org/).
+#
+# See the section "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
-# top of each HTML page. The value NO (the default) enables the index and
-# the value YES disables it.
+EXTERNAL_SEARCH = NO
-DISABLE_INDEX = NO
+# The SEARCHENGINE_URL should point to a search engine hosted by a web server
+# which will return the search results when EXTERNAL_SEARCH is enabled.
+#
+# Doxygen ships with an example indexer (doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see:
+# https://xapian.org/). See the section "External Indexing and Searching" for
+# details.
+# This tag requires that the tag SEARCHENGINE is set to YES.
-# This tag can be used to set the number of enum values (range [1..20])
-# that doxygen will group on one line in the generated HTML documentation.
+SEARCHENGINE_URL =
-ENUM_VALUES_PER_LINE = 4
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
+# search data is written to a file for indexing by an external tool. With the
+# SEARCHDATA_FILE tag the name of this file can be specified.
+# The default file is: searchdata.xml.
+# This tag requires that the tag SEARCHENGINE is set to YES.
-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
-# structure should be generated to display hierarchical information.
-# If the tag value is set to FRAME, a side panel will be generated
-# containing a tree-like index structure (just like the one that
-# is generated for HTML Help). For this to work a browser that supports
-# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
-# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
-# probably better off using the HTML help feature. Other possible values
-# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
-# and Class Hierarchy pages using a tree view instead of an ordered list;
-# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
-# disables this behavior completely. For backwards compatibility with previous
-# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
-# respectively.
-
-GENERATE_TREEVIEW = NO
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
-# used to set the initial width (in pixels) of the frame in which the tree
-# is shown.
+SEARCHDATA_FILE = searchdata.xml
-TREEVIEW_WIDTH = 250
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
+# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
+# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
+# projects and redirect the results back to the right project.
+# This tag requires that the tag SEARCHENGINE is set to YES.
-# Use this tag to change the font size of Latex formulas included
-# as images in the HTML documentation. The default is 10. Note that
-# when you change the font size after a successful doxygen run you need
-# to manually remove any form_*.png images from the HTML output directory
-# to force them to be regenerated.
+EXTERNAL_SEARCH_ID =
-FORMULA_FONTSIZE = 10
+# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
+# projects other than the one defined by this configuration file, but that are
+# all added to the same external search index. Each project needs to have a
+# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
+# to a relative location where the documentation can be found. The format is:
+# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTRA_SEARCH_MAPPINGS =
#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
+# Configuration options related to the LaTeX output
#---------------------------------------------------------------------------
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
-# generate Latex output.
+# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
+# The default value is: YES.
GENERATE_LATEX = NO
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `latex' will be used as the default path.
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_OUTPUT = latex
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked. If left blank `latex' will be used as the default command name.
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked.
+#
+# Note that when not enabling USE_PDFLATEX the default is latex when enabling
+# USE_PDFLATEX the default is pdflatex and when in the later case latex is
+# chosen this is overwritten by pdflatex. For specific output languages the
+# default can have been set differently, this depends on the implementation of
+# the output language.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_CMD_NAME = latex
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
-# generate index for LaTeX. If left blank `makeindex' will be used as the
-# default command name.
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
+# index for LaTeX.
+# Note: This tag is used in the Makefile / make.bat.
+# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file
+# (.tex).
+# The default file is: makeindex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
MAKEINDEX_CMD_NAME = makeindex
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
-# LaTeX documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_LATEX = NO
-
-# The PAPER_TYPE tag can be used to set the paper type that is used
-# by the printer. Possible values are: a4, a4wide, letter, legal and
-# executive. If left blank a4wide will be used.
+# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to
+# generate index for LaTeX. In case there is no backslash (\) as first character
+# it will be automatically added in the LaTeX code.
+# Note: This tag is used in the generated output file (.tex).
+# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat.
+# The default value is: makeindex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
-PAPER_TYPE = a4wide
+LATEX_MAKEINDEX_CMD = makeindex
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
-# packages that should be included in the LaTeX output.
+# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
-EXTRA_PACKAGES =
-
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
-# the generated latex document. The header should contain everything until
-# the first chapter. If it is left blank doxygen will generate a
-# standard header. Notice: only use this tag if you know what you are doing!
-
-LATEX_HEADER =
+COMPACT_LATEX = NO
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will
-# contain links (just like the HTML output) instead of page references
-# This makes the output suitable for online browsing using a pdf viewer.
+# The PAPER_TYPE tag can be used to set the paper type that is used by the
+# printer.
+# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
+# 14 inches) and executive (7.25 x 10.5 inches).
+# The default value is: a4.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+PAPER_TYPE = a4
+
+# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
+# that should be included in the LaTeX output. The package can be specified just
+# by its name or with the correct syntax as to be used with the LaTeX
+# \usepackage command. To get the times font for instance you can specify :
+# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times}
+# To use the option intlimits with the amsmath package you can specify:
+# EXTRA_PACKAGES=[intlimits]{amsmath}
+# If left blank no extra packages will be included.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a user-defined LaTeX header for
+# the generated LaTeX document. The header should contain everything until the
+# first chapter. If it is left blank doxygen will generate a standard header. It
+# is highly recommended to start with a default header using
+# doxygen -w latex new_header.tex new_footer.tex new_stylesheet.sty
+# and then modify the file new_header.tex. See also section "Doxygen usage" for
+# information on how to generate the default header that doxygen normally uses.
+#
+# Note: Only use a user-defined header if you know what you are doing!
+# Note: The header is subject to change so you typically have to regenerate the
+# default header when upgrading to a newer version of doxygen. The following
+# commands have a special meaning inside the header (and footer): For a
+# description of the possible markers and block names see the documentation.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_HEADER =
+
+# The LATEX_FOOTER tag can be used to specify a user-defined LaTeX footer for
+# the generated LaTeX document. The footer should contain everything after the
+# last chapter. If it is left blank doxygen will generate a standard footer. See
+# LATEX_HEADER for more information on how to generate a default footer and what
+# special commands can be used inside the footer. See also section "Doxygen
+# usage" for information on how to generate the default footer that doxygen
+# normally uses. Note: Only use a user-defined footer if you know what you are
+# doing!
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_FOOTER =
+
+# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# LaTeX style sheets that are included after the standard style sheets created
+# by doxygen. Using this option one can overrule certain style aspects. Doxygen
+# will copy the style sheet files to the output directory.
+# Note: The order of the extra style sheet files is of importance (e.g. the last
+# style sheet in the list overrules the setting of the previous ones in the
+# list).
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_STYLESHEET =
+
+# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the LATEX_OUTPUT output
+# directory. Note that the files will be copied as-is; there are no commands or
+# markers available.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_FILES =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
+# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
+# contain links (just like the HTML output) instead of page references. This
+# makes the output suitable for online browsing using a PDF viewer.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
PDF_HYPERLINKS = YES
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
-# plain latex in the generated Makefile. Set this option to YES to get a
-# higher quality PDF documentation.
+# If the USE_PDFLATEX tag is set to YES, doxygen will use the engine as
+# specified with LATEX_CMD_NAME to generate the PDF file directly from the LaTeX
+# files. Set this option to YES, to get a higher quality PDF documentation.
+#
+# See also section LATEX_CMD_NAME for selecting the engine.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
USE_PDFLATEX = YES
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
-# command to the generated LaTeX files. This will instruct LaTeX to keep
-# running if errors occur, instead of asking the user for help.
-# This option is also used when generating formulas in HTML.
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
+# command to the generated LaTeX files. This will instruct LaTeX to keep running
+# if errors occur, instead of asking the user for help.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_BATCHMODE = NO
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not
-# include the index chapters (such as File Index, Compound Index, etc.)
-# in the output.
+# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
+# index chapters (such as File Index, Compound Index, etc.) in the output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_HIDE_INDICES = NO
-# If LATEX_SOURCE_CODE is set to YES then doxygen will include
-# source code with syntax highlighting in the LaTeX output.
-# Note that which sources are shown also depends on other settings
-# such as SOURCE_BROWSER.
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. See
+# https://en.wikipedia.org/wiki/BibTeX and \cite for more info.
+# The default value is: plain.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
-LATEX_SOURCE_CODE = NO
+LATEX_BIB_STYLE = plain
+
+# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated
+# page will contain the date and time when the page was generated. Setting this
+# to NO can help when comparing the output of multiple runs.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_TIMESTAMP = NO
+
+# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute)
+# path from which the emoji images will be read. If a relative path is entered,
+# it will be relative to the LATEX_OUTPUT directory. If left blank the
+# LATEX_OUTPUT directory will be used.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EMOJI_DIRECTORY =
#---------------------------------------------------------------------------
-# configuration options related to the RTF output
+# Configuration options related to the RTF output
#---------------------------------------------------------------------------
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
-# The RTF output is optimized for Word 97 and may not look very pretty with
-# other RTF readers or editors.
+# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The
+# RTF output is optimized for Word 97 and may not look too pretty with other RTF
+# readers/editors.
+# The default value is: NO.
GENERATE_RTF = NO
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `rtf' will be used as the default path.
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: rtf.
+# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_OUTPUT = rtf
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
-# RTF documents. This may be useful for small projects and may help to
-# save some trees in general.
+# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
COMPACT_RTF = NO
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
-# will contain hyperlink fields. The RTF file will
-# contain links (just like the HTML output) instead of page references.
-# This makes the output suitable for online browsing using WORD or other
-# programs which support those fields.
-# Note: wordpad (write) and others do not support links.
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
+# contain hyperlink fields. The RTF file will contain links (just like the HTML
+# output) instead of page references. This makes the output suitable for online
+# browsing using Word or some other Word compatible readers that support those
+# fields.
+#
+# Note: WordPad (write) and others do not support links.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_HYPERLINKS = NO
-# Load stylesheet definitions from file. Syntax is similar to doxygen's
-# config file, i.e. a series of assignments. You only have to provide
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# configuration file, i.e. a series of assignments. You only have to provide
# replacements, missing definitions are set to their default value.
+#
+# See also section "Doxygen usage" for information on how to generate the
+# default style sheet that doxygen normally uses.
+# This tag requires that the tag GENERATE_RTF is set to YES.
-RTF_STYLESHEET_FILE =
+RTF_STYLESHEET_FILE =
-# Set optional variables used in the generation of an rtf document.
-# Syntax is similar to doxygen's config file.
+# Set optional variables used in the generation of an RTF document. Syntax is
+# similar to doxygen's configuration file. A template extensions file can be
+# generated using doxygen -e rtf extensionFile.
+# This tag requires that the tag GENERATE_RTF is set to YES.
-RTF_EXTENSIONS_FILE =
+RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
-# configuration options related to the man page output
+# Configuration options related to the man page output
#---------------------------------------------------------------------------
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
-# generate man pages
+# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for
+# classes and files.
+# The default value is: NO.
GENERATE_MAN = NO
-# The MAN_OUTPUT tag is used to specify where the man pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `man' will be used as the default path.
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it. A directory man3 will be created inside the directory specified by
+# MAN_OUTPUT.
+# The default directory is: man.
+# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_OUTPUT = man
-# The MAN_EXTENSION tag determines the extension that is added to
-# the generated man pages (default is the subroutine's section .3)
+# The MAN_EXTENSION tag determines the extension that is added to the generated
+# man pages. In case the manual section does not start with a number, the number
+# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
+# optional.
+# The default value is: .3.
+# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_EXTENSION = .3
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
-# then it will generate one additional man file for each entity
-# documented in the real man page(s). These additional files
-# only source the real man page, but without them the man command
-# would be unable to find the correct page. The default is NO.
+# The MAN_SUBDIR tag determines the name of the directory created within
+# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
+# MAN_EXTENSION with the initial . removed.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_SUBDIR =
+
+# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
+# will generate one additional man file for each entity documented in the real
+# man page(s). These additional files only source the real man page, but without
+# them the man command would be unable to find the correct page.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_LINKS = NO
#---------------------------------------------------------------------------
-# configuration options related to the XML output
+# Configuration options related to the XML output
#---------------------------------------------------------------------------
-# If the GENERATE_XML tag is set to YES Doxygen will
-# generate an XML file that captures the structure of
-# the code including all documentation.
+# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that
+# captures the structure of the code including all documentation.
+# The default value is: NO.
GENERATE_XML = NO
-# The XML_OUTPUT tag is used to specify where the XML pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `xml' will be used as the default path.
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: xml.
+# This tag requires that the tag GENERATE_XML is set to YES.
XML_OUTPUT = xml
-# The XML_SCHEMA tag can be used to specify an XML schema,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
+# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program
+# listings (including syntax highlighting and cross-referencing information) to
+# the XML output. Note that enabling this will significantly increase the size
+# of the XML output.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_XML is set to YES.
-XML_SCHEMA =
+XML_PROGRAMLISTING = YES
-# The XML_DTD tag can be used to specify an XML DTD,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
+# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include
+# namespace members in file scope as well, matching the HTML output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_XML is set to YES.
-XML_DTD =
+XML_NS_MEMB_FILE_SCOPE = NO
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
-# dump the program listings (including syntax highlighting
-# and cross-referencing information) to the XML output. Note that
-# enabling this will significantly increase the size of the XML output.
+#---------------------------------------------------------------------------
+# Configuration options related to the DOCBOOK output
+#---------------------------------------------------------------------------
-XML_PROGRAMLISTING = YES
+# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files
+# that can be used to generate PDF.
+# The default value is: NO.
+
+GENERATE_DOCBOOK = NO
+
+# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
+# front of it.
+# The default directory is: docbook.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+DOCBOOK_OUTPUT = docbook
#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
+# Configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
-# generate an AutoGen Definitions (see autogen.sf.net) file
-# that captures the structure of the code including all
-# documentation. Note that this feature is still experimental
-# and incomplete at the moment.
+# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an
+# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures
+# the structure of the code including all documentation. Note that this feature
+# is still experimental and incomplete at the moment.
+# The default value is: NO.
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
+# Configuration options related to Sqlite3 output
#---------------------------------------------------------------------------
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will
-# generate a Perl module file that captures the structure of
-# the code including all documentation. Note that this
-# feature is still experimental and incomplete at the
-# moment.
+#---------------------------------------------------------------------------
+# Configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module
+# file that captures the structure of the code including all documentation.
+#
+# Note that this feature is still experimental and incomplete at the moment.
+# The default value is: NO.
GENERATE_PERLMOD = NO
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able
-# to generate PDF and DVI output from the Perl module output.
+# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary
+# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
+# output from the Perl module output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_LATEX = NO
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
-# nicely formatted so it can be parsed by a human reader. This is useful
-# if you want to understand what is going on. On the other hand, if this
-# tag is set to NO the size of the Perl module output will be much smaller
-# and Perl will parse it just the same.
+# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely
+# formatted so it can be parsed by a human reader. This is useful if you want to
+# understand what is going on. On the other hand, if this tag is set to NO, the
+# size of the Perl module output will be much smaller and Perl will parse it
+# just the same.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_PRETTY = YES
-# The names of the make variables in the generated doxyrules.make file
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
-# This is useful so different doxyrules.make files included by the same
-# Makefile don't overwrite each other's variables.
+# The names of the make variables in the generated doxyrules.make file are
+# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
+# so different doxyrules.make files included by the same Makefile don't
+# overwrite each other's variables.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
-PERLMOD_MAKEVAR_PREFIX =
+PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
+# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
-# evaluate all C-preprocessor directives found in the sources and include
-# files.
+# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all
+# C-preprocessor directives found in the sources and include files.
+# The default value is: YES.
ENABLE_PREPROCESSING = YES
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
-# names in the source code. If set to NO (the default) only conditional
-# compilation will be performed. Macro expansion can be done in a controlled
-# way by setting EXPAND_ONLY_PREDEF to YES.
+# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names
+# in the source code. If set to NO, only conditional compilation will be
+# performed. Macro expansion can be done in a controlled way by setting
+# EXPAND_ONLY_PREDEF to YES.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-MACRO_EXPANSION = NO
+MACRO_EXPANSION = YES
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
-# then the macro expansion is limited to the macros specified with the
-# PREDEFINED and EXPAND_AS_DEFINED tags.
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
+# the macro expansion is limited to the macros specified with the PREDEFINED and
+# EXPAND_AS_DEFINED tags.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-EXPAND_ONLY_PREDEF = NO
+EXPAND_ONLY_PREDEF = YES
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
-# in the INCLUDE_PATH (see below) will be search if a #include is found.
+# If the SEARCH_INCLUDES tag is set to YES, the include files in the
+# INCLUDE_PATH will be searched if a #include is found.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
SEARCH_INCLUDES = YES
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by
-# the preprocessor.
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by the
+# preprocessor.
+# This tag requires that the tag SEARCH_INCLUDES is set to YES.
-INCLUDE_PATH =
+INCLUDE_PATH =
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
-# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will
-# be used.
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will be
+# used.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-INCLUDE_FILE_PATTERNS =
+INCLUDE_FILE_PATTERNS =
-# The PREDEFINED tag can be used to specify one or more macro names that
-# are defined before the preprocessor is started (similar to the -D option of
-# gcc). The argument of the tag is a list of macros of the form: name
-# or name=definition (no spaces). If the definition and the = are
-# omitted =1 is assumed. To prevent a macro definition from being
-# undefined via #undef or recursively expanded use the := operator
-# instead of the = operator.
+# The PREDEFINED tag can be used to specify one or more macro names that are
+# defined before the preprocessor is started (similar to the -D option of e.g.
+# gcc). The argument of the tag is a list of macros of the form: name or
+# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
+# is assumed. To prevent a macro definition from being undefined via #undef or
+# recursively expanded use the := operator instead of the = operator.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-PREDEFINED =
+PREDEFINED =
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
-# this tag can be used to specify a list of macro names that should be expanded.
-# The macro definition that is found in the sources will be used.
-# Use the PREDEFINED tag if you want to use a different macro definition.
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
+# tag can be used to specify a list of macro names that should be expanded. The
+# macro definition that is found in the sources will be used. Use the PREDEFINED
+# tag if you want to use a different macro definition that overrules the
+# definition found in the source code.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-EXPAND_AS_DEFINED =
+EXPAND_AS_DEFINED =
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
-# doxygen's preprocessor will remove all function-like macros that are alone
-# on a line, have an all uppercase name, and do not end with a semicolon. Such
-# function macros are typically used for boiler-plate code, and will confuse
-# the parser if not removed.
+# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
+# remove all references to function-like macros that are alone on a line, have
+# an all uppercase name, and do not end with a semicolon. Such function macros
+# are typically used for boiler-plate code, and will confuse the parser if not
+# removed.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
-# Configuration::additions related to external references
+# Configuration options related to external references
#---------------------------------------------------------------------------
-# The TAGFILES option can be used to specify one or more tagfiles.
-# Optionally an initial location of the external documentation
-# can be added for each tagfile. The format of a tag file without
-# this location is as follows:
-# TAGFILES = file1 file2 ...
-# Adding location for the tag files is done as follows:
-# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where "loc1" and "loc2" can be relative or absolute paths or
-# URLs. If a location is present for each tag, the installdox tool
-# does not have to be run to correct the links.
-# Note that each tag file must have a unique name
-# (where the name does NOT include the path)
-# If a tag file is not located in the directory in which doxygen
-# is run, you must also specify the path to the tagfile here.
+# The TAGFILES tag can be used to specify one or more tag files. For each tag
+# file the location of the external documentation should be added. The format of
+# a tag file without this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where loc1 and loc2 can be relative or absolute paths or URLs. See the
+# section "Linking to external documentation" for more information about the use
+# of tag files.
+# Note: Each tag file must have a unique name (where the name does NOT include
+# the path). If a tag file is not located in the directory in which doxygen is
+# run, you must also specify the path to the tagfile here.
-TAGFILES =
+TAGFILES =
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create
-# a tag file that is based on the input files it reads.
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
+# tag file that is based on the input files it reads. See section "Linking to
+# external documentation" for more information about the usage of tag files.
-GENERATE_TAGFILE =
+GENERATE_TAGFILE =
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed
-# in the class index. If set to NO only the inherited external classes
-# will be listed.
+# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
+# the class index. If set to NO, only the inherited external classes will be
+# listed.
+# The default value is: NO.
ALLEXTERNALS = NO
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will
-# be listed.
+# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will be
+# listed.
+# The default value is: YES.
EXTERNAL_GROUPS = YES
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of `which perl').
+# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in
+# the related pages index. If set to NO, only the current project's pages will
+# be listed.
+# The default value is: YES.
-PERL_PATH = /usr/bin/perl
+EXTERNAL_PAGES = YES
#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
+# Configuration options related to the dot tool
#---------------------------------------------------------------------------
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
-# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
-# or super classes. Setting the tag to NO turns the diagrams off. Note that
-# this option is superseded by the HAVE_DOT option below. This is only a
-# fallback. It is recommended to install and use dot, since it yields more
+# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram
+# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
+# NO turns the diagrams off. Note that this option also works with HAVE_DOT
+# disabled, but it is recommended to install and use dot, since it yields more
# powerful graphs.
+# The default value is: YES.
CLASS_DIAGRAMS = YES
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see
-# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
-# the mscgen tool resides. If left empty the tool is assumed to be found in the
-# default search path.
+# You can include diagrams made with dia in doxygen documentation. Doxygen will
+# then run dia to produce the diagram and insert it in the documentation. The
+# DIA_PATH tag allows you to specify the directory where the dia binary resides.
+# If left empty dia is assumed to be found in the default search path.
+
+DIA_PATH =
+
+# If set to YES the inheritance and collaboration graphs will hide inheritance
+# and usage relations if the target is undocumented or is not a class.
+# The default value is: YES.
-MSCGEN_PATH =
+HIDE_UNDOC_RELATIONS = NO
-# If set to YES, the inheritance and collaboration graphs will hide
-# inheritance and usage relations if the target is undocumented
-# or is not a class.
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz (see:
+# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
+# Bell Labs. The other options in this section have no effect if this option is
+# set to NO
+# The default value is: NO.
-HIDE_UNDOC_RELATIONS = YES
+HAVE_DOT = YES
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz, a graph visualization
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section
-# have no effect if this option is set to NO (the default)
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
+# to run in parallel. When set to 0 doxygen will base this on the number of
+# processors available in the system. You can set it explicitly to a value
+# larger than 0 to get control over the balance between CPU load and processing
+# speed.
+# Minimum value: 0, maximum value: 32, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
-HAVE_DOT = NO
+DOT_NUM_THREADS = 0
-# By default doxygen will write a font called FreeSans.ttf to the output
-# directory and reference it in all dot files that doxygen generates. This
-# font does not include all possible unicode characters however, so when you need
-# these (or just want a differently looking font) you can specify the font name
-# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
-# which can be done by putting it in a standard location or by setting the
-# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
-# containing the font.
+# When you want a differently looking font in the dot files that doxygen
+# generates you can specify the font name using DOT_FONTNAME. You need to make
+# sure dot is able to find the font, which can be done by putting it in a
+# standard location or by setting the DOTFONTPATH environment variable or by
+# setting DOT_FONTPATH to the directory containing the font.
+# The default value is: Helvetica.
+# This tag requires that the tag HAVE_DOT is set to YES.
-DOT_FONTNAME = FreeSans
+DOT_FONTNAME = Helvetica
-# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
-# The default size is 10pt.
+# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
+# dot graphs.
+# Minimum value: 4, maximum value: 24, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTSIZE = 10
-# By default doxygen will tell dot to use the output directory to look for the
-# FreeSans.ttf font (which doxygen will put there itself). If you specify a
-# different font using DOT_FONTNAME you can set the path where dot
-# can find it using this tag.
+# By default doxygen will tell dot to use the default font as specified with
+# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
+# the path where dot can find it using this tag.
+# This tag requires that the tag HAVE_DOT is set to YES.
-DOT_FONTPATH =
+DOT_FONTPATH =
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect inheritance relations. Setting this tag to YES will force the
-# the CLASS_DIAGRAMS tag to NO.
+# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
+# each documented class showing the direct and indirect inheritance relations.
+# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
CLASS_GRAPH = YES
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect implementation dependencies (inheritance, containment, and
-# class references variables) of the class with other documented classes.
+# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
+# graph for each documented class showing the direct and indirect implementation
+# dependencies (inheritance, containment, and class references variables) of the
+# class with other documented classes.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
COLLABORATION_GRAPH = YES
-# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for groups, showing the direct groups dependencies
+# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
+# groups, showing the direct groups dependencies.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
GROUP_GRAPHS = YES
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
-# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
# Language.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
UML_LOOK = NO
-# If set to YES, the inheritance and collaboration graphs will show the
-# relations between templates and their instances.
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
+# class node. If there are many fields or methods and many nodes the graph may
+# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
+# number of items for each type to make the size more manageable. Set this to 0
+# for no limit. Note that the threshold may be exceeded by 50% before the limit
+# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
+# but if the number exceeds 15, the total amount of fields shown is limited to
+# 10.
+# Minimum value: 0, maximum value: 100, default value: 10.
+# This tag requires that the tag UML_LOOK is set to YES.
+
+UML_LIMIT_NUM_FIELDS = 10
+
+# If the DOT_UML_DETAILS tag is set to NO, doxygen will show attributes and
+# methods without types and arguments in the UML graphs. If the DOT_UML_DETAILS
+# tag is set to YES, doxygen will add type and arguments for attributes and
+# methods in the UML graphs. If the DOT_UML_DETAILS tag is set to NONE, doxygen
+# will not generate fields with class member information in the UML graphs. The
+# class diagrams will look similar to the default class diagrams but using UML
+# notation for the relationships.
+# Possible values are: NO, YES and NONE.
+# The default value is: NO.
+# This tag requires that the tag UML_LOOK is set to YES.
+
+DOT_UML_DETAILS = NO
+
+# The DOT_WRAP_THRESHOLD tag can be used to set the maximum number of characters
+# to display on a single line. If the actual line length exceeds this threshold
+# significantly it will wrapped across multiple lines. Some heuristics are apply
+# to avoid ugly line breaks.
+# Minimum value: 0, maximum value: 1000, default value: 17.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_WRAP_THRESHOLD = 17
+
+# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
+# collaboration graphs will show the relations between templates and their
+# instances.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
TEMPLATE_RELATIONS = NO
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
-# tags are set to YES then doxygen will generate a graph for each documented
-# file showing the direct and indirect include dependencies of the file with
-# other documented files.
+# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
+# YES then doxygen will generate a graph for each documented file showing the
+# direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
INCLUDE_GRAPH = YES
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
-# documented header file showing the documented files that directly or
-# indirectly include this file.
+# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
+# set to YES then doxygen will generate a graph for each documented file showing
+# the direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
INCLUDED_BY_GRAPH = YES
-# If the CALL_GRAPH and HAVE_DOT options are set to YES then
-# doxygen will generate a call dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable call graphs
-# for selected functions only using the \callgraph command.
+# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command. Disabling a call graph can be
+# accomplished by means of the command \hidecallgraph.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
CALL_GRAPH = NO
-# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
-# doxygen will generate a caller dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable caller
-# graphs for selected functions only using the \callergraph command.
+# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable caller graphs for selected
+# functions only using the \callergraph command. Disabling a caller graph can be
+# accomplished by means of the command \hidecallergraph.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
CALLER_GRAPH = NO
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
-# will graphical hierarchy of all classes instead of a textual one.
+# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
+# hierarchy of all classes instead of a textual one.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
GRAPHICAL_HIERARCHY = YES
-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
-# then doxygen will show the dependencies a directory has on other directories
-# in a graphical way. The dependency relations are determined by the #include
-# relations between the files in the directories.
+# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
+# dependencies a directory has on other directories in a graphical way. The
+# dependency relations are determined by the #include relations between the
+# files in the directories.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
DIRECTORY_GRAPH = YES
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. Possible values are png, jpg, or gif
-# If left blank png will be used.
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. For an explanation of the image formats see the section
+# output formats in the documentation of the dot tool (Graphviz (see:
+# http://www.graphviz.org/)).
+# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
+# to make the SVG files visible in IE 9+ (other browsers do not have this
+# requirement).
+# Possible values are: png, jpg, gif, svg, png:gd, png:gd:gd, png:cairo,
+# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and
+# png:gdiplus:gdiplus.
+# The default value is: png.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_IMAGE_FORMAT = svg
+
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+#
+# Note that this requires a modern browser other than Internet Explorer. Tested
+# and working are Firefox, Chrome, Safari, and Opera.
+# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
+# the SVG files visible. Older versions of IE do not have SVG support.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
-DOT_IMAGE_FORMAT = png
+INTERACTIVE_SVG = YES
-# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# The DOT_PATH tag can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the \dotfile
+# command).
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOTFILE_DIRS =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the \mscfile
+# command).
+
+MSCFILE_DIRS =
+
+# The DIAFILE_DIRS tag can be used to specify one or more directories that
+# contain dia files that are included in the documentation (see the \diafile
+# command).
+
+DIAFILE_DIRS =
+
+# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
+# path where java can find the plantuml.jar file. If left blank, it is assumed
+# PlantUML is not used or called during a preprocessing step. Doxygen will
+# generate a warning when it encounters a \startuml command in this case and
+# will not generate output for the diagram.
+
+PLANTUML_JAR_PATH =
-DOT_PATH =
+# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a
+# configuration file for plantuml.
-# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the
-# \dotfile command).
+PLANTUML_CFG_FILE =
-DOTFILE_DIRS =
+# When using plantuml, the specified paths are searched for files specified by
+# the !include statement in a plantuml block.
-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
-# nodes that will be shown in the graph. If the number of nodes in a graph
-# becomes larger than this value, doxygen will truncate the graph, which is
-# visualized by representing a node as a red box. Note that doxygen if the
-# number of direct children of the root node in a graph is already larger than
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
-# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+PLANTUML_INCLUDE_PATH =
-DOT_GRAPH_MAX_NODES = 50
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
+# that will be shown in the graph. If the number of nodes in a graph becomes
+# larger than this value, doxygen will truncate the graph, which is visualized
+# by representing a node as a red box. Note that doxygen if the number of direct
+# children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
+# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+# Minimum value: 0, maximum value: 10000, default value: 50.
+# This tag requires that the tag HAVE_DOT is set to YES.
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
-# graphs generated by dot. A depth value of 3 means that only nodes reachable
-# from the root by following a path via at most 3 edges will be shown. Nodes
-# that lay further from the root node will be omitted. Note that setting this
-# option to 1 or 2 may greatly reduce the computation time needed for large
-# code bases. Also note that the size of a graph can be further restricted by
+DOT_GRAPH_MAX_NODES = 500
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
+# generated by dot. A depth value of 3 means that only nodes reachable from the
+# root by following a path via at most 3 edges will be shown. Nodes that lay
+# further from the root node will be omitted. Note that setting this option to 1
+# or 2 may greatly reduce the computation time needed for large code bases. Also
+# note that the size of a graph can be further restricted by
# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+# Minimum value: 0, maximum value: 1000, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
MAX_DOT_GRAPH_DEPTH = 0
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, because dot on Windows does not
-# seem to support this out of the box. Warning: Depending on the platform used,
-# enabling this option may lead to badly anti-aliased labels on the edges of
-# a graph (i.e. they become hard to read).
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not seem
+# to support this out of the box.
+#
+# Warning: Depending on the platform used, enabling this option may lead to
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
+# read).
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
-DOT_TRANSPARENT = NO
+DOT_TRANSPARENT = YES
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
-# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10)
-# support this, this feature is disabled by default.
+# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10) support
+# this, this feature is disabled by default.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
-DOT_MULTI_TARGETS = NO
+DOT_MULTI_TARGETS = YES
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
-# generate a legend page explaining the meaning of the various boxes and
-# arrows in the dot generated graphs.
+# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
+# explaining the meaning of the various boxes and arrows in the dot generated
+# graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
GENERATE_LEGEND = YES
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
-# remove the intermediate dot files that are used to generate
-# the various graphs.
+# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate
+# files that are used to generate the various graphs.
+#
+# Note: This setting is not only used for dot files but also for msc temporary
+# files.
+# The default value is: YES.
DOT_CLEANUP = YES
-
-#---------------------------------------------------------------------------
-# Options related to the search engine
-#---------------------------------------------------------------------------
-
-# The SEARCHENGINE tag specifies whether or not a search engine should be
-# used. If set to NO the values of all tags below this one will be ignored.
-
-SEARCHENGINE = NO
--- /dev/null
+# DarkPlaces Engine
+
+DarkPlaces is a game engine based on the Quake 1 engine by id Software. It
+improves and builds upon the original 1996 engine by adding modern rendering
+features, and expanding upon the engine's native game code language QuakeC, as
+well as supporting additional map and model formats.
+
+Developed by LadyHavoc. See CREDITS.md for a list of contributors.
+
+## Help/support
+
+### IRC:
+#darkplaces on irc.anynet.org
+
+### Discord:
+https://discord.gg/ZHT9QeW
+
+## Build instructions (WIP)
+
+You will need the following packages regardless of platform:
+* SDL2
+* libjpeg
+* libpng
+* libvorbis
+* libogg
+
+### Windows (MSYS2):
+
+1. Install MSYS2, found [here](https://www.msys2.org/).
+2. Once you've installed MSYS2 and have fully updated it, open a MinGW64 terminal (***not an MSYS2 terminal***) and input the following command:
+
+```
+pacman -S --needed gcc make mingw-w64-x86_64-{toolchain,libjpeg-turbo,libpng,libogg,libvorbis,SDL2}
+```
+
+3. See [Unix instructions](#unix-(general)).
+
+### Unix (General)
+
+In the engine's root directory, run `make`. See `make help` for options.
+
+### Windows (Visual Studio)
+
+Instructions coming soon.
+
+## Documentation
+
+Doxygen: https://xonotic.org/doxygen/darkplaces
+
#include "cl_collision.h"
-cvar_t cl_name = {CF_CLIENT | CF_ARCHIVE | CF_USERINFO, "name", "player", "change your player name"};
-cvar_t cl_rate = {CF_CLIENT | CF_ARCHIVE | CF_USERINFO, "rate", "20000", "change your connection speed"};
-cvar_t cl_rate_burstsize = {CF_CLIENT | CF_ARCHIVE | CF_USERINFO, "rate_burstsize", "1024", "internal storage cvar for current rate control burst size (changed by rate_burstsize command)"};
-cvar_t cl_topcolor = {CF_CLIENT | CF_ARCHIVE | CF_USERINFO, "topcolor", "0", "change the color of your shirt"};
-cvar_t cl_bottomcolor = {CF_CLIENT | CF_ARCHIVE | CF_USERINFO, "bottomcolor", "0", "change the color of your pants"};
+cvar_t cl_name = {CF_CLIENT | CF_ARCHIVE | CF_USERINFO, "name", "player", "player name"};
+cvar_t cl_rate = {CF_CLIENT | CF_ARCHIVE | CF_USERINFO, "rate", "20000", "connection speed"};
+cvar_t cl_rate_burstsize = {CF_CLIENT | CF_ARCHIVE | CF_USERINFO, "rate_burstsize", "1024", "rate control burst size"};
+cvar_t cl_topcolor = {CF_CLIENT | CF_ARCHIVE | CF_USERINFO, "topcolor", "0", "color of your shirt"};
+cvar_t cl_bottomcolor = {CF_CLIENT | CF_ARCHIVE | CF_USERINFO, "bottomcolor", "0", "color of your pants"};
cvar_t cl_team = {CF_CLIENT | CF_USERINFO | CF_ARCHIVE, "team", "none", "QW team (4 character limit, example: blue)"};
cvar_t cl_skin = {CF_CLIENT | CF_USERINFO | CF_ARCHIVE, "skin", "", "QW player skin name (example: base)"};
cvar_t cl_noaim = {CF_CLIENT | CF_USERINFO | CF_ARCHIVE, "noaim", "1", "QW option to disable vertical autoaim"};
dpsnprintf(cls.userinfo, sizeof(cls.userinfo), "\\name\\player\\team\\none\\topcolor\\0\\bottomcolor\\0\\rate\\10000\\msg\\1\\noaim\\1\\*ver\\dp");
Cvar_RegisterVariable(&cl_name);
- Cvar_RegisterAlias(&cl_name, "_cl_name");
+ Cvar_RegisterVirtual(&cl_name, "_cl_name");
Cvar_RegisterVariable(&cl_rate);
- Cvar_RegisterAlias(&cl_rate, "_cl_rate");
+ Cvar_RegisterVirtual(&cl_rate, "_cl_rate");
Cvar_RegisterVariable(&cl_rate_burstsize);
- Cvar_RegisterAlias(&cl_rate_burstsize, "_cl_rate_burstsize");
+ Cvar_RegisterVirtual(&cl_rate_burstsize, "_cl_rate_burstsize");
Cvar_RegisterVariable(&cl_pmodel);
- Cvar_RegisterAlias(&cl_pmodel, "_cl_pmodel");
+ Cvar_RegisterVirtual(&cl_pmodel, "_cl_pmodel");
Cvar_RegisterVariable(&cl_color);
Cvar_RegisterCallback(&cl_color, CL_Color_c);
Cvar_RegisterVariable(&cl_topcolor);
model_t *CL_GetModelFromEdict(prvm_edict_t *ed)
{
prvm_prog_t *prog = CLVM_prog;
- if (!ed || ed->priv.server->free)
+ if (!ed || ed->free)
return NULL;
return CL_GetModelByIndex((int)PRVM_clientedictfloat(ed, modelindex));
}
if (ent == prog->edicts)
return; // don't add the world
- if (ent->priv.server->free)
+ if (ent->free)
return;
// set the abs box
}
dpsnprintf (str, sizeof(str), "playdemo %s\n", cls.demos[cls.demonum]);
- Cbuf_InsertText(cmd_client, str);
+ Cbuf_InsertText(cmd_local, str);
cls.demonum++;
}
}
if (cl_message.cursize > cl_message.maxsize)
{
- Con_Printf("Demo message (%i) > cl_message.maxsize (%i)", cl_message.cursize, cl_message.maxsize);
+ CL_DisconnectEx(false, "Demo message (%i) > cl_message.maxsize (%i)", cl_message.cursize, cl_message.maxsize);
cl_message.cursize = 0;
- CL_Disconnect();
return;
}
VectorCopy(cl.mviewangles[0], cl.mviewangles[1]);
CL_ParseServerMessage();
if (cls.signon != SIGNONS)
- Cbuf_Execute((cmd_client)->cbuf); // immediately execute svc_stufftext if in the demo before connect!
+ Cbuf_Execute((cmd_local)->cbuf); // immediately execute svc_stufftext if in the demo before connect!
// In case the demo contains a "svc_disconnect" message
if (!cls.demoplayback)
cls.demo_lastcsprogscrc = -1;
}
-
-/*
-====================
-CL_PlayDemo_f
-
-playdemo [demoname]
-====================
-*/
-void CL_PlayDemo_f(cmd_state_t *cmd)
+void CL_PlayDemo(const char *demo)
{
- char name[MAX_QPATH];
+ char name[MAX_QPATH];
int c;
qbool neg = false;
qfile_t *f;
- if (Cmd_Argc(cmd) != 2)
- {
- Con_Print("playdemo <demoname> : plays a demo\n");
- return;
- }
-
// open the demo file
- strlcpy (name, Cmd_Argv(cmd, 1), sizeof (name));
+ strlcpy (name, demo, sizeof (name));
FS_DefaultExtension (name, ".dem", sizeof (name));
f = FS_OpenVirtualFile(name, false);
if (!f)
cls.demostarting = true;
// disconnect from server
- if(cls.state == ca_connected)
- CL_Disconnect();
- if(sv.active)
- SV_Shutdown();
+ CL_Disconnect();
// update networking ports (this is mainly just needed at startup)
NetConn_UpdateSockets();
cls.demostarting = false;
}
+/*
+====================
+CL_PlayDemo_f
+
+playdemo [demoname]
+====================
+*/
+void CL_PlayDemo_f(cmd_state_t *cmd)
+{
+ if (Cmd_Argc(cmd) != 2)
+ {
+ Con_Print("playdemo <demoname> : plays a demo\n");
+ return;
+ }
+
+ CL_PlayDemo(Cmd_Argv(cmd, 1));
+}
+
typedef struct
{
int frames;
if(atoi(sys.argv[i + 1]) > benchmark_runs)
{
// restart the benchmark
- Cbuf_AddText(cmd_client, va(vabuf, sizeof(vabuf), "timedemo %s\n", cls.demoname));
+ Cbuf_AddText(cmd_local, va(vabuf, sizeof(vabuf), "timedemo %s\n", cls.demoname));
// cannot execute here
}
else
srand(0); // predictable random sequence for benchmarking
- CL_PlayDemo_f (cmd);
+ CL_PlayDemo(Cmd_Argv(cmd, 1));
// cls.td_starttime will be grabbed at the second frame of the demo, so
// all the loading time doesn't get counted
return;
if (cls.demonum == -1)
cls.demonum = 1;
- CL_Disconnect_f (cmd);
- CL_NextDemo ();
+ CL_Disconnect();
+ CL_NextDemo();
}
/*
else
{
cl.moveflags = 0;
- cl.movevars_ticrate = (cls.demoplayback ? 1.0f : host_timescale.value) / bound(1.0f, cl_netfps.value, 1000.0f);
+ cl.movevars_ticrate = (cls.demoplayback ? 1.0f : host_timescale.value) / bound(10.0f, cl_netfps.value, 1000.0f);
cl.movevars_timescale = (cls.demoplayback ? 1.0f : host_timescale.value);
cl.movevars_gravity = sv_gravity.value;
cl.movevars_stopspeed = cl_movement_stopspeed.value;
usercmd_t *cmd;
sizebuf_t buf;
unsigned char data[1024];
- double packettime;
- int msecdelta;
+ float packettime;
qbool quemove;
qbool important;
// set viewangles
VectorCopy(cl.viewangles, cl.cmd.viewangles);
- msecdelta = (int)(floor(cl.cmd.time * 1000) - floor(cl.movecmd[1].time * 1000));
- cl.cmd.msec = (unsigned char)bound(0, msecdelta, 255);
+ // bones_was_here: previously cl.cmd.frametime was floored to nearest millisec
+ // this meant the smoothest async movement required integer millisec
+ // client and server frame times (eg 125fps)
+ cl.cmd.frametime = bound(0.0, cl.cmd.time - cl.movecmd[1].time, 0.255);
// ridiculous value rejection (matches qw)
- if (cl.cmd.msec > 250)
- cl.cmd.msec = 100;
- cl.cmd.frametime = cl.cmd.msec * (1.0 / 1000.0);
+ if (cl.cmd.frametime > 0.25)
+ cl.cmd.frametime = 0.1;
+ cl.cmd.msec = (unsigned char)floor(cl.cmd.frametime * 1000);
switch(cls.protocol)
{
break;
case PROTOCOL_DARKPLACES6:
case PROTOCOL_DARKPLACES7:
+ case PROTOCOL_DARKPLACES8:
cl.cmd.predicted = cl_movement.integer != 0;
break;
default:
break;
case PROTOCOL_DARKPLACES6:
case PROTOCOL_DARKPLACES7:
+ case PROTOCOL_DARKPLACES8:
// FIXME: cl.cmd.buttons & 16 is +button5, Nexuiz/Xonotic specific
cl.cmd.crouch = (cl.cmd.buttons & 16) != 0;
break;
cl.movecmd[0] = cl.cmd;
// don't predict more than 200fps
- if (host.realtime >= cl.lastpackettime + 0.005)
+ if (cl.timesincepacket >= 0.005)
cl.movement_replay = true; // redo the prediction
// now decide whether to actually send this move
// (otherwise it is only for prediction)
+ // do not send 0ms packets because they mess up physics
+ if(cl.cmd.msec == 0 && cl.time > cl.oldtime && (cls.protocol == PROTOCOL_QUAKEWORLD || cls.signon == SIGNONS))
+ return;
+
// don't send too often or else network connections can get clogged by a
// high renderer framerate
- packettime = 1.0 / bound(1, cl_netfps.value, 1000);
+ packettime = 1.0f / bound(10.0f, cl_netfps.value, 1000.0f);
if (cl.movevars_timescale && cl.movevars_ticrate)
{
+ // try to ensure at least 1 packet per server frame
+ // and apply soft limit of 2, hard limit < 4 (packettime reduced further below)
float maxtic = cl.movevars_ticrate / cl.movevars_timescale;
- packettime = min(packettime, maxtic);
+ packettime = bound(maxtic * 0.5f, packettime, maxtic);
}
+ // bones_was_here: reduce packettime to (largest multiple of realframetime) <= packettime
+ // prevents packet rates lower than cl_netfps or server frame rate
+ // eg: cl_netfps 60 and cl_maxfps 250 would otherwise send only 50 netfps
+ // with this line that config sends 62.5 netfps
+ // (this causes it to emit packets at a steady beat)
+ packettime = floor(packettime / (float)cl.realframetime) * (float)cl.realframetime;
- // do not send 0ms packets because they mess up physics
- if(cl.cmd.msec == 0 && cl.time > cl.oldtime && (cls.protocol == PROTOCOL_QUAKEWORLD || cls.signon == SIGNONS))
- return;
// always send if buttons changed or an impulse is pending
// even if it violates the rate limit!
important = (cl.cmd.impulse || (cl_netimmediatebuttons.integer && cl.cmd.buttons != cl.movecmd[1].buttons));
- // don't send too often (cl_netfps)
- if (!important && host.realtime < cl.lastpackettime + packettime)
+
+ // don't send too often (cl_netfps), allowing a small margin for float error
+ // bones_was_here: accumulate realframetime to prevent low packet rates
+ // previously with cl_maxfps == cl_netfps it did not send every frame as
+ // host.realtime - cl.lastpackettime was often well below (or above) packettime
+ if (!important && cl.timesincepacket < packettime * 0.99999f)
+ {
+ cl.timesincepacket += cl.realframetime;
return;
+ }
+
// don't choke the connection with packets (obey rate limit)
// it is important that this check be last, because it adds a new
// frame to the shownetgraph output and any cancelation after this
// we also still send if it is important
if (!NetConn_CanSend(cls.netcon) && !important)
return;
- // try to round off the lastpackettime to a multiple of the packet interval
- // (this causes it to emit packets at a steady beat)
- if (packettime > 0)
- cl.lastpackettime = floor(host.realtime / packettime) * packettime;
- else
- cl.lastpackettime = host.realtime;
+
+ // reset the packet timing accumulator
+ cl.timesincepacket = cl.realframetime;
buf.maxsize = sizeof(data);
buf.cursize = 0;
// PROTOCOL_DARKPLACES5 clc_move = 19 bytes total
// PROTOCOL_DARKPLACES6 clc_move = 52 bytes total
// PROTOCOL_DARKPLACES7 clc_move = 56 bytes total per move (can be up to 16 moves)
+ // PROTOCOL_DARKPLACES8 clc_move = 56 bytes total per move (can be up to 16 moves)
// PROTOCOL_QUAKEWORLD clc_move = 34 bytes total (typically, but can reach 43 bytes, or even 49 bytes with roll)
// set prydon cursor info
MSG_WriteByte (&buf, cl.cmd.impulse);
case PROTOCOL_DARKPLACES6:
case PROTOCOL_DARKPLACES7:
+ case PROTOCOL_DARKPLACES8:
// set the maxusercmds variable to limit how many should be sent
maxusercmds = bound(1, cl_netrepeatinput.integer + 1, min(3, CL_MAX_USERCMDS));
// when movement prediction is off, there's not much point in repeating old input as it will just be ignored
in_impulse = 0;
if (cls.netcon->message.overflowed)
- {
- Con_Print("CL_SendMove: lost server connection\n");
- CL_Disconnect();
- SV_LockThreadMutex();
- SV_Shutdown();
- SV_UnlockThreadMutex();
- }
+ CL_DisconnectEx(true, "Lost connection to server");
}
/*
This is also called on Host_Error, so it shouldn't cause any errors
=====================
*/
-void CL_Disconnect(void)
+
+void CL_DisconnectEx(qbool kicked, const char *fmt, ... )
{
+ va_list argptr;
+ char reason[512];
+
if (cls.state == ca_dedicated)
return;
+ if(fmt)
+ {
+ va_start(argptr,fmt);
+ dpvsnprintf(reason,sizeof(reason),fmt,argptr);
+ va_end(argptr);
+ }
+ else
+ {
+ dpsnprintf(reason, sizeof(reason), "Disconnect by user");
+ }
+
if (Sys_CheckParm("-profilegameonly"))
Sys_AllowProfiling(false);
else if (cls.netcon)
{
sizebuf_t buf;
- unsigned char bufdata[8];
+ unsigned char bufdata[520];
if (cls.demorecording)
- CL_Stop_f(cmd_client);
+ CL_Stop_f(cmd_local);
- // send disconnect message 3 times to improve chances of server
- // receiving it (but it still fails sometimes)
- memset(&buf, 0, sizeof(buf));
- buf.data = bufdata;
- buf.maxsize = sizeof(bufdata);
- if (cls.protocol == PROTOCOL_QUAKEWORLD)
- {
- Con_DPrint("Sending drop command\n");
- MSG_WriteByte(&buf, qw_clc_stringcmd);
- MSG_WriteString(&buf, "drop");
- }
- else
+ if(!kicked)
{
- Con_DPrint("Sending clc_disconnect\n");
- MSG_WriteByte(&buf, clc_disconnect);
+ // send disconnect message 3 times to improve chances of server
+ // receiving it (but it still fails sometimes)
+ memset(&buf, 0, sizeof(buf));
+ buf.data = bufdata;
+ buf.maxsize = sizeof(bufdata);
+ if (cls.protocol == PROTOCOL_QUAKEWORLD)
+ {
+ Con_DPrint("Sending drop command\n");
+ MSG_WriteByte(&buf, qw_clc_stringcmd);
+ MSG_WriteString(&buf, "drop");
+ }
+ else
+ {
+ Con_DPrint("Sending clc_disconnect\n");
+ MSG_WriteByte(&buf, clc_disconnect);
+ if(cls.protocol == PROTOCOL_DARKPLACES8)
+ MSG_WriteString(&buf, reason);
+ }
+ NetConn_SendUnreliableMessage(cls.netcon, &buf, cls.protocol, 10000, 0, false);
+ NetConn_SendUnreliableMessage(cls.netcon, &buf, cls.protocol, 10000, 0, false);
+ NetConn_SendUnreliableMessage(cls.netcon, &buf, cls.protocol, 10000, 0, false);
}
- NetConn_SendUnreliableMessage(cls.netcon, &buf, cls.protocol, 10000, 0, false);
- NetConn_SendUnreliableMessage(cls.netcon, &buf, cls.protocol, 10000, 0, false);
- NetConn_SendUnreliableMessage(cls.netcon, &buf, cls.protocol, 10000, 0, false);
+
NetConn_Close(cls.netcon);
cls.netcon = NULL;
- Con_Printf("Disconnected\n");
+ if(fmt)
+ Con_Printf("Disconnect: %s\n", reason);
+ else
+ Con_Printf("Disconnected\n");
}
cls.state = ca_disconnected;
cl.islocalgame = false;
cls.demoplayback = cls.timedemo = host.restless = false;
cls.signon = 0;
+ Cvar_Callback(&cl_netport);
+
// If we're dropped mid-connection attempt, it won't clear otherwise.
SCR_ClearLoadingScreen(false);
+
+ if(host.hook.SV_Shutdown)
+ host.hook.SV_Shutdown();
+}
+
+void CL_Disconnect(void)
+{
+ CL_DisconnectEx(false, NULL);
}
/*
void CL_Disconnect_f(cmd_state_t *cmd)
{
- CL_Disconnect ();
- if (sv.active)
- SV_Shutdown ();
+ Cmd_Argc(cmd) < 1 ? CL_Disconnect() : CL_DisconnectEx(false, Cmd_Argv(cmd, 1));
}
{
int i;
*cls.connect_userinfo = 0;
- for(i = firstarg; i+2 <= Cmd_Argc(cmd_client); i += 2)
- InfoString_SetValue(cls.connect_userinfo, sizeof(cls.connect_userinfo), Cmd_Argv(cmd_client, i), Cmd_Argv(cmd_client, i+1));
+ for(i = firstarg; i+2 <= Cmd_Argc(cmd_local); i += 2)
+ InfoString_SetValue(cls.connect_userinfo, sizeof(cls.connect_userinfo), Cmd_Argv(cmd_local, i), Cmd_Argv(cmd_local, i+1));
}
else if(firstarg < -1)
{
int i;
entity_t *ent;
for (i = 0; i < NUM_MESHENTITIES; i++)
+ {
+ ent = cl_meshentities + i;
+ Mod_Mesh_Destroy(ent->render.model);
+ Mod_Mesh_Create(ent->render.model, cl_meshentitynames[i]);
+ }
+}
+
+static void CL_MeshEntities_Start(void)
+{
+ int i;
+ entity_t *ent;
+ for(i = 0; i < NUM_MESHENTITIES; i++)
{
ent = cl_meshentities + i;
Mod_Mesh_Create(ent->render.model, cl_meshentitynames[i]);
}
}
+static void CL_MeshEntities_Shutdown(void)
+{
+ int i;
+ entity_t *ent;
+ for(i = 0; i < NUM_MESHENTITIES; i++)
+ {
+ ent = cl_meshentities + i;
+ Mod_Mesh_Destroy(ent->render.model);
+ }
+}
+
static void CL_MeshEntities_Init(void)
{
int i;
CL_UpdateRenderEntity(&ent->render);
}
cl_meshentities[MESH_UI].render.flags = RENDER_NOSELFSHADOW;
- R_RegisterModule("cl_meshentities", CL_MeshEntities_Restart, CL_MeshEntities_Restart, CL_MeshEntities_Restart, CL_MeshEntities_Restart, CL_MeshEntities_Restart);
+ R_RegisterModule("cl_meshentities", CL_MeshEntities_Start, CL_MeshEntities_Shutdown, CL_MeshEntities_Restart, CL_MeshEntities_Restart, CL_MeshEntities_Restart);
}
void CL_MeshEntities_Scene_Clear(void)
VectorCopy(ent->render.model->normalmaxs, ent->render.maxs);
}
-static void CL_MeshEntities_Shutdown(void)
-{
-}
-
extern cvar_t r_overheadsprites_pushback;
extern cvar_t r_fullbright_directed_pitch_relative;
extern cvar_t r_fullbright_directed_pitch;
static double clframetime;
static double cl_timer = 0;
static double time1 = 0, time2 = 0, time3 = 0;
- static double wait;
int pass1, pass2, pass3;
CL_VM_PreventInformationLeaks();
{
clframetime = cl.realframetime = max(cl_timer, 1.0 / cl_maxfps.value);
// when running slow, we need to sleep to keep input responsive
- wait = bound(0, cl_maxfps_alwayssleep.value * 1000, 100000);
- if (wait > 0)
- Sys_Sleep((int)wait);
+ if (cl_maxfps_alwayssleep.value > 0)
+ Sys_Sleep((int)bound(0, cl_maxfps_alwayssleep.value * 1000, 100000));
}
else if (!vid_activewindow && cl_maxidlefps.value >= 1 && !cls.timedemo)
clframetime = cl.realframetime = max(cl_timer, 1.0 / cl_maxidlefps.value);
CL_Video_Init();
+ NetConn_UpdateSockets_Client();
+
host.hook.ConnectLocal = CL_EstablishConnection_Local;
- host.hook.Disconnect = CL_Disconnect;
+ host.hook.Disconnect = CL_DisconnectEx;
host.hook.CL_Intermission = CL_Intermission;
host.hook.ToggleMenu = CL_ToggleMenu_Hook;
}
#include "menu.h"
#endif
#include "cl_video.h"
+#include "float.h"
const char *svc_strings[128] =
{
"svc_bad",
"svc_nop",
- "svc_disconnect",
+ "svc_disconnect", // (DP8) [string] null terminated parting message
"svc_updatestat",
"svc_version", // [int] server version
"svc_setview", // [short] entity number
cvar_t cl_sound_r_exp3 = {CF_CLIENT, "cl_sound_r_exp3", "weapons/r_exp3.wav", "sound to play during TE_EXPLOSION and related effects (empty cvar disables sound)"};
cvar_t cl_serverextension_download = {CF_CLIENT, "cl_serverextension_download", "0", "indicates whether the server supports the download command"};
cvar_t cl_joinbeforedownloadsfinish = {CF_CLIENT | CF_ARCHIVE, "cl_joinbeforedownloadsfinish", "1", "if non-zero the game will begin after the map is loaded before other downloads finish"};
-cvar_t cl_nettimesyncfactor = {CF_CLIENT | CF_ARCHIVE, "cl_nettimesyncfactor", "0", "rate at which client time adapts to match server time, 1 = instantly, 0.125 = slowly, 0 = not at all (bounding still applies)"};
-cvar_t cl_nettimesyncboundmode = {CF_CLIENT | CF_ARCHIVE, "cl_nettimesyncboundmode", "6", "method of restricting client time to valid values, 0 = no correction, 1 = tight bounding (jerky with packet loss), 2 = loose bounding (corrects it if out of bounds), 3 = leniant bounding (ignores temporary errors due to varying framerate), 4 = slow adjustment method from Quake3, 5 = slighttly nicer version of Quake3 method, 6 = bounding + Quake3"};
-cvar_t cl_nettimesyncboundtolerance = {CF_CLIENT | CF_ARCHIVE, "cl_nettimesyncboundtolerance", "0.25", "how much error is tolerated by bounding check, as a fraction of frametime, 0.25 = up to 25% margin of error tolerated, 1 = use only new time, 0 = use only old time (same effect as setting cl_nettimesyncfactor to 1)"};
+cvar_t cl_nettimesyncfactor = {CF_CLIENT | CF_ARCHIVE, "cl_nettimesyncfactor", "0", "rate at which client time adapts to match server time, 1 = instantly, 0.125 = slowly, 0 = not at all (only applied in bound modes 0, 1, 2, 3)"};
+cvar_t cl_nettimesyncboundmode = {CF_CLIENT | CF_ARCHIVE, "cl_nettimesyncboundmode", "6", "method of restricting client time to valid values, 0 = no correction, 1 = tight bounding (jerky with packet loss), 2 = loose bounding (corrects it if out of bounds), 3 = leniant bounding (ignores temporary errors due to varying framerate), 4 = slow adjustment method from Quake3, 5 = slightly nicer version of Quake3 method, 6 = tight bounding + mode 5, 7 = jitter compensated dynamic adjustment rate"};
+cvar_t cl_nettimesyncboundtolerance = {CF_CLIENT | CF_ARCHIVE, "cl_nettimesyncboundtolerance", "0.25", "how much error is tolerated by bounding check, as a fraction of frametime, 0.25 = up to 25% margin of error tolerated, 1 = use only new time, 0 = use only old time (same effect as setting cl_nettimesyncfactor to 1) (only affects bound modes 2 and 3)"};
cvar_t cl_iplog_name = {CF_CLIENT | CF_ARCHIVE, "cl_iplog_name", "darkplaces_iplog.txt", "name of iplog file containing player addresses for iplog_list command and automatic ip logging when parsing status command"};
static qbool QW_CL_CheckOrDownloadFile(const char *filename);
World_Start(&cl.world);
// load or reload .loc file for team chat messages
- CL_Locs_Reload_f(cmd_client);
+ CL_Locs_Reload_f(cmd_local);
// make sure we send enough keepalives
CL_KeepaliveMessage(false);
return;
// abort existing upload if in progress
- QW_CL_StopUpload_f(cmd_client);
+ QW_CL_StopUpload_f(cmd_local);
Con_DPrintf("Starting upload of %d bytes...\n", size);
cls.qw_uploadsize = size;
cls.qw_uploadpos = 0;
- QW_CL_NextUpload_f(cmd_client);
+ QW_CL_NextUpload_f(cmd_local);
}
#if 0
Con_Printf("Downloaded \"%s\" (%i bytes, %i CRC)\n", cls.qw_downloadname, size, crc);
FS_WriteFile(cls.qw_downloadname, cls.qw_downloadmemory, cls.qw_downloadmemorycursize);
extension = FS_FileExtension(cls.qw_downloadname);
- if (!strcasecmp(extension, "pak") || !strcasecmp(extension, "pk3"))
+ if (!strcasecmp(extension, "pak") || !strcasecmp(extension, "pk3") || !strcasecmp(extension, "dpk"))
FS_Rescan();
}
}
// execute cl_begindownloads next frame
// (after any commands added by svc_stufftext have been executed)
// when done with downloads the "prespawn" will be sent
- Cbuf_AddText(cmd_client, "\ncl_begindownloads\n");
+ Cbuf_AddText(cmd_local, "\ncl_begindownloads\n");
//MSG_WriteByte (&cls.netcon->message, clc_stringcmd);
//MSG_WriteString (&cls.netcon->message, "prespawn");
if (cls.demorecording)
{
// finish the previous level's demo file
- CL_Stop_f(cmd_client);
+ CL_Stop_f(cmd_local);
}
// start a new demo file
extern cvar_t cl_lerpexcess;
static void CL_NetworkTimeReceived(double newtime)
{
- double timehigh;
cl.mtime[1] = cl.mtime[0];
cl.mtime[0] = newtime;
if (cl_nolerp.integer || cls.timedemo || cl.mtime[1] == cl.mtime[0] || cls.signon < SIGNONS)
}
else if (cls.protocol != PROTOCOL_QUAKEWORLD)
{
+ double timehigh = 0; // hush compiler warning
cl.mtime[1] = max(cl.mtime[1], cl.mtime[0] - 0.1);
+
if (developer_extra.integer && vid_activewindow)
{
if (cl.time < cl.mtime[1] - (cl.mtime[0] - cl.mtime[1]))
else if (cl.time > cl.mtime[0] + (cl.mtime[0] - cl.mtime[1]))
Con_DPrintf("--- cl.time > cl.mtime[0] (%f > %f ... %f)\n", cl.time, cl.mtime[1], cl.mtime[0]);
}
- cl.time += (cl.mtime[1] - cl.time) * bound(0, cl_nettimesyncfactor.value, 1);
- timehigh = cl.mtime[1] + (cl.mtime[0] - cl.mtime[1]) * cl_nettimesyncboundtolerance.value;
- if (cl_nettimesyncboundmode.integer == 1)
- cl.time = bound(cl.mtime[1], cl.time, cl.mtime[0]);
- else if (cl_nettimesyncboundmode.integer == 2)
+
+ if (cl_nettimesyncboundmode.integer < 4)
{
- if (cl.time < cl.mtime[1] || cl.time > timehigh)
- cl.time = cl.mtime[1];
+ // doesn't make sense for modes > 3
+ cl.time += (cl.mtime[1] - cl.time) * bound(0, cl_nettimesyncfactor.value, 1);
+ timehigh = cl.mtime[1] + (cl.mtime[0] - cl.mtime[1]) * cl_nettimesyncboundtolerance.value;
}
- else if (cl_nettimesyncboundmode.integer == 3)
+
+ switch (cl_nettimesyncboundmode.integer)
{
+ case 1:
+ cl.time = bound(cl.mtime[1], cl.time, cl.mtime[0]);
+ break;
+
+ case 2:
+ if (cl.time < cl.mtime[1] || cl.time > timehigh)
+ cl.time = cl.mtime[1];
+ break;
+
+ case 3:
if ((cl.time < cl.mtime[1] && cl.oldtime < cl.mtime[1]) || (cl.time > timehigh && cl.oldtime > timehigh))
cl.time = cl.mtime[1];
- }
- else if (cl_nettimesyncboundmode.integer == 4)
- {
+ break;
+
+ case 4:
if (fabs(cl.time - cl.mtime[1]) > 0.5)
cl.time = cl.mtime[1]; // reset
else if (fabs(cl.time - cl.mtime[1]) > 0.1)
cl.time -= 0.002 * cl.movevars_timescale; // fall into the past by 2ms
else
cl.time += 0.001 * cl.movevars_timescale; // creep forward 1ms
- }
- else if (cl_nettimesyncboundmode.integer == 5)
- {
+ break;
+
+ case 5:
if (fabs(cl.time - cl.mtime[1]) > 0.5)
cl.time = cl.mtime[1]; // reset
else if (fabs(cl.time - cl.mtime[1]) > 0.1)
cl.time += 0.5 * (cl.mtime[1] - cl.time); // fast
else
cl.time = bound(cl.time - 0.002 * cl.movevars_timescale, cl.mtime[1], cl.time + 0.001 * cl.movevars_timescale);
- }
- else if (cl_nettimesyncboundmode.integer == 6)
- {
+ break;
+
+ case 6:
cl.time = bound(cl.mtime[1], cl.time, cl.mtime[0]);
cl.time = bound(cl.time - 0.002 * cl.movevars_timescale, cl.mtime[1], cl.time + 0.001 * cl.movevars_timescale);
+ break;
+
+ case 7:
+ /* bones_was_here: this aims to prevent disturbances in the force from affecting cl.time
+ * the rolling harmonic mean gives large time error outliers low significance
+ * correction rate is dynamic and gradual (max 10% of mean error per tic)
+ * time is correct within a few server frames of connect/map start
+ * can achieve microsecond accuracy when cl.realframetime is a multiple of sv.frametime
+ * prevents 0ms move frame times with uncapped fps
+ * smoothest mode esp. for vsynced clients on servers with aggressive inputtimeout
+ */
+ {
+ unsigned char i;
+ float error;
+ // in event of packet loss, cl.mtime[1] could be very old, so avoid if possible
+ double target = cl.movevars_ticrate ? cl.mtime[0] - cl.movevars_ticrate : cl.mtime[1];
+ cl.ts_error_stor[cl.ts_error_num] = 1.0f / max(fabs(cl.time - target), FLT_MIN);
+ cl.ts_error_num = (cl.ts_error_num + 1) % NUM_TS_ERRORS;
+ for (i = 0, error = 0.0f; i < NUM_TS_ERRORS; i++)
+ error += cl.ts_error_stor[i];
+ error = 0.1f / (error / NUM_TS_ERRORS);
+ cl.time = bound(cl.time - error, target, cl.time + error);
+ }
+ break;
}
}
// this packet probably contains a player entity update, so we will need
// update the csqc's server timestamps, critical for proper sync
CSQC_UpdateNetworkTimes(cl.mtime[0], cl.mtime[1]);
+#ifdef USEODE
if (cl.mtime[0] > cl.mtime[1])
World_Physics_Frame(&cl.world, cl.mtime[0] - cl.mtime[1], cl.movevars_gravity);
+#endif
// only lerp entities that also get an update in this frame, when lerp excess is used
if(cl_lerpexcess.value > 0)
if (cls.demonum != -1)
CL_NextDemo();
else
- {
- Con_Printf("Server disconnected\n");
- CL_Disconnect();
- }
- return;
+ CL_DisconnectEx(true, "Server disconnected");
+ break;
case qw_svc_print:
i = MSG_ReadByte(&cl_message);
break;
case qw_svc_sellscreen:
- Cmd_ExecuteString(cmd_client, "help", src_local, true);
+ Cmd_ExecuteString(cmd_local, "help", src_local, true);
break;
case qw_svc_smallkick:
case svc_disconnect:
if (cls.demonum != -1)
- CL_NextDemo ();
+ CL_NextDemo();
else
- {
- Con_Printf ("Server disconnected\n");
- CL_Disconnect ();
- }
+ CL_DisconnectEx(true, cls.protocol == PROTOCOL_DARKPLACES8 ? MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)) : "Server disconnected");
break;
case svc_print:
break;
case svc_sellscreen:
- Cmd_ExecuteString(cmd_client, "help", src_local, true);
+ Cmd_ExecuteString(cmd_local, "help", src_local, true);
break;
case svc_hidelmp:
if (gamemode == GAME_TENEBRAE)
void CL_Parse_ErrorCleanUp(void)
{
CL_StopDownload(0, 0);
- QW_CL_StopUpload_f(cmd_client);
+ QW_CL_StopUpload_f(cmd_local);
}
void CL_Parse_Init(void)
b = g[(j+1)%NETGRAPH_PACKETS];
if (a[0] < 0.0f || b[0] > 1.0f || b[0] < a[0])
continue;
- DrawQ_Line(1, graphx + graphwidth * a[0], graphy + graphheight * a[2], graphx + graphwidth * b[0], graphy + graphheight * b[2], 1.0f, 1.0f, 1.0f, 1.0f, 0, true);
- DrawQ_Line(1, graphx + graphwidth * a[0], graphy + graphheight * a[1], graphx + graphwidth * b[0], graphy + graphheight * b[1], 1.0f, 0.0f, 0.0f, 1.0f, 0, true);
- DrawQ_Line(1, graphx + graphwidth * a[0], graphy + graphheight * a[5], graphx + graphwidth * b[0], graphy + graphheight * b[5], 0.0f, 1.0f, 0.0f, 1.0f, 0, true);
- DrawQ_Line(1, graphx + graphwidth * a[0], graphy + graphheight * a[4], graphx + graphwidth * b[0], graphy + graphheight * b[4], 1.0f, 1.0f, 1.0f, 1.0f, 0, true);
- DrawQ_Line(1, graphx + graphwidth * a[0], graphy + graphheight * a[3], graphx + graphwidth * b[0], graphy + graphheight * b[3], 1.0f, 0.5f, 0.0f, 1.0f, 0, true);
- DrawQ_Line(1, graphx + graphwidth * a[0], graphy + graphheight * a[6], graphx + graphwidth * b[0], graphy + graphheight * b[6], 0.0f, 0.0f, 1.0f, 1.0f, 0, true);
+ DrawQ_Line(1, graphx + graphwidth * a[0], graphy + graphheight * a[2], graphx + graphwidth * b[0], graphy + graphheight * b[2], 1.0f, 1.0f, 1.0f, 1.0f, 0);
+ DrawQ_Line(1, graphx + graphwidth * a[0], graphy + graphheight * a[1], graphx + graphwidth * b[0], graphy + graphheight * b[1], 1.0f, 0.0f, 0.0f, 1.0f, 0);
+ DrawQ_Line(1, graphx + graphwidth * a[0], graphy + graphheight * a[5], graphx + graphwidth * b[0], graphy + graphheight * b[5], 0.0f, 1.0f, 0.0f, 1.0f, 0);
+ DrawQ_Line(1, graphx + graphwidth * a[0], graphy + graphheight * a[4], graphx + graphwidth * b[0], graphy + graphheight * b[4], 1.0f, 1.0f, 1.0f, 1.0f, 0);
+ DrawQ_Line(1, graphx + graphwidth * a[0], graphy + graphheight * a[3], graphx + graphwidth * b[0], graphy + graphheight * b[3], 1.0f, 0.5f, 0.0f, 1.0f, 0);
+ DrawQ_Line(1, graphx + graphwidth * a[0], graphy + graphheight * a[6], graphx + graphwidth * b[0], graphy + graphheight * b[6], 0.0f, 0.0f, 1.0f, 1.0f, 0);
}
x = graphx;
y = graphy + graphheight;
Cvar_RegisterVariable(&scr_stipple);
Cvar_RegisterVariable(&scr_refresh);
Cvar_RegisterVariable(&net_graph);
- Cvar_RegisterAlias(&net_graph, "shownetgraph");
+ Cvar_RegisterVirtual(&net_graph, "shownetgraph");
Cvar_RegisterVariable(&cl_demo_mousegrab);
Cvar_RegisterVariable(&timedemo_screenshotframelist);
Cvar_RegisterVariable(&vid_touchscreen_outlinealpha);
double fps1 = (cls.capturevideo.frame - cls.capturevideo.lastfpsframe) / (t - cls.capturevideo.lastfpstime + 0.0000001);
double fps = (cls.capturevideo.frame ) / (t - cls.capturevideo.starttime + 0.0000001);
dpsnprintf(buf, sizeof(buf), "capturevideo: (%.1fs) last second %.3ffps, total %.3ffps\n", cls.capturevideo.frame / cls.capturevideo.framerate, fps1, fps);
- Sys_PrintToTerminal(buf);
+ Sys_Print(buf);
cls.capturevideo.lastfpstime = t;
cls.capturevideo.lastfpsframe = cls.capturevideo.frame;
}
int demonum;
// list of demos in loop
char demos[MAX_DEMOS][MAX_DEMONAME];
- // the actively playing demo (set by CL_PlayDemo_f)
+ // the actively playing demo (set by CL_PlayDemo)
char demoname[MAX_QPATH];
// demo recording info must be here, because record is started before
// how long it has been since the previous client frame in real time
// (not game time, for that use cl.time - cl.oldtime)
double realframetime;
-
+
+ // used by cl_nettimesyncboundmode 7
+#define NUM_TS_ERRORS 32 // max 256
+ unsigned char ts_error_num;
+ float ts_error_stor[NUM_TS_ERRORS];
+
// fade var for fading while dead
float deathfade;
// use cl.scores[cl.playerentity-1].qw_spectator instead
//qbool qw_spectator;
- // last time an input packet was sent
- double lastpackettime;
+ // time accumulated since an input packet was sent
+ float timesincepacket;
// movement parameters for client prediction
unsigned int moveflags;
void CL_EstablishConnection(const char *host, int firstarg);
-void CL_Disconnect (void);
+void CL_Disconnect(void);
+void CL_DisconnectEx(qbool kicked, const char *reason, ... );
void CL_Disconnect_f(cmd_state_t *cmd);
void CL_UpdateRenderEntity(entity_render_t *ent);
void CL_CutDemo(unsigned char **buf, fs_offset_t *filesize);
void CL_PasteDemo(unsigned char **buf, fs_offset_t *filesize);
+void CL_PlayDemo(const char *demo);
void CL_NextDemo(void);
void CL_Stop_f(cmd_state_t *cmd);
void CL_Record_f(cmd_state_t *cmd);
VM_Warning(prog, "setorigin: can not modify world entity\n");
return;
}
- if (e->priv.required->free)
+ if (e->free)
{
VM_Warning(prog, "setorigin: can not modify free entity\n");
return;
VM_Warning(prog, "setsize: can not modify world entity\n");
return;
}
- if (e->priv.server->free)
+ if (e->free)
{
VM_Warning(prog, "setsize: can not modify free entity\n");
return;
VM_Warning(prog, "droptofloor: can not modify world entity\n");
return;
}
- if (ent->priv.server->free)
+ if (ent->free)
{
VM_Warning(prog, "droptofloor: can not modify free entity\n");
return;
// so we can easily check if CSQC entity #edictnum is currently drawn
cl.csqcrenderentities[i].entitynumber = 0;
ed = &prog->edicts[i];
- if(ed->priv.required->free)
+ if(ed->free)
continue;
CSQC_Think(ed);
- if(ed->priv.required->free)
+ if(ed->free)
continue;
// note that for RF_USEAXIS entities, Predraw sets v_forward/v_right/v_up globals that are read by CSQC_AddRenderEdict
CSQC_Predraw(ed);
- if(ed->priv.required->free)
+ if(ed->free)
continue;
if(!((int)PRVM_clientedictfloat(ed, drawmask) & drawmask))
continue;
rgb = PRVM_G_VECTOR(OFS_PARM3);
alpha = PRVM_G_FLOAT(OFS_PARM4);
flags = (int)PRVM_G_FLOAT(OFS_PARM5);
- DrawQ_Line(width, c1[0], c1[1], c2[0], c2[1], rgb[0], rgb[1], rgb[2], alpha, flags, false);
+ DrawQ_Line(width, c1[0], c1[1], c2[0], c2[1], rgb[0], rgb[1], rgb[2], alpha, flags);
}
/*
static void VM_CL_registercmd (prvm_prog_t *prog)
{
VM_SAFEPARMCOUNT(1, VM_CL_registercmd);
- if(!Cmd_Exists(cmd_client, PRVM_G_STRING(OFS_PARM0)))
+ if(!Cmd_Exists(cmd_local, PRVM_G_STRING(OFS_PARM0)))
Cmd_AddCommand(CF_CLIENT, PRVM_G_STRING(OFS_PARM0), NULL, "console command created by QuakeC");
}
VM_Warning(prog, "makestatic: can not modify world entity\n");
return;
}
- if (ent->priv.server->free)
+ if (ent->free)
{
VM_Warning(prog, "makestatic: can not modify free entity\n");
return;
VM_Warning(prog, "copyentity: can not read world entity\n");
return;
}
- if (in->priv.server->free)
+ if (in->free)
{
VM_Warning(prog, "copyentity: can not read free entity\n");
return;
VM_Warning(prog, "copyentity: can not modify world entity\n");
return;
}
- if (out->priv.server->free)
+ if (out->free)
{
VM_Warning(prog, "copyentity: can not modify free entity\n");
return;
VM_Warning(prog, "setattachment: can not modify world entity\n");
return;
}
- if (e->priv.server->free)
+ if (e->free)
{
VM_Warning(prog, "setattachment: can not modify free entity\n");
return;
if (ent == prog->edicts)
return 1;
- if (ent->priv.server->free)
+ if (ent->free)
return 2;
model = CL_GetModelFromEdict(ent);
VM_Warning(prog, "VM_CL_gettagindex(entity #%i): can't affect world entity\n", PRVM_NUM_FOR_EDICT(ent));
return;
}
- if (ent->priv.server->free)
+ if (ent->free)
{
VM_Warning(prog, "VM_CL_gettagindex(entity #%i): can't affect free entity\n", PRVM_NUM_FOR_EDICT(ent));
return;
VM_Warning(prog, "walkmove: can not modify world entity\n");
return;
}
- if (ent->priv.server->free)
+ if (ent->free)
{
VM_Warning(prog, "walkmove: can not modify free entity\n");
return;
VectorCopy(PRVM_G_VECTOR(OFS_PARM0), viewpos);
viewee = PRVM_G_EDICT(OFS_PARM1);
- if(viewee->priv.required->free)
+ if(viewee->free)
{
VM_Warning(prog, "checkpvs: can not check free entity\n");
PRVM_G_FLOAT(OFS_RETURN) = 4;
VM_fabs, // #43 float(float f) fabs (QUAKE)
NULL, // #44 vector(entity e, float speed) aim (QUAKE)
VM_cvar, // #45 float(string s) cvar (QUAKE)
-VM_localcmd_client, // #46 void(string s) localcmd (QUAKE)
+VM_localcmd_local, // #46 void(string s) localcmd (QUAKE)
VM_nextent, // #47 entity(entity e) nextent (QUAKE)
VM_CL_particle, // #48 void(vector o, vector d, float color, float count) particle (QUAKE)
VM_changeyaw, // #49 void() ChangeYaw (QUAKE)
NULL, // #174
NULL, // #175
NULL, // #176
-NULL, // #177
+VM_localsound, // #177
NULL, // #178
NULL, // #179
NULL, // #180
#include "quakedef.h"
#include "thread.h"
-cmd_state_t *cmd_client;
-cmd_state_t *cmd_server;
+cmd_state_t *cmd_local;
cmd_state_t *cmd_serverfromclient;
cmd_userdefined_t cmd_userdefined_all;
Con_Printf("No commands are pending.\n");
else
{
- llist_t *pos;
- List_For_Each(pos, &cbuf->deferred)
- {
- current = List_Entry(*pos, cmd_input_t, list);
+ List_For_Each_Entry(current, &cbuf->deferred, cmd_input_t, list)
Con_Printf("-> In %9.2f: %s\n", current->delay, current->text);
- }
}
}
else if(Cmd_Argc(cmd) == 2 && !strcasecmp("clear", Cmd_Argv(cmd, 1)))
ret = existing;
else if(!List_Is_Empty(&cbuf->free))
{
- ret = List_Entry(*cbuf->free.next, cmd_input_t, list);
+ ret = List_Entry(cbuf->free.next, cmd_input_t, list);
ret->length = 0;
ret->pending = false;
}
return node;
}
+
+// Cloudwalk FIXME: The entire design of this thing is overly complicated.
+// We could very much safely have one input node per line whether or not
+// the command was terminated. We don't need to split up input nodes per command
+// executed.
static size_t Cmd_ParseInput (cmd_input_t **output, char **input)
{
size_t pos, cmdsize = 0, start = 0;
if(!*output)
*output = Cmd_AllocInputNode();
+ // Append, since this input line hasn't closed yet.
if((*output)->pending)
offset = (*output)->length;
}
strlcpy(&(*output)->text[offset], &(*input)[start], cmdsize + 1);
+
+ /*
+ * If we were still looking ahead by the time we broke from the loop, the command input
+ * hasn't terminated yet and we're still expecting more, so keep this node open for appending later.
+ */
(*output)->pending = !lookahead;
}
// Slide the pointer down until we reach the end
while(*in)
{
+ // Check if the current node is still accepting input (input line hasn't terminated)
current = Cbuf_LinkGet(cbuf, existing);
newsize = Cmd_ParseInput(¤t, &in);
// Valid command
if(newsize)
{
+ // current will match existing if the input line hasn't terminated yet
if(current != existing)
{
current->source = cmd;
Con_Print("Cbuf_AddText: overflow\n");
else
{
- Cbuf_LinkCreate(cmd, &llist, (List_Is_Empty(&cbuf->start) ? NULL : List_Entry(*cbuf->start.prev, cmd_input_t, list)), text);
+ Cbuf_LinkCreate(cmd, &llist, (List_Is_Empty(&cbuf->start) ? NULL : List_Entry(cbuf->start.prev, cmd_input_t, list)), text);
if(!List_Is_Empty(&llist))
List_Splice_Tail(&llist, &cbuf->start);
}
Con_Print("Cbuf_InsertText: overflow\n");
else
{
- Cbuf_LinkCreate(cmd, &llist, List_Entry(*cbuf->start.next, cmd_input_t, list), text);
+ Cbuf_LinkCreate(cmd, &llist, (List_Is_Empty(&cbuf->start) ? NULL : List_Entry(cbuf->start.next, cmd_input_t, list)), text);
if(!List_Is_Empty(&llist))
List_Splice(&llist, &cbuf->start);
}
*/
static void Cbuf_Execute_Deferred (cmd_buf_t *cbuf)
{
- llist_t *pos;
cmd_input_t *current;
double eat;
return;
cbuf->deferred_oldtime = host.realtime;
- List_For_Each(pos, &cbuf->deferred)
+ List_For_Each_Entry(current, &cbuf->deferred, cmd_input_t, list)
{
- current = List_Entry(*pos, cmd_input_t, list);
current->delay -= eat;
if(current->delay <= 0)
{
cbuf->size += current->length;
- List_Move(pos, &cbuf->start);
+ List_Move(¤t->list, &cbuf->start);
// We must return and come back next frame or the engine will freeze. Fragile... like glass :3
return;
}
* commands down. This is necessary because commands (exec, alias)
* can insert data at the beginning of the text buffer
*/
- current = List_Entry(*cbuf->start.next, cmd_input_t, list);
+ current = List_Entry(cbuf->start.next, cmd_input_t, list);
// Recycle memory so using WASD doesn't cause a malloc and free
List_Move_Tail(¤t->list, &cbuf->free);
}
}
+/*
+===================
+Cbuf_Frame_Input
+
+Add them exactly as if they had been typed at the console
+===================
+*/
+static void Cbuf_Frame_Input(void)
+{
+ char *line;
+
+ while ((line = Sys_ConsoleInput()))
+ Cbuf_AddText(cmd_local, line);
+}
+
void Cbuf_Frame(cmd_buf_t *cbuf)
{
+ // check for commands typed to the host
+ Cbuf_Frame_Input();
+
+// R_TimeReport("preconsole");
+
+ // execute commands queued with the defer command
Cbuf_Execute_Deferred(cbuf);
if (cbuf->size)
{
Cbuf_Execute(cbuf);
SV_UnlockThreadMutex();
}
+
+// R_TimeReport("console");
}
/*
Cvar_PrintHelp(cvar, cvar->name, true);
count++;
}
- for (int i = 0; i < cvar->aliasindex; i++)
+ for (char **cvar_alias = cvar->aliases; cvar_alias && *cvar_alias; cvar_alias++)
{
- if (matchpattern_with_separator(cvar->aliases[i], partial, true, "", false))
+ if (matchpattern_with_separator(*cvar_alias, partial, true, "", false))
{
Con_Printf ("cvar ");
- Cvar_PrintHelp(cvar, cvar->aliases[i], true);
+ Cvar_PrintHelp(cvar, *cvar_alias, true);
count++;
}
}
Con_Printf("%i result%s\n\n", count, (count > 1) ? "s" : "");
}
-static cmd_state_t *Cmd_AddInterpreter(cmd_buf_t *cbuf, cvar_state_t *cvars, int cvars_flagsmask, int cmds_flagsmask, cmd_userdefined_t *userdefined, int autoflags, xcommand_t autofunction)
+static cmd_state_t *Cmd_AddInterpreter(cmd_buf_t *cbuf, cvar_state_t *cvars, int cvars_flagsmask, int cmds_flagsmask, cmd_userdefined_t *userdefined)
{
cmd_state_t *cmd = (cmd_state_t *)Mem_Alloc(tempmempool, sizeof(cmd_state_t));
cmd->cvars = cvars;
cmd->cvars_flagsmask = cvars_flagsmask;
cmd->cmd_flags = cmds_flagsmask;
- cmd->auto_flags = autoflags;
- cmd->auto_function = autofunction;
cmd->userdefined = userdefined;
return cmd;
cbuf->free.prev = cbuf->free.next = &(cbuf->free);
// FIXME: Get rid of cmd_iter_all eventually. This is just a hack to reduce the amount of work to make the interpreters dynamic.
- cmd_iter_all = (cmd_iter_t *)Mem_Alloc(tempmempool, sizeof(cmd_iter_t) * 4);
-
- // client console can see server cvars because the user may start a server
- cmd_iter_all[0].cmd = cmd_client = Cmd_AddInterpreter(cbuf, &cvars_all, CF_CLIENT | CF_SERVER, CF_CLIENT | CF_CLIENT_FROM_SERVER, &cmd_userdefined_all, CF_SERVER_FROM_CLIENT, CL_ForwardToServer_f);
+ cmd_iter_all = (cmd_iter_t *)Mem_Alloc(tempmempool, sizeof(cmd_iter_t) * 3);
- // dedicated server console can only see server cvars, there is no client
- cmd_iter_all[1].cmd = cmd_server = Cmd_AddInterpreter(cbuf, &cvars_all, CF_SERVER, CF_SERVER, &cmd_userdefined_all, 0, NULL);
+ // local console
+ cmd_iter_all[0].cmd = cmd_local = Cmd_AddInterpreter(cbuf, &cvars_all, CF_CLIENT | CF_SERVER, CF_CLIENT | CF_CLIENT_FROM_SERVER | CF_SERVER_FROM_CLIENT, &cmd_userdefined_all);
+ cmd_local->Handle = Cmd_CL_Callback;
+ cmd_local->NotFound = NULL;
// server commands received from clients have no reason to access cvars, cvar expansion seems perilous.
- cmd_iter_all[2].cmd = cmd_serverfromclient = Cmd_AddInterpreter(cbuf, &cvars_null, 0, CF_SERVER_FROM_CLIENT | CF_USERINFO, &cmd_userdefined_null, 0, NULL);
+ cmd_iter_all[1].cmd = cmd_serverfromclient = Cmd_AddInterpreter(cbuf, &cvars_null, 0, CF_SERVER_FROM_CLIENT | CF_USERINFO, &cmd_userdefined_null);
+ cmd_serverfromclient->Handle = Cmd_SV_Callback;
+ cmd_serverfromclient->NotFound = Cmd_SV_NotFound;
- cmd_iter_all[3].cmd = NULL;
+ cmd_iter_all[2].cmd = NULL;
//
// register our commands
//
cmd_function_t *func;
cmd_function_t *prev, *current;
cmd_state_t *cmd;
- xcommand_t save = NULL;
- qbool auto_add = false;
int i;
- for (i = 0; i < 3; i++)
+ for (i = 0; i < 2; i++)
{
cmd = cmd_iter_all[i].cmd;
- if ((flags & cmd->cmd_flags) || (flags & cmd->auto_flags))
+ if (flags & cmd->cmd_flags)
{
- if((flags & cmd->auto_flags) && cmd->auto_function)
- {
- save = function;
- function = cmd->auto_function;
- auto_add = true;
- }
-
// fail if the command is a variable name
if (Cvar_FindVar(cmd->cvars, cmd_name, ~0))
{
{
if (!strcmp(cmd_name, func->name))
{
- if(func->autofunc && !auto_add)
- break;
Con_Printf("Cmd_AddCommand: %s already defined\n", cmd_name);
- goto next;
+ continue;
}
}
func->function = function;
func->description = description;
func->next = cmd->engine_functions;
- func->autofunc = auto_add;
// insert it at the right alphanumeric position
for (prev = NULL, current = cmd->engine_functions; current && strcmp(current->name, func->name) < 0; prev = current, current = current->next)
func->description = description;
func->qcfunc = true; //[515]: csqc
func->next = cmd->userdefined->qc_functions;
- func->autofunc = false;
// insert it at the right alphanumeric position
for (prev = NULL, current = cmd->userdefined->qc_functions; current && strcmp(current->name, func->name) < 0; prev = current, current = current->next)
}
func->next = current;
}
- if (save)
- function = save;
}
-next:
- auto_add = false;
- continue;
}
}
extern cvar_t sv_cheats;
+/*
+ * Cloudwalk FIXME: This idea sounded great in my head but...
+ * How do we handle commands that can be received by the client,
+ * but which the server can also execute locally?
+ *
+ * If we create a callback where the engine will forward to server
+ * but try to execute the command locally if it's dedicated,
+ * we're back to intermixing client and server code which I'm
+ * trying to avoid. There's no other way I can think of to
+ * implement that behavior that doesn't involve an #ifdef, or
+ * making a mess of hooks.
+ */
+qbool Cmd_Callback(cmd_state_t *cmd, cmd_function_t *func, const char *text, cmd_source_t src)
+{
+ if (func->function)
+ func->function(cmd);
+ else
+ Con_Printf("Command \"%s\" can not be executed\n", Cmd_Argv(cmd, 0));
+ return true;
+}
+
+qbool Cmd_CL_Callback(cmd_state_t *cmd, cmd_function_t *func, const char *text, cmd_source_t src)
+{
+ // TODO: Assign these functions to QC commands directly?
+ if(func->qcfunc)
+ {
+ if(((func->flags & CF_CLIENT) && CL_VM_ConsoleCommand(text)) ||
+ ((func->flags & CF_SERVER) && SV_VM_ConsoleCommand(text)))
+ return true;
+ }
+ if (func->flags & CF_SERVER_FROM_CLIENT)
+ {
+ if(host_isclient.integer)
+ {
+ CL_ForwardToServer_f(cmd);
+ return true;
+ }
+ else if(!(func->flags & CF_SERVER))
+ {
+ Con_Printf("Cannot execute client commands from a dedicated server console.\n");
+ return true;
+ }
+ }
+ return Cmd_Callback(cmd, func, text, src);
+}
+
+qbool Cmd_SV_Callback(cmd_state_t *cmd, cmd_function_t *func, const char *text, cmd_source_t src)
+{
+ if(func->qcfunc && (func->flags & CF_SERVER))
+ return SV_VM_ConsoleCommand(text);
+ else if (src == src_client)
+ {
+ if((func->flags & CF_CHEAT) && !sv_cheats.integer)
+ SV_ClientPrintf("No cheats allowed. The server must have sv_cheats set to 1\n");
+ else
+ func->function(cmd);
+ return true;
+ }
+ return false;
+}
+
+qbool Cmd_SV_NotFound(cmd_state_t *cmd, cmd_function_t *func, const char *text, cmd_source_t src)
+{
+ if (cmd->source == src_client)
+ {
+ Con_Printf("Client \"%s\" tried to execute \"%s\"\n", host_client->name, text);
+ return true;
+ }
+ return false;
+}
/*
============
Cmd_ExecuteString
{
if (!strcasecmp(cmd->argv[0], func->name))
{
- if(func->qcfunc)
- {
- if((func->flags & CF_CLIENT) && CL_VM_ConsoleCommand(text))
- goto done;
- else if((func->flags & CF_SERVER) && SV_VM_ConsoleCommand(text))
- goto done;
- }
+ if(cmd->Handle(cmd, func, text, src))
+ goto done;
}
}
{
if (!strcasecmp (cmd->argv[0], func->name))
{
- switch (src)
- {
- case src_local:
- if (func->function)
- func->function(cmd);
- else
- Con_Printf("Command \"%s\" can not be executed\n", Cmd_Argv(cmd, 0));
+ if(cmd->Handle(cmd, func, text, src))
goto done;
- case src_client:
- if (func->function)
- {
- if((func->flags & CF_CHEAT) && !sv_cheats.integer)
- SV_ClientPrintf("No cheats allowed. The server must have sv_cheats set to 1\n");
- else
- func->function(cmd);
- goto done;
- }
- }
- break;
}
}
// if it's a client command and no command was found, say so.
- if (cmd->source == src_client)
+ if(cmd->NotFound)
{
- Con_Printf("Client \"%s\" tried to execute \"%s\"\n", host_client->name, text);
- goto done;
+ if(cmd->NotFound(cmd, func, text, src))
+ goto done;
}
// check alias
}
Cvar_RestoreInitState(&cvars_all);
}
+
+void Cmd_NoOperation_f(cmd_state_t *cmd)
+{
+}
#define CF_USERINFO (1<<9) // command or cvar used to communicate userinfo to the server
#define CF_PERSISTENT (1<<10) // cvar must not be reset on gametype switch (such as scr_screenshot_name, which otherwise isn't set to the mod name properly)
#define CF_PRIVATE (1<<11) // cvar should not be $ expanded or sent to the server under any circumstances (rcon_password, etc)
-#define CF_MAXFLAGSVAL 4095 // used to determine if flags is valid
+#define CF_MAXFLAGSVAL ((1<<12) - 1) // used to determine if flags is valid
// for internal use only!
#define CF_DEFAULTSET (1<<30)
#define CF_ALLOCATED (1<<31)
int cmd_flags; // cmd flags that identify this interpreter
- /*
- * If a requested flag matches auto_flags, a command will be
- * added to a given interpreter with auto_function. For example,
- * a CF_SERVER_FROM_CLIENT command should be automatically added
- * to the client interpreter as CL_ForwardToServer_f. It can be
- * overridden at any time.
- */
- int auto_flags;
- xcommand_t auto_function;
+ qbool (*Handle)(struct cmd_state_s *, struct cmd_function_s *, const char *, enum cmd_source_s);
+ qbool (*NotFound)(struct cmd_state_s *, struct cmd_function_s *, const char *, enum cmd_source_s);
}
cmd_state_t;
+qbool Cmd_Callback(cmd_state_t *cmd, cmd_function_t *func, const char *text, cmd_source_t src);
+qbool Cmd_CL_Callback(cmd_state_t *cmd, cmd_function_t *func, const char *text, cmd_source_t src);
+qbool Cmd_SV_Callback(cmd_state_t *cmd, cmd_function_t *func, const char *text, cmd_source_t src);
+qbool Cmd_SV_NotFound(cmd_state_t *cmd, cmd_function_t *func, const char *text, cmd_source_t src);
+
typedef struct cmd_input_s
{
llist_t list;
extern cmd_userdefined_t cmd_userdefined_all; // aliases and csqc functions
extern cmd_userdefined_t cmd_userdefined_null; // intentionally empty
-// command interpreter for client commands injected by CSQC, MQC or client engine code
-// uses cmddefs_all
-extern cmd_state_t *cmd_client;
-// command interpreter for server commands injected by MQC, SVQC, menu engine code or server engine code
+// command interpreter for local commands injected by SVQC, CSQC, MQC, server or client engine code
// uses cmddefs_all
-extern cmd_state_t *cmd_server;
+extern cmd_state_t *cmd_local;
// command interpreter for server commands received over network from clients
// uses cmddefs_null
extern cmd_state_t *cmd_serverfromclient;
void Cmd_ClearCSQCCommands (cmd_state_t *cmd);
+void Cmd_NoOperation_f(cmd_state_t *cmd);
+
#endif
/*
-Copyright (C) 1996-1997 Id Software, Inc.
-Copyright (C) 2000-2020 Ashley Rose "LadyHavoc" Hale
-Copyright (C) 2020 David "Cloudwalk" Knapp
-Copyright (C) 2020 Kristus <kristustf@gmail.com>
+Copyright (C) 2000-2021 DarkPlaces contributors
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
*/
-#include "quakedef.h"
+#include "darkplaces.h"
+#include "com_game.h"
// Game mods
--- /dev/null
+/*
+Copyright (C) 2000-2021 DarkPlaces contributors
+
+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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+#ifndef COM_GAME_H
+#define COM_GAME_H
+
+#include "qdefs.h"
+
+typedef enum gamemode_e
+{
+ GAME_NORMAL,
+ GAME_HIPNOTIC,
+ GAME_ROGUE,
+ GAME_QUOTH,
+ GAME_NEHAHRA,
+ GAME_NEXUIZ,
+ GAME_XONOTIC,
+ GAME_TRANSFUSION,
+ GAME_GOODVSBAD2,
+ GAME_TEU,
+ GAME_BATTLEMECH,
+ GAME_ZYMOTIC,
+ GAME_SETHERAL,
+ GAME_TENEBRAE, // full of evil hackery
+ GAME_NEOTERIC,
+ GAME_OPENQUARTZ, //this game sucks
+ GAME_PRYDON,
+ GAME_DELUXEQUAKE,
+ GAME_THEHUNTED,
+ GAME_DEFEATINDETAIL2,
+ GAME_DARSANA,
+ GAME_CONTAGIONTHEORY,
+ GAME_EDU2P,
+ GAME_PROPHECY,
+ GAME_BLOODOMNICIDE,
+ GAME_STEELSTORM, // added by motorsep
+ GAME_STEELSTORM2, // added by motorsep
+ GAME_SSAMMO, // added by motorsep
+ GAME_STEELSTORMREVENANTS, // added by motorsep 07/19/2015
+ GAME_TOMESOFMEPHISTOPHELES, // added by motorsep
+ GAME_STRAPBOMB, // added by motorsep for Urre
+ GAME_MOONHELM,
+ GAME_VORETOURNAMENT,
+ GAME_DOOMBRINGER, // added by Cloudwalk for kristus
+ GAME_BATTLEMETAL, // added by Cloudwalk for Subject9x
+ GAME_COUNT
+}
+gamemode_t;
+
+// Master switch for some hacks/changes that eventually should become cvars.
+#define IS_NEXUIZ_DERIVED(g) ((g) == GAME_NEXUIZ || (g) == GAME_XONOTIC || (g) == GAME_VORETOURNAMENT)
+// Pre-csqcmodels era.
+#define IS_OLDNEXUIZ_DERIVED(g) ((g) == GAME_NEXUIZ || (g) == GAME_VORETOURNAMENT)
+
+extern gamemode_t gamemode;
+extern const char *gamename;
+extern const char *gamenetworkfiltername;
+extern const char *gamedirname1;
+extern const char *gamedirname2;
+extern const char *gamescreenshotname;
+extern const char *gameuserdirname;
+extern char com_modname[MAX_OSPATH];
+
+void COM_InitGameType (void);
+void COM_ChangeGameTypeForGameDirs(void);
+
+#endif
--- /dev/null
+/*
+Copyright (C) 2006-2021 DarkPlaces contributors
+
+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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+#include "darkplaces.h"
+
+char *InfoString_GetValue(const char *buffer, const char *key, char *value, size_t valuelength)
+{
+ int pos = 0, j;
+ size_t keylength;
+ if (!key)
+ key = "";
+ keylength = strlen(key);
+ if (valuelength < 1 || !value)
+ {
+ Con_Printf("InfoString_GetValue: no room in value\n");
+ return NULL;
+ }
+ value[0] = 0;
+ if (strchr(key, '\\'))
+ {
+ Con_Printf("InfoString_GetValue: key name \"%s\" contains \\ which is not possible in an infostring\n", key);
+ return NULL;
+ }
+ if (strchr(key, '\"'))
+ {
+ Con_Printf("InfoString_SetValue: key name \"%s\" contains \" which is not allowed in an infostring\n", key);
+ return NULL;
+ }
+ if (!key[0])
+ {
+ Con_Printf("InfoString_GetValue: can not look up a key with no name\n");
+ return NULL;
+ }
+ while (buffer[pos] == '\\')
+ {
+ if (!memcmp(buffer + pos+1, key, keylength) &&
+ (buffer[pos+1 + keylength] == 0 ||
+ buffer[pos+1 + keylength] == '\\'))
+ {
+ pos += 1 + (int)keylength; // Skip \key
+ if (buffer[pos] == '\\') pos++; // Skip \ before value.
+ for (j = 0;buffer[pos+j] && buffer[pos+j] != '\\' && j < (int)valuelength - 1;j++)
+ value[j] = buffer[pos+j];
+ value[j] = 0;
+ return value;
+ }
+ if (buffer[pos] == '\\') pos++; // Skip \ before value.
+ for (pos++;buffer[pos] && buffer[pos] != '\\';pos++);
+ if (buffer[pos] == '\\') pos++; // Skip \ before value.
+ for (pos++;buffer[pos] && buffer[pos] != '\\';pos++);
+ }
+ // if we reach this point the key was not found
+ return NULL;
+}
+
+void InfoString_SetValue(char *buffer, size_t bufferlength, const char *key, const char *value)
+{
+ int pos = 0, pos2;
+ size_t keylength;
+ if (!key)
+ key = "";
+ if (!value)
+ value = "";
+ keylength = strlen(key);
+ if (strchr(key, '\\') || strchr(value, '\\'))
+ {
+ Con_Printf("InfoString_SetValue: \"%s\" \"%s\" contains \\ which is not possible to store in an infostring\n", key, value);
+ return;
+ }
+ if (strchr(key, '\"') || strchr(value, '\"'))
+ {
+ Con_Printf("InfoString_SetValue: \"%s\" \"%s\" contains \" which is not allowed in an infostring\n", key, value);
+ return;
+ }
+ if (!key[0])
+ {
+ Con_Printf("InfoString_SetValue: can not set a key with no name\n");
+ return;
+ }
+ while (buffer[pos] == '\\')
+ {
+ if (!memcmp(buffer + pos+1, key, keylength) &&
+ (buffer[pos+1 + keylength] == 0 ||
+ buffer[pos+1 + keylength] == '\\'))
+ break;
+ if (buffer[pos] == '\\') pos++; // Skip \ before value.
+ for (;buffer[pos] && buffer[pos] != '\\';pos++);
+ if (buffer[pos] == '\\') pos++; // Skip \ before value.
+ for (;buffer[pos] && buffer[pos] != '\\';pos++);
+ }
+ // if we found the key, find the end of it because we will be replacing it
+ pos2 = pos;
+ if (buffer[pos] == '\\')
+ {
+ pos2 += 1 + (int)keylength; // Skip \key
+ if (buffer[pos2] == '\\') pos2++; // Skip \ before value.
+ for (;buffer[pos2] && buffer[pos2] != '\\';pos2++);
+ }
+ if (bufferlength <= pos + 1 + strlen(key) + 1 + strlen(value) + strlen(buffer + pos2))
+ {
+ Con_Printf("InfoString_SetValue: no room for \"%s\" \"%s\" in infostring\n", key, value);
+ return;
+ }
+ if (value[0])
+ {
+ // set the key/value and append the remaining text
+ char tempbuffer[MAX_INPUTLINE];
+ strlcpy(tempbuffer, buffer + pos2, sizeof(tempbuffer));
+ dpsnprintf(buffer + pos, bufferlength - pos, "\\%s\\%s%s", key, value, tempbuffer);
+ }
+ else
+ {
+ // just remove the key from the text
+ strlcpy(buffer + pos, buffer + pos2, bufferlength - pos);
+ }
+}
+
+void InfoString_Print(char *buffer)
+{
+ int i;
+ char key[MAX_INPUTLINE];
+ char value[MAX_INPUTLINE];
+ while (*buffer)
+ {
+ if (*buffer != '\\')
+ {
+ Con_Printf("InfoString_Print: corrupt string\n");
+ return;
+ }
+ for (buffer++, i = 0;*buffer && *buffer != '\\';buffer++)
+ if (i < (int)sizeof(key)-1)
+ key[i++] = *buffer;
+ key[i] = 0;
+ if (*buffer != '\\')
+ {
+ Con_Printf("InfoString_Print: corrupt string\n");
+ return;
+ }
+ for (buffer++, i = 0;*buffer && *buffer != '\\';buffer++)
+ if (i < (int)sizeof(value)-1)
+ value[i++] = *buffer;
+ value[i] = 0;
+ // empty value is an error case
+ Con_Printf("%20s %s\n", key, value[0] ? value : "NO VALUE");
+ }
+}
--- /dev/null
+/*
+Copyright (C) 2006-2021 DarkPlaces contributors
+
+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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+#ifndef INFOSTRING_H
+#define INFOSTRING_H
+
+#include "qtypes.h"
+#include <stdlib.h>
+
+char *InfoString_GetValue(const char *buffer, const char *key, char *value, size_t valuelength);
+void InfoString_SetValue(char *buffer, size_t bufferlength, const char *key, const char *value);
+void InfoString_Print(char *buffer);
+
+#endif
+++ /dev/null
-/*
-Copyright (C) 2020 David "Cloudwalk" Knapp
-
-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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-*/
-
-// com_list.c - generic doubly linked list interface, adapted from Linux list.h
-
-#include "qtypes.h"
-#include "com_list.h"
-
-/*
- * Creates a new linked list. Initializes the head to point to itself.
- * If it's a list header, the result is an empty list.
- */
-void List_Create(llist_t *list)
-{
- list->next = list->prev = NULL;
-}
-
-/*
- * Insert a node between two known nodes.
- *
- * Only use when prev and next are known.
- */
-static void __List_Add(llist_t *node, llist_t *prev, llist_t *next)
-{
- next->prev = node;
- node->next = next;
- node->prev = prev;
- prev->next = node;
-}
-
-/*
- * Insert a node immediately after head.
- */
-void List_Add(llist_t *node, llist_t *head)
-{
- __List_Add(node, head, head->next);
-}
-
-/*
- * Insert a node immediately before head.
- */
-void List_Add_Tail(llist_t *node, llist_t *head)
-{
- __List_Add(node, head->prev, head);
-}
-
-/*
- * Bridge prev and next together, when removing the parent of them.
- */
-static inline void __List_Delete(llist_t *prev, llist_t *next)
-{
- next->prev = prev;
- prev->next = next;
-}
-
-/*
- * Redundant?
- */
-static inline void __List_Delete_Node(llist_t *node)
-{
- __List_Delete(node->prev, node->next);
-}
-
-/*
- * Removes a node from its list. Sets its pointers to NULL.
- */
-void List_Delete(llist_t *node)
-{
- __List_Delete_Node(node);
- node->next = node->prev = NULL;
-}
-
-/*
- * Removes a node from its list. Reinitialize it.
- */
-void List_Delete_Init(llist_t *node)
-{
- __List_Delete_Node(node);
- node->next = node->prev = node;
-}
-
-/*
- * Replace old with new. Old is overwritten if empty.
- */
-void List_Replace(llist_t *old, llist_t *_new)
-{
- _new->next = old->next;
- _new->next->prev = _new;
- _new->prev = old->prev;
- _new->prev->next = _new;
- old->next = old->prev = old;
-}
-
-/*
- * Replace old with new. Initialize old.
- * Old is overwritten if empty.
- */
-void List_Replace_Init(llist_t *old, llist_t *_new)
-{
- List_Replace(old, _new);
- List_Create(old);
-}
-
-/*
- * Swap node1 with node2 in place.
- */
-void List_Swap(llist_t *node1, llist_t *node2)
-{
- llist_t *pos = node2->prev;
- List_Delete_Init(node2);
- List_Replace(node1, node2);
- if(pos == node1)
- pos = node2;
- List_Add(node1, pos);
-}
-
-/*
- * Delete list from its... list, then insert after head.
- */
-void List_Move(llist_t *list, llist_t *head)
-{
- __List_Delete_Node(list);
- List_Add(list, head);
-}
-
-/*
- * Delete list from its... list, then insert before head.
- */
-void List_Move_Tail(llist_t *list, llist_t *head)
-{
- __List_Delete_Node(list);
- List_Add_Tail(list, head);
-}
-
-/*
- * Move the first node of a range of nodes immediately after head.
- * All three parameters must belong to the same list.
- */
-
-void List_Bulk_Move_Tail(llist_t *head, llist_t *first, llist_t *last)
-{
- first->prev->next = last->next;
- last->next->prev = first->prev;
-
- head->prev->next = first;
- first->prev = head->prev;
-
- last->next = head;
- head->prev = last;
-}
-
-/*
- * Shift the head to the right (like rotating a wheel counterclockwise).
- * The node immediately to the right becomes the new head.
- */
-void List_Rotate_Left(llist_t *head)
-{
- llist_t *first;
-
- if (!List_Is_Empty(head))
- {
- first = head->next;
- List_Move_Tail(first, head);
- }
-}
-
-/*
- * Make list the new head.
- */
-void List_Rotate_To_Front(llist_t *list, llist_t *head)
-{
- List_Move_Tail(head, list);
-}
-
-/*
- * Concatenate two lists. The head of list will be discarded.
- */
-static inline void __List_Splice(const llist_t *list, llist_t *prev, llist_t *next)
-{
- llist_t *first = list->next;
- llist_t *last = list->prev;
-
- first->prev = prev;
- prev->next = first;
-
- last->next = next;
- next->prev = last;
-}
-
-/*
- * Concatenate two lists. The first node of list will be inserted after head.
- */
-void List_Splice(const llist_t *list, llist_t *head)
-{
- if(!List_Is_Empty(list))
- __List_Splice(list, head, head->next);
-}
-
-/*
- * Concatenate two lists. The tail of list will be inserted before head.
- */
-void List_Splice_Tail(const llist_t *list, llist_t *head)
-{
- if (!List_Is_Empty(list))
- __List_Splice(list, head->prev, head);
-}
-
-qbool List_Is_First(llist_t *list, llist_t *start)
-{
- return list->prev == start;
-}
-
-qbool List_Is_Last(llist_t *list, llist_t *start)
-{
- return list->next == start;
-}
-
-qbool List_Is_Empty(const llist_t *list)
-{
- return list->next == list;
-}
/*
-Copyright (C) 2020 David "Cloudwalk" Knapp
+Copyright (C) 2020-2021 David Knapp (Cloudwalk)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
/*
* Get the next element in the list
*/
-#define List_Next_Entry(pos, member) \
- List_Entry((pos)->member.next, Q_typeof(*(pos)), member)
+#define List_Next_Entry(pos, type, member) \
+ List_Entry((pos)->member.next, type, member)
/*
* Get the prev element in the list
*/
-#define List_Prev_Entry(pos, member) \
- List_Entry((pos)->member.prev, Q_typeof(*(pos)), member)
+#define List_Prev_Entry(pos, type, member) \
+ List_Entry((pos)->member.prev, type, member)
/*
* Iterate over a list
#define List_For_Each_Safe(pos, n, head) \
for (pos = (head)->next, n = pos->next; pos != (head); \
pos = n, n = pos->next)
+
/*
* Iterate over a list backwards, safe against removal of list entry
*/
for (pos = (head)->prev, n = pos->prev; \
pos != (head); \
pos = n, n = pos->prev)
+
/*
* Test if the entry points to the head of the list
*/
/*
* Iterate over a list of a given type
*/
-#define List_For_Each_Entry(pos, head, member) \
- for (pos = List_Last_Entry(head, Q_typeof(*pos), member); \
+#define List_For_Each_Entry(pos, head, type, member) \
+ for (pos = List_First_Entry(head, type, member); \
!List_Entry_Is_Head(pos, head, member); \
- pos = List_Prev_Entry(pos, member))
+ pos = List_Next_Entry(pos, type, member))
/*
* Iterate over a list of a given type backwards
*/
-#define List_For_Each_Prev_Entry(pos, head, member) \
- for (pos = List_Last_Entry(head, Q_typeof(*pos), member); \
+#define List_For_Each_Prev_Entry(pos, head, type, member) \
+ for (pos = List_Last_Entry(head, type, member); \
!List_Entry_Is_Head(pos, head, member); \
- pos = List_Prev_Entry(pos, member))
+ pos = List_Prev_Entry(pos, type, member))
/*
* Prepares a pos entry for use as a start point in List_For_Each_Entry_Continue()
*/
-#define List_Prepare_Entry(pos, head, member) \
- ((pos) ? : List_Entry(head, Q_typeof(*pos), member))
+#define List_Prepare_Entry(pos, head, type, member) \
+ ((pos) ? : List_Entry(head, type, member))
/*
* Continue iteration over a list of a given type, after the current position
*/
-#define List_For_Each_Entry_Continue(pos, head, member) \
- for (pos = List_Next_Entry(pos, member); \
+#define List_For_Each_Entry_Continue(pos, head, type, member) \
+ for (pos = List_Next_Entry(pos, type, member); \
!List_Entry_Is_Head(pos, head, member); \
- pos = List_Next_Entry(pos, member))
+ pos = List_Next_Entry(pos, type, member))
/*
* Continue iteration over a list of a given type backwards, after the current position
*/
-#define List_For_Each_Prev_Entry_Continue(pos, head, member) \
- for (pos = List_Prev_Entry(pos, member); \
+#define List_For_Each_Prev_Entry_Continue(pos, head, type, member) \
+ for (pos = List_Prev_Entry(pos, type, member); \
!List_Entry_Is_Head(pos, head, member); \
- pos = List_Prev_Entry(pos, member))
+ pos = List_Prev_Entry(pos, type, member))
/*
* Continue iteration over a list of a given type, from the current position
*/
-#define List_For_Each_Entry_From(pos, head, member) \
+#define List_For_Each_Entry_From(pos, head, type, member) \
for (; !List_Entry_Is_Head(pos, head, member); \
- pos = List_Next_Entry(pos, member))
+ pos = List_Next_Entry(pos, type, member))
/*
* Continue iteration over a list of a given type backwards, from the current position
*/
-#define List_For_Each_Prev_Entry_From(pos, head, member) \
+#define List_For_Each_Prev_Entry_From(pos, head, type, member) \
for (; !List_Entry_Is_Head(pos, head, member); \
- pos = List_Prev_Entry(pos, member))
+ pos = List_Prev_Entry(pos, type, member))
/*
* Iterate over a list of a given type, safe against removal of list entry
*/
-#define List_For_Each_Entry_Safe(pos, n, head, member) \
- for (pos = List_First_Entry(head, Q_typeof(*pos), member), \
- n = List_Next_Entry(pos, member); \
+#define List_For_Each_Entry_Safe(pos, n, head, type, member) \
+ for (pos = List_First_Entry(head, type, member), \
+ n = List_Next_Entry(pos, type, member); \
!List_Entry_Is_Head(pos, head, member); \
- pos = n, n = List_Next_Entry(n, member))
+ pos = n, n = List_Next_Entry(n, type, member))
+
/*
* Continue iteration over a list of a given type, after the current position, safe against removal of list entry
*/
-#define List_For_Each_Entry_Safe_Continue(pos, n, head, member) \
- for (pos = List_Next_Entry(pos, member), \
- n = List_Next_Entry(pos, member); \
+#define List_For_Each_Entry_Safe_Continue(pos, n, head, type, member) \
+ for (pos = List_Next_Entry(pos, type, member), \
+ n = List_Next_Entry(pos, type, member); \
!List_Entry_Is_Head(pos, head, member); \
- pos = n, n = List_Next_Entry(n, member))
+ pos = n, n = List_Next_Entry(n, type, member))
/*
* Continue iteration over a list of a given type, from the current position, safe against removal of list entry
*/
-#define List_For_Each_Entry_Safe_From(pos, n, head, member) \
- for (n = List_Next_Entry(pos, member); \
+#define List_For_Each_Entry_Safe_From(pos, n, head, type, member) \
+ for (n = List_Next_Entry(pos, type, member); \
!List_Entry_Is_Head(pos, head, member); \
- pos = n, n = List_Next_Entry(n, member))
-
+ pos = n, n = List_Next_Entry(n, type, member))
/*
* Iterate over a list of a given type backwards, safe against removal of list entry
*/
-#define List_For_Each_Prev_Entry_Safe(pos, n, head, member) \
- for (pos = List_Last_Entry(head, Q_typeof(*pos), member), \
- n = List_Prev_Entry(pos, member); \
+#define List_For_Each_Prev_Entry_Safe(pos, n, head, type, member) \
+ for (pos = List_Last_Entry(head, type, member), \
+ n = List_Prev_Entry(pos, type, member); \
!List_Entry_Is_Head(pos, head, member); \
- pos = n, n = List_Prev_Entry(n, member))
+ pos = n, n = List_Prev_Entry(n, type, member))
/*
* Reset a stale List_For_Each_Entry_Safe loop
*/
-#define List_Safe_Reset_Next(pos, n, member) \
- n = List_Next_Entry(pos, member)
-
-void List_Create(llist_t *list);
-void List_Add(llist_t *node, llist_t *start);
-void List_Add_Tail(llist_t *node, llist_t *start);
-void List_Delete(llist_t *node);
-void List_Delete_Init(llist_t *node);
-void List_Replace(llist_t *old, llist_t *_new);
-void List_Replace_Init(llist_t *old, llist_t *_new);
-void List_Swap(llist_t *node1, llist_t *node2);
-void List_Move(llist_t *list, llist_t *start);
-void List_Move_Tail(llist_t *list, llist_t *start);
-void List_Bulk_Move_Tail(llist_t *start, llist_t *first, llist_t *last);
-void List_Rotate_Left(llist_t *head);
-void List_Rotate_To_Front(llist_t *list, llist_t *head);
-void List_Splice(const llist_t *list, llist_t *head);
-void List_Splice_Tail(const llist_t *list, llist_t *head);
-qbool List_Is_First(llist_t *list, llist_t *start);
-qbool List_Is_Last(llist_t *list, llist_t *start);
-qbool List_Is_Empty(const llist_t *list);
+#define List_Safe_Reset_Next(pos, n, type, member) \
+ n = List_Next_Entry(pos, type, member)
+
+static inline qbool List_Is_Empty(const llist_t *list)
+{
+ return list->next == list;
+}
+
+/*
+ * Creates a new linked list. Initializes the head to point to itself.
+ * If it's a list header, the result is an empty list.
+ */
+static inline void List_Create(llist_t *list)
+{
+ list->next = list->prev = list;
+}
+
+/*
+ * Insert a node between two known nodes.
+ *
+ * Only use when prev and next are known.
+ */
+static inline void __List_Add(llist_t *node, llist_t *prev, llist_t *next)
+{
+ next->prev = node;
+ node->next = next;
+ node->prev = prev;
+ prev->next = node;
+}
+
+/*
+ * Insert a node immediately after head.
+ */
+static inline void List_Add(llist_t *node, llist_t *head)
+{
+ __List_Add(node, head, head->next);
+}
+
+/*
+ * Insert a node immediately before head.
+ */
+static inline void List_Add_Tail(llist_t *node, llist_t *head)
+{
+ __List_Add(node, head->prev, head);
+}
+
+/*
+ * Bridge prev and next together, when removing the parent of them.
+ */
+static inline void __List_Delete(llist_t *prev, llist_t *next)
+{
+ next->prev = prev;
+ prev->next = next;
+}
+
+/*
+ * Redundant?
+ */
+static inline void __List_Delete_Node(llist_t *node)
+{
+ __List_Delete(node->prev, node->next);
+}
+
+/*
+ * Removes a node from its list. Sets its pointers to NULL.
+ */
+static inline void List_Delete(llist_t *node)
+{
+ __List_Delete_Node(node);
+ node->next = node->prev = NULL;
+}
+
+/*
+ * Removes a node from its list. Reinitialize it.
+ */
+static inline void List_Delete_Init(llist_t *node)
+{
+ __List_Delete_Node(node);
+ node->next = node->prev = node;
+}
+
+/*
+ * Replace old with new. Old is overwritten if empty.
+ */
+static inline void List_Replace(llist_t *old, llist_t *_new)
+{
+ _new->next = old->next;
+ _new->next->prev = _new;
+ _new->prev = old->prev;
+ _new->prev->next = _new;
+ old->next = old->prev = old;
+}
+
+/*
+ * Replace old with new. Initialize old.
+ * Old is overwritten if empty.
+ */
+static inline void List_Replace_Init(llist_t *old, llist_t *_new)
+{
+ List_Replace(old, _new);
+ List_Create(old);
+}
+
+/*
+ * Swap node1 with node2 in place.
+ */
+static inline void List_Swap(llist_t *node1, llist_t *node2)
+{
+ llist_t *pos = node2->prev;
+ List_Delete_Init(node2);
+ List_Replace(node1, node2);
+ if(pos == node1)
+ pos = node2;
+ List_Add(node1, pos);
+}
+
+/*
+ * Delete list from its... list, then insert after head.
+ */
+static inline void List_Move(llist_t *list, llist_t *head)
+{
+ __List_Delete_Node(list);
+ List_Add(list, head);
+}
+
+/*
+ * Delete list from its... list, then insert before head.
+ */
+static inline void List_Move_Tail(llist_t *list, llist_t *head)
+{
+ __List_Delete_Node(list);
+ List_Add_Tail(list, head);
+}
+
+/*
+ * Move the first node of a range of nodes immediately after head.
+ * All three parameters must belong to the same list.
+ */
+
+static inline void List_Bulk_Move_Tail(llist_t *head, llist_t *first, llist_t *last)
+{
+ first->prev->next = last->next;
+ last->next->prev = first->prev;
+
+ head->prev->next = first;
+ first->prev = head->prev;
+
+ last->next = head;
+ head->prev = last;
+}
+
+/*
+ * Shift the head to the right (like rotating a wheel counterclockwise).
+ * The node immediately to the right becomes the new head.
+ */
+static inline void List_Rotate_Left(llist_t *head)
+{
+ llist_t *first;
+
+ if (!List_Is_Empty(head))
+ {
+ first = head->next;
+ List_Move_Tail(first, head);
+ }
+}
+
+/*
+ * Make list the new head.
+ */
+static inline void List_Rotate_To_Front(llist_t *list, llist_t *head)
+{
+ List_Move_Tail(head, list);
+}
+
+/*
+ * Concatenate two lists. The head of list will be discarded.
+ */
+static inline void __List_Splice(const llist_t *list, llist_t *prev, llist_t *next)
+{
+ llist_t *first = list->next;
+ llist_t *last = list->prev;
+
+ first->prev = prev;
+ prev->next = first;
+
+ last->next = next;
+ next->prev = last;
+}
+
+/*
+ * Concatenate two lists. The first node of list will be inserted after head.
+ */
+static inline void List_Splice(const llist_t *list, llist_t *head)
+{
+ if(!List_Is_Empty(list))
+ __List_Splice(list, head, head->next);
+}
+
+/*
+ * Concatenate two lists. The tail of list will be inserted before head.
+ */
+static inline void List_Splice_Tail(const llist_t *list, llist_t *head)
+{
+ if (!List_Is_Empty(list))
+ __List_Splice(list, head->prev, head);
+}
+
+static inline qbool List_Is_First(llist_t *list, llist_t *start)
+{
+ return list->prev == start;
+}
+
+static inline qbool List_Is_Last(llist_t *list, llist_t *start)
+{
+ return list->next == start;
+}
#endif
/*
Copyright (C) 1996-1997 Id Software, Inc.
+Copyright (C) 2000-2020 DarkPlaces contributors
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
/*
Copyright (C) 1996-1997 Id Software, Inc.
+Copyright (C) 2000-2020 DarkPlaces contributors
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
Cvar_RegisterVariable (®istered);
Cvar_RegisterVariable (&cmdline);
Cvar_RegisterVariable(&cl_playermodel);
- Cvar_RegisterAlias(&cl_playermodel, "_cl_playermodel");
+ Cvar_RegisterVirtual(&cl_playermodel, "_cl_playermodel");
Cvar_RegisterVariable(&cl_playerskin);
- Cvar_RegisterAlias(&cl_playerskin, "_cl_playerskin");
+ Cvar_RegisterVirtual(&cl_playerskin, "_cl_playerskin");
// reconstitute the command line for the cmdline externally visible cvar
n = 0;
#undef APPEND
}
-char *InfoString_GetValue(const char *buffer, const char *key, char *value, size_t valuelength)
-{
- int pos = 0, j;
- size_t keylength;
- if (!key)
- key = "";
- keylength = strlen(key);
- if (valuelength < 1 || !value)
- {
- Con_Printf("InfoString_GetValue: no room in value\n");
- return NULL;
- }
- value[0] = 0;
- if (strchr(key, '\\'))
- {
- Con_Printf("InfoString_GetValue: key name \"%s\" contains \\ which is not possible in an infostring\n", key);
- return NULL;
- }
- if (strchr(key, '\"'))
- {
- Con_Printf("InfoString_SetValue: key name \"%s\" contains \" which is not allowed in an infostring\n", key);
- return NULL;
- }
- if (!key[0])
- {
- Con_Printf("InfoString_GetValue: can not look up a key with no name\n");
- return NULL;
- }
- while (buffer[pos] == '\\')
- {
- if (!memcmp(buffer + pos+1, key, keylength) &&
- (buffer[pos+1 + keylength] == 0 ||
- buffer[pos+1 + keylength] == '\\'))
- {
- pos += 1 + (int)keylength; // Skip \key
- if (buffer[pos] == '\\') pos++; // Skip \ before value.
- for (j = 0;buffer[pos+j] && buffer[pos+j] != '\\' && j < (int)valuelength - 1;j++)
- value[j] = buffer[pos+j];
- value[j] = 0;
- return value;
- }
- if (buffer[pos] == '\\') pos++; // Skip \ before value.
- for (pos++;buffer[pos] && buffer[pos] != '\\';pos++);
- if (buffer[pos] == '\\') pos++; // Skip \ before value.
- for (pos++;buffer[pos] && buffer[pos] != '\\';pos++);
- }
- // if we reach this point the key was not found
- return NULL;
-}
-
-void InfoString_SetValue(char *buffer, size_t bufferlength, const char *key, const char *value)
-{
- int pos = 0, pos2;
- size_t keylength;
- if (!key)
- key = "";
- if (!value)
- value = "";
- keylength = strlen(key);
- if (strchr(key, '\\') || strchr(value, '\\'))
- {
- Con_Printf("InfoString_SetValue: \"%s\" \"%s\" contains \\ which is not possible to store in an infostring\n", key, value);
- return;
- }
- if (strchr(key, '\"') || strchr(value, '\"'))
- {
- Con_Printf("InfoString_SetValue: \"%s\" \"%s\" contains \" which is not allowed in an infostring\n", key, value);
- return;
- }
- if (!key[0])
- {
- Con_Printf("InfoString_SetValue: can not set a key with no name\n");
- return;
- }
- while (buffer[pos] == '\\')
- {
- if (!memcmp(buffer + pos+1, key, keylength) &&
- (buffer[pos+1 + keylength] == 0 ||
- buffer[pos+1 + keylength] == '\\'))
- break;
- if (buffer[pos] == '\\') pos++; // Skip \ before value.
- for (;buffer[pos] && buffer[pos] != '\\';pos++);
- if (buffer[pos] == '\\') pos++; // Skip \ before value.
- for (;buffer[pos] && buffer[pos] != '\\';pos++);
- }
- // if we found the key, find the end of it because we will be replacing it
- pos2 = pos;
- if (buffer[pos] == '\\')
- {
- pos2 += 1 + (int)keylength; // Skip \key
- if (buffer[pos2] == '\\') pos2++; // Skip \ before value.
- for (;buffer[pos2] && buffer[pos2] != '\\';pos2++);
- }
- if (bufferlength <= pos + 1 + strlen(key) + 1 + strlen(value) + strlen(buffer + pos2))
- {
- Con_Printf("InfoString_SetValue: no room for \"%s\" \"%s\" in infostring\n", key, value);
- return;
- }
- if (value[0])
- {
- // set the key/value and append the remaining text
- char tempbuffer[MAX_INPUTLINE];
- strlcpy(tempbuffer, buffer + pos2, sizeof(tempbuffer));
- dpsnprintf(buffer + pos, bufferlength - pos, "\\%s\\%s%s", key, value, tempbuffer);
- }
- else
- {
- // just remove the key from the text
- strlcpy(buffer + pos, buffer + pos2, bufferlength - pos);
- }
-}
-
-void InfoString_Print(char *buffer)
-{
- int i;
- char key[MAX_INPUTLINE];
- char value[MAX_INPUTLINE];
- while (*buffer)
- {
- if (*buffer != '\\')
- {
- Con_Printf("InfoString_Print: corrupt string\n");
- return;
- }
- for (buffer++, i = 0;*buffer && *buffer != '\\';buffer++)
- if (i < (int)sizeof(key)-1)
- key[i++] = *buffer;
- key[i] = 0;
- if (*buffer != '\\')
- {
- Con_Printf("InfoString_Print: corrupt string\n");
- return;
- }
- for (buffer++, i = 0;*buffer && *buffer != '\\';buffer++)
- if (i < (int)sizeof(value)-1)
- value[i++] = *buffer;
- value[i] = 0;
- // empty value is an error case
- Con_Printf("%20s %s\n", key, value[0] ? value : "NO VALUE");
- }
-}
-
//========================================================
// strlcat and strlcpy, from OpenBSD
/*
- * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 1998, 2015 Todd C. Miller <millert@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $OpenBSD: strlcat.c,v 1.11 2003/06/17 21:56:24 millert Exp $ */
-/* $OpenBSD: strlcpy.c,v 1.8 2003/06/17 21:56:24 millert Exp $ */
+/* $OpenBSD: strlcat.c,v 1.19 2019/01/25 00:19:25 millert Exp $ */
+/* $OpenBSD: strlcpy.c,v 1.16 2019/01/25 00:19:25 millert Exp $ */
#ifndef HAVE_STRLCAT
size_t
-strlcat(char *dst, const char *src, size_t siz)
+strlcat(char *dst, const char *src, size_t dsize)
{
- register char *d = dst;
- register const char *s = src;
- register size_t n = siz;
+ const char *odst = dst;
+ const char *osrc = src;
+ size_t n = dsize;
size_t dlen;
- /* Find the end of dst and adjust bytes left but don't go past end */
- while (n-- != 0 && *d != '\0')
- d++;
- dlen = d - dst;
- n = siz - dlen;
-
- if (n == 0)
- return(dlen + strlen(s));
- while (*s != '\0') {
- if (n != 1) {
- *d++ = *s;
+ /* Find the end of dst and adjust bytes left but don't go past end. */
+ while (n-- != 0 && *dst != '\0')
+ dst++;
+ dlen = dst - odst;
+ n = dsize - dlen;
+
+ if (n-- == 0)
+ return(dlen + strlen(src));
+ while (*src != '\0') {
+ if (n != 0) {
+ *dst++ = *src;
n--;
}
- s++;
+ src++;
}
- *d = '\0';
+ *dst = '\0';
- return(dlen + (s - src)); /* count does not include NUL */
+ return(dlen + (src - osrc)); /* count does not include NUL */
}
#endif // #ifndef HAVE_STRLCAT
#ifndef HAVE_STRLCPY
size_t
-strlcpy(char *dst, const char *src, size_t siz)
+strlcpy(char *dst, const char *src, size_t dsize)
{
- register char *d = dst;
- register const char *s = src;
- register size_t n = siz;
-
- /* Copy as many bytes as will fit */
- if (n != 0 && --n != 0) {
- do {
- if ((*d++ = *s++) == 0)
+ const char *osrc = src;
+ size_t nleft = dsize;
+
+ /* Copy as many bytes as will fit. */
+ if (nleft != 0) {
+ while (--nleft != 0) {
+ if ((*dst++ = *src++) == '\0')
break;
- } while (--n != 0);
+ }
}
- /* Not enough room in dst, add NUL and traverse rest of src */
- if (n == 0) {
- if (siz != 0)
- *d = '\0'; /* NUL-terminate dst */
- while (*s++)
+ /* Not enough room in dst, add NUL and traverse rest of src. */
+ if (nleft == 0) {
+ if (dsize != 0)
+ *dst = '\0'; /* NUL-terminate dst */
+ while (*src++)
;
}
- return(s - src - 1); /* count does not include NUL */
+ return(src - osrc - 1); /* count does not include NUL */
}
#endif // #ifndef HAVE_STRLCPY
/*
Copyright (C) 1996-1997 Id Software, Inc.
+Copyright (C) 2000-2020 DarkPlaces contributors
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
#define COMMON_H
#include <stdarg.h>
+#include <assert.h>
#include "qtypes.h"
#include "qdefs.h"
//============================================================================
-#define ContainerOf(ptr, type, member) ((type *)((char *)&(ptr) - offsetof(type, member)))
+#define ContainerOf(ptr, type, member) ((type *)((char *)(ptr) - offsetof(type, member)))
typedef struct sizebuf_s
{
typedef enum protocolversion_e
{
PROTOCOL_UNKNOWN,
+ PROTOCOL_DARKPLACES8, ///< added parting messages. WIP
PROTOCOL_DARKPLACES7, ///< added QuakeWorld-style movement protocol to allow more consistent prediction
PROTOCOL_DARKPLACES6, ///< various changes
PROTOCOL_DARKPLACES5, ///< uses EntityFrame5 entity snapshot encoder/decoder which is based on a Tribes networking article at http://www.garagegames.com/articles/networking1/
void COM_Init (void);
void COM_Shutdown (void);
-void COM_InitGameType (void);
char *va(char *buf, size_t buflen, const char *format, ...) DP_FUNC_PRINTF(3);
// does a varargs printf into provided buffer, returns buffer (so it can be called in-line unlike dpsnprintf)
+// GCC with -Werror=c++-compat will error out if static_assert is used even though the macro is valid C11...
+#ifndef __cplusplus
+#define DP_STATIC_ASSERT(expr, str) _Static_assert(expr, str)
+#else
+#define DP_STATIC_ASSERT(expr, str) static_assert(expr, str)
+#endif
// snprintf and vsnprintf are NOT portable. Use their DP counterparts instead
#ifdef snprintf
# undef snprintf
#endif
-#define snprintf DO_NOT_USE_SNPRINTF__USE_DPSNPRINTF
+#define snprintf DP_STATIC_ASSERT(0, "snprintf is forbidden for portability reasons. Use dpsnprintf instead.")
#ifdef vsnprintf
# undef vsnprintf
#endif
-#define vsnprintf DO_NOT_USE_VSNPRINTF__USE_DPVSNPRINTF
+#define vsnprintf DP_STATIC_ASSERT(0, "vsnprintf is forbidden for portability reasons. Use dpvsnprintf instead.")
// dpsnprintf and dpvsnprintf
// return the number of printed characters, excluding the final '\0'
// A bunch of functions are forbidden for security reasons (and also to please MSVS 2005, for some of them)
// LadyHavoc: added #undef lines here to avoid warnings in Linux
#undef strcat
-#define strcat DO_NOT_USE_STRCAT__USE_STRLCAT_OR_MEMCPY
+#define strcat DP_STATIC_ASSERT(0, "strcat is forbidden for security reasons. Use strlcat or memcpy instead.")
#undef strncat
-#define strncat DO_NOT_USE_STRNCAT__USE_STRLCAT_OR_MEMCPY
+#define strncat DP_STATIC_ASSERT(0, "strncat is forbidden for security reasons. Use strlcat or memcpy instead.")
#undef strcpy
-#define strcpy DO_NOT_USE_STRCPY__USE_STRLCPY_OR_MEMCPY
+#define strcpy DP_STATIC_ASSERT(0, "strcpy is forbidden for security reasons. Use strlcpy or memcpy instead.")
#undef strncpy
-#define strncpy DO_NOT_USE_STRNCPY__USE_STRLCPY_OR_MEMCPY
-//#undef sprintf
-//#define sprintf DO_NOT_USE_SPRINTF__USE_DPSNPRINTF
+#define strncpy DP_STATIC_ASSERT(0, "strncpy is forbidden for security reasons. Use strlcpy or memcpy instead.")
+#undef sprintf
+#define sprintf DP_STATIC_ASSERT(0, "sprintf is forbidden for security reasons. Use dpsnprintf instead.")
//============================================================================
}
userdirmode_t;
-typedef enum gamemode_e
-{
- GAME_NORMAL,
- GAME_HIPNOTIC,
- GAME_ROGUE,
- GAME_QUOTH,
- GAME_NEHAHRA,
- GAME_NEXUIZ,
- GAME_XONOTIC,
- GAME_TRANSFUSION,
- GAME_GOODVSBAD2,
- GAME_TEU,
- GAME_BATTLEMECH,
- GAME_ZYMOTIC,
- GAME_SETHERAL,
- GAME_TENEBRAE, // full of evil hackery
- GAME_NEOTERIC,
- GAME_OPENQUARTZ, //this game sucks
- GAME_PRYDON,
- GAME_DELUXEQUAKE,
- GAME_THEHUNTED,
- GAME_DEFEATINDETAIL2,
- GAME_DARSANA,
- GAME_CONTAGIONTHEORY,
- GAME_EDU2P,
- GAME_PROPHECY,
- GAME_BLOODOMNICIDE,
- GAME_STEELSTORM, // added by motorsep
- GAME_STEELSTORM2, // added by motorsep
- GAME_SSAMMO, // added by motorsep
- GAME_STEELSTORMREVENANTS, // added by motorsep 07/19/2015
- GAME_TOMESOFMEPHISTOPHELES, // added by motorsep
- GAME_STRAPBOMB, // added by motorsep for Urre
- GAME_MOONHELM,
- GAME_VORETOURNAMENT,
- GAME_DOOMBRINGER, // added by Cloudwalk for kristus
- GAME_BATTLEMETAL, // added by Cloudwalk for Subject9x
- GAME_COUNT
-}
-gamemode_t;
-
-// Master switch for some hacks/changes that eventually should become cvars.
-#define IS_NEXUIZ_DERIVED(g) ((g) == GAME_NEXUIZ || (g) == GAME_XONOTIC || (g) == GAME_VORETOURNAMENT)
-// Pre-csqcmodels era.
-#define IS_OLDNEXUIZ_DERIVED(g) ((g) == GAME_NEXUIZ || (g) == GAME_VORETOURNAMENT)
-
-extern gamemode_t gamemode;
-extern const char *gamename;
-extern const char *gamenetworkfiltername;
-extern const char *gamedirname1;
-extern const char *gamedirname2;
-extern const char *gamescreenshotname;
-extern const char *gameuserdirname;
-extern char com_modname[MAX_OSPATH];
-
-void COM_ChangeGameTypeForGameDirs(void);
-
void COM_ToLowerString (const char *in, char *out, size_t size_out);
void COM_ToUpperString (const char *in, char *out, size_t size_out);
int COM_StringBeginsWith(const char *s, const char *match);
void COM_ToLowerString (const char *in, char *out, size_t size_out);
void COM_ToUpperString (const char *in, char *out, size_t size_out);
-typedef struct stringlist_s
-{
- /// maxstrings changes as needed, causing reallocation of strings[] array
- int maxstrings;
- int numstrings;
- char **strings;
-} stringlist_t;
-
-int matchpattern(const char *in, const char *pattern, int caseinsensitive);
-int matchpattern_with_separator(const char *in, const char *pattern, int caseinsensitive, const char *separators, qbool wildcard_least_one);
-void stringlistinit(stringlist_t *list);
-void stringlistfreecontents(stringlist_t *list);
-void stringlistappend(stringlist_t *list, const char *text);
-void stringlistsort(stringlist_t *list, qbool uniq);
-void listdirectory(stringlist_t *list, const char *basepath, const char *path);
-
-char *InfoString_GetValue(const char *buffer, const char *key, char *value, size_t valuelength);
-void InfoString_SetValue(char *buffer, size_t bufferlength, const char *key, const char *value);
-void InfoString_Print(char *buffer);
-
// strlcat and strlcpy, from OpenBSD
// Most (all?) BSDs already have them
#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(MACOSX)
#ifndef HAVE_STRLCAT
/*!
- * Appends src to string dst of size siz (unlike strncat, siz is the
- * full size of dst, not space left). At most siz-1 characters
- * will be copied. Always NUL terminates (unless siz <= strlen(dst)).
- * Returns strlen(src) + MIN(siz, strlen(initial dst)).
- * If retval >= siz, truncation occurred.
+ * Appends src to string dst of size dsize (unlike strncat, dsize is the
+ * full size of dst, not space left). At most dsize-1 characters
+ * will be copied. Always NUL terminates (unless dsize <= strlen(dst)).
+ * Returns strlen(src) + MIN(dsize, strlen(initial dst)).
+ * If retval >= dsize, truncation occurred.
*/
-size_t strlcat(char *dst, const char *src, size_t siz);
+size_t strlcat(char *dst, const char *src, size_t dsize);
#endif // #ifndef HAVE_STRLCAT
#ifndef HAVE_STRLCPY
/*!
- * Copy src to string dst of size siz. At most siz-1 characters
- * will be copied. Always NUL terminates (unless siz == 0).
- * Returns strlen(src); if retval >= siz, truncation occurred.
+ * Copy string src to buffer dst of size dsize. At most dsize-1
+ * chars will be copied. Always NUL terminates (unless dsize == 0).
+ * Returns strlen(src); if retval >= dsize, truncation occurred.
*/
-size_t strlcpy(char *dst, const char *src, size_t siz);
+size_t strlcpy(char *dst, const char *src, size_t dsize);
#endif // #ifndef HAVE_STRLCPY
+++ /dev/null
-/*
-Copyright (C) 1996-1997 Id Software, Inc.
-
-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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-*/
-// conproc.c
-
-#include "quakedef.h"
-
-#include <windows.h>
-#include <wchar.h>
-#include "conproc.h"
-
-HANDLE heventDone;
-HANDLE hfileBuffer;
-HANDLE heventChildSend;
-HANDLE heventParentSend;
-HANDLE hStdout;
-HANDLE hStdin;
-
-DWORD RequestProc (DWORD dwNichts);
-LPVOID GetMappedBuffer (HANDLE hfileBuffer);
-void ReleaseMappedBuffer (LPVOID pBuffer);
-BOOL GetScreenBufferLines (int *piLines);
-BOOL SetScreenBufferLines (int iLines);
-BOOL ReadText (LPTSTR pszText, int iBeginLine, int iEndLine);
-BOOL WriteText (LPCTSTR szText);
-int CharToCode (int c);
-BOOL SetConsoleCXCY(HANDLE hStdout, int cx, int cy);
-
-
-void InitConProc (HANDLE hFile, HANDLE heventParent, HANDLE heventChild)
-{
- DWORD dwID;
-
-// ignore if we don't have all the events.
- if (!hFile || !heventParent || !heventChild)
- return;
-
- hfileBuffer = hFile;
- heventParentSend = heventParent;
- heventChildSend = heventChild;
-
-// so we'll know when to go away.
- heventDone = CreateEvent (NULL, false, false, NULL);
-
- if (!heventDone)
- {
- Con_Print("Couldn't create heventDone\n");
- return;
- }
-
- if (!CreateThread (NULL,
- 0,
- (LPTHREAD_START_ROUTINE) RequestProc,
- 0,
- 0,
- &dwID))
- {
- CloseHandle (heventDone);
- Con_Print("Couldn't create QHOST thread\n");
- return;
- }
-
-// save off the input/output handles.
- hStdout = GetStdHandle (STD_OUTPUT_HANDLE);
- hStdin = GetStdHandle (STD_INPUT_HANDLE);
-
-// force 80 character width, at least 25 character height
- SetConsoleCXCY (hStdout, 80, 25);
-}
-
-
-void DeinitConProc (void)
-{
- if (heventDone)
- SetEvent (heventDone);
-}
-
-
-DWORD RequestProc (DWORD dwNichts)
-{
- int *pBuffer;
- DWORD dwRet;
- HANDLE heventWait[2];
- int iBeginLine, iEndLine;
-
- heventWait[0] = heventParentSend;
- heventWait[1] = heventDone;
-
- while (1)
- {
- dwRet = WaitForMultipleObjects (2, heventWait, false, INFINITE);
-
- // heventDone fired, so we're exiting.
- if (dwRet == WAIT_OBJECT_0 + 1)
- break;
-
- pBuffer = (int *) GetMappedBuffer (hfileBuffer);
-
- // hfileBuffer is invalid. Just leave.
- if (!pBuffer)
- {
- Con_Print("Invalid hfileBuffer\n");
- break;
- }
-
- switch (pBuffer[0])
- {
- case CCOM_WRITE_TEXT:
- // Param1 : Text
- pBuffer[0] = WriteText ((LPCTSTR) (pBuffer + 1));
- break;
-
- case CCOM_GET_TEXT:
- // Param1 : Begin line
- // Param2 : End line
- iBeginLine = pBuffer[1];
- iEndLine = pBuffer[2];
- pBuffer[0] = ReadText ((LPTSTR) (pBuffer + 1), iBeginLine,
- iEndLine);
- break;
-
- case CCOM_GET_SCR_LINES:
- // No params
- pBuffer[0] = GetScreenBufferLines (&pBuffer[1]);
- break;
-
- case CCOM_SET_SCR_LINES:
- // Param1 : Number of lines
- pBuffer[0] = SetScreenBufferLines (pBuffer[1]);
- break;
- }
-
- ReleaseMappedBuffer (pBuffer);
- SetEvent (heventChildSend);
- }
-
- return 0;
-}
-
-
-LPVOID GetMappedBuffer (HANDLE hfileBuffer)
-{
- LPVOID pBuffer;
-
- pBuffer = MapViewOfFile (hfileBuffer,
- FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, 0);
-
- return pBuffer;
-}
-
-
-void ReleaseMappedBuffer (LPVOID pBuffer)
-{
- UnmapViewOfFile (pBuffer);
-}
-
-
-BOOL GetScreenBufferLines (int *piLines)
-{
- CONSOLE_SCREEN_BUFFER_INFO info;
- BOOL bRet;
-
- bRet = GetConsoleScreenBufferInfo (hStdout, &info);
-
- if (bRet)
- *piLines = info.dwSize.Y;
-
- return bRet;
-}
-
-
-BOOL SetScreenBufferLines (int iLines)
-{
-
- return SetConsoleCXCY (hStdout, 80, iLines);
-}
-
-
-BOOL ReadText (LPTSTR pszText, int iBeginLine, int iEndLine)
-{
- COORD coord;
- DWORD dwRead;
- BOOL bRet;
-
- coord.X = 0;
- coord.Y = iBeginLine;
-
- bRet = ReadConsoleOutputCharacter(
- hStdout,
- pszText,
- 80 * (iEndLine - iBeginLine + 1),
- coord,
- &dwRead);
-
- // Make sure it's null terminated.
- if (bRet)
- pszText[dwRead] = '\0';
-
- return bRet;
-}
-
-
-BOOL WriteText (LPCTSTR szText)
-{
- DWORD dwWritten;
- INPUT_RECORD rec;
- char upper, *sz;
-
- sz = (LPTSTR) szText;
-
- while (*sz)
- {
- // 13 is the code for a carriage return (\n) instead of 10.
- if (*sz == 10)
- *sz = 13;
-
- upper = toupper(*sz);
-
- rec.EventType = KEY_EVENT;
- rec.Event.KeyEvent.bKeyDown = true;
- rec.Event.KeyEvent.wRepeatCount = 1;
- rec.Event.KeyEvent.wVirtualKeyCode = upper;
- rec.Event.KeyEvent.wVirtualScanCode = CharToCode (*sz);
- rec.Event.KeyEvent.uChar.AsciiChar = *sz;
- rec.Event.KeyEvent.uChar.UnicodeChar = *sz;
- rec.Event.KeyEvent.dwControlKeyState = isupper(*sz) ? 0x80 : 0x0;
-
- WriteConsoleInput(
- hStdin,
- &rec,
- 1,
- &dwWritten);
-
- rec.Event.KeyEvent.bKeyDown = false;
-
- WriteConsoleInput(
- hStdin,
- &rec,
- 1,
- &dwWritten);
-
- sz++;
- }
-
- return true;
-}
-
-
-int CharToCode (int c)
-{
- char upper;
-
- upper = toupper(c);
-
- switch (c)
- {
- case 13:
- return 28;
-
- default:
- break;
- }
-
- if (isalpha(c))
- return (30 + upper - 65);
-
- if (isdigit(c))
- return (1 + upper - 47);
-
- return c;
-}
-
-
-BOOL SetConsoleCXCY(HANDLE hStdout, int cx, int cy)
-{
- CONSOLE_SCREEN_BUFFER_INFO info;
- COORD coordMax;
-
- coordMax = GetLargestConsoleWindowSize(hStdout);
-
- if (cy > coordMax.Y)
- cy = coordMax.Y;
-
- if (cx > coordMax.X)
- cx = coordMax.X;
-
- if (!GetConsoleScreenBufferInfo(hStdout, &info))
- return false;
-
-// height
- info.srWindow.Left = 0;
- info.srWindow.Right = info.dwSize.X - 1;
- info.srWindow.Top = 0;
- info.srWindow.Bottom = cy - 1;
-
- if (cy < info.dwSize.Y)
- {
- if (!SetConsoleWindowInfo(hStdout, true, &info.srWindow))
- return false;
-
- info.dwSize.Y = cy;
-
- if (!SetConsoleScreenBufferSize(hStdout, info.dwSize))
- return false;
- }
- else if (cy > info.dwSize.Y)
- {
- info.dwSize.Y = cy;
-
- if (!SetConsoleScreenBufferSize(hStdout, info.dwSize))
- return false;
-
- if (!SetConsoleWindowInfo(hStdout, true, &info.srWindow))
- return false;
- }
-
- if (!GetConsoleScreenBufferInfo(hStdout, &info))
- return false;
-
-// width
- info.srWindow.Left = 0;
- info.srWindow.Right = cx - 1;
- info.srWindow.Top = 0;
- info.srWindow.Bottom = info.dwSize.Y - 1;
-
- if (cx < info.dwSize.X)
- {
- if (!SetConsoleWindowInfo(hStdout, true, &info.srWindow))
- return false;
-
- info.dwSize.X = cx;
-
- if (!SetConsoleScreenBufferSize(hStdout, info.dwSize))
- return false;
- }
- else if (cx > info.dwSize.X)
- {
- info.dwSize.X = cx;
-
- if (!SetConsoleScreenBufferSize(hStdout, info.dwSize))
- return false;
-
- if (!SetConsoleWindowInfo(hStdout, true, &info.srWindow))
- return false;
- }
-
- return true;
-}
-
+++ /dev/null
-/*
-Copyright (C) 1996-1997 Id Software, Inc.
-
-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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-*/
-// conproc.h
-
-#ifndef CONPROC_H
-#define CONPROC_H
-
-#define CCOM_WRITE_TEXT 0x2
-// Param1 : Text
-
-#define CCOM_GET_TEXT 0x3
-// Param1 : Begin line
-// Param2 : End line
-
-#define CCOM_GET_SCR_LINES 0x4
-// No params
-
-#define CCOM_SET_SCR_LINES 0x5
-// Param1 : Number of lines
-
-void InitConProc (HANDLE hFile, HANDLE heventParent, HANDLE heventChild);
-void DeinitConProc (void);
-
-#endif
-
/*
Copyright (C) 1996-1997 Id Software, Inc.
+Copyright (C) 2000-2020 DarkPlaces contributors
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
*/
void Log_Close (void)
{
- if (logfile == NULL)
- return;
+ qfile_t* l = logfile;
- FS_Print (logfile, Log_Timestamp ("Log stopped"));
- FS_Print (logfile, "\n");
- FS_Close (logfile);
+ if (l == NULL)
+ return;
+ FS_Print (l, Log_Timestamp ("Log stopped"));
+ FS_Print (l, "\n");
logfile = NULL;
+ FS_Close (l);
+
crt_log_file[0] = '\0';
}
Cmd_AddCommand(CF_SHARED, "condump", Con_ConDump_f, "output console history to a file (see also log_file)");
con_initialized = true;
- // initialize console window (only used by sys_win.c)
- Sys_InitConsole();
-
+
Con_Print("Console initialized.\n");
}
*out++ = 'm';
}
*out++ = 0;
- Sys_PrintToTerminal(printline);
+ Sys_Print(printline);
}
else if(sys_colortranslation.integer == 2) // Quake
{
- Sys_PrintToTerminal(line);
+ Sys_Print(line);
}
else // strip
{
}
}
*out++ = 0;
- Sys_PrintToTerminal(printline);
+ Sys_Print(printline);
}
}
// empty the line buffer
return DrawQ_TextWidth(w, *length, ti->fontsize, ti->fontsize, false, ti->font);
else
{
- Sys_PrintfToTerminal("Con_WordWidthFunc: can't get here (maxWidth should never be %f)\n", maxWidth);
+ Sys_Printf("Con_WordWidthFunc: can't get here (maxWidth should never be %f)\n", maxWidth);
// Note: this is NOT a Con_Printf, as it could print recursively
return 0;
}
/*
Copyright (C) 1996-1997 Id Software, Inc.
+Copyright (C) 2000-2020 DarkPlaces contributors
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
+/*
+Copyright (C) 2010-2015 Rudolf Polzer (divVerent)
+Copyright (C) 2010-2020 Ashley Rose Hale (LadyHavoc)
+
+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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
#include "quakedef.h"
#include "crypto.h"
#include "common.h"
+/*
+Copyright (C) 2010-2015 Rudolf Polzer (divVerent)
+
+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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
#ifndef CRYPTO_H
#define CRYPTO_H
+/*
+Copyright (C) 2006-2021 DarkPlaces contributors
+
+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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
#include "quakedef.h"
#include "progsvm.h"
#include "clprogdefs.h"
qbool CL_VM_ConsoleCommand (const char *text)
{
prvm_prog_t *prog = CLVM_prog;
- int restorevm_tempstringsbuf_cursize;
- qbool r = false;
- if(!cl.csqc_loaded)
- return false;
- CSQC_BEGIN
- if (PRVM_clientfunction(CSQC_ConsoleCommand))
- {
- PRVM_clientglobalfloat(time) = cl.time;
- PRVM_clientglobaledict(self) = cl.csqc_server2csqcentitynumber[cl.playerentity];
- restorevm_tempstringsbuf_cursize = prog->tempstringsbuf.cursize;
- PRVM_G_INT(OFS_PARM0) = PRVM_SetTempString(prog, text);
- prog->ExecuteProgram(prog, PRVM_clientfunction(CSQC_ConsoleCommand), "QC function CSQC_ConsoleCommand is missing");
- prog->tempstringsbuf.cursize = restorevm_tempstringsbuf_cursize;
- r = CSQC_RETURNVAL != 0;
- }
- CSQC_END
- return r;
+ return PRVM_ConsoleCommand(prog, text, &prog->funcoffsets.CSQC_ConsoleCommand, false, cl.csqc_server2csqcentitynumber[cl.playerentity], cl.time, cl.csqc_loaded, "QC function CSQC_ConsoleCommand is missing");
}
qbool CL_VM_Parse_TempEntity (void)
int crcflags = csqc_progcrc.flags;
csqc_progcrc.flags &= ~CF_READONLY;
csqc_progsize.flags &= ~CF_READONLY;
- Cmd_ExecuteString(cmd_client, msg, src_local, true);
+ Cmd_ExecuteString(cmd_local, msg, src_local, true);
csqc_progcrc.flags = csqc_progsize.flags = crcflags;
return;
}
l = sizeof(buf) - 1;
strlcpy(buf, p, l + 1); // strlcpy needs a + 1 as it includes the newline!
- Cmd_ExecuteString(cmd_client, buf, src_local, true);
+ Cmd_ExecuteString(cmd_local, buf, src_local, true);
p += l;
if(*p == '\n')
else
break; // end of string or overflow
}
- Cmd_ExecuteString(cmd_client, "curl --clear_autodownload", src_local, true); // don't inhibit CSQC loading
+ Cmd_ExecuteString(cmd_local, "curl --clear_autodownload", src_local, true); // don't inhibit CSQC loading
return;
}
if(!cl.csqc_loaded)
{
- Cbuf_AddText(cmd_client, msg);
+ Cbuf_AddText(cmd_local, msg);
return;
}
CSQC_BEGIN
prog->tempstringsbuf.cursize = restorevm_tempstringsbuf_cursize;
}
else
- Cbuf_AddText(cmd_client, msg);
+ Cbuf_AddText(cmd_local, msg);
CSQC_END
}
// link every entity except world
for (i = 1, ent = prog->edicts;i < prog->num_edicts;i++, ent++)
- if (!ent->priv.server->free && !VectorCompare(PRVM_clientedictvector(ent, absmin), PRVM_clientedictvector(ent, absmax)))
+ if (!ent->free && !VectorCompare(PRVM_clientedictvector(ent, absmin), PRVM_clientedictvector(ent, absmax)))
CL_LinkEdict(ent);
}
World_UnlinkEdict(ed);
memset(ed->fields.fp, 0, prog->entityfields * sizeof(prvm_vec_t));
VM_RemoveEdictSkeleton(prog, ed);
+#ifdef USEODE
World_Physics_RemoveFromEntity(&cl.world, ed);
World_Physics_RemoveJointFromEntity(&cl.world, ed);
+#endif
}
static void CLVM_count_edicts(prvm_prog_t *prog)
for (i=0 ; i<prog->num_edicts ; i++)
{
ent = PRVM_EDICT_NUM(i);
- if (ent->priv.server->free)
+ if (ent->free)
continue;
active++;
if (PRVM_clientedictfloat(ent, solid))
else
{
Mem_Free(csprogsdata);
- Con_Printf(CON_ERROR "Your %s is not the same version as the server (CRC is %i/%i but should be %i/%i)\n", csqc_progname.string, csprogsdatacrc, (int)csprogsdatasize, requiredcrc, requiredsize);
- CL_Disconnect();
+ CL_DisconnectEx(false, "Your %s is not the same version as the server (CRC is %i/%i but should be %i/%i)\n", csqc_progname.string, csprogsdatacrc, (int)csprogsdatasize, requiredcrc, requiredsize);
return;
}
}
else
{
if (requiredcrc >= 0)
- {
- if (cls.demoplayback)
- Con_Printf(CON_ERROR "CL_VM_Init: demo requires CSQC, but \"%s\" wasn't found\n", csqc_progname.string);
- else
- Con_Printf(CON_ERROR "CL_VM_Init: server requires CSQC, but \"%s\" wasn't found\n", csqc_progname.string);
- CL_Disconnect();
- }
+ CL_DisconnectEx(false, CON_ERROR "CL_VM_Init: %s requires CSQC, but \"%s\" wasn't found\n", cls.demoplayback ? "demo" : "server", csqc_progname.string);
return;
}
- PRVM_Prog_Init(prog, cmd_client);
+ PRVM_Prog_Init(prog, cmd_local);
// allocate the mempools
prog->progs_mempool = Mem_AllocPool(csqc_progname.string, 0, NULL);
if (!prog->loaded)
{
- Host_Error("CSQC %s failed to load\n", csprogsfn);
- if(!sv.active)
- CL_Disconnect();
Mem_Free(csprogsdata);
- return;
+ Host_Error("CSQC %s failed to load\n", csprogsfn);
}
if(cls.demorecording)
void CL_VM_ShutDown (void)
{
prvm_prog_t *prog = CLVM_prog;
- Cmd_ClearCSQCCommands(cmd_client);
+ Cmd_ClearCSQCCommands(cmd_local);
//Cvar_SetValueQuick(&csqc_progcrc, -1);
//Cvar_SetValueQuick(&csqc_progsize, -1);
if(!cl.csqc_loaded)
ed = PRVM_EDICT_NUM(entnum - MAX_EDICTS);
- if(!ed->priv.required->free)
+ if(!ed->free)
{
mod = CL_GetModelFromEdict(ed);
VectorCopy(PRVM_clientedictvector(ed, origin), out);
+/*
+Copyright (C) 2006-2021 DarkPlaces contributors
+
+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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
#ifndef CSPROGS_H
#define CSPROGS_H
-
/*
this code written by Ashley Rose Hale (LadyHavoc), on 2004-10-17, and placed into public domain
this implements Quadratic BSpline surfaces as seen in Quake3 by id Software
-
#ifndef CURVES_H
#define CURVES_H
/*
Copyright (C) 1996-1997 Id Software, Inc.
+Copyright (C) 2000-2021 DarkPlaces contributors
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
if (!strcmp (var_name, hash->cvar->name) && (hash->cvar->flags & neededflags))
return hash->cvar;
else
- for (int i = 0; i < hash->cvar->aliasindex; i++)
- if (!strcmp (var_name, hash->cvar->aliases[i]) && (hash->cvar->flags & neededflags))
+ for (char **alias = hash->cvar->aliases; alias && *alias; alias++)
+ if (!strcmp (var_name, *alias) && (hash->cvar->flags & neededflags))
return hash->cvar;
return NULL;
}
if (!strcmp (var_name, hash->cvar->name) && (hash->cvar->flags & neededflags))
goto match;
else
- for (int i = 0; i < hash->cvar->aliasindex; i++)
- if (!strcmp (var_name, hash->cvar->aliases[i]) && (hash->cvar->flags & neededflags))
+ for (char **alias = hash->cvar->aliases; alias && *alias; alias++)
+ if (!strcmp (var_name, *alias) && (hash->cvar->flags & neededflags))
goto match;
if(parent) *parent = hash->cvar;
}
if (!strncasecmp(partial, cvar->name, len) && (cvar->flags & neededflags))
h++;
else
- for(int i = 0; i < cvar->aliasindex; i++)
- if (!strncasecmp(partial, cvar->aliases[i], len) && (cvar->flags & neededflags))
+ for (char **alias = cvar->aliases; alias && *alias; alias++)
+ if (!strncasecmp(partial, *alias, len) && (cvar->flags & neededflags))
h++;
return h;
if (!strncasecmp(partial, cvar->name, len) && (cvar->flags & neededflags))
buf[bpos++] = cvar->name;
else
- for(int i = 0; i < cvar->aliasindex; i++)
- if (!strncasecmp(partial, cvar->aliases[i], len) && (cvar->flags & neededflags))
- buf[bpos++] = cvar->aliases[i];
+ for (char **alias = cvar->aliases; alias && *alias; alias++)
+ if (!strncasecmp(partial, *alias, len) && (cvar->flags & neededflags))
+ buf[bpos++] = *alias;
buf[bpos] = NULL;
if (!strncasecmp(partial, cvar->name, len) && (cvar->flags & neededflags))
Cvar_PrintHelp(cvar, cvar->name, true);
else
- for (int i = 0; i < cvar->aliasindex; i++)
- if (!strncasecmp (partial, cvar->aliases[i], len) && (cvar->flags & neededflags))
- Cvar_PrintHelp(cvar, cvar->aliases[i], true);
+ for (char **alias = cvar->aliases; alias && *alias; alias++)
+ if (!strncasecmp (partial, *alias, len) && (cvar->flags & neededflags))
+ Cvar_PrintHelp(cvar, *alias, true);
}
variable->callback = callback;
}
-void Cvar_RegisterAlias(cvar_t *variable, const char *alias )
+void Cvar_RegisterVirtual(cvar_t *variable, const char *name )
{
cvar_state_t *cvars = &cvars_all;
cvar_hash_t *hash;
int hashindex;
- variable->aliases = (char **)Mem_Realloc(zonemempool, variable->aliases, sizeof(char *) * (variable->aliasindex + 1));
- // Add to it
- variable->aliases[variable->aliasindex] = (char *)Z_Malloc(strlen(alias) + 1);
- memcpy(variable->aliases[variable->aliasindex], alias, strlen(alias) + 1);
- variable->aliasindex++;
+ if(!*name)
+ {
+ Con_Printf("Cvar_RegisterVirtual: invalid virtual cvar name\n");
+ return;
+ }
+
+ // check for overlap with a command
+ if (Cmd_Exists(cmd_local, name))
+ {
+ Con_Printf("Cvar_RegisterVirtual: %s is a command\n", name);
+ return;
+ }
+
+ if(Cvar_FindVar(&cvars_all, name, 0))
+ {
+ Con_Printf("Cvar_RegisterVirtual: %s is a cvar\n", name);
+ return;
+ }
+
+ // Resize the variable->aliases list to have room for another entry and a null terminator.
+ // This zero-pads when resizing, so we don't need to write the NULL terminator manually here.
+ // Also if aliases is NULL this allocates fresh for the correct size, so it's fine to just do this.
+ variable->aliases = (char **)Z_Realloc(variable->aliases, sizeof(char *) * (variable->aliases_size + 2));
+ // Add the new alias, and increment the number of aliases in the list
+ variable->aliases[variable->aliases_size++] = (char *)Z_strdup(name);
// link to head of list in this hash table index
hash = (cvar_hash_t *)Z_Malloc(sizeof(cvar_hash_t));
- hashindex = CRC_Block((const unsigned char *)alias, strlen(alias)) % CVAR_HASHSIZE;
+ hashindex = CRC_Block((const unsigned char *)name, strlen(name)) % CVAR_HASHSIZE;
hash->next = cvars->hashtable[hashindex];
cvars->hashtable[hashindex] = hash;
hash->cvar = variable;
}
// check for overlap with a command
- if (Cmd_Exists(cmd_client, variable->name) || Cmd_Exists(cmd_server, variable->name))
+ if (Cmd_Exists(cmd_local, variable->name))
{
Con_Printf("Cvar_RegisterVariable: %s is a command\n", variable->name);
return;
variable->defstring = (char *)Mem_strdup(zonemempool, variable->string);
variable->value = atof (variable->string);
variable->integer = (int) variable->value;
- variable->aliasindex = 0;
+ variable->aliases = NULL;
+ variable->aliases_size = 0;
variable->initstate = NULL;
// Mark it as not an autocvar.
}
// check for overlap with a command
- if (Cmd_Exists(cmd_client, name) || Cmd_Exists(cmd_server, name))
+ if (Cmd_Exists(cmd_local, name))
{
Con_Printf("Cvar_Get: %s is a command\n", name);
return NULL;
cvar->defstring = (char *)Mem_strdup(zonemempool, value);
cvar->value = atof (cvar->string);
cvar->integer = (int) cvar->value;
- cvar->aliases = (char **)Z_Malloc(sizeof(char **));
+ cvar->aliases = NULL;
+ cvar->aliases_size = 0;
cvar->initstate = NULL;
- memset(cvar->aliases, 0, sizeof(char *));
if(newdescription && *newdescription)
cvar->description = (char *)Mem_strdup(zonemempool, newdescription);
Cvar_PrintHelp(cvar, cvar->name, true);
count++;
}
- for (int i = 0; i < cvar->aliasindex; i++)
+ for (char **alias = cvar->aliases; alias && *alias; alias++)
{
- if (matchpattern_with_separator(cvar->aliases[i], partial, false, "", false))
+ if (matchpattern_with_separator(*alias, partial, false, "", false))
{
- Cvar_PrintHelp(cvar, cvar->aliases[i], true);
+ Cvar_PrintHelp(cvar, *alias, true);
count++;
}
}
/*
Copyright (C) 1996-1997 Id Software, Inc.
+Copyright (C) 2006-2021 DarkPlaces contributors
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
const char *defstring;
void (*callback)(struct cvar_s *var);
- qbool ignore_callback;
char **aliases;
- int aliasindex;
+ int aliases_size;
struct cvar_s *initstate; // snapshot of cvar during init
extern cvar_state_t cvars_all;
extern cvar_state_t cvars_null; // used by cmd_serverfromclient which intentionally has no cvars available
-void Cvar_RegisterAlias(cvar_t *variable, const char *alias );
+void Cvar_RegisterVirtual(cvar_t *variable, const char *name );
void Cvar_RegisterCallback(cvar_t *variable, void (*callback)(cvar_t *));
-<?xml version="1.0" encoding="utf-8"?>\r
+<?xml version="1.0" encoding="utf-8"?>\r
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
<ItemGroup Label="ProjectConfigurations">\r
<ProjectConfiguration Include="Debug|Win32">\r
<ClCompile Include="cap_avi.c" />\r
<ClCompile Include="cap_ogg.c" />\r
<ClCompile Include="cd_shared.c" />\r
- <ClCompile Include="cl_cmd.c" />\r
+ <ClCompile Include="cl_cmd.c" />\r
<ClCompile Include="cl_collision.c" />\r
<ClCompile Include="cl_demo.c" />\r
- <ClCompile Include="cl_ents.c" />\r
- <ClCompile Include="cl_ents4.c" />\r
- <ClCompile Include="cl_ents5.c" />\r
- <ClCompile Include="cl_ents_nq.c" />\r
- <ClCompile Include="cl_ents_qw.c" />\r
+ <ClCompile Include="cl_ents.c" />\r
+ <ClCompile Include="cl_ents4.c" />\r
+ <ClCompile Include="cl_ents5.c" />\r
+ <ClCompile Include="cl_ents_nq.c" />\r
+ <ClCompile Include="cl_ents_qw.c" />\r
<ClCompile Include="cl_input.c" />\r
<ClCompile Include="cl_main.c" />\r
<ClCompile Include="cl_parse.c" />\r
<ClCompile Include="cl_particles.c" />\r
<ClCompile Include="cl_screen.c" />\r
<ClCompile Include="cl_video.c" />\r
- <ClCompile Include="cl_video_libavw.c" />\r
+ <ClCompile Include="cl_video_libavw.c" />\r
<ClCompile Include="clvm_cmds.c" />\r
<ClCompile Include="cmd.c" />\r
<ClCompile Include="collision.c" />\r
- <ClCompile Include="com_crc16.c" />\r
- <ClCompile Include="com_ents.c" />\r
- <ClCompile Include="com_ents4.c" />\r
- <ClCompile Include="com_game.c" />\r
- <ClCompile Include="com_list.c" />\r
- <ClCompile Include="com_msg.c" />\r
+ <ClCompile Include="com_crc16.c" />\r
+ <ClCompile Include="com_ents.c" />\r
+ <ClCompile Include="com_ents4.c" />\r
+ <ClCompile Include="com_game.c" />\r
+ <ClCompile Include="com_infostring.c" />\r
+ <ClCompile Include="com_msg.c" />\r
<ClCompile Include="common.c" />\r
<ClCompile Include="console.c" />\r
<ClCompile Include="crypto.c">\r
<ClCompile Include="snd_ogg.c" />\r
<ClCompile Include="snd_sdl.c" />\r
<ClCompile Include="snd_wav.c" />\r
- <ClInclude Include="snd_xmp.c" />\r
+ <ClInclude Include="snd_xmp.c" />\r
<ClCompile Include="sv_ccmds.c" />\r
<ClCompile Include="sv_demo.c" />\r
- <ClCompile Include="sv_ents.c" />\r
- <ClCompile Include="sv_ents4.c" />\r
- <ClCompile Include="sv_ents5.c" />\r
- <ClCompile Include="sv_ents_nq.c" />\r
- <ClCompile Include="sv_ents_csqc.c" />\r
+ <ClCompile Include="sv_ents.c" />\r
+ <ClCompile Include="sv_ents4.c" />\r
+ <ClCompile Include="sv_ents5.c" />\r
+ <ClCompile Include="sv_ents_nq.c" />\r
+ <ClCompile Include="sv_ents_csqc.c" />\r
<ClCompile Include="sv_main.c" />\r
<ClCompile Include="sv_move.c" />\r
<ClCompile Include="sv_phys.c" />\r
<ClInclude Include="cdaudio.h" />\r
<ClInclude Include="cl_collision.h" />\r
<ClInclude Include="cl_gecko.h" />\r
- <ClInclude Include="cl_parse.h" />\r
- <ClInclude Include="cl_particles.h" />\r
+ <ClInclude Include="cl_parse.h" />\r
+ <ClInclude Include="cl_particles.h" />\r
<ClInclude Include="cl_screen.h" />\r
<ClInclude Include="cl_video.h" />\r
<ClInclude Include="cl_video_libavw.h" />\r
<ClInclude Include="clvm_cmds.h" />\r
<ClInclude Include="cmd.h" />\r
<ClInclude Include="collision.h" />\r
- <ClInclude Include="com_list.h" />\r
+ <ClInclude Include="com_game.h" />\r
+ <ClInclude Include="com_infostring.h" />\r
+ <ClInclude Include="com_list.h" />\r
<ClInclude Include="common.h" />\r
<ClInclude Include="console.h" />\r
<ClInclude Include="crypto.h" />\r
<ClInclude Include="darkplaces.h" />\r
<ClInclude Include="dpvsimpledecode.h" />\r
<ClInclude Include="draw.h" />\r
+ <ClInclude Include="filematch.h" />\r
<ClInclude Include="fs.h" />\r
<ClInclude Include="ft2.h" />\r
<ClInclude Include="ft2_defs.h" />\r
<ClInclude Include="image.h" />\r
<ClInclude Include="image_png.h" />\r
<ClInclude Include="input.h" />\r
- <ClInclude Include="intoverflow.h" />\r
<ClInclude Include="jpeg.h" />\r
<ClInclude Include="keys.h" />\r
<ClInclude Include="lhfont.h" />\r
<ClInclude Include="snd_main.h" />\r
<ClInclude Include="snd_ogg.h" />\r
<ClInclude Include="snd_wav.h" />\r
- <ClInclude Include="snd_xmp.h" />\r
+ <ClInclude Include="snd_xmp.h" />\r
<ClInclude Include="sound.h" />\r
<ClInclude Include="spritegn.h" />\r
<ClInclude Include="sv_demo.h" />\r
<ClCompile Include="com_ents.c" />\r
<ClCompile Include="com_ents4.c" />\r
<ClCompile Include="com_game.c" />\r
- <ClCompile Include="com_list.c" />\r
+ <ClCompile Include="com_infostring.c" />\r
<ClCompile Include="com_msg.c" />\r
<ClCompile Include="common.c" />\r
<ClCompile Include="console.c" />\r
<ClInclude Include="clvm_cmds.h" />\r
<ClInclude Include="cmd.h" />\r
<ClInclude Include="collision.h" />\r
+ <ClInclude Include="com_game.h" />\r
+ <ClInclude Include="com_infostring.h" />\r
<ClInclude Include="com_list.h" />\r
<ClInclude Include="common.h" />\r
<ClInclude Include="console.h" />\r
<ClInclude Include="darkplaces.h" />\r
<ClInclude Include="dpvsimpledecode.h" />\r
<ClInclude Include="draw.h" />\r
+ <ClInclude Include="filematch.h" />\r
<ClInclude Include="fs.h" />\r
<ClInclude Include="ft2.h" />\r
<ClInclude Include="ft2_defs.h" />\r
<ClInclude Include="image.h" />\r
<ClInclude Include="image_png.h" />\r
<ClInclude Include="input.h" />\r
- <ClInclude Include="intoverflow.h" />\r
<ClInclude Include="jpeg.h" />\r
<ClInclude Include="keys.h" />\r
<ClInclude Include="lhfont.h" />\r
<ItemGroup>\r
<ResourceCompile Include="darkplaces.rc" />\r
</ItemGroup>\r
+ <ItemGroup>\r
+ <None Include="packages.config" />\r
+ </ItemGroup>\r
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
<ImportGroup Label="ExtensionTargets">\r
+ <Import Project="packages\sdl2.nuget.redist.2.0.14\build\native\sdl2.nuget.redist.targets" Condition="Exists('packages\sdl2.nuget.redist.2.0.14\build\native\sdl2.nuget.redist.targets')" />\r
+ <Import Project="packages\sdl2.nuget.2.0.14\build\native\sdl2.nuget.targets" Condition="Exists('packages\sdl2.nuget.2.0.14\build\native\sdl2.nuget.targets')" />\r
</ImportGroup>\r
+ <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">\r
+ <PropertyGroup>\r
+ <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>\r
+ </PropertyGroup>\r
+ <Error Condition="!Exists('packages\sdl2.nuget.redist.2.0.14\build\native\sdl2.nuget.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\sdl2.nuget.redist.2.0.14\build\native\sdl2.nuget.redist.targets'))" />\r
+ <Error Condition="!Exists('packages\sdl2.nuget.2.0.14\build\native\sdl2.nuget.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\sdl2.nuget.2.0.14\build\native\sdl2.nuget.targets'))" />\r
+ </Target>\r
</Project>
\ No newline at end of file
/*
-Copyright (C) 1996-1997 Id Software, Inc.
Copyright (C) 2020 Ashley Rose Hale (LadyHavoc)
Copyright (C) 2020 David Knapp (Cloudwalk)
#include "qdefs.h"
#include "zone.h"
#include "thread.h"
-#include "com_list.h"
+#include "com_game.h"
+#include "com_infostring.h"
#include "common.h"
+#include "filematch.h"
#include "fs.h"
#include "host.h"
#include "cvar.h"
vector(string) stov = #117;
string(string s) strzone = #118;
void(string s) strunzone = #119;
+void(string s, float chan, float vol) localsound = #177;
// FTEQW range #200-#299
+/*
+Copyright (C) 2002-2013 DarkPlaces contributors
+
+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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
#include "quakedef.h"
#include "dpvsimpledecode.h"
+/*
+Copyright (C) 2002-2012 DarkPlaces contributors
+
+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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
#ifndef DPVSIMPLEDECODE_H
#define DPVSIMPLEDECODE_H
/*
Copyright (C) 1996-1997 Id Software, Inc.
+Copyright (C) 2000-2021 DarkPlaces contributors
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
// reset the clipping area
void DrawQ_ResetClipArea(void);
// draw a line
-void DrawQ_Line(float width, float x1, float y1, float x2, float y2, float r, float g, float b, float alpha, int flags, qbool fast);
+void DrawQ_Line(float width, float x1, float y1, float x2, float y2, float r, float g, float b, float alpha, int flags);
const char *Draw_GetPicName(cachepic_t *pic);
int Draw_GetPicWidth(cachepic_t *pic);
--- /dev/null
+/*
+Copyright (C) 2006-2021 DarkPlaces contributors
+
+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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+#ifndef FILEMATCH_H
+#define FILEMATCH_H
+
+#include "qtypes.h"
+
+typedef struct stringlist_s
+{
+ /// maxstrings changes as needed, causing reallocation of strings[] array
+ int maxstrings;
+ int numstrings;
+ char **strings;
+} stringlist_t;
+
+int matchpattern(const char *in, const char *pattern, int caseinsensitive);
+int matchpattern_with_separator(const char *in, const char *pattern, int caseinsensitive, const char *separators, qbool wildcard_least_one);
+void stringlistinit(stringlist_t *list);
+void stringlistfreecontents(stringlist_t *list);
+void stringlistappend(stringlist_t *list, const char *text);
+void stringlistsort(stringlist_t *list, qbool uniq);
+void listdirectory(stringlist_t *list, const char *basepath, const char *path);
+
+#endif
if(already_loaded)
*already_loaded = false;
- if(!strcasecmp(ext, "pk3dir"))
+ if(!strcasecmp(ext, "pk3dir") || !strcasecmp(ext, "dpkdir"))
pak = FS_LoadPackVirtual (pakfile);
else if(!strcasecmp(ext, "pak"))
pak = FS_LoadPackPAK (pakfile);
- else if(!strcasecmp(ext, "pk3"))
+ else if(!strcasecmp(ext, "pk3") || !strcasecmp(ext, "dpk"))
pak = FS_LoadPackPK3 (pakfile);
else if(!strcasecmp(ext, "obb")) // android apk expansion
pak = FS_LoadPackPK3 (pakfile);
if(pak->vpack)
{
dpsnprintf(search->filename, sizeof(search->filename), "%s/", pakfile);
- // if shortname ends with "pk3dir", strip that suffix to make it just "pk3"
+ // if shortname ends with "pk3dir" or "dpkdir", strip that suffix to make it just "pk3" or "dpk"
// same goes for the name inside the pack structure
l = strlen(pak->shortname);
if(l >= 7)
- if(!strcasecmp(pak->shortname + l - 7, ".pk3dir"))
+ if(!strcasecmp(pak->shortname + l - 7, ".pk3dir") || !strcasecmp(pak->shortname + l - 7, ".dpkdir"))
pak->shortname[l - 3] = 0;
l = strlen(pak->filename);
if(l >= 7)
- if(!strcasecmp(pak->filename + l - 7, ".pk3dir"))
+ if(!strcasecmp(pak->filename + l - 7, ".pk3dir") || !strcasecmp(pak->filename + l - 7, ".dpkdir"))
pak->filename[l - 3] = 0;
}
return true;
// add any PK3 package in the directory
for (i = 0;i < list.numstrings;i++)
{
- if (!strcasecmp(FS_FileExtension(list.strings[i]), "pk3") || !strcasecmp(FS_FileExtension(list.strings[i]), "obb") || !strcasecmp(FS_FileExtension(list.strings[i]), "pk3dir"))
+ if (!strcasecmp(FS_FileExtension(list.strings[i]), "pk3") || !strcasecmp(FS_FileExtension(list.strings[i]), "obb") || !strcasecmp(FS_FileExtension(list.strings[i]), "pk3dir")
+ || !strcasecmp(FS_FileExtension(list.strings[i]), "dpk") || !strcasecmp(FS_FileExtension(list.strings[i]), "dpkdir"))
{
FS_AddPack_Fullpath(list.strings[i], list.strings[i] + strlen(dir), NULL, false);
}
{
const char *separator, *backslash, *colon, *dot;
+ dot = strrchr(in, '.');
+ if (dot == NULL)
+ return "";
+
separator = strrchr(in, '/');
backslash = strrchr(in, '\\');
if (!separator || separator < backslash)
if (!separator || separator < colon)
separator = colon;
- dot = strrchr(in, '.');
- if (dot == NULL || (separator && (dot < separator)))
+ if (separator && (dot < separator))
return "";
return dot + 1;
}
}
- Host_SaveConfig();
+ Host_SaveConfig(CONFIGFILENAME);
fs_numgamedirs = numgamedirs;
for (i = 0;i < fs_numgamedirs;i++)
if (cls.demoplayback)
{
- CL_Disconnect_f(cmd_client);
+ CL_Disconnect();
cls.demonum = 0;
}
// unload all sounds so they will be reloaded from the new files as needed
- S_UnloadAllSounds_f(cmd_client);
+ S_UnloadAllSounds_f(cmd_local);
// restart the video subsystem after the config is executed
- Cbuf_InsertText(cmd_client, "\nloadconfig\nvid_restart\n\n");
+ Cbuf_InsertText(cmd_local, "\nloadconfig\nvid_restart\n\n");
return true;
}
return false;
}
+/*
+====================
+FS_SanitizePath
+
+Sanitize path (replace non-portable characters
+with portable ones in-place, etc)
+====================
+*/
+void FS_SanitizePath(char *path)
+{
+ for (; *path; path++)
+ if (*path == '\\')
+ *path = '/';
+}
/*
====================
const char *FS_FileWithoutPath (const char *in);
const char *FS_FileExtension (const char *in);
int FS_CheckNastyPath (const char *path, qbool isgamedir);
+void FS_SanitizePath (char *path);
extern const char *const fs_checkgamedir_missing; // "(missing)"
const char *FS_CheckGameDir(const char *gamedir); // returns NULL if nasty, fs_checkgamedir_missing (exact pointer) if missing
Mod_Mesh_AddTriangle(mod, surf, e0, e2, e3);
}
-void DrawQ_Line (float width, float x1, float y1, float x2, float y2, float r, float g, float b, float alpha, int flags, qbool fast)
+void DrawQ_Line (float width, float x1, float y1, float x2, float y2, float r, float g, float b, float alpha, int flags)
{
model_t *mod = CL_Mesh_UI();
msurface_t *surf;
offsety = 0;
}
surf = Mod_Mesh_AddSurface(mod, Mod_Mesh_GetTexture(mod, "white", 0, 0, MATERIALFLAG_WALL | MATERIALFLAG_VERTEXCOLOR | MATERIALFLAG_ALPHAGEN_VERTEX | MATERIALFLAG_ALPHA | MATERIALFLAG_BLENDED | MATERIALFLAG_NOSHADOW), true);
- if (fast)
- {
- Mod_Mesh_CheckResize_Vertex(mod, surf);
- e0 = Mod_Mesh_AddVertex(mod, surf, x1 - offsetx, y1 - offsety, 10, 0, 0, -1, 0, 0, 0, 0, r, g, b, alpha);
- e1 = Mod_Mesh_AddVertex(mod, surf, x2 - offsetx, y2 - offsety, 10, 0, 0, -1, 0, 0, 0, 0, r, g, b, alpha);
- e2 = Mod_Mesh_AddVertex(mod, surf, x2 + offsetx, y2 + offsety, 10, 0, 0, -1, 0, 0, 0, 0, r, g, b, alpha);
- e3 = Mod_Mesh_AddVertex(mod, surf, x1 + offsetx, y1 + offsety, 10, 0, 0, -1, 0, 0, 0, 0, r, g, b, alpha);
- }
- else
- {
- e0 = Mod_Mesh_IndexForVertex(mod, surf, x1 - offsetx, y1 - offsety, 10, 0, 0, -1, 0, 0, 0, 0, r, g, b, alpha);
- e1 = Mod_Mesh_IndexForVertex(mod, surf, x2 - offsetx, y2 - offsety, 10, 0, 0, -1, 0, 0, 0, 0, r, g, b, alpha);
- e2 = Mod_Mesh_IndexForVertex(mod, surf, x2 + offsetx, y2 + offsety, 10, 0, 0, -1, 0, 0, 0, 0, r, g, b, alpha);
- e3 = Mod_Mesh_IndexForVertex(mod, surf, x1 + offsetx, y1 + offsety, 10, 0, 0, -1, 0, 0, 0, 0, r, g, b, alpha);
- }
+ e0 = Mod_Mesh_IndexForVertex(mod, surf, x1 - offsetx, y1 - offsety, 10, 0, 0, -1, 0, 0, 0, 0, r, g, b, alpha);
+ e1 = Mod_Mesh_IndexForVertex(mod, surf, x2 - offsetx, y2 - offsety, 10, 0, 0, -1, 0, 0, 0, 0, r, g, b, alpha);
+ e2 = Mod_Mesh_IndexForVertex(mod, surf, x2 + offsetx, y2 + offsety, 10, 0, 0, -1, 0, 0, 0, 0, r, g, b, alpha);
+ e3 = Mod_Mesh_IndexForVertex(mod, surf, x1 + offsetx, y1 + offsety, 10, 0, 0, -1, 0, 0, 0, 0, r, g, b, alpha);
Mod_Mesh_AddTriangle(mod, surf, e0, e1, e2);
Mod_Mesh_AddTriangle(mod, surf, e0, e2, e3);
}
cvar_t r_glsl_vertextextureblend_usebothalphas = {CF_CLIENT | CF_ARCHIVE, "r_glsl_vertextextureblend_usebothalphas", "0", "use both alpha layers on vertex blended surfaces, each alpha layer sets amount of 'blend leak' on another layer, requires mod_q3shader_force_terrain_alphaflag on."};
+// FIXME: This cvar would grow to a ridiculous size after several launches and clean exits when used during surface sorting.
cvar_t r_framedatasize = {CF_CLIENT | CF_ARCHIVE, "r_framedatasize", "0.5", "size of renderer data cache used during one frame (for skeletal animation caching, light processing, etc)"};
cvar_t r_buffermegs[R_BUFFERDATA_COUNT] =
{
r_texture_numcubemaps = 0;
//r_texture_fogintensity = NULL;
memset(&r_fb, 0, sizeof(r_fb));
- R_GLSL_Restart_f(cmd_client);
+ R_GLSL_Restart_f(cmd_local);
r_glsl_permutation = NULL;
memset(r_glsl_permutationhash, 0, sizeof(r_glsl_permutationhash));
Mod_RenderInit();
}
-int R_CullBox(const vec3_t mins, const vec3_t maxs)
+static void R_GetCornerOfBox(vec3_t out, const vec3_t mins, const vec3_t maxs, int signbits)
{
- int i;
- mplane_t *p;
- if (r_trippy.integer)
- return false;
- for (i = 0;i < r_refdef.view.numfrustumplanes;i++)
- {
- p = r_refdef.view.frustum + i;
- switch(p->signbits)
- {
- default:
- case 0:
- if (p->normal[0]*maxs[0] + p->normal[1]*maxs[1] + p->normal[2]*maxs[2] < p->dist)
- return true;
- break;
- case 1:
- if (p->normal[0]*mins[0] + p->normal[1]*maxs[1] + p->normal[2]*maxs[2] < p->dist)
- return true;
- break;
- case 2:
- if (p->normal[0]*maxs[0] + p->normal[1]*mins[1] + p->normal[2]*maxs[2] < p->dist)
- return true;
- break;
- case 3:
- if (p->normal[0]*mins[0] + p->normal[1]*mins[1] + p->normal[2]*maxs[2] < p->dist)
- return true;
- break;
- case 4:
- if (p->normal[0]*maxs[0] + p->normal[1]*maxs[1] + p->normal[2]*mins[2] < p->dist)
- return true;
- break;
- case 5:
- if (p->normal[0]*mins[0] + p->normal[1]*maxs[1] + p->normal[2]*mins[2] < p->dist)
- return true;
- break;
- case 6:
- if (p->normal[0]*maxs[0] + p->normal[1]*mins[1] + p->normal[2]*mins[2] < p->dist)
- return true;
- break;
- case 7:
- if (p->normal[0]*mins[0] + p->normal[1]*mins[1] + p->normal[2]*mins[2] < p->dist)
- return true;
- break;
- }
- }
- return false;
+ out[0] = ((signbits & 1) ? mins : maxs)[0];
+ out[1] = ((signbits & 2) ? mins : maxs)[1];
+ out[2] = ((signbits & 4) ? mins : maxs)[2];
}
-int R_CullBoxCustomPlanes(const vec3_t mins, const vec3_t maxs, int numplanes, const mplane_t *planes)
+static qbool _R_CullBox(const vec3_t mins, const vec3_t maxs, int numplanes, const mplane_t *planes, int ignore)
{
int i;
const mplane_t *p;
+ vec3_t corner;
if (r_trippy.integer)
return false;
for (i = 0;i < numplanes;i++)
{
+ if(i == ignore)
+ continue;
p = planes + i;
- switch(p->signbits)
- {
- default:
- case 0:
- if (p->normal[0]*maxs[0] + p->normal[1]*maxs[1] + p->normal[2]*maxs[2] < p->dist)
- return true;
- break;
- case 1:
- if (p->normal[0]*mins[0] + p->normal[1]*maxs[1] + p->normal[2]*maxs[2] < p->dist)
- return true;
- break;
- case 2:
- if (p->normal[0]*maxs[0] + p->normal[1]*mins[1] + p->normal[2]*maxs[2] < p->dist)
- return true;
- break;
- case 3:
- if (p->normal[0]*mins[0] + p->normal[1]*mins[1] + p->normal[2]*maxs[2] < p->dist)
- return true;
- break;
- case 4:
- if (p->normal[0]*maxs[0] + p->normal[1]*maxs[1] + p->normal[2]*mins[2] < p->dist)
- return true;
- break;
- case 5:
- if (p->normal[0]*mins[0] + p->normal[1]*maxs[1] + p->normal[2]*mins[2] < p->dist)
- return true;
- break;
- case 6:
- if (p->normal[0]*maxs[0] + p->normal[1]*mins[1] + p->normal[2]*mins[2] < p->dist)
- return true;
- break;
- case 7:
- if (p->normal[0]*mins[0] + p->normal[1]*mins[1] + p->normal[2]*mins[2] < p->dist)
- return true;
- break;
- }
+ R_GetCornerOfBox(corner, mins, maxs, p->signbits);
+ if (DotProduct(p->normal, corner) < p->dist)
+ return true;
}
return false;
}
+qbool R_CullFrustum(const vec3_t mins, const vec3_t maxs)
+{
+ // skip nearclip plane, it often culls portals when you are very close, and is almost never useful
+ return _R_CullBox(mins, maxs, r_refdef.view.numfrustumplanes, r_refdef.view.frustum, 4);
+}
+
+qbool R_CullBox(const vec3_t mins, const vec3_t maxs, int numplanes, const mplane_t *planes)
+{
+ // nothing to ignore
+ return _R_CullBox(mins, maxs, numplanes, planes, -1);
+}
+
//==================================================================================
// LadyHavoc: this stores temporary data used within the same frame
continue;
}
if (!(ent->flags & renderimask))
- if (!R_CullBox(ent->mins, ent->maxs) || (ent->model && ent->model->type == mod_sprite && (ent->model->sprite.sprnum_type == SPR_LABEL || ent->model->sprite.sprnum_type == SPR_LABEL_SCALE)))
+ if (!R_CullFrustum(ent->mins, ent->maxs) || (ent->model && ent->model->type == mod_sprite && (ent->model->sprite.sprnum_type == SPR_LABEL || ent->model->sprite.sprnum_type == SPR_LABEL_SCALE)))
if ((ent->flags & (RENDER_NODEPTHTEST | RENDER_WORLDOBJECT | RENDER_VIEWMODEL)) || r_refdef.scene.worldmodel->brush.BoxTouchingVisibleLeafs(r_refdef.scene.worldmodel, r_refdef.viewcache.world_leafvisible, ent->mins, ent->maxs))
r_refdef.viewcache.entityvisible[i] = true;
}
{
ent = r_refdef.scene.entities[i];
if (!(ent->flags & renderimask))
- if (!R_CullBox(ent->mins, ent->maxs) || (ent->model && ent->model->type == mod_sprite && (ent->model->sprite.sprnum_type == SPR_LABEL || ent->model->sprite.sprnum_type == SPR_LABEL_SCALE)))
+ if (!R_CullFrustum(ent->mins, ent->maxs) || (ent->model && ent->model->type == mod_sprite && (ent->model->sprite.sprnum_type == SPR_LABEL || ent->model->sprite.sprnum_type == SPR_LABEL_SCALE)))
r_refdef.viewcache.entityvisible[i] = true;
}
}
rsurface.entity = NULL; // used only by R_GetCurrentTexture and RSurf_ActiveModelEntity
if(R_CompileShader_CheckStaticParms())
- R_GLSL_Restart_f(cmd_client);
+ R_GLSL_Restart_f(cmd_local);
if (!r_drawentities.integer)
r_refdef.scene.numentities = 0;
for (i = 0; i < prog->num_edicts; i++)
{
edict = PRVM_EDICT_NUM(i);
- if (edict->priv.server->free)
+ if (edict->free)
continue;
// exclude the following for now, as they don't live in world coordinate space and can't be solid:
if (PRVM_gameedictedict(edict, tag_entity) != 0)
GL_PolygonOffset(r_refdef.polygonfactor + r_showcollisionbrushes_polygonfactor.value, r_refdef.polygonoffset + r_showcollisionbrushes_polygonoffset.value);
for (bihleafindex = 0, bihleaf = bih->leafs;bihleafindex < bih->numleafs;bihleafindex++, bihleaf++)
{
- if (cullbox && R_CullBox(bihleaf->mins, bihleaf->maxs))
+ if (cullbox && R_CullFrustum(bihleaf->mins, bihleaf->maxs))
continue;
switch (bihleaf->type)
{
for (portal = model->brush.data_leafs[leafnum].portals;portal;portal = portal->next)
{
if (portal->numpoints <= POLYGONELEMENTS_MAXPOINTS)
- if (!R_CullBox(portal->mins, portal->maxs))
+ if (!R_CullFrustum(portal->mins, portal->maxs))
{
VectorClear(center);
for (i = 0;i < portal->numpoints;i++)
{
if (surfacevisible[surfaceindex])
{
- if (R_CullBox(surfaces[surfaceindex].mins, surfaces[surfaceindex].maxs)
+ if (R_CullFrustum(surfaces[surfaceindex].mins, surfaces[surfaceindex].maxs)
|| (r_vis_trace_surfaces.integer && !R_CanSeeBox(r_vis_trace_samples.integer, r_vis_trace_eyejitter.value, r_vis_trace_enlarge.value, r_vis_trace_expand.value, r_vis_trace_pad.value, r_refdef.view.origin, surfaces[surfaceindex].mins, surfaces[surfaceindex].maxs)))
surfacevisible[surfaceindex] = 0;
}
for (j = 0, leaf = model->brush.data_leafs;j < model->brush.num_leafs;j++, leaf++)
{
// if leaf is in current pvs and on the screen, mark its surfaces
- if (CHECKPVSBIT(r_refdef.viewcache.world_pvsbits, leaf->clusterindex) && !R_CullBox(leaf->mins, leaf->maxs))
+ if (CHECKPVSBIT(r_refdef.viewcache.world_pvsbits, leaf->clusterindex) && !R_CullFrustum(leaf->mins, leaf->maxs))
{
r_refdef.stats[r_stat_world_leafs]++;
r_refdef.viewcache.world_leafvisible[j] = true;
if (leaf->clusterindex < 0)
continue;
// if leaf is in current pvs and on the screen, mark its surfaces
- if (!R_CullBox(leaf->mins, leaf->maxs))
+ if (!R_CullFrustum(leaf->mins, leaf->maxs))
{
r_refdef.stats[r_stat_world_leafs]++;
r_refdef.viewcache.world_leafvisible[j] = true;
if (leaf->clusterindex < 0)
continue;
// if leaf is in current pvs and on the screen, mark its surfaces
- if (CHECKPVSBIT(r_refdef.viewcache.world_pvsbits, leaf->clusterindex) && !R_CullBox(leaf->mins, leaf->maxs))
+ if (CHECKPVSBIT(r_refdef.viewcache.world_pvsbits, leaf->clusterindex) && !R_CullFrustum(leaf->mins, leaf->maxs))
{
r_refdef.stats[r_stat_world_leafs]++;
r_refdef.viewcache.world_leafvisible[j] = true;
cullmaxs[0] = p->maxs[0] + cullbias;
cullmaxs[1] = p->maxs[1] + cullbias;
cullmaxs[2] = p->maxs[2] + cullbias;
- if (R_CullBox(cullmins, cullmaxs))
+ if (R_CullFrustum(cullmins, cullmaxs))
continue;
if (r_vis_trace.integer)
{
continue;
#endif
#if 0
- if (!r_shadow_compilingrtlight && R_CullBoxCustomPlanes(node->mins, node->maxs, rtlight->cached_numfrustumplanes, rtlight->cached_frustumplanes))
+ if (!r_shadow_compilingrtlight && R_CullBox(node->mins, node->maxs, rtlight->cached_numfrustumplanes, rtlight->cached_frustumplanes))
continue;
#endif
// axial planes can be processed much more quickly
continue;
#endif
#if 1
- if (!r_shadow_compilingrtlight && R_CullBoxCustomPlanes(leaf->mins, leaf->maxs, info->numfrustumplanes, info->frustumplanes))
+ if (!r_shadow_compilingrtlight && R_CullBox(leaf->mins, leaf->maxs, info->numfrustumplanes, info->frustumplanes))
continue;
#endif
continue;
#endif
#if 1
- if (!r_shadow_compilingrtlight && R_CullBoxCustomPlanes(leaf->mins, leaf->maxs, info->numfrustumplanes, info->frustumplanes))
+ if (!r_shadow_compilingrtlight && R_CullBox(leaf->mins, leaf->maxs, info->numfrustumplanes, info->frustumplanes))
continue;
#endif
surfaceindex = leaf->surfaceindex;
continue;
#endif
#if 0
- if (!r_shadow_compilingrtlight && R_CullBoxCustomPlanes(node->mins, node->maxs, rtlight->cached_numfrustumplanes, rtlight->cached_frustumplanes))
+ if (!r_shadow_compilingrtlight && R_CullBox(node->mins, node->maxs, rtlight->cached_numfrustumplanes, rtlight->cached_frustumplanes))
continue;
#endif
if (info->lightmins[axis] <= node->backmax)
+/*
+Copyright (C) 2000-2020 DarkPlaces contributors
+
+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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
#include "quakedef.h"
#include "image.h"
#include "jpeg.h"
#include "image_png.h"
-#include "intoverflow.h"
cvar_t gl_max_size = {CF_CLIENT | CF_ARCHIVE, "gl_max_size", "2048", "maximum allowed texture size, can be used to reduce video memory usage, limited by hardware capabilities (typically 2048, 4096, or 8192)"};
cvar_t gl_max_lightmapsize = {CF_CLIENT | CF_ARCHIVE, "gl_max_lightmapsize", "512", "maximum allowed texture size for lightmap textures, use larger values to improve rendering speed, as long as there is enough video memory available (setting it too high for the hardware will cause very bad performance)"};
/*
Copyright (C) 1996-1997 Id Software, Inc.
+Copyright (C) 2000-2021 DarkPlaces contributors
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
*/
-host_t host;
+host_static_t host;
// pretend frames take this amount of time (in seconds), 0 = realtime
cvar_t host_framerate = {CF_CLIENT | CF_SERVER, "host_framerate","0", "locks frame timing to this value in seconds, 0.05 is 20fps for example, note that this can easily run too fast, use cl_maxfps if you want to limit your framerate instead, or sys_ticrate to limit server speed"};
aborts the current host frame and goes on with the next one
================
*/
-void Host_AbortCurrentFrame(void) DP_FUNC_NORETURN;
void Host_AbortCurrentFrame(void)
{
// in case we were previously nice, make us mean again
Cvar_SetValueQuick(&csqc_progcrc, -1);
Cvar_SetValueQuick(&csqc_progsize, -1);
- SV_LockThreadMutex();
- SV_Shutdown ();
- SV_UnlockThreadMutex();
+ if(host.hook.SV_Shutdown)
+ host.hook.SV_Shutdown();
if (cls.state == ca_dedicated)
Sys_Error ("Host_Error: %s",hosterrorstring2); // dedicated servers exit
- CL_Disconnect ();
+ CL_Disconnect();
cls.demonum = -1;
hosterror = false;
}
}
-/*
-=======================
-Host_InitLocal
-======================
-*/
-void Host_SaveConfig_f(cmd_state_t *cmd);
-void Host_LoadConfig_f(cmd_state_t *cmd);
-extern cvar_t sv_writepicture_quality;
-extern cvar_t r_texture_jpeg_fastpicmip;
-static void Host_InitLocal (void)
-{
- Cmd_AddCommand(CF_SHARED, "quit", Host_Quit_f, "quit the game");
- Cmd_AddCommand(CF_SHARED, "version", Host_Version_f, "print engine version");
- Cmd_AddCommand(CF_SHARED, "saveconfig", Host_SaveConfig_f, "save settings to config.cfg (or a specified filename) immediately (also automatic when quitting)");
- Cmd_AddCommand(CF_SHARED, "loadconfig", Host_LoadConfig_f, "reset everything and reload configs");
- Cmd_AddCommand(CF_SHARED, "sendcvar", SendCvar_f, "sends the value of a cvar to the server as a sentcvar command, for use by QuakeC");
- Cvar_RegisterVariable (&cl_maxphysicsframesperserverframe);
- Cvar_RegisterVariable (&host_framerate);
- Cvar_RegisterCallback (&host_framerate, Host_Framerate_c);
- Cvar_RegisterVariable (&host_speeds);
- Cvar_RegisterVariable (&host_maxwait);
- Cvar_RegisterVariable (&host_isclient);
-
- Cvar_RegisterVariable (&developer);
- Cvar_RegisterVariable (&developer_extra);
- Cvar_RegisterVariable (&developer_insane);
- Cvar_RegisterVariable (&developer_loadfile);
- Cvar_RegisterVariable (&developer_loading);
- Cvar_RegisterVariable (&developer_entityparsing);
-
- Cvar_RegisterVariable (×tamps);
- Cvar_RegisterVariable (&timeformat);
-
- Cvar_RegisterVariable (&sv_writepicture_quality);
- Cvar_RegisterVariable (&r_texture_jpeg_fastpicmip);
-}
-
-
/*
===============
Host_SaveConfig_f
Writes key bindings and archived cvars to config.cfg
===============
*/
-static void Host_SaveConfig_to(const char *file)
+void Host_SaveConfig(const char *file)
{
qfile_t *f;
FS_Close (f);
}
}
-void Host_SaveConfig(void)
-{
- Host_SaveConfig_to(CONFIGFILENAME);
-}
-void Host_SaveConfig_f(cmd_state_t *cmd)
+
+static void Host_SaveConfig_f(cmd_state_t *cmd)
{
const char *file = CONFIGFILENAME;
Con_Printf("Saving to %s\n", file);
}
- Host_SaveConfig_to(file);
+ Host_SaveConfig(file);
}
static void Host_AddConfigText(cmd_state_t *cmd)
Resets key bindings and cvars to defaults and then reloads scripts
===============
*/
-void Host_LoadConfig_f(cmd_state_t *cmd)
+static void Host_LoadConfig_f(cmd_state_t *cmd)
{
// reset all cvars, commands and aliases to init values
Cmd_RestoreInitState();
#ifdef CONFIG_MENU
// prepend a menu restart command to execute after the config
- Cbuf_InsertText(cmd_client, "\nmenu_restart\n");
+ Cbuf_InsertText(cmd_local, "\nmenu_restart\n");
#endif
// reset cvars to their defaults, and then exec startup scripts again
- Host_AddConfigText(cmd_client);
+ Host_AddConfigText(cmd_local);
}
-//============================================================================
-
/*
-===================
-Host_GetConsoleCommands
-
-Add them exactly as if they had been typed at the console
-===================
-*/
-static void Host_GetConsoleCommands (void)
-{
- char *line;
-
- while ((line = Sys_ConsoleInput()))
- {
- if (cls.state == ca_dedicated)
- Cbuf_AddText(cmd_server, line);
- else
- Cbuf_AddText(cmd_client, line);
- }
-}
-
-/*
-==================
-Host_TimeReport
-
-Returns a time report string, for example for
-==================
-*/
-const char *Host_TimingReport(char *buf, size_t buflen)
-{
- return va(buf, buflen, "%.1f%% CPU, %.2f%% lost, offset avg %.1fms, max %.1fms, sdev %.1fms", svs.perf_cpuload * 100, svs.perf_lost * 100, svs.perf_offset_avg * 1000, svs.perf_offset_max * 1000, svs.perf_offset_sdev * 1000);
-}
-
-/*
-==================
-Host_Frame
-
-Runs all active servers
-==================
+=======================
+Host_InitLocal
+======================
*/
-static void Host_Init(void);
-double Host_Frame(double time)
-{
- double cl_timer = 0;
- double sv_timer = 0;
- static double wait;
-
- TaskQueue_Frame(false);
-
- // keep the random time dependent, but not when playing demos/benchmarking
- if(!*sv_random_seed.string && !host.restless)
- rand();
-
- NetConn_UpdateSockets();
-
- Log_DestBuffer_Flush();
-
- Curl_Run();
-
- // check for commands typed to the host
- Host_GetConsoleCommands();
-
- // process console commands
-// R_TimeReport("preconsole");
-
- Cbuf_Frame(host.cbuf);
-
-// R_TimeReport("console");
-
- //Con_Printf("%6.0f %6.0f\n", cl_timer * 1000000.0, sv_timer * 1000000.0);
-
- R_TimeReport("---");
-
- sv_timer = SV_Frame(time);
- cl_timer = CL_Frame(time);
-
- Mem_CheckSentinelsGlobal();
-
- // if the accumulators haven't become positive yet, wait a while
- if (cls.state == ca_dedicated)
- wait = sv_timer * -1000000.0; // dedicated
- else if (!sv.active || svs.threaded)
- wait = cl_timer * -1000000.0; // connected to server, main menu, or server is on different thread
- else
- wait = max(cl_timer, sv_timer) * -1000000.0; // listen server or singleplayer
-
- if (!host.restless && wait >= 1)
- return wait;
- else
- return 0;
-}
-
-static inline void Host_Sleep(double time)
-{
- static double delta;
- double time0;
-
- if(host_maxwait.value <= 0)
- time = min(time, 1000000.0);
- else
- time = min(time, host_maxwait.value * 1000.0);
- if(time < 1)
- time = 1; // because we cast to int
-
- time0 = Sys_DirtyTime();
- if (sv_checkforpacketsduringsleep.integer && !sys_usenoclockbutbenchmark.integer && !svs.threaded) {
- NetConn_SleepMicroseconds((int)time);
- if (cls.state != ca_dedicated)
- NetConn_ClientFrame(); // helps server browser get good ping values
- // TODO can we do the same for ServerFrame? Probably not.
- }
- else
- Sys_Sleep((int)time);
- delta = Sys_DirtyTime() - time0;
- if (delta < 0 || delta >= 1800)
- delta = 0;
- host.sleeptime += delta;
-// R_TimeReport("sleep");
- return;
-}
-
-// Cloudwalk: Most overpowered function declaration...
-static inline double Host_UpdateTime (double newtime, double oldtime)
-{
- double time = newtime - oldtime;
-
- if (time < 0)
- {
- // warn if it's significant
- if (time < -0.01)
- Con_Printf(CON_WARN "Host_UpdateTime: time stepped backwards (went from %f to %f, difference %f)\n", oldtime, newtime, time);
- time = 0;
- }
- else if (time >= 1800)
- {
- Con_Printf(CON_WARN "Host_UpdateTime: time stepped forward (went from %f to %f, difference %f)\n", oldtime, newtime, time);
- time = 0;
- }
-
- return time;
-}
-
-void Host_Main(void)
+extern cvar_t r_texture_jpeg_fastpicmip;
+static void Host_InitLocal (void)
{
- double time, newtime, oldtime, sleeptime;
-
- Host_Init(); // Start!
-
- host.realtime = 0;
- oldtime = Sys_DirtyTime();
-
- // Main event loop
- while(host.state != host_shutdown)
- {
- // Something bad happened, or the server disconnected
- if (setjmp(host.abortframe))
- {
- host.state = host_active; // In case we were loading
- continue;
- }
-
- newtime = host.dirtytime = Sys_DirtyTime();
- host.realtime += time = Host_UpdateTime(newtime, oldtime);
-
- sleeptime = Host_Frame(time);
- oldtime = newtime;
+ Cmd_AddCommand(CF_SHARED, "quit", Host_Quit_f, "quit the game");
+ Cmd_AddCommand(CF_SHARED, "version", Host_Version_f, "print engine version");
+ Cmd_AddCommand(CF_SHARED, "saveconfig", Host_SaveConfig_f, "save settings to config.cfg (or a specified filename) immediately (also automatic when quitting)");
+ Cmd_AddCommand(CF_SHARED, "loadconfig", Host_LoadConfig_f, "reset everything and reload configs");
+ Cmd_AddCommand(CF_SHARED, "sendcvar", SendCvar_f, "sends the value of a cvar to the server as a sentcvar command, for use by QuakeC");
+ Cvar_RegisterVariable (&cl_maxphysicsframesperserverframe);
+ Cvar_RegisterVariable (&host_framerate);
+ Cvar_RegisterCallback (&host_framerate, Host_Framerate_c);
+ Cvar_RegisterVariable (&host_speeds);
+ Cvar_RegisterVariable (&host_maxwait);
+ Cvar_RegisterVariable (&host_isclient);
- if (sleeptime)
- {
- Host_Sleep(sleeptime);
- continue;
- }
+ Cvar_RegisterVariable (&developer);
+ Cvar_RegisterVariable (&developer_extra);
+ Cvar_RegisterVariable (&developer_insane);
+ Cvar_RegisterVariable (&developer_loadfile);
+ Cvar_RegisterVariable (&developer_loading);
+ Cvar_RegisterVariable (&developer_entityparsing);
- host.framecount++;
- }
+ Cvar_RegisterVariable (×tamps);
+ Cvar_RegisterVariable (&timeformat);
- return;
+ Cvar_RegisterVariable (&r_texture_jpeg_fastpicmip);
}
-//============================================================================
-
char engineversion[128];
qbool sys_nostdout = false;
}
}
}
+
void Host_LockSession(void)
{
if(locksession_run)
}
}
}
+
void Host_UnlockSession(void)
{
if(!locksession_run)
host.hook.Disconnect = NULL;
host.hook.ToggleMenu = NULL;
host.hook.CL_Intermission = NULL;
- host.hook.SV_CanSave = NULL;
+ host.hook.SV_Shutdown = NULL;
host.state = host_init;
// here comes the not so critical stuff
- Host_AddConfigText(cmd_client);
+ Host_AddConfigText(cmd_local);
// if quake.rc is missing, use default
if (!FS_FileExists("quake.rc"))
{
- Cbuf_AddText(cmd_client, "exec default.cfg\nexec " CONFIGFILENAME "\nexec autoexec.cfg\n");
- Cbuf_Execute(cmd_client->cbuf);
+ Cbuf_AddText(cmd_local, "exec default.cfg\nexec " CONFIGFILENAME "\nexec autoexec.cfg\n");
+ Cbuf_Execute(cmd_local->cbuf);
}
host.state = host_active;
if (i && i + 1 < sys.argc)
if (!sv.active && !cls.demoplayback && !cls.connect_trying)
{
- Cbuf_AddText(cmd_client, va(vabuf, sizeof(vabuf), "timedemo %s\n", sys.argv[i + 1]));
- Cbuf_Execute(cmd_client->cbuf);
+ Cbuf_AddText(cmd_local, va(vabuf, sizeof(vabuf), "timedemo %s\n", sys.argv[i + 1]));
+ Cbuf_Execute(cmd_local->cbuf);
}
// check for special demo mode
if (i && i + 1 < sys.argc)
if (!sv.active && !cls.demoplayback && !cls.connect_trying)
{
- Cbuf_AddText(cmd_client, va(vabuf, sizeof(vabuf), "playdemo %s\n", sys.argv[i + 1]));
- Cbuf_Execute(cmd_client->cbuf);
+ Cbuf_AddText(cmd_local, va(vabuf, sizeof(vabuf), "playdemo %s\n", sys.argv[i + 1]));
+ Cbuf_Execute(cmd_local->cbuf);
}
#ifdef CONFIG_VIDEO_CAPTURE
if (i && i + 1 < sys.argc)
if (!sv.active && !cls.demoplayback && !cls.connect_trying)
{
- Cbuf_AddText(cmd_client, va(vabuf, sizeof(vabuf), "playdemo %s\ncl_capturevideo 1\n", sys.argv[i + 1]));
- Cbuf_Execute((cmd_client)->cbuf);
+ Cbuf_AddText(cmd_local, va(vabuf, sizeof(vabuf), "playdemo %s\ncl_capturevideo 1\n", sys.argv[i + 1]));
+ Cbuf_Execute((cmd_local)->cbuf);
}
#endif
if (cls.state == ca_dedicated || Sys_CheckParm("-listen"))
if (!sv.active && !cls.demoplayback && !cls.connect_trying)
{
- Cbuf_AddText(cmd_client, "startmap_dm\n");
- Cbuf_Execute(cmd_client->cbuf);
+ Cbuf_AddText(cmd_local, "startmap_dm\n");
+ Cbuf_Execute(cmd_local->cbuf);
}
if (!sv.active && !cls.demoplayback && !cls.connect_trying)
{
#ifdef CONFIG_MENU
- Cbuf_AddText(cmd_client, "togglemenu 1\n");
+ Cbuf_AddText(cmd_local, "togglemenu 1\n");
#endif
- Cbuf_Execute(cmd_client->cbuf);
+ Cbuf_Execute(cmd_local->cbuf);
}
Con_DPrint("========Initialized=========\n");
SV_StartThread();
}
-
/*
===============
Host_Shutdown
SV_StopThread();
// shut down local server if active
- SV_LockThreadMutex();
- SV_Shutdown ();
- SV_UnlockThreadMutex();
+ if(host.hook.SV_Shutdown)
+ host.hook.SV_Shutdown();
// AK shutdown PRVM
// AK hmm, no PRVM_Shutdown(); yet
- Host_SaveConfig();
+ Host_SaveConfig(CONFIGFILENAME);
Curl_Shutdown ();
NetConn_Shutdown ();
Memory_Shutdown();
}
-void Host_NoOperation_f(cmd_state_t *cmd)
+//============================================================================
+
+/*
+==================
+Host_Frame
+
+Runs all active servers
+==================
+*/
+static double Host_Frame(double time)
{
+ double cl_wait, sv_wait;
+
+ TaskQueue_Frame(false);
+
+ // keep the random time dependent, but not when playing demos/benchmarking
+ if(!*sv_random_seed.string && !host.restless)
+ rand();
+
+ NetConn_UpdateSockets();
+
+ Log_DestBuffer_Flush();
+
+ // Run any downloads
+ Curl_Frame();
+
+ // process console commands
+ Cbuf_Frame(host.cbuf);
+
+ R_TimeReport("---");
+
+ sv_wait = SV_Frame(time);
+ cl_wait = CL_Frame(time);
+
+// Con_Printf("%6.0f %6.0f\n", cl_wait * 1000000.0, sv_wait * 1000000.0);
+
+ Mem_CheckSentinelsGlobal();
+
+ if(host.restless)
+ return 0;
+
+ // if the accumulators haven't become positive yet, wait a while
+ if (cls.state == ca_dedicated)
+ return sv_wait * -1000000.0; // dedicated
+ else if (!sv.active || svs.threaded)
+ return cl_wait * -1000000.0; // connected to server, main menu, or server is on different thread
+ else
+ return max(cl_wait, sv_wait) * -1000000.0; // listen server or singleplayer
+}
+
+static inline void Host_Sleep(double time)
+{
+ double delta, time0;
+
+ if(host_maxwait.value <= 0)
+ time = min(time, 1000000.0);
+ else
+ time = min(time, host_maxwait.value * 1000.0);
+ if(time < 1)
+ time = 1; // because we cast to int
+
+ time0 = Sys_DirtyTime();
+ if (sv_checkforpacketsduringsleep.integer && !sys_usenoclockbutbenchmark.integer && !svs.threaded) {
+ NetConn_SleepMicroseconds((int)time);
+ if (cls.state != ca_dedicated)
+ NetConn_ClientFrame(); // helps server browser get good ping values
+ // TODO can we do the same for ServerFrame? Probably not.
+ }
+ else
+ Sys_Sleep((int)time);
+ delta = Sys_DirtyTime() - time0;
+ if (delta < 0 || delta >= 1800)
+ delta = 0;
+ host.sleeptime += delta;
+// R_TimeReport("sleep");
+ return;
+}
+
+// Cloudwalk: Most overpowered function declaration...
+static inline double Host_UpdateTime (double newtime, double oldtime)
+{
+ double time = newtime - oldtime;
+
+ if (time < 0)
+ {
+ // warn if it's significant
+ if (time < -0.01)
+ Con_Printf(CON_WARN "Host_UpdateTime: time stepped backwards (went from %f to %f, difference %f)\n", oldtime, newtime, time);
+ time = 0;
+ }
+ else if (time >= 1800)
+ {
+ Con_Printf(CON_WARN "Host_UpdateTime: time stepped forward (went from %f to %f, difference %f)\n", oldtime, newtime, time);
+ time = 0;
+ }
+
+ return time;
+}
+
+void Host_Main(void)
+{
+ double time, newtime, oldtime, sleeptime;
+
+ Host_Init(); // Start!
+
+ host.realtime = 0;
+ oldtime = Sys_DirtyTime();
+
+ // Main event loop
+ while(host.state != host_shutdown)
+ {
+ // Something bad happened, or the server disconnected
+ if (setjmp(host.abortframe))
+ {
+ host.state = host_active; // In case we were loading
+ continue;
+ }
+
+ newtime = host.dirtytime = Sys_DirtyTime();
+ host.realtime += time = Host_UpdateTime(newtime, oldtime);
+
+ sleeptime = Host_Frame(time);
+ oldtime = newtime;
+
+ if (sleeptime >= 1)
+ {
+ Host_Sleep(sleeptime);
+ continue;
+ }
+
+ host.framecount++;
+ }
+
+ return;
}
host_active
} host_state_t;
-typedef struct host_s
+typedef struct host_static_s
{
jmp_buf abortframe;
int state;
struct
{
void (*ConnectLocal)(void);
- void (*Disconnect)(void);
+ void (*Disconnect)(qbool, const char *, ... );
void (*ToggleMenu)(void);
qbool (*CL_Intermission)(void); // Quake compatibility
- qbool (*SV_CanSave)(void); // Quake compatibility
void (*CL_SendCvar)(struct cmd_state_s *);
void (*SV_SendCvar)(struct cmd_state_s *);
+ void (*SV_Shutdown)(void);
} hook;
-} host_t;
+} host_static_t;
-extern host_t host;
+extern host_static_t host;
-void Host_InitCommands(void);
void Host_Main(void);
-double Host_Frame(double time);
void Host_Shutdown(void);
void Host_Error(const char *error, ...) DP_FUNC_PRINTF(1) DP_FUNC_NORETURN;
void Host_LockSession(void);
void Host_UnlockSession(void);
-void Host_AbortCurrentFrame(void);
-void Host_SaveConfig(void);
-void Host_LoadConfig_f(cmd_state_t *cmd);
-void Host_NoOperation_f(cmd_state_t *cmd);
+void Host_AbortCurrentFrame(void) DP_FUNC_NORETURN;
+void Host_SaveConfig(const char *file);
#endif
for (format = firstformat;format->formatstring;format++)
{
dpsnprintf (name, sizeof(name), format->formatstring, basename);
+
+ FS_SanitizePath(name);
+
if(FS_FileExists(name) && (f = FS_LoadFile(name, tempmempool, true, &filesize)) != NULL)
{
mymiplevel = miplevel ? *miplevel : 0;
+++ /dev/null
-#ifndef INTOVERFLOW_H
-#define INTOVERFLOW_H
-
-// simple safe library to handle integer overflows when doing buffer size calculations
-// Usage:
-// - calculate data size using INTOVERFLOW_??? macros
-// - compare: calculated-size <= INTOVERFLOW_NORMALIZE(buffersize)
-// Functionality:
-// - all overflows (values > INTOVERFLOW_MAX) and errors are mapped to INTOVERFLOW_MAX
-// - if any input of an operation is INTOVERFLOW_MAX, INTOVERFLOW_MAX will be returned
-// - otherwise, regular arithmetics apply
-
-#define INTOVERFLOW_MAX 2147483647
-
-#define INTOVERFLOW_ADD(a,b) (((a) < INTOVERFLOW_MAX && (b) < INTOVERFLOW_MAX && (a) < INTOVERFLOW_MAX - (b)) ? ((a) + (b)) : INTOVERFLOW_MAX)
-#define INTOVERFLOW_SUB(a,b) (((a) < INTOVERFLOW_MAX && (b) < INTOVERFLOW_MAX && (b) <= (a)) ? ((a) - (b)) : INTOVERFLOW_MAX)
-#define INTOVERFLOW_MUL(a,b) (((a) < INTOVERFLOW_MAX && (b) < INTOVERFLOW_MAX && (a) < INTOVERFLOW_MAX / (b)) ? ((a) * (b)) : INTOVERFLOW_MAX)
-#define INTOVERFLOW_DIV(a,b) (((a) < INTOVERFLOW_MAX && (b) < INTOVERFLOW_MAX && (b) > 0) ? ((a) / (b)) : INTOVERFLOW_MAX)
-
-#define INTOVERFLOW_NORMALIZE(a) (((a) < INTOVERFLOW_MAX) ? (a) : (INTOVERFLOW_MAX - 1))
-
-#endif
#include "jpeg.h"
#include "image_png.h"
-cvar_t sv_writepicture_quality = {CF_SERVER | CF_ARCHIVE, "sv_writepicture_quality", "10", "WritePicture quality offset (higher means better quality, but slower)"};
+extern cvar_t sv_writepicture_quality;
cvar_t r_texture_jpeg_fastpicmip = {CF_CLIENT | CF_ARCHIVE, "r_texture_jpeg_fastpicmip", "1", "perform gl_picmip during decompression for JPEG files (faster)"};
// jboolean is unsigned char instead of int on Win32
/* The decompressor output side may not use these variables. */
int dc_tbl_no; /* DC entropy table selector (0..3) */
int ac_tbl_no; /* AC entropy table selector (0..3) */
-
+
/* Remaining fields should be treated as private by applications. */
-
+
/* These values are computed during compression or decompression startup: */
/* Component's size in DCT blocks.
* Any dummy blocks added to complete an MCU are not counted; therefore
cinfo->in_color_space = JCS_RGB;
cinfo->input_components = 3;
qjpeg_set_defaults (cinfo);
- qjpeg_set_quality (cinfo, quality, FALSE);
+ qjpeg_set_quality (cinfo, quality, false);
cinfo->comp_info[0].h_samp_factor = 2;
cinfo->comp_info[0].v_samp_factor = 2;
if(strlen(imagename) >= MAX_QPATH)
return; // can't add this
-
+
i = (CompressedImageCacheItem*) Z_Malloc(sizeof(CompressedImageCacheItem));
strlcpy(i->imagename, imagename, sizeof(i->imagename));
i->maxsize = maxsize;
void
Key_Event (int key, int ascii, qbool down)
{
- cmd_state_t *cmd = cmd_client;
+ cmd_state_t *cmd = cmd_local;
const char *bind;
qbool q;
keydest_t keydest = key_dest;
{
if(down)
{
- Con_ToggleConsole_f(cmd_client);
+ Con_ToggleConsole_f(cmd_local);
tbl_keydest[key] = key_void; // esc release should go nowhere (especially not to key_menu or key_game)
}
return;
#endif
}
else
- Con_ToggleConsole_f(cmd_client);
+ Con_ToggleConsole_f(cmd_local);
}
break;
// (special exemption for german keyboard layouts)
if (con_closeontoggleconsole.integer && bind && !strncmp(bind, "toggleconsole", strlen("toggleconsole")) && (key_consoleactive & KEY_CONSOLEACTIVE_USER) && (con_closeontoggleconsole.integer >= ((ascii != STRING_COLOR_TAG) ? 2 : 3) || key_linepos == 1))
{
- Con_ToggleConsole_f(cmd_client);
+ Con_ToggleConsole_f(cmd_local);
return;
}
+++ /dev/null
-/* $XFree86$
- * This module converts keysym values into the corresponding ISO 10646
- * (UCS, Unicode) values.
- *
- * The array keysymtab[] contains pairs of X11 keysym values for graphical
- * characters and the corresponding Unicode value. The function
- * keysym2ucs() maps a keysym onto a Unicode value using a binary search,
- * therefore keysymtab[] must remain SORTED by keysym value.
- *
- * The keysym -> UTF-8 conversion will hopefully one day be provided
- * by Xlib via XmbLookupString() and should ideally not have to be
- * done in X applications. But we are not there yet.
- *
- * We allow to represent any UCS character in the range U-00000000 to
- * U-00FFFFFF by a keysym value in the range 0x01000000 to 0x01ffffff.
- * This admittedly does not cover the entire 31-bit space of UCS, but
- * it does cover all of the characters up to U-10FFFF, which can be
- * represented by UTF-16, and more, and it is very unlikely that higher
- * UCS codes will ever be assigned by ISO. So to get Unicode character
- * U+ABCD you can directly use keysym 0x0100abcd.
- *
- * NOTE: The comments in the table below contain the actual character
- * encoded in UTF-8, so for viewing and editing best use an editor in
- * UTF-8 mode.
- *
- * Author: Markus G. Kuhn <http://www.cl.cam.ac.uk/~mgk25/>,
- * University of Cambridge, April 2001
- *
- * Special thanks to Richard Verhoeven <river@win.tue.nl> for preparing
- * an initial draft of the mapping table.
- *
- * This software is in the public domain. Share and enjoy!
- *
- * AUTOMATICALLY GENERATED FILE, DO NOT EDIT !!! (unicode/convmap.pl)
- */
-
-#include <X11/X.h>
-
-struct codepair {
- unsigned short keysym;
- unsigned short ucs;
-} keysymtab[] = {
- { 0x01a1, 0x0104 }, /* Aogonek Ą LATIN CAPITAL LETTER A WITH OGONEK */
- { 0x01a2, 0x02d8 }, /* breve ˘ BREVE */
- { 0x01a3, 0x0141 }, /* Lstroke Ł LATIN CAPITAL LETTER L WITH STROKE */
- { 0x01a5, 0x013d }, /* Lcaron Ľ LATIN CAPITAL LETTER L WITH CARON */
- { 0x01a6, 0x015a }, /* Sacute Ś LATIN CAPITAL LETTER S WITH ACUTE */
- { 0x01a9, 0x0160 }, /* Scaron Š LATIN CAPITAL LETTER S WITH CARON */
- { 0x01aa, 0x015e }, /* Scedilla Ş LATIN CAPITAL LETTER S WITH CEDILLA */
- { 0x01ab, 0x0164 }, /* Tcaron Ť LATIN CAPITAL LETTER T WITH CARON */
- { 0x01ac, 0x0179 }, /* Zacute Ź LATIN CAPITAL LETTER Z WITH ACUTE */
- { 0x01ae, 0x017d }, /* Zcaron Ž LATIN CAPITAL LETTER Z WITH CARON */
- { 0x01af, 0x017b }, /* Zabovedot Ż LATIN CAPITAL LETTER Z WITH DOT ABOVE */
- { 0x01b1, 0x0105 }, /* aogonek ą LATIN SMALL LETTER A WITH OGONEK */
- { 0x01b2, 0x02db }, /* ogonek ˛ OGONEK */
- { 0x01b3, 0x0142 }, /* lstroke ł LATIN SMALL LETTER L WITH STROKE */
- { 0x01b5, 0x013e }, /* lcaron ľ LATIN SMALL LETTER L WITH CARON */
- { 0x01b6, 0x015b }, /* sacute ś LATIN SMALL LETTER S WITH ACUTE */
- { 0x01b7, 0x02c7 }, /* caron ˇ CARON */
- { 0x01b9, 0x0161 }, /* scaron š LATIN SMALL LETTER S WITH CARON */
- { 0x01ba, 0x015f }, /* scedilla ş LATIN SMALL LETTER S WITH CEDILLA */
- { 0x01bb, 0x0165 }, /* tcaron ť LATIN SMALL LETTER T WITH CARON */
- { 0x01bc, 0x017a }, /* zacute ź LATIN SMALL LETTER Z WITH ACUTE */
- { 0x01bd, 0x02dd }, /* doubleacute ˝ DOUBLE ACUTE ACCENT */
- { 0x01be, 0x017e }, /* zcaron ž LATIN SMALL LETTER Z WITH CARON */
- { 0x01bf, 0x017c }, /* zabovedot ż LATIN SMALL LETTER Z WITH DOT ABOVE */
- { 0x01c0, 0x0154 }, /* Racute Ŕ LATIN CAPITAL LETTER R WITH ACUTE */
- { 0x01c3, 0x0102 }, /* Abreve Ă LATIN CAPITAL LETTER A WITH BREVE */
- { 0x01c5, 0x0139 }, /* Lacute Ĺ LATIN CAPITAL LETTER L WITH ACUTE */
- { 0x01c6, 0x0106 }, /* Cacute Ć LATIN CAPITAL LETTER C WITH ACUTE */
- { 0x01c8, 0x010c }, /* Ccaron Č LATIN CAPITAL LETTER C WITH CARON */
- { 0x01ca, 0x0118 }, /* Eogonek Ę LATIN CAPITAL LETTER E WITH OGONEK */
- { 0x01cc, 0x011a }, /* Ecaron Ě LATIN CAPITAL LETTER E WITH CARON */
- { 0x01cf, 0x010e }, /* Dcaron Ď LATIN CAPITAL LETTER D WITH CARON */
- { 0x01d0, 0x0110 }, /* Dstroke Đ LATIN CAPITAL LETTER D WITH STROKE */
- { 0x01d1, 0x0143 }, /* Nacute Ń LATIN CAPITAL LETTER N WITH ACUTE */
- { 0x01d2, 0x0147 }, /* Ncaron Ň LATIN CAPITAL LETTER N WITH CARON */
- { 0x01d5, 0x0150 }, /* Odoubleacute Ő LATIN CAPITAL LETTER O WITH DOUBLE ACUTE */
- { 0x01d8, 0x0158 }, /* Rcaron Ř LATIN CAPITAL LETTER R WITH CARON */
- { 0x01d9, 0x016e }, /* Uring Ů LATIN CAPITAL LETTER U WITH RING ABOVE */
- { 0x01db, 0x0170 }, /* Udoubleacute Ű LATIN CAPITAL LETTER U WITH DOUBLE ACUTE */
- { 0x01de, 0x0162 }, /* Tcedilla Ţ LATIN CAPITAL LETTER T WITH CEDILLA */
- { 0x01e0, 0x0155 }, /* racute ŕ LATIN SMALL LETTER R WITH ACUTE */
- { 0x01e3, 0x0103 }, /* abreve ă LATIN SMALL LETTER A WITH BREVE */
- { 0x01e5, 0x013a }, /* lacute ĺ LATIN SMALL LETTER L WITH ACUTE */
- { 0x01e6, 0x0107 }, /* cacute ć LATIN SMALL LETTER C WITH ACUTE */
- { 0x01e8, 0x010d }, /* ccaron č LATIN SMALL LETTER C WITH CARON */
- { 0x01ea, 0x0119 }, /* eogonek ę LATIN SMALL LETTER E WITH OGONEK */
- { 0x01ec, 0x011b }, /* ecaron ě LATIN SMALL LETTER E WITH CARON */
- { 0x01ef, 0x010f }, /* dcaron ď LATIN SMALL LETTER D WITH CARON */
- { 0x01f0, 0x0111 }, /* dstroke đ LATIN SMALL LETTER D WITH STROKE */
- { 0x01f1, 0x0144 }, /* nacute ń LATIN SMALL LETTER N WITH ACUTE */
- { 0x01f2, 0x0148 }, /* ncaron ň LATIN SMALL LETTER N WITH CARON */
- { 0x01f5, 0x0151 }, /* odoubleacute ő LATIN SMALL LETTER O WITH DOUBLE ACUTE */
- { 0x01f8, 0x0159 }, /* rcaron ř LATIN SMALL LETTER R WITH CARON */
- { 0x01f9, 0x016f }, /* uring ů LATIN SMALL LETTER U WITH RING ABOVE */
- { 0x01fb, 0x0171 }, /* udoubleacute ű LATIN SMALL LETTER U WITH DOUBLE ACUTE */
- { 0x01fe, 0x0163 }, /* tcedilla ţ LATIN SMALL LETTER T WITH CEDILLA */
- { 0x01ff, 0x02d9 }, /* abovedot ˙ DOT ABOVE */
- { 0x02a1, 0x0126 }, /* Hstroke Ħ LATIN CAPITAL LETTER H WITH STROKE */
- { 0x02a6, 0x0124 }, /* Hcircumflex Ĥ LATIN CAPITAL LETTER H WITH CIRCUMFLEX */
- { 0x02a9, 0x0130 }, /* Iabovedot İ LATIN CAPITAL LETTER I WITH DOT ABOVE */
- { 0x02ab, 0x011e }, /* Gbreve Ğ LATIN CAPITAL LETTER G WITH BREVE */
- { 0x02ac, 0x0134 }, /* Jcircumflex Ĵ LATIN CAPITAL LETTER J WITH CIRCUMFLEX */
- { 0x02b1, 0x0127 }, /* hstroke ħ LATIN SMALL LETTER H WITH STROKE */
- { 0x02b6, 0x0125 }, /* hcircumflex ĥ LATIN SMALL LETTER H WITH CIRCUMFLEX */
- { 0x02b9, 0x0131 }, /* idotless ı LATIN SMALL LETTER DOTLESS I */
- { 0x02bb, 0x011f }, /* gbreve ğ LATIN SMALL LETTER G WITH BREVE */
- { 0x02bc, 0x0135 }, /* jcircumflex ĵ LATIN SMALL LETTER J WITH CIRCUMFLEX */
- { 0x02c5, 0x010a }, /* Cabovedot Ċ LATIN CAPITAL LETTER C WITH DOT ABOVE */
- { 0x02c6, 0x0108 }, /* Ccircumflex Ĉ LATIN CAPITAL LETTER C WITH CIRCUMFLEX */
- { 0x02d5, 0x0120 }, /* Gabovedot Ġ LATIN CAPITAL LETTER G WITH DOT ABOVE */
- { 0x02d8, 0x011c }, /* Gcircumflex Ĝ LATIN CAPITAL LETTER G WITH CIRCUMFLEX */
- { 0x02dd, 0x016c }, /* Ubreve Ŭ LATIN CAPITAL LETTER U WITH BREVE */
- { 0x02de, 0x015c }, /* Scircumflex Ŝ LATIN CAPITAL LETTER S WITH CIRCUMFLEX */
- { 0x02e5, 0x010b }, /* cabovedot ċ LATIN SMALL LETTER C WITH DOT ABOVE */
- { 0x02e6, 0x0109 }, /* ccircumflex ĉ LATIN SMALL LETTER C WITH CIRCUMFLEX */
- { 0x02f5, 0x0121 }, /* gabovedot ġ LATIN SMALL LETTER G WITH DOT ABOVE */
- { 0x02f8, 0x011d }, /* gcircumflex ĝ LATIN SMALL LETTER G WITH CIRCUMFLEX */
- { 0x02fd, 0x016d }, /* ubreve ŭ LATIN SMALL LETTER U WITH BREVE */
- { 0x02fe, 0x015d }, /* scircumflex ŝ LATIN SMALL LETTER S WITH CIRCUMFLEX */
- { 0x03a2, 0x0138 }, /* kra ĸ LATIN SMALL LETTER KRA */
- { 0x03a3, 0x0156 }, /* Rcedilla Ŗ LATIN CAPITAL LETTER R WITH CEDILLA */
- { 0x03a5, 0x0128 }, /* Itilde Ĩ LATIN CAPITAL LETTER I WITH TILDE */
- { 0x03a6, 0x013b }, /* Lcedilla Ļ LATIN CAPITAL LETTER L WITH CEDILLA */
- { 0x03aa, 0x0112 }, /* Emacron Ē LATIN CAPITAL LETTER E WITH MACRON */
- { 0x03ab, 0x0122 }, /* Gcedilla Ģ LATIN CAPITAL LETTER G WITH CEDILLA */
- { 0x03ac, 0x0166 }, /* Tslash Ŧ LATIN CAPITAL LETTER T WITH STROKE */
- { 0x03b3, 0x0157 }, /* rcedilla ŗ LATIN SMALL LETTER R WITH CEDILLA */
- { 0x03b5, 0x0129 }, /* itilde ĩ LATIN SMALL LETTER I WITH TILDE */
- { 0x03b6, 0x013c }, /* lcedilla ļ LATIN SMALL LETTER L WITH CEDILLA */
- { 0x03ba, 0x0113 }, /* emacron ē LATIN SMALL LETTER E WITH MACRON */
- { 0x03bb, 0x0123 }, /* gcedilla ģ LATIN SMALL LETTER G WITH CEDILLA */
- { 0x03bc, 0x0167 }, /* tslash ŧ LATIN SMALL LETTER T WITH STROKE */
- { 0x03bd, 0x014a }, /* ENG Ŋ LATIN CAPITAL LETTER ENG */
- { 0x03bf, 0x014b }, /* eng ŋ LATIN SMALL LETTER ENG */
- { 0x03c0, 0x0100 }, /* Amacron Ā LATIN CAPITAL LETTER A WITH MACRON */
- { 0x03c7, 0x012e }, /* Iogonek Į LATIN CAPITAL LETTER I WITH OGONEK */
- { 0x03cc, 0x0116 }, /* Eabovedot Ė LATIN CAPITAL LETTER E WITH DOT ABOVE */
- { 0x03cf, 0x012a }, /* Imacron Ī LATIN CAPITAL LETTER I WITH MACRON */
- { 0x03d1, 0x0145 }, /* Ncedilla Ņ LATIN CAPITAL LETTER N WITH CEDILLA */
- { 0x03d2, 0x014c }, /* Omacron Ō LATIN CAPITAL LETTER O WITH MACRON */
- { 0x03d3, 0x0136 }, /* Kcedilla Ķ LATIN CAPITAL LETTER K WITH CEDILLA */
- { 0x03d9, 0x0172 }, /* Uogonek Ų LATIN CAPITAL LETTER U WITH OGONEK */
- { 0x03dd, 0x0168 }, /* Utilde Ũ LATIN CAPITAL LETTER U WITH TILDE */
- { 0x03de, 0x016a }, /* Umacron Ū LATIN CAPITAL LETTER U WITH MACRON */
- { 0x03e0, 0x0101 }, /* amacron ā LATIN SMALL LETTER A WITH MACRON */
- { 0x03e7, 0x012f }, /* iogonek į LATIN SMALL LETTER I WITH OGONEK */
- { 0x03ec, 0x0117 }, /* eabovedot ė LATIN SMALL LETTER E WITH DOT ABOVE */
- { 0x03ef, 0x012b }, /* imacron ī LATIN SMALL LETTER I WITH MACRON */
- { 0x03f1, 0x0146 }, /* ncedilla ņ LATIN SMALL LETTER N WITH CEDILLA */
- { 0x03f2, 0x014d }, /* omacron ō LATIN SMALL LETTER O WITH MACRON */
- { 0x03f3, 0x0137 }, /* kcedilla ķ LATIN SMALL LETTER K WITH CEDILLA */
- { 0x03f9, 0x0173 }, /* uogonek ų LATIN SMALL LETTER U WITH OGONEK */
- { 0x03fd, 0x0169 }, /* utilde ũ LATIN SMALL LETTER U WITH TILDE */
- { 0x03fe, 0x016b }, /* umacron ū LATIN SMALL LETTER U WITH MACRON */
- { 0x047e, 0x203e }, /* overline ‾ OVERLINE */
- { 0x04a1, 0x3002 }, /* kana_fullstop 。 IDEOGRAPHIC FULL STOP */
- { 0x04a2, 0x300c }, /* kana_openingbracket 「 LEFT CORNER BRACKET */
- { 0x04a3, 0x300d }, /* kana_closingbracket 」 RIGHT CORNER BRACKET */
- { 0x04a4, 0x3001 }, /* kana_comma 、 IDEOGRAPHIC COMMA */
- { 0x04a5, 0x30fb }, /* kana_conjunctive ・ KATAKANA MIDDLE DOT */
- { 0x04a6, 0x30f2 }, /* kana_WO ヲ KATAKANA LETTER WO */
- { 0x04a7, 0x30a1 }, /* kana_a ァ KATAKANA LETTER SMALL A */
- { 0x04a8, 0x30a3 }, /* kana_i ィ KATAKANA LETTER SMALL I */
- { 0x04a9, 0x30a5 }, /* kana_u ゥ KATAKANA LETTER SMALL U */
- { 0x04aa, 0x30a7 }, /* kana_e ェ KATAKANA LETTER SMALL E */
- { 0x04ab, 0x30a9 }, /* kana_o ォ KATAKANA LETTER SMALL O */
- { 0x04ac, 0x30e3 }, /* kana_ya ャ KATAKANA LETTER SMALL YA */
- { 0x04ad, 0x30e5 }, /* kana_yu ュ KATAKANA LETTER SMALL YU */
- { 0x04ae, 0x30e7 }, /* kana_yo ョ KATAKANA LETTER SMALL YO */
- { 0x04af, 0x30c3 }, /* kana_tsu ッ KATAKANA LETTER SMALL TU */
- { 0x04b0, 0x30fc }, /* prolongedsound ー KATAKANA-HIRAGANA PROLONGED SOUND MARK */
- { 0x04b1, 0x30a2 }, /* kana_A ア KATAKANA LETTER A */
- { 0x04b2, 0x30a4 }, /* kana_I イ KATAKANA LETTER I */
- { 0x04b3, 0x30a6 }, /* kana_U ウ KATAKANA LETTER U */
- { 0x04b4, 0x30a8 }, /* kana_E エ KATAKANA LETTER E */
- { 0x04b5, 0x30aa }, /* kana_O オ KATAKANA LETTER O */
- { 0x04b6, 0x30ab }, /* kana_KA カ KATAKANA LETTER KA */
- { 0x04b7, 0x30ad }, /* kana_KI キ KATAKANA LETTER KI */
- { 0x04b8, 0x30af }, /* kana_KU ク KATAKANA LETTER KU */
- { 0x04b9, 0x30b1 }, /* kana_KE ケ KATAKANA LETTER KE */
- { 0x04ba, 0x30b3 }, /* kana_KO コ KATAKANA LETTER KO */
- { 0x04bb, 0x30b5 }, /* kana_SA サ KATAKANA LETTER SA */
- { 0x04bc, 0x30b7 }, /* kana_SHI シ KATAKANA LETTER SI */
- { 0x04bd, 0x30b9 }, /* kana_SU ス KATAKANA LETTER SU */
- { 0x04be, 0x30bb }, /* kana_SE セ KATAKANA LETTER SE */
- { 0x04bf, 0x30bd }, /* kana_SO ソ KATAKANA LETTER SO */
- { 0x04c0, 0x30bf }, /* kana_TA タ KATAKANA LETTER TA */
- { 0x04c1, 0x30c1 }, /* kana_CHI チ KATAKANA LETTER TI */
- { 0x04c2, 0x30c4 }, /* kana_TSU ツ KATAKANA LETTER TU */
- { 0x04c3, 0x30c6 }, /* kana_TE テ KATAKANA LETTER TE */
- { 0x04c4, 0x30c8 }, /* kana_TO ト KATAKANA LETTER TO */
- { 0x04c5, 0x30ca }, /* kana_NA ナ KATAKANA LETTER NA */
- { 0x04c6, 0x30cb }, /* kana_NI ニ KATAKANA LETTER NI */
- { 0x04c7, 0x30cc }, /* kana_NU ヌ KATAKANA LETTER NU */
- { 0x04c8, 0x30cd }, /* kana_NE ネ KATAKANA LETTER NE */
- { 0x04c9, 0x30ce }, /* kana_NO ノ KATAKANA LETTER NO */
- { 0x04ca, 0x30cf }, /* kana_HA ハ KATAKANA LETTER HA */
- { 0x04cb, 0x30d2 }, /* kana_HI ヒ KATAKANA LETTER HI */
- { 0x04cc, 0x30d5 }, /* kana_FU フ KATAKANA LETTER HU */
- { 0x04cd, 0x30d8 }, /* kana_HE ヘ KATAKANA LETTER HE */
- { 0x04ce, 0x30db }, /* kana_HO ホ KATAKANA LETTER HO */
- { 0x04cf, 0x30de }, /* kana_MA マ KATAKANA LETTER MA */
- { 0x04d0, 0x30df }, /* kana_MI ミ KATAKANA LETTER MI */
- { 0x04d1, 0x30e0 }, /* kana_MU ム KATAKANA LETTER MU */
- { 0x04d2, 0x30e1 }, /* kana_ME メ KATAKANA LETTER ME */
- { 0x04d3, 0x30e2 }, /* kana_MO モ KATAKANA LETTER MO */
- { 0x04d4, 0x30e4 }, /* kana_YA ヤ KATAKANA LETTER YA */
- { 0x04d5, 0x30e6 }, /* kana_YU ユ KATAKANA LETTER YU */
- { 0x04d6, 0x30e8 }, /* kana_YO ヨ KATAKANA LETTER YO */
- { 0x04d7, 0x30e9 }, /* kana_RA ラ KATAKANA LETTER RA */
- { 0x04d8, 0x30ea }, /* kana_RI リ KATAKANA LETTER RI */
- { 0x04d9, 0x30eb }, /* kana_RU ル KATAKANA LETTER RU */
- { 0x04da, 0x30ec }, /* kana_RE レ KATAKANA LETTER RE */
- { 0x04db, 0x30ed }, /* kana_RO ロ KATAKANA LETTER RO */
- { 0x04dc, 0x30ef }, /* kana_WA ワ KATAKANA LETTER WA */
- { 0x04dd, 0x30f3 }, /* kana_N ン KATAKANA LETTER N */
- { 0x04de, 0x309b }, /* voicedsound ゛ KATAKANA-HIRAGANA VOICED SOUND MARK */
- { 0x04df, 0x309c }, /* semivoicedsound ゜ KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK */
- { 0x05ac, 0x060c }, /* Arabic_comma ، ARABIC COMMA */
- { 0x05bb, 0x061b }, /* Arabic_semicolon ؛ ARABIC SEMICOLON */
- { 0x05bf, 0x061f }, /* Arabic_question_mark ؟ ARABIC QUESTION MARK */
- { 0x05c1, 0x0621 }, /* Arabic_hamza ء ARABIC LETTER HAMZA */
- { 0x05c2, 0x0622 }, /* Arabic_maddaonalef آ ARABIC LETTER ALEF WITH MADDA ABOVE */
- { 0x05c3, 0x0623 }, /* Arabic_hamzaonalef أ ARABIC LETTER ALEF WITH HAMZA ABOVE */
- { 0x05c4, 0x0624 }, /* Arabic_hamzaonwaw ؤ ARABIC LETTER WAW WITH HAMZA ABOVE */
- { 0x05c5, 0x0625 }, /* Arabic_hamzaunderalef إ ARABIC LETTER ALEF WITH HAMZA BELOW */
- { 0x05c6, 0x0626 }, /* Arabic_hamzaonyeh ئ ARABIC LETTER YEH WITH HAMZA ABOVE */
- { 0x05c7, 0x0627 }, /* Arabic_alef ا ARABIC LETTER ALEF */
- { 0x05c8, 0x0628 }, /* Arabic_beh ب ARABIC LETTER BEH */
- { 0x05c9, 0x0629 }, /* Arabic_tehmarbuta ة ARABIC LETTER TEH MARBUTA */
- { 0x05ca, 0x062a }, /* Arabic_teh ت ARABIC LETTER TEH */
- { 0x05cb, 0x062b }, /* Arabic_theh ث ARABIC LETTER THEH */
- { 0x05cc, 0x062c }, /* Arabic_jeem ج ARABIC LETTER JEEM */
- { 0x05cd, 0x062d }, /* Arabic_hah ح ARABIC LETTER HAH */
- { 0x05ce, 0x062e }, /* Arabic_khah خ ARABIC LETTER KHAH */
- { 0x05cf, 0x062f }, /* Arabic_dal د ARABIC LETTER DAL */
- { 0x05d0, 0x0630 }, /* Arabic_thal ذ ARABIC LETTER THAL */
- { 0x05d1, 0x0631 }, /* Arabic_ra ر ARABIC LETTER REH */
- { 0x05d2, 0x0632 }, /* Arabic_zain ز ARABIC LETTER ZAIN */
- { 0x05d3, 0x0633 }, /* Arabic_seen س ARABIC LETTER SEEN */
- { 0x05d4, 0x0634 }, /* Arabic_sheen ش ARABIC LETTER SHEEN */
- { 0x05d5, 0x0635 }, /* Arabic_sad ص ARABIC LETTER SAD */
- { 0x05d6, 0x0636 }, /* Arabic_dad ض ARABIC LETTER DAD */
- { 0x05d7, 0x0637 }, /* Arabic_tah ط ARABIC LETTER TAH */
- { 0x05d8, 0x0638 }, /* Arabic_zah ظ ARABIC LETTER ZAH */
- { 0x05d9, 0x0639 }, /* Arabic_ain ع ARABIC LETTER AIN */
- { 0x05da, 0x063a }, /* Arabic_ghain غ ARABIC LETTER GHAIN */
- { 0x05e0, 0x0640 }, /* Arabic_tatweel ـ ARABIC TATWEEL */
- { 0x05e1, 0x0641 }, /* Arabic_feh ف ARABIC LETTER FEH */
- { 0x05e2, 0x0642 }, /* Arabic_qaf ق ARABIC LETTER QAF */
- { 0x05e3, 0x0643 }, /* Arabic_kaf ك ARABIC LETTER KAF */
- { 0x05e4, 0x0644 }, /* Arabic_lam ل ARABIC LETTER LAM */
- { 0x05e5, 0x0645 }, /* Arabic_meem م ARABIC LETTER MEEM */
- { 0x05e6, 0x0646 }, /* Arabic_noon ن ARABIC LETTER NOON */
- { 0x05e7, 0x0647 }, /* Arabic_ha ه ARABIC LETTER HEH */
- { 0x05e8, 0x0648 }, /* Arabic_waw و ARABIC LETTER WAW */
- { 0x05e9, 0x0649 }, /* Arabic_alefmaksura ى ARABIC LETTER ALEF MAKSURA */
- { 0x05ea, 0x064a }, /* Arabic_yeh ي ARABIC LETTER YEH */
- { 0x05eb, 0x064b }, /* Arabic_fathatan ً ARABIC FATHATAN */
- { 0x05ec, 0x064c }, /* Arabic_dammatan ٌ ARABIC DAMMATAN */
- { 0x05ed, 0x064d }, /* Arabic_kasratan ٍ ARABIC KASRATAN */
- { 0x05ee, 0x064e }, /* Arabic_fatha َ ARABIC FATHA */
- { 0x05ef, 0x064f }, /* Arabic_damma ُ ARABIC DAMMA */
- { 0x05f0, 0x0650 }, /* Arabic_kasra ِ ARABIC KASRA */
- { 0x05f1, 0x0651 }, /* Arabic_shadda ّ ARABIC SHADDA */
- { 0x05f2, 0x0652 }, /* Arabic_sukun ْ ARABIC SUKUN */
- { 0x06a1, 0x0452 }, /* Serbian_dje ђ CYRILLIC SMALL LETTER DJE */
- { 0x06a2, 0x0453 }, /* Macedonia_gje ѓ CYRILLIC SMALL LETTER GJE */
- { 0x06a3, 0x0451 }, /* Cyrillic_io ё CYRILLIC SMALL LETTER IO */
- { 0x06a4, 0x0454 }, /* Ukrainian_ie є CYRILLIC SMALL LETTER UKRAINIAN IE */
- { 0x06a5, 0x0455 }, /* Macedonia_dse ѕ CYRILLIC SMALL LETTER DZE */
- { 0x06a6, 0x0456 }, /* Ukrainian_i і CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I */
- { 0x06a7, 0x0457 }, /* Ukrainian_yi ї CYRILLIC SMALL LETTER YI */
- { 0x06a8, 0x0458 }, /* Cyrillic_je ј CYRILLIC SMALL LETTER JE */
- { 0x06a9, 0x0459 }, /* Cyrillic_lje љ CYRILLIC SMALL LETTER LJE */
- { 0x06aa, 0x045a }, /* Cyrillic_nje њ CYRILLIC SMALL LETTER NJE */
- { 0x06ab, 0x045b }, /* Serbian_tshe ћ CYRILLIC SMALL LETTER TSHE */
- { 0x06ac, 0x045c }, /* Macedonia_kje ќ CYRILLIC SMALL LETTER KJE */
- { 0x06ae, 0x045e }, /* Byelorussian_shortu ў CYRILLIC SMALL LETTER SHORT U */
- { 0x06af, 0x045f }, /* Cyrillic_dzhe џ CYRILLIC SMALL LETTER DZHE */
- { 0x06b0, 0x2116 }, /* numerosign № NUMERO SIGN */
- { 0x06b1, 0x0402 }, /* Serbian_DJE Ђ CYRILLIC CAPITAL LETTER DJE */
- { 0x06b2, 0x0403 }, /* Macedonia_GJE Ѓ CYRILLIC CAPITAL LETTER GJE */
- { 0x06b3, 0x0401 }, /* Cyrillic_IO Ё CYRILLIC CAPITAL LETTER IO */
- { 0x06b4, 0x0404 }, /* Ukrainian_IE Є CYRILLIC CAPITAL LETTER UKRAINIAN IE */
- { 0x06b5, 0x0405 }, /* Macedonia_DSE Ѕ CYRILLIC CAPITAL LETTER DZE */
- { 0x06b6, 0x0406 }, /* Ukrainian_I І CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I */
- { 0x06b7, 0x0407 }, /* Ukrainian_YI Ї CYRILLIC CAPITAL LETTER YI */
- { 0x06b8, 0x0408 }, /* Cyrillic_JE Ј CYRILLIC CAPITAL LETTER JE */
- { 0x06b9, 0x0409 }, /* Cyrillic_LJE Љ CYRILLIC CAPITAL LETTER LJE */
- { 0x06ba, 0x040a }, /* Cyrillic_NJE Њ CYRILLIC CAPITAL LETTER NJE */
- { 0x06bb, 0x040b }, /* Serbian_TSHE Ћ CYRILLIC CAPITAL LETTER TSHE */
- { 0x06bc, 0x040c }, /* Macedonia_KJE Ќ CYRILLIC CAPITAL LETTER KJE */
- { 0x06be, 0x040e }, /* Byelorussian_SHORTU Ў CYRILLIC CAPITAL LETTER SHORT U */
- { 0x06bf, 0x040f }, /* Cyrillic_DZHE Џ CYRILLIC CAPITAL LETTER DZHE */
- { 0x06c0, 0x044e }, /* Cyrillic_yu ю CYRILLIC SMALL LETTER YU */
- { 0x06c1, 0x0430 }, /* Cyrillic_a а CYRILLIC SMALL LETTER A */
- { 0x06c2, 0x0431 }, /* Cyrillic_be б CYRILLIC SMALL LETTER BE */
- { 0x06c3, 0x0446 }, /* Cyrillic_tse ц CYRILLIC SMALL LETTER TSE */
- { 0x06c4, 0x0434 }, /* Cyrillic_de д CYRILLIC SMALL LETTER DE */
- { 0x06c5, 0x0435 }, /* Cyrillic_ie е CYRILLIC SMALL LETTER IE */
- { 0x06c6, 0x0444 }, /* Cyrillic_ef ф CYRILLIC SMALL LETTER EF */
- { 0x06c7, 0x0433 }, /* Cyrillic_ghe г CYRILLIC SMALL LETTER GHE */
- { 0x06c8, 0x0445 }, /* Cyrillic_ha х CYRILLIC SMALL LETTER HA */
- { 0x06c9, 0x0438 }, /* Cyrillic_i и CYRILLIC SMALL LETTER I */
- { 0x06ca, 0x0439 }, /* Cyrillic_shorti й CYRILLIC SMALL LETTER SHORT I */
- { 0x06cb, 0x043a }, /* Cyrillic_ka к CYRILLIC SMALL LETTER KA */
- { 0x06cc, 0x043b }, /* Cyrillic_el л CYRILLIC SMALL LETTER EL */
- { 0x06cd, 0x043c }, /* Cyrillic_em м CYRILLIC SMALL LETTER EM */
- { 0x06ce, 0x043d }, /* Cyrillic_en н CYRILLIC SMALL LETTER EN */
- { 0x06cf, 0x043e }, /* Cyrillic_o о CYRILLIC SMALL LETTER O */
- { 0x06d0, 0x043f }, /* Cyrillic_pe п CYRILLIC SMALL LETTER PE */
- { 0x06d1, 0x044f }, /* Cyrillic_ya я CYRILLIC SMALL LETTER YA */
- { 0x06d2, 0x0440 }, /* Cyrillic_er р CYRILLIC SMALL LETTER ER */
- { 0x06d3, 0x0441 }, /* Cyrillic_es с CYRILLIC SMALL LETTER ES */
- { 0x06d4, 0x0442 }, /* Cyrillic_te т CYRILLIC SMALL LETTER TE */
- { 0x06d5, 0x0443 }, /* Cyrillic_u у CYRILLIC SMALL LETTER U */
- { 0x06d6, 0x0436 }, /* Cyrillic_zhe ж CYRILLIC SMALL LETTER ZHE */
- { 0x06d7, 0x0432 }, /* Cyrillic_ve в CYRILLIC SMALL LETTER VE */
- { 0x06d8, 0x044c }, /* Cyrillic_softsign ь CYRILLIC SMALL LETTER SOFT SIGN */
- { 0x06d9, 0x044b }, /* Cyrillic_yeru ы CYRILLIC SMALL LETTER YERU */
- { 0x06da, 0x0437 }, /* Cyrillic_ze з CYRILLIC SMALL LETTER ZE */
- { 0x06db, 0x0448 }, /* Cyrillic_sha ш CYRILLIC SMALL LETTER SHA */
- { 0x06dc, 0x044d }, /* Cyrillic_e э CYRILLIC SMALL LETTER E */
- { 0x06dd, 0x0449 }, /* Cyrillic_shcha щ CYRILLIC SMALL LETTER SHCHA */
- { 0x06de, 0x0447 }, /* Cyrillic_che ч CYRILLIC SMALL LETTER CHE */
- { 0x06df, 0x044a }, /* Cyrillic_hardsign ъ CYRILLIC SMALL LETTER HARD SIGN */
- { 0x06e0, 0x042e }, /* Cyrillic_YU Ю CYRILLIC CAPITAL LETTER YU */
- { 0x06e1, 0x0410 }, /* Cyrillic_A А CYRILLIC CAPITAL LETTER A */
- { 0x06e2, 0x0411 }, /* Cyrillic_BE Б CYRILLIC CAPITAL LETTER BE */
- { 0x06e3, 0x0426 }, /* Cyrillic_TSE Ц CYRILLIC CAPITAL LETTER TSE */
- { 0x06e4, 0x0414 }, /* Cyrillic_DE Д CYRILLIC CAPITAL LETTER DE */
- { 0x06e5, 0x0415 }, /* Cyrillic_IE Е CYRILLIC CAPITAL LETTER IE */
- { 0x06e6, 0x0424 }, /* Cyrillic_EF Ф CYRILLIC CAPITAL LETTER EF */
- { 0x06e7, 0x0413 }, /* Cyrillic_GHE Г CYRILLIC CAPITAL LETTER GHE */
- { 0x06e8, 0x0425 }, /* Cyrillic_HA Х CYRILLIC CAPITAL LETTER HA */
- { 0x06e9, 0x0418 }, /* Cyrillic_I И CYRILLIC CAPITAL LETTER I */
- { 0x06ea, 0x0419 }, /* Cyrillic_SHORTI Й CYRILLIC CAPITAL LETTER SHORT I */
- { 0x06eb, 0x041a }, /* Cyrillic_KA К CYRILLIC CAPITAL LETTER KA */
- { 0x06ec, 0x041b }, /* Cyrillic_EL Л CYRILLIC CAPITAL LETTER EL */
- { 0x06ed, 0x041c }, /* Cyrillic_EM М CYRILLIC CAPITAL LETTER EM */
- { 0x06ee, 0x041d }, /* Cyrillic_EN Н CYRILLIC CAPITAL LETTER EN */
- { 0x06ef, 0x041e }, /* Cyrillic_O О CYRILLIC CAPITAL LETTER O */
- { 0x06f0, 0x041f }, /* Cyrillic_PE П CYRILLIC CAPITAL LETTER PE */
- { 0x06f1, 0x042f }, /* Cyrillic_YA Я CYRILLIC CAPITAL LETTER YA */
- { 0x06f2, 0x0420 }, /* Cyrillic_ER Р CYRILLIC CAPITAL LETTER ER */
- { 0x06f3, 0x0421 }, /* Cyrillic_ES С CYRILLIC CAPITAL LETTER ES */
- { 0x06f4, 0x0422 }, /* Cyrillic_TE Т CYRILLIC CAPITAL LETTER TE */
- { 0x06f5, 0x0423 }, /* Cyrillic_U У CYRILLIC CAPITAL LETTER U */
- { 0x06f6, 0x0416 }, /* Cyrillic_ZHE Ж CYRILLIC CAPITAL LETTER ZHE */
- { 0x06f7, 0x0412 }, /* Cyrillic_VE В CYRILLIC CAPITAL LETTER VE */
- { 0x06f8, 0x042c }, /* Cyrillic_SOFTSIGN Ь CYRILLIC CAPITAL LETTER SOFT SIGN */
- { 0x06f9, 0x042b }, /* Cyrillic_YERU Ы CYRILLIC CAPITAL LETTER YERU */
- { 0x06fa, 0x0417 }, /* Cyrillic_ZE З CYRILLIC CAPITAL LETTER ZE */
- { 0x06fb, 0x0428 }, /* Cyrillic_SHA Ш CYRILLIC CAPITAL LETTER SHA */
- { 0x06fc, 0x042d }, /* Cyrillic_E Э CYRILLIC CAPITAL LETTER E */
- { 0x06fd, 0x0429 }, /* Cyrillic_SHCHA Щ CYRILLIC CAPITAL LETTER SHCHA */
- { 0x06fe, 0x0427 }, /* Cyrillic_CHE Ч CYRILLIC CAPITAL LETTER CHE */
- { 0x06ff, 0x042a }, /* Cyrillic_HARDSIGN Ъ CYRILLIC CAPITAL LETTER HARD SIGN */
- { 0x07a1, 0x0386 }, /* Greek_ALPHAaccent Ά GREEK CAPITAL LETTER ALPHA WITH TONOS */
- { 0x07a2, 0x0388 }, /* Greek_EPSILONaccent Έ GREEK CAPITAL LETTER EPSILON WITH TONOS */
- { 0x07a3, 0x0389 }, /* Greek_ETAaccent Ή GREEK CAPITAL LETTER ETA WITH TONOS */
- { 0x07a4, 0x038a }, /* Greek_IOTAaccent Ί GREEK CAPITAL LETTER IOTA WITH TONOS */
- { 0x07a5, 0x03aa }, /* Greek_IOTAdiaeresis Ϊ GREEK CAPITAL LETTER IOTA WITH DIALYTIKA */
- { 0x07a7, 0x038c }, /* Greek_OMICRONaccent Ό GREEK CAPITAL LETTER OMICRON WITH TONOS */
- { 0x07a8, 0x038e }, /* Greek_UPSILONaccent Ύ GREEK CAPITAL LETTER UPSILON WITH TONOS */
- { 0x07a9, 0x03ab }, /* Greek_UPSILONdieresis Ϋ GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA */
- { 0x07ab, 0x038f }, /* Greek_OMEGAaccent Ώ GREEK CAPITAL LETTER OMEGA WITH TONOS */
- { 0x07ae, 0x0385 }, /* Greek_accentdieresis ΅ GREEK DIALYTIKA TONOS */
- { 0x07af, 0x2015 }, /* Greek_horizbar ― HORIZONTAL BAR */
- { 0x07b1, 0x03ac }, /* Greek_alphaaccent ά GREEK SMALL LETTER ALPHA WITH TONOS */
- { 0x07b2, 0x03ad }, /* Greek_epsilonaccent έ GREEK SMALL LETTER EPSILON WITH TONOS */
- { 0x07b3, 0x03ae }, /* Greek_etaaccent ή GREEK SMALL LETTER ETA WITH TONOS */
- { 0x07b4, 0x03af }, /* Greek_iotaaccent ί GREEK SMALL LETTER IOTA WITH TONOS */
- { 0x07b5, 0x03ca }, /* Greek_iotadieresis ϊ GREEK SMALL LETTER IOTA WITH DIALYTIKA */
- { 0x07b6, 0x0390 }, /* Greek_iotaaccentdieresis ΐ GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS */
- { 0x07b7, 0x03cc }, /* Greek_omicronaccent ό GREEK SMALL LETTER OMICRON WITH TONOS */
- { 0x07b8, 0x03cd }, /* Greek_upsilonaccent ύ GREEK SMALL LETTER UPSILON WITH TONOS */
- { 0x07b9, 0x03cb }, /* Greek_upsilondieresis ϋ GREEK SMALL LETTER UPSILON WITH DIALYTIKA */
- { 0x07ba, 0x03b0 }, /* Greek_upsilonaccentdieresis ΰ GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS */
- { 0x07bb, 0x03ce }, /* Greek_omegaaccent ώ GREEK SMALL LETTER OMEGA WITH TONOS */
- { 0x07c1, 0x0391 }, /* Greek_ALPHA Α GREEK CAPITAL LETTER ALPHA */
- { 0x07c2, 0x0392 }, /* Greek_BETA Β GREEK CAPITAL LETTER BETA */
- { 0x07c3, 0x0393 }, /* Greek_GAMMA Γ GREEK CAPITAL LETTER GAMMA */
- { 0x07c4, 0x0394 }, /* Greek_DELTA Δ GREEK CAPITAL LETTER DELTA */
- { 0x07c5, 0x0395 }, /* Greek_EPSILON Ε GREEK CAPITAL LETTER EPSILON */
- { 0x07c6, 0x0396 }, /* Greek_ZETA Ζ GREEK CAPITAL LETTER ZETA */
- { 0x07c7, 0x0397 }, /* Greek_ETA Η GREEK CAPITAL LETTER ETA */
- { 0x07c8, 0x0398 }, /* Greek_THETA Θ GREEK CAPITAL LETTER THETA */
- { 0x07c9, 0x0399 }, /* Greek_IOTA Ι GREEK CAPITAL LETTER IOTA */
- { 0x07ca, 0x039a }, /* Greek_KAPPA Κ GREEK CAPITAL LETTER KAPPA */
- { 0x07cb, 0x039b }, /* Greek_LAMBDA Λ GREEK CAPITAL LETTER LAMDA */
- { 0x07cc, 0x039c }, /* Greek_MU Μ GREEK CAPITAL LETTER MU */
- { 0x07cd, 0x039d }, /* Greek_NU Ν GREEK CAPITAL LETTER NU */
- { 0x07ce, 0x039e }, /* Greek_XI Ξ GREEK CAPITAL LETTER XI */
- { 0x07cf, 0x039f }, /* Greek_OMICRON Ο GREEK CAPITAL LETTER OMICRON */
- { 0x07d0, 0x03a0 }, /* Greek_PI Π GREEK CAPITAL LETTER PI */
- { 0x07d1, 0x03a1 }, /* Greek_RHO Ρ GREEK CAPITAL LETTER RHO */
- { 0x07d2, 0x03a3 }, /* Greek_SIGMA Σ GREEK CAPITAL LETTER SIGMA */
- { 0x07d4, 0x03a4 }, /* Greek_TAU Τ GREEK CAPITAL LETTER TAU */
- { 0x07d5, 0x03a5 }, /* Greek_UPSILON Υ GREEK CAPITAL LETTER UPSILON */
- { 0x07d6, 0x03a6 }, /* Greek_PHI Φ GREEK CAPITAL LETTER PHI */
- { 0x07d7, 0x03a7 }, /* Greek_CHI Χ GREEK CAPITAL LETTER CHI */
- { 0x07d8, 0x03a8 }, /* Greek_PSI Ψ GREEK CAPITAL LETTER PSI */
- { 0x07d9, 0x03a9 }, /* Greek_OMEGA Ω GREEK CAPITAL LETTER OMEGA */
- { 0x07e1, 0x03b1 }, /* Greek_alpha α GREEK SMALL LETTER ALPHA */
- { 0x07e2, 0x03b2 }, /* Greek_beta β GREEK SMALL LETTER BETA */
- { 0x07e3, 0x03b3 }, /* Greek_gamma γ GREEK SMALL LETTER GAMMA */
- { 0x07e4, 0x03b4 }, /* Greek_delta δ GREEK SMALL LETTER DELTA */
- { 0x07e5, 0x03b5 }, /* Greek_epsilon ε GREEK SMALL LETTER EPSILON */
- { 0x07e6, 0x03b6 }, /* Greek_zeta ζ GREEK SMALL LETTER ZETA */
- { 0x07e7, 0x03b7 }, /* Greek_eta η GREEK SMALL LETTER ETA */
- { 0x07e8, 0x03b8 }, /* Greek_theta θ GREEK SMALL LETTER THETA */
- { 0x07e9, 0x03b9 }, /* Greek_iota ι GREEK SMALL LETTER IOTA */
- { 0x07ea, 0x03ba }, /* Greek_kappa κ GREEK SMALL LETTER KAPPA */
- { 0x07eb, 0x03bb }, /* Greek_lambda λ GREEK SMALL LETTER LAMDA */
- { 0x07ec, 0x03bc }, /* Greek_mu μ GREEK SMALL LETTER MU */
- { 0x07ed, 0x03bd }, /* Greek_nu ν GREEK SMALL LETTER NU */
- { 0x07ee, 0x03be }, /* Greek_xi ξ GREEK SMALL LETTER XI */
- { 0x07ef, 0x03bf }, /* Greek_omicron ο GREEK SMALL LETTER OMICRON */
- { 0x07f0, 0x03c0 }, /* Greek_pi π GREEK SMALL LETTER PI */
- { 0x07f1, 0x03c1 }, /* Greek_rho ρ GREEK SMALL LETTER RHO */
- { 0x07f2, 0x03c3 }, /* Greek_sigma σ GREEK SMALL LETTER SIGMA */
- { 0x07f3, 0x03c2 }, /* Greek_finalsmallsigma ς GREEK SMALL LETTER FINAL SIGMA */
- { 0x07f4, 0x03c4 }, /* Greek_tau τ GREEK SMALL LETTER TAU */
- { 0x07f5, 0x03c5 }, /* Greek_upsilon υ GREEK SMALL LETTER UPSILON */
- { 0x07f6, 0x03c6 }, /* Greek_phi φ GREEK SMALL LETTER PHI */
- { 0x07f7, 0x03c7 }, /* Greek_chi χ GREEK SMALL LETTER CHI */
- { 0x07f8, 0x03c8 }, /* Greek_psi ψ GREEK SMALL LETTER PSI */
- { 0x07f9, 0x03c9 }, /* Greek_omega ω GREEK SMALL LETTER OMEGA */
- { 0x08a1, 0x23b7 }, /* leftradical ⎷ ??? */
- { 0x08a2, 0x250c }, /* topleftradical ┌ BOX DRAWINGS LIGHT DOWN AND RIGHT */
- { 0x08a3, 0x2500 }, /* horizconnector ─ BOX DRAWINGS LIGHT HORIZONTAL */
- { 0x08a4, 0x2320 }, /* topintegral ⌠ TOP HALF INTEGRAL */
- { 0x08a5, 0x2321 }, /* botintegral ⌡ BOTTOM HALF INTEGRAL */
- { 0x08a6, 0x2502 }, /* vertconnector │ BOX DRAWINGS LIGHT VERTICAL */
- { 0x08a7, 0x23a1 }, /* topleftsqbracket ⎡ ??? */
- { 0x08a8, 0x23a3 }, /* botleftsqbracket ⎣ ??? */
- { 0x08a9, 0x23a4 }, /* toprightsqbracket ⎤ ??? */
- { 0x08aa, 0x23a6 }, /* botrightsqbracket ⎦ ??? */
- { 0x08ab, 0x239b }, /* topleftparens ⎛ ??? */
- { 0x08ac, 0x239d }, /* botleftparens ⎝ ??? */
- { 0x08ad, 0x239e }, /* toprightparens ⎞ ??? */
- { 0x08ae, 0x23a0 }, /* botrightparens ⎠ ??? */
- { 0x08af, 0x23a8 }, /* leftmiddlecurlybrace ⎨ ??? */
- { 0x08b0, 0x23ac }, /* rightmiddlecurlybrace ⎬ ??? */
-/* 0x08b1 topleftsummation ? ??? */
-/* 0x08b2 botleftsummation ? ??? */
-/* 0x08b3 topvertsummationconnector ? ??? */
-/* 0x08b4 botvertsummationconnector ? ??? */
-/* 0x08b5 toprightsummation ? ??? */
-/* 0x08b6 botrightsummation ? ??? */
-/* 0x08b7 rightmiddlesummation ? ??? */
- { 0x08bc, 0x2264 }, /* lessthanequal ≤ LESS-THAN OR EQUAL TO */
- { 0x08bd, 0x2260 }, /* notequal ≠ NOT EQUAL TO */
- { 0x08be, 0x2265 }, /* greaterthanequal ≥ GREATER-THAN OR EQUAL TO */
- { 0x08bf, 0x222b }, /* integral ∫ INTEGRAL */
- { 0x08c0, 0x2234 }, /* therefore ∴ THEREFORE */
- { 0x08c1, 0x221d }, /* variation ∝ PROPORTIONAL TO */
- { 0x08c2, 0x221e }, /* infinity ∞ INFINITY */
- { 0x08c5, 0x2207 }, /* nabla ∇ NABLA */
- { 0x08c8, 0x223c }, /* approximate ∼ TILDE OPERATOR */
- { 0x08c9, 0x2243 }, /* similarequal ≃ ASYMPTOTICALLY EQUAL TO */
- { 0x08cd, 0x21d4 }, /* ifonlyif ⇔ LEFT RIGHT DOUBLE ARROW */
- { 0x08ce, 0x21d2 }, /* implies ⇒ RIGHTWARDS DOUBLE ARROW */
- { 0x08cf, 0x2261 }, /* identical ≡ IDENTICAL TO */
- { 0x08d6, 0x221a }, /* radical √ SQUARE ROOT */
- { 0x08da, 0x2282 }, /* includedin ⊂ SUBSET OF */
- { 0x08db, 0x2283 }, /* includes ⊃ SUPERSET OF */
- { 0x08dc, 0x2229 }, /* intersection ∩ INTERSECTION */
- { 0x08dd, 0x222a }, /* union ∪ UNION */
- { 0x08de, 0x2227 }, /* logicaland ∧ LOGICAL AND */
- { 0x08df, 0x2228 }, /* logicalor ∨ LOGICAL OR */
- { 0x08ef, 0x2202 }, /* partialderivative ∂ PARTIAL DIFFERENTIAL */
- { 0x08f6, 0x0192 }, /* function ƒ LATIN SMALL LETTER F WITH HOOK */
- { 0x08fb, 0x2190 }, /* leftarrow ← LEFTWARDS ARROW */
- { 0x08fc, 0x2191 }, /* uparrow ↑ UPWARDS ARROW */
- { 0x08fd, 0x2192 }, /* rightarrow → RIGHTWARDS ARROW */
- { 0x08fe, 0x2193 }, /* downarrow ↓ DOWNWARDS ARROW */
-/* 0x09df blank ? ??? */
- { 0x09e0, 0x25c6 }, /* soliddiamond ◆ BLACK DIAMOND */
- { 0x09e1, 0x2592 }, /* checkerboard ▒ MEDIUM SHADE */
- { 0x09e2, 0x2409 }, /* ht ␉ SYMBOL FOR HORIZONTAL TABULATION */
- { 0x09e3, 0x240c }, /* ff ␌ SYMBOL FOR FORM FEED */
- { 0x09e4, 0x240d }, /* cr ␍ SYMBOL FOR CARRIAGE RETURN */
- { 0x09e5, 0x240a }, /* lf ␊ SYMBOL FOR LINE FEED */
- { 0x09e8, 0x2424 }, /* nl  SYMBOL FOR NEWLINE */
- { 0x09e9, 0x240b }, /* vt ␋ SYMBOL FOR VERTICAL TABULATION */
- { 0x09ea, 0x2518 }, /* lowrightcorner ┘ BOX DRAWINGS LIGHT UP AND LEFT */
- { 0x09eb, 0x2510 }, /* uprightcorner ┐ BOX DRAWINGS LIGHT DOWN AND LEFT */
- { 0x09ec, 0x250c }, /* upleftcorner ┌ BOX DRAWINGS LIGHT DOWN AND RIGHT */
- { 0x09ed, 0x2514 }, /* lowleftcorner └ BOX DRAWINGS LIGHT UP AND RIGHT */
- { 0x09ee, 0x253c }, /* crossinglines ┼ BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL */
- { 0x09ef, 0x23ba }, /* horizlinescan1 ⎺ HORIZONTAL SCAN LINE-1 (Unicode 3.2 draft) */
- { 0x09f0, 0x23bb }, /* horizlinescan3 ⎻ HORIZONTAL SCAN LINE-3 (Unicode 3.2 draft) */
- { 0x09f1, 0x2500 }, /* horizlinescan5 ─ BOX DRAWINGS LIGHT HORIZONTAL */
- { 0x09f2, 0x23bc }, /* horizlinescan7 ⎼ HORIZONTAL SCAN LINE-7 (Unicode 3.2 draft) */
- { 0x09f3, 0x23bd }, /* horizlinescan9 ⎽ HORIZONTAL SCAN LINE-9 (Unicode 3.2 draft) */
- { 0x09f4, 0x251c }, /* leftt ├ BOX DRAWINGS LIGHT VERTICAL AND RIGHT */
- { 0x09f5, 0x2524 }, /* rightt ┤ BOX DRAWINGS LIGHT VERTICAL AND LEFT */
- { 0x09f6, 0x2534 }, /* bott ┴ BOX DRAWINGS LIGHT UP AND HORIZONTAL */
- { 0x09f7, 0x252c }, /* topt ┬ BOX DRAWINGS LIGHT DOWN AND HORIZONTAL */
- { 0x09f8, 0x2502 }, /* vertbar │ BOX DRAWINGS LIGHT VERTICAL */
- { 0x0aa1, 0x2003 }, /* emspace EM SPACE */
- { 0x0aa2, 0x2002 }, /* enspace EN SPACE */
- { 0x0aa3, 0x2004 }, /* em3space THREE-PER-EM SPACE */
- { 0x0aa4, 0x2005 }, /* em4space FOUR-PER-EM SPACE */
- { 0x0aa5, 0x2007 }, /* digitspace FIGURE SPACE */
- { 0x0aa6, 0x2008 }, /* punctspace PUNCTUATION SPACE */
- { 0x0aa7, 0x2009 }, /* thinspace THIN SPACE */
- { 0x0aa8, 0x200a }, /* hairspace HAIR SPACE */
- { 0x0aa9, 0x2014 }, /* emdash — EM DASH */
- { 0x0aaa, 0x2013 }, /* endash – EN DASH */
-/* 0x0aac signifblank ? ??? */
- { 0x0aae, 0x2026 }, /* ellipsis … HORIZONTAL ELLIPSIS */
- { 0x0aaf, 0x2025 }, /* doubbaselinedot ‥ TWO DOT LEADER */
- { 0x0ab0, 0x2153 }, /* onethird ⅓ VULGAR FRACTION ONE THIRD */
- { 0x0ab1, 0x2154 }, /* twothirds ⅔ VULGAR FRACTION TWO THIRDS */
- { 0x0ab2, 0x2155 }, /* onefifth ⅕ VULGAR FRACTION ONE FIFTH */
- { 0x0ab3, 0x2156 }, /* twofifths ⅖ VULGAR FRACTION TWO FIFTHS */
- { 0x0ab4, 0x2157 }, /* threefifths ⅗ VULGAR FRACTION THREE FIFTHS */
- { 0x0ab5, 0x2158 }, /* fourfifths ⅘ VULGAR FRACTION FOUR FIFTHS */
- { 0x0ab6, 0x2159 }, /* onesixth ⅙ VULGAR FRACTION ONE SIXTH */
- { 0x0ab7, 0x215a }, /* fivesixths ⅚ VULGAR FRACTION FIVE SIXTHS */
- { 0x0ab8, 0x2105 }, /* careof ℅ CARE OF */
- { 0x0abb, 0x2012 }, /* figdash ‒ FIGURE DASH */
- { 0x0abc, 0x2329 }, /* leftanglebracket 〈 LEFT-POINTING ANGLE BRACKET */
-/* 0x0abd decimalpoint ? ??? */
- { 0x0abe, 0x232a }, /* rightanglebracket 〉 RIGHT-POINTING ANGLE BRACKET */
-/* 0x0abf marker ? ??? */
- { 0x0ac3, 0x215b }, /* oneeighth ⅛ VULGAR FRACTION ONE EIGHTH */
- { 0x0ac4, 0x215c }, /* threeeighths ⅜ VULGAR FRACTION THREE EIGHTHS */
- { 0x0ac5, 0x215d }, /* fiveeighths ⅝ VULGAR FRACTION FIVE EIGHTHS */
- { 0x0ac6, 0x215e }, /* seveneighths ⅞ VULGAR FRACTION SEVEN EIGHTHS */
- { 0x0ac9, 0x2122 }, /* trademark ™ TRADE MARK SIGN */
- { 0x0aca, 0x2613 }, /* signaturemark ☓ SALTIRE */
-/* 0x0acb trademarkincircle ? ??? */
- { 0x0acc, 0x25c1 }, /* leftopentriangle ◁ WHITE LEFT-POINTING TRIANGLE */
- { 0x0acd, 0x25b7 }, /* rightopentriangle ▷ WHITE RIGHT-POINTING TRIANGLE */
- { 0x0ace, 0x25cb }, /* emopencircle ○ WHITE CIRCLE */
- { 0x0acf, 0x25af }, /* emopenrectangle ▯ WHITE VERTICAL RECTANGLE */
- { 0x0ad0, 0x2018 }, /* leftsinglequotemark ‘ LEFT SINGLE QUOTATION MARK */
- { 0x0ad1, 0x2019 }, /* rightsinglequotemark ’ RIGHT SINGLE QUOTATION MARK */
- { 0x0ad2, 0x201c }, /* leftdoublequotemark “ LEFT DOUBLE QUOTATION MARK */
- { 0x0ad3, 0x201d }, /* rightdoublequotemark ” RIGHT DOUBLE QUOTATION MARK */
- { 0x0ad4, 0x211e }, /* prescription ℞ PRESCRIPTION TAKE */
- { 0x0ad6, 0x2032 }, /* minutes ′ PRIME */
- { 0x0ad7, 0x2033 }, /* seconds ″ DOUBLE PRIME */
- { 0x0ad9, 0x271d }, /* latincross ✝ LATIN CROSS */
-/* 0x0ada hexagram ? ??? */
- { 0x0adb, 0x25ac }, /* filledrectbullet ▬ BLACK RECTANGLE */
- { 0x0adc, 0x25c0 }, /* filledlefttribullet ◀ BLACK LEFT-POINTING TRIANGLE */
- { 0x0add, 0x25b6 }, /* filledrighttribullet ▶ BLACK RIGHT-POINTING TRIANGLE */
- { 0x0ade, 0x25cf }, /* emfilledcircle ● BLACK CIRCLE */
- { 0x0adf, 0x25ae }, /* emfilledrect ▮ BLACK VERTICAL RECTANGLE */
- { 0x0ae0, 0x25e6 }, /* enopencircbullet ◦ WHITE BULLET */
- { 0x0ae1, 0x25ab }, /* enopensquarebullet ▫ WHITE SMALL SQUARE */
- { 0x0ae2, 0x25ad }, /* openrectbullet ▭ WHITE RECTANGLE */
- { 0x0ae3, 0x25b3 }, /* opentribulletup △ WHITE UP-POINTING TRIANGLE */
- { 0x0ae4, 0x25bd }, /* opentribulletdown ▽ WHITE DOWN-POINTING TRIANGLE */
- { 0x0ae5, 0x2606 }, /* openstar ☆ WHITE STAR */
- { 0x0ae6, 0x2022 }, /* enfilledcircbullet • BULLET */
- { 0x0ae7, 0x25aa }, /* enfilledsqbullet ▪ BLACK SMALL SQUARE */
- { 0x0ae8, 0x25b2 }, /* filledtribulletup ▲ BLACK UP-POINTING TRIANGLE */
- { 0x0ae9, 0x25bc }, /* filledtribulletdown ▼ BLACK DOWN-POINTING TRIANGLE */
- { 0x0aea, 0x261c }, /* leftpointer ☜ WHITE LEFT POINTING INDEX */
- { 0x0aeb, 0x261e }, /* rightpointer ☞ WHITE RIGHT POINTING INDEX */
- { 0x0aec, 0x2663 }, /* club ♣ BLACK CLUB SUIT */
- { 0x0aed, 0x2666 }, /* diamond ♦ BLACK DIAMOND SUIT */
- { 0x0aee, 0x2665 }, /* heart ♥ BLACK HEART SUIT */
- { 0x0af0, 0x2720 }, /* maltesecross ✠ MALTESE CROSS */
- { 0x0af1, 0x2020 }, /* dagger † DAGGER */
- { 0x0af2, 0x2021 }, /* doubledagger ‡ DOUBLE DAGGER */
- { 0x0af3, 0x2713 }, /* checkmark ✓ CHECK MARK */
- { 0x0af4, 0x2717 }, /* ballotcross ✗ BALLOT X */
- { 0x0af5, 0x266f }, /* musicalsharp ♯ MUSIC SHARP SIGN */
- { 0x0af6, 0x266d }, /* musicalflat ♭ MUSIC FLAT SIGN */
- { 0x0af7, 0x2642 }, /* malesymbol ♂ MALE SIGN */
- { 0x0af8, 0x2640 }, /* femalesymbol ♀ FEMALE SIGN */
- { 0x0af9, 0x260e }, /* telephone ☎ BLACK TELEPHONE */
- { 0x0afa, 0x2315 }, /* telephonerecorder ⌕ TELEPHONE RECORDER */
- { 0x0afb, 0x2117 }, /* phonographcopyright ℗ SOUND RECORDING COPYRIGHT */
- { 0x0afc, 0x2038 }, /* caret ‸ CARET */
- { 0x0afd, 0x201a }, /* singlelowquotemark ‚ SINGLE LOW-9 QUOTATION MARK */
- { 0x0afe, 0x201e }, /* doublelowquotemark „ DOUBLE LOW-9 QUOTATION MARK */
-/* 0x0aff cursor ? ??? */
- { 0x0ba3, 0x003c }, /* leftcaret < LESS-THAN SIGN */
- { 0x0ba6, 0x003e }, /* rightcaret > GREATER-THAN SIGN */
- { 0x0ba8, 0x2228 }, /* downcaret ∨ LOGICAL OR */
- { 0x0ba9, 0x2227 }, /* upcaret ∧ LOGICAL AND */
- { 0x0bc0, 0x00af }, /* overbar ¯ MACRON */
- { 0x0bc2, 0x22a5 }, /* downtack ⊥ UP TACK */
- { 0x0bc3, 0x2229 }, /* upshoe ∩ INTERSECTION */
- { 0x0bc4, 0x230a }, /* downstile ⌊ LEFT FLOOR */
- { 0x0bc6, 0x005f }, /* underbar _ LOW LINE */
- { 0x0bca, 0x2218 }, /* jot ∘ RING OPERATOR */
- { 0x0bcc, 0x2395 }, /* quad ⎕ APL FUNCTIONAL SYMBOL QUAD */
- { 0x0bce, 0x22a4 }, /* uptack ⊤ DOWN TACK */
- { 0x0bcf, 0x25cb }, /* circle ○ WHITE CIRCLE */
- { 0x0bd3, 0x2308 }, /* upstile ⌈ LEFT CEILING */
- { 0x0bd6, 0x222a }, /* downshoe ∪ UNION */
- { 0x0bd8, 0x2283 }, /* rightshoe ⊃ SUPERSET OF */
- { 0x0bda, 0x2282 }, /* leftshoe ⊂ SUBSET OF */
- { 0x0bdc, 0x22a2 }, /* lefttack ⊢ RIGHT TACK */
- { 0x0bfc, 0x22a3 }, /* righttack ⊣ LEFT TACK */
- { 0x0cdf, 0x2017 }, /* hebrew_doublelowline ‗ DOUBLE LOW LINE */
- { 0x0ce0, 0x05d0 }, /* hebrew_aleph א HEBREW LETTER ALEF */
- { 0x0ce1, 0x05d1 }, /* hebrew_bet ב HEBREW LETTER BET */
- { 0x0ce2, 0x05d2 }, /* hebrew_gimel ג HEBREW LETTER GIMEL */
- { 0x0ce3, 0x05d3 }, /* hebrew_dalet ד HEBREW LETTER DALET */
- { 0x0ce4, 0x05d4 }, /* hebrew_he ה HEBREW LETTER HE */
- { 0x0ce5, 0x05d5 }, /* hebrew_waw ו HEBREW LETTER VAV */
- { 0x0ce6, 0x05d6 }, /* hebrew_zain ז HEBREW LETTER ZAYIN */
- { 0x0ce7, 0x05d7 }, /* hebrew_chet ח HEBREW LETTER HET */
- { 0x0ce8, 0x05d8 }, /* hebrew_tet ט HEBREW LETTER TET */
- { 0x0ce9, 0x05d9 }, /* hebrew_yod י HEBREW LETTER YOD */
- { 0x0cea, 0x05da }, /* hebrew_finalkaph ך HEBREW LETTER FINAL KAF */
- { 0x0ceb, 0x05db }, /* hebrew_kaph כ HEBREW LETTER KAF */
- { 0x0cec, 0x05dc }, /* hebrew_lamed ל HEBREW LETTER LAMED */
- { 0x0ced, 0x05dd }, /* hebrew_finalmem ם HEBREW LETTER FINAL MEM */
- { 0x0cee, 0x05de }, /* hebrew_mem מ HEBREW LETTER MEM */
- { 0x0cef, 0x05df }, /* hebrew_finalnun ן HEBREW LETTER FINAL NUN */
- { 0x0cf0, 0x05e0 }, /* hebrew_nun נ HEBREW LETTER NUN */
- { 0x0cf1, 0x05e1 }, /* hebrew_samech ס HEBREW LETTER SAMEKH */
- { 0x0cf2, 0x05e2 }, /* hebrew_ayin ע HEBREW LETTER AYIN */
- { 0x0cf3, 0x05e3 }, /* hebrew_finalpe ף HEBREW LETTER FINAL PE */
- { 0x0cf4, 0x05e4 }, /* hebrew_pe פ HEBREW LETTER PE */
- { 0x0cf5, 0x05e5 }, /* hebrew_finalzade ץ HEBREW LETTER FINAL TSADI */
- { 0x0cf6, 0x05e6 }, /* hebrew_zade צ HEBREW LETTER TSADI */
- { 0x0cf7, 0x05e7 }, /* hebrew_qoph ק HEBREW LETTER QOF */
- { 0x0cf8, 0x05e8 }, /* hebrew_resh ר HEBREW LETTER RESH */
- { 0x0cf9, 0x05e9 }, /* hebrew_shin ש HEBREW LETTER SHIN */
- { 0x0cfa, 0x05ea }, /* hebrew_taw ת HEBREW LETTER TAV */
- { 0x0da1, 0x0e01 }, /* Thai_kokai ก THAI CHARACTER KO KAI */
- { 0x0da2, 0x0e02 }, /* Thai_khokhai ข THAI CHARACTER KHO KHAI */
- { 0x0da3, 0x0e03 }, /* Thai_khokhuat ฃ THAI CHARACTER KHO KHUAT */
- { 0x0da4, 0x0e04 }, /* Thai_khokhwai ค THAI CHARACTER KHO KHWAI */
- { 0x0da5, 0x0e05 }, /* Thai_khokhon ฅ THAI CHARACTER KHO KHON */
- { 0x0da6, 0x0e06 }, /* Thai_khorakhang ฆ THAI CHARACTER KHO RAKHANG */
- { 0x0da7, 0x0e07 }, /* Thai_ngongu ง THAI CHARACTER NGO NGU */
- { 0x0da8, 0x0e08 }, /* Thai_chochan จ THAI CHARACTER CHO CHAN */
- { 0x0da9, 0x0e09 }, /* Thai_choching ฉ THAI CHARACTER CHO CHING */
- { 0x0daa, 0x0e0a }, /* Thai_chochang ช THAI CHARACTER CHO CHANG */
- { 0x0dab, 0x0e0b }, /* Thai_soso ซ THAI CHARACTER SO SO */
- { 0x0dac, 0x0e0c }, /* Thai_chochoe ฌ THAI CHARACTER CHO CHOE */
- { 0x0dad, 0x0e0d }, /* Thai_yoying ญ THAI CHARACTER YO YING */
- { 0x0dae, 0x0e0e }, /* Thai_dochada ฎ THAI CHARACTER DO CHADA */
- { 0x0daf, 0x0e0f }, /* Thai_topatak ฏ THAI CHARACTER TO PATAK */
- { 0x0db0, 0x0e10 }, /* Thai_thothan ฐ THAI CHARACTER THO THAN */
- { 0x0db1, 0x0e11 }, /* Thai_thonangmontho ฑ THAI CHARACTER THO NANGMONTHO */
- { 0x0db2, 0x0e12 }, /* Thai_thophuthao ฒ THAI CHARACTER THO PHUTHAO */
- { 0x0db3, 0x0e13 }, /* Thai_nonen ณ THAI CHARACTER NO NEN */
- { 0x0db4, 0x0e14 }, /* Thai_dodek ด THAI CHARACTER DO DEK */
- { 0x0db5, 0x0e15 }, /* Thai_totao ต THAI CHARACTER TO TAO */
- { 0x0db6, 0x0e16 }, /* Thai_thothung ถ THAI CHARACTER THO THUNG */
- { 0x0db7, 0x0e17 }, /* Thai_thothahan ท THAI CHARACTER THO THAHAN */
- { 0x0db8, 0x0e18 }, /* Thai_thothong ธ THAI CHARACTER THO THONG */
- { 0x0db9, 0x0e19 }, /* Thai_nonu น THAI CHARACTER NO NU */
- { 0x0dba, 0x0e1a }, /* Thai_bobaimai บ THAI CHARACTER BO BAIMAI */
- { 0x0dbb, 0x0e1b }, /* Thai_popla ป THAI CHARACTER PO PLA */
- { 0x0dbc, 0x0e1c }, /* Thai_phophung ผ THAI CHARACTER PHO PHUNG */
- { 0x0dbd, 0x0e1d }, /* Thai_fofa ฝ THAI CHARACTER FO FA */
- { 0x0dbe, 0x0e1e }, /* Thai_phophan พ THAI CHARACTER PHO PHAN */
- { 0x0dbf, 0x0e1f }, /* Thai_fofan ฟ THAI CHARACTER FO FAN */
- { 0x0dc0, 0x0e20 }, /* Thai_phosamphao ภ THAI CHARACTER PHO SAMPHAO */
- { 0x0dc1, 0x0e21 }, /* Thai_moma ม THAI CHARACTER MO MA */
- { 0x0dc2, 0x0e22 }, /* Thai_yoyak ย THAI CHARACTER YO YAK */
- { 0x0dc3, 0x0e23 }, /* Thai_rorua ร THAI CHARACTER RO RUA */
- { 0x0dc4, 0x0e24 }, /* Thai_ru ฤ THAI CHARACTER RU */
- { 0x0dc5, 0x0e25 }, /* Thai_loling ล THAI CHARACTER LO LING */
- { 0x0dc6, 0x0e26 }, /* Thai_lu ฦ THAI CHARACTER LU */
- { 0x0dc7, 0x0e27 }, /* Thai_wowaen ว THAI CHARACTER WO WAEN */
- { 0x0dc8, 0x0e28 }, /* Thai_sosala ศ THAI CHARACTER SO SALA */
- { 0x0dc9, 0x0e29 }, /* Thai_sorusi ษ THAI CHARACTER SO RUSI */
- { 0x0dca, 0x0e2a }, /* Thai_sosua ส THAI CHARACTER SO SUA */
- { 0x0dcb, 0x0e2b }, /* Thai_hohip ห THAI CHARACTER HO HIP */
- { 0x0dcc, 0x0e2c }, /* Thai_lochula ฬ THAI CHARACTER LO CHULA */
- { 0x0dcd, 0x0e2d }, /* Thai_oang อ THAI CHARACTER O ANG */
- { 0x0dce, 0x0e2e }, /* Thai_honokhuk ฮ THAI CHARACTER HO NOKHUK */
- { 0x0dcf, 0x0e2f }, /* Thai_paiyannoi ฯ THAI CHARACTER PAIYANNOI */
- { 0x0dd0, 0x0e30 }, /* Thai_saraa ะ THAI CHARACTER SARA A */
- { 0x0dd1, 0x0e31 }, /* Thai_maihanakat ั THAI CHARACTER MAI HAN-AKAT */
- { 0x0dd2, 0x0e32 }, /* Thai_saraaa า THAI CHARACTER SARA AA */
- { 0x0dd3, 0x0e33 }, /* Thai_saraam ำ THAI CHARACTER SARA AM */
- { 0x0dd4, 0x0e34 }, /* Thai_sarai ิ THAI CHARACTER SARA I */
- { 0x0dd5, 0x0e35 }, /* Thai_saraii ี THAI CHARACTER SARA II */
- { 0x0dd6, 0x0e36 }, /* Thai_saraue ึ THAI CHARACTER SARA UE */
- { 0x0dd7, 0x0e37 }, /* Thai_sarauee ื THAI CHARACTER SARA UEE */
- { 0x0dd8, 0x0e38 }, /* Thai_sarau ุ THAI CHARACTER SARA U */
- { 0x0dd9, 0x0e39 }, /* Thai_sarauu ู THAI CHARACTER SARA UU */
- { 0x0dda, 0x0e3a }, /* Thai_phinthu ฺ THAI CHARACTER PHINTHU */
-/* 0x0dde Thai_maihanakat_maitho ? ??? */
- { 0x0ddf, 0x0e3f }, /* Thai_baht ฿ THAI CURRENCY SYMBOL BAHT */
- { 0x0de0, 0x0e40 }, /* Thai_sarae เ THAI CHARACTER SARA E */
- { 0x0de1, 0x0e41 }, /* Thai_saraae แ THAI CHARACTER SARA AE */
- { 0x0de2, 0x0e42 }, /* Thai_sarao โ THAI CHARACTER SARA O */
- { 0x0de3, 0x0e43 }, /* Thai_saraaimaimuan ใ THAI CHARACTER SARA AI MAIMUAN */
- { 0x0de4, 0x0e44 }, /* Thai_saraaimaimalai ไ THAI CHARACTER SARA AI MAIMALAI */
- { 0x0de5, 0x0e45 }, /* Thai_lakkhangyao ๅ THAI CHARACTER LAKKHANGYAO */
- { 0x0de6, 0x0e46 }, /* Thai_maiyamok ๆ THAI CHARACTER MAIYAMOK */
- { 0x0de7, 0x0e47 }, /* Thai_maitaikhu ็ THAI CHARACTER MAITAIKHU */
- { 0x0de8, 0x0e48 }, /* Thai_maiek ่ THAI CHARACTER MAI EK */
- { 0x0de9, 0x0e49 }, /* Thai_maitho ้ THAI CHARACTER MAI THO */
- { 0x0dea, 0x0e4a }, /* Thai_maitri ๊ THAI CHARACTER MAI TRI */
- { 0x0deb, 0x0e4b }, /* Thai_maichattawa ๋ THAI CHARACTER MAI CHATTAWA */
- { 0x0dec, 0x0e4c }, /* Thai_thanthakhat ์ THAI CHARACTER THANTHAKHAT */
- { 0x0ded, 0x0e4d }, /* Thai_nikhahit ํ THAI CHARACTER NIKHAHIT */
- { 0x0df0, 0x0e50 }, /* Thai_leksun ๐ THAI DIGIT ZERO */
- { 0x0df1, 0x0e51 }, /* Thai_leknung ๑ THAI DIGIT ONE */
- { 0x0df2, 0x0e52 }, /* Thai_leksong ๒ THAI DIGIT TWO */
- { 0x0df3, 0x0e53 }, /* Thai_leksam ๓ THAI DIGIT THREE */
- { 0x0df4, 0x0e54 }, /* Thai_leksi ๔ THAI DIGIT FOUR */
- { 0x0df5, 0x0e55 }, /* Thai_lekha ๕ THAI DIGIT FIVE */
- { 0x0df6, 0x0e56 }, /* Thai_lekhok ๖ THAI DIGIT SIX */
- { 0x0df7, 0x0e57 }, /* Thai_lekchet ๗ THAI DIGIT SEVEN */
- { 0x0df8, 0x0e58 }, /* Thai_lekpaet ๘ THAI DIGIT EIGHT */
- { 0x0df9, 0x0e59 }, /* Thai_lekkao ๙ THAI DIGIT NINE */
- { 0x0ea1, 0x3131 }, /* Hangul_Kiyeog ㄱ HANGUL LETTER KIYEOK */
- { 0x0ea2, 0x3132 }, /* Hangul_SsangKiyeog ㄲ HANGUL LETTER SSANGKIYEOK */
- { 0x0ea3, 0x3133 }, /* Hangul_KiyeogSios ㄳ HANGUL LETTER KIYEOK-SIOS */
- { 0x0ea4, 0x3134 }, /* Hangul_Nieun ㄴ HANGUL LETTER NIEUN */
- { 0x0ea5, 0x3135 }, /* Hangul_NieunJieuj ㄵ HANGUL LETTER NIEUN-CIEUC */
- { 0x0ea6, 0x3136 }, /* Hangul_NieunHieuh ㄶ HANGUL LETTER NIEUN-HIEUH */
- { 0x0ea7, 0x3137 }, /* Hangul_Dikeud ㄷ HANGUL LETTER TIKEUT */
- { 0x0ea8, 0x3138 }, /* Hangul_SsangDikeud ㄸ HANGUL LETTER SSANGTIKEUT */
- { 0x0ea9, 0x3139 }, /* Hangul_Rieul ㄹ HANGUL LETTER RIEUL */
- { 0x0eaa, 0x313a }, /* Hangul_RieulKiyeog ㄺ HANGUL LETTER RIEUL-KIYEOK */
- { 0x0eab, 0x313b }, /* Hangul_RieulMieum ㄻ HANGUL LETTER RIEUL-MIEUM */
- { 0x0eac, 0x313c }, /* Hangul_RieulPieub ㄼ HANGUL LETTER RIEUL-PIEUP */
- { 0x0ead, 0x313d }, /* Hangul_RieulSios ㄽ HANGUL LETTER RIEUL-SIOS */
- { 0x0eae, 0x313e }, /* Hangul_RieulTieut ㄾ HANGUL LETTER RIEUL-THIEUTH */
- { 0x0eaf, 0x313f }, /* Hangul_RieulPhieuf ㄿ HANGUL LETTER RIEUL-PHIEUPH */
- { 0x0eb0, 0x3140 }, /* Hangul_RieulHieuh ㅀ HANGUL LETTER RIEUL-HIEUH */
- { 0x0eb1, 0x3141 }, /* Hangul_Mieum ㅁ HANGUL LETTER MIEUM */
- { 0x0eb2, 0x3142 }, /* Hangul_Pieub ㅂ HANGUL LETTER PIEUP */
- { 0x0eb3, 0x3143 }, /* Hangul_SsangPieub ㅃ HANGUL LETTER SSANGPIEUP */
- { 0x0eb4, 0x3144 }, /* Hangul_PieubSios ㅄ HANGUL LETTER PIEUP-SIOS */
- { 0x0eb5, 0x3145 }, /* Hangul_Sios ㅅ HANGUL LETTER SIOS */
- { 0x0eb6, 0x3146 }, /* Hangul_SsangSios ㅆ HANGUL LETTER SSANGSIOS */
- { 0x0eb7, 0x3147 }, /* Hangul_Ieung ㅇ HANGUL LETTER IEUNG */
- { 0x0eb8, 0x3148 }, /* Hangul_Jieuj ㅈ HANGUL LETTER CIEUC */
- { 0x0eb9, 0x3149 }, /* Hangul_SsangJieuj ㅉ HANGUL LETTER SSANGCIEUC */
- { 0x0eba, 0x314a }, /* Hangul_Cieuc ㅊ HANGUL LETTER CHIEUCH */
- { 0x0ebb, 0x314b }, /* Hangul_Khieuq ㅋ HANGUL LETTER KHIEUKH */
- { 0x0ebc, 0x314c }, /* Hangul_Tieut ㅌ HANGUL LETTER THIEUTH */
- { 0x0ebd, 0x314d }, /* Hangul_Phieuf ㅍ HANGUL LETTER PHIEUPH */
- { 0x0ebe, 0x314e }, /* Hangul_Hieuh ㅎ HANGUL LETTER HIEUH */
- { 0x0ebf, 0x314f }, /* Hangul_A ㅏ HANGUL LETTER A */
- { 0x0ec0, 0x3150 }, /* Hangul_AE ㅐ HANGUL LETTER AE */
- { 0x0ec1, 0x3151 }, /* Hangul_YA ㅑ HANGUL LETTER YA */
- { 0x0ec2, 0x3152 }, /* Hangul_YAE ㅒ HANGUL LETTER YAE */
- { 0x0ec3, 0x3153 }, /* Hangul_EO ㅓ HANGUL LETTER EO */
- { 0x0ec4, 0x3154 }, /* Hangul_E ㅔ HANGUL LETTER E */
- { 0x0ec5, 0x3155 }, /* Hangul_YEO ㅕ HANGUL LETTER YEO */
- { 0x0ec6, 0x3156 }, /* Hangul_YE ㅖ HANGUL LETTER YE */
- { 0x0ec7, 0x3157 }, /* Hangul_O ㅗ HANGUL LETTER O */
- { 0x0ec8, 0x3158 }, /* Hangul_WA ㅘ HANGUL LETTER WA */
- { 0x0ec9, 0x3159 }, /* Hangul_WAE ㅙ HANGUL LETTER WAE */
- { 0x0eca, 0x315a }, /* Hangul_OE ㅚ HANGUL LETTER OE */
- { 0x0ecb, 0x315b }, /* Hangul_YO ㅛ HANGUL LETTER YO */
- { 0x0ecc, 0x315c }, /* Hangul_U ㅜ HANGUL LETTER U */
- { 0x0ecd, 0x315d }, /* Hangul_WEO ㅝ HANGUL LETTER WEO */
- { 0x0ece, 0x315e }, /* Hangul_WE ㅞ HANGUL LETTER WE */
- { 0x0ecf, 0x315f }, /* Hangul_WI ㅟ HANGUL LETTER WI */
- { 0x0ed0, 0x3160 }, /* Hangul_YU ㅠ HANGUL LETTER YU */
- { 0x0ed1, 0x3161 }, /* Hangul_EU ㅡ HANGUL LETTER EU */
- { 0x0ed2, 0x3162 }, /* Hangul_YI ㅢ HANGUL LETTER YI */
- { 0x0ed3, 0x3163 }, /* Hangul_I ㅣ HANGUL LETTER I */
- { 0x0ed4, 0x11a8 }, /* Hangul_J_Kiyeog ᆨ HANGUL JONGSEONG KIYEOK */
- { 0x0ed5, 0x11a9 }, /* Hangul_J_SsangKiyeog ᆩ HANGUL JONGSEONG SSANGKIYEOK */
- { 0x0ed6, 0x11aa }, /* Hangul_J_KiyeogSios ᆪ HANGUL JONGSEONG KIYEOK-SIOS */
- { 0x0ed7, 0x11ab }, /* Hangul_J_Nieun ᆫ HANGUL JONGSEONG NIEUN */
- { 0x0ed8, 0x11ac }, /* Hangul_J_NieunJieuj ᆬ HANGUL JONGSEONG NIEUN-CIEUC */
- { 0x0ed9, 0x11ad }, /* Hangul_J_NieunHieuh ᆭ HANGUL JONGSEONG NIEUN-HIEUH */
- { 0x0eda, 0x11ae }, /* Hangul_J_Dikeud ᆮ HANGUL JONGSEONG TIKEUT */
- { 0x0edb, 0x11af }, /* Hangul_J_Rieul ᆯ HANGUL JONGSEONG RIEUL */
- { 0x0edc, 0x11b0 }, /* Hangul_J_RieulKiyeog ᆰ HANGUL JONGSEONG RIEUL-KIYEOK */
- { 0x0edd, 0x11b1 }, /* Hangul_J_RieulMieum ᆱ HANGUL JONGSEONG RIEUL-MIEUM */
- { 0x0ede, 0x11b2 }, /* Hangul_J_RieulPieub ᆲ HANGUL JONGSEONG RIEUL-PIEUP */
- { 0x0edf, 0x11b3 }, /* Hangul_J_RieulSios ᆳ HANGUL JONGSEONG RIEUL-SIOS */
- { 0x0ee0, 0x11b4 }, /* Hangul_J_RieulTieut ᆴ HANGUL JONGSEONG RIEUL-THIEUTH */
- { 0x0ee1, 0x11b5 }, /* Hangul_J_RieulPhieuf ᆵ HANGUL JONGSEONG RIEUL-PHIEUPH */
- { 0x0ee2, 0x11b6 }, /* Hangul_J_RieulHieuh ᆶ HANGUL JONGSEONG RIEUL-HIEUH */
- { 0x0ee3, 0x11b7 }, /* Hangul_J_Mieum ᆷ HANGUL JONGSEONG MIEUM */
- { 0x0ee4, 0x11b8 }, /* Hangul_J_Pieub ᆸ HANGUL JONGSEONG PIEUP */
- { 0x0ee5, 0x11b9 }, /* Hangul_J_PieubSios ᆹ HANGUL JONGSEONG PIEUP-SIOS */
- { 0x0ee6, 0x11ba }, /* Hangul_J_Sios ᆺ HANGUL JONGSEONG SIOS */
- { 0x0ee7, 0x11bb }, /* Hangul_J_SsangSios ᆻ HANGUL JONGSEONG SSANGSIOS */
- { 0x0ee8, 0x11bc }, /* Hangul_J_Ieung ᆼ HANGUL JONGSEONG IEUNG */
- { 0x0ee9, 0x11bd }, /* Hangul_J_Jieuj ᆽ HANGUL JONGSEONG CIEUC */
- { 0x0eea, 0x11be }, /* Hangul_J_Cieuc ᆾ HANGUL JONGSEONG CHIEUCH */
- { 0x0eeb, 0x11bf }, /* Hangul_J_Khieuq ᆿ HANGUL JONGSEONG KHIEUKH */
- { 0x0eec, 0x11c0 }, /* Hangul_J_Tieut ᇀ HANGUL JONGSEONG THIEUTH */
- { 0x0eed, 0x11c1 }, /* Hangul_J_Phieuf ᇁ HANGUL JONGSEONG PHIEUPH */
- { 0x0eee, 0x11c2 }, /* Hangul_J_Hieuh ᇂ HANGUL JONGSEONG HIEUH */
- { 0x0eef, 0x316d }, /* Hangul_RieulYeorinHieuh ㅭ HANGUL LETTER RIEUL-YEORINHIEUH */
- { 0x0ef0, 0x3171 }, /* Hangul_SunkyeongeumMieum ㅱ HANGUL LETTER KAPYEOUNMIEUM */
- { 0x0ef1, 0x3178 }, /* Hangul_SunkyeongeumPieub ㅸ HANGUL LETTER KAPYEOUNPIEUP */
- { 0x0ef2, 0x317f }, /* Hangul_PanSios ㅿ HANGUL LETTER PANSIOS */
- { 0x0ef3, 0x3181 }, /* Hangul_KkogjiDalrinIeung ㆁ HANGUL LETTER YESIEUNG */
- { 0x0ef4, 0x3184 }, /* Hangul_SunkyeongeumPhieuf ㆄ HANGUL LETTER KAPYEOUNPHIEUPH */
- { 0x0ef5, 0x3186 }, /* Hangul_YeorinHieuh ㆆ HANGUL LETTER YEORINHIEUH */
- { 0x0ef6, 0x318d }, /* Hangul_AraeA ㆍ HANGUL LETTER ARAEA */
- { 0x0ef7, 0x318e }, /* Hangul_AraeAE ㆎ HANGUL LETTER ARAEAE */
- { 0x0ef8, 0x11eb }, /* Hangul_J_PanSios ᇫ HANGUL JONGSEONG PANSIOS */
- { 0x0ef9, 0x11f0 }, /* Hangul_J_KkogjiDalrinIeung ᇰ HANGUL JONGSEONG YESIEUNG */
- { 0x0efa, 0x11f9 }, /* Hangul_J_YeorinHieuh ᇹ HANGUL JONGSEONG YEORINHIEUH */
- { 0x0eff, 0x20a9 }, /* Korean_Won ₩ WON SIGN */
- { 0x13a4, 0x20ac }, /* Euro € EURO SIGN */
- { 0x13bc, 0x0152 }, /* OE Œ LATIN CAPITAL LIGATURE OE */
- { 0x13bd, 0x0153 }, /* oe œ LATIN SMALL LIGATURE OE */
- { 0x13be, 0x0178 }, /* Ydiaeresis Ÿ LATIN CAPITAL LETTER Y WITH DIAERESIS */
- { 0x20ac, 0x20ac }, /* EuroSign € EURO SIGN */
-};
-
-extern long keysym2ucs(KeySym keysym); // LadyHavoc: suppress warning just in this case, it's not worth having a header file for this...
-long keysym2ucs(KeySym keysym)
-{
- int min = 0;
- int max = sizeof(keysymtab) / sizeof(struct codepair) - 1;
- int mid;
-
- /* first check for Latin-1 characters (1:1 mapping) */
- if ((keysym >= 0x0020 && keysym <= 0x007e) ||
- (keysym >= 0x00a0 && keysym <= 0x00ff))
- return keysym;
-
- /* also check for directly encoded 24-bit UCS characters */
- if ((keysym & 0xff000000) == 0x01000000)
- return keysym & 0x00ffffff;
-
- /* binary search in table */
- while (max >= min) {
- mid = (min + max) / 2;
- if (keysymtab[mid].keysym < keysym)
- min = mid + 1;
- else if (keysymtab[mid].keysym > keysym)
- max = mid - 1;
- else {
- /* found it */
- return keysymtab[mid].ucs;
- }
- }
-
- /* no matching Unicode value found */
- return -1;
-}
#ifndef STANDALONETEST
double sentdoubletime;
#endif
- struct lhnetpacket_s *next, *prev;
+ llist_t list;
}
lhnetpacket_t;
{
if (lhnet_active)
return;
- lhnet_socketlist.next = lhnet_socketlist.prev = &lhnet_socketlist;
- lhnet_packetlist.next = lhnet_packetlist.prev = &lhnet_packetlist;
+ List_Create(&lhnet_socketlist.list);
+ List_Create(&lhnet_packetlist.list);
lhnet_active = 1;
#ifdef WIN32
lhnet_didWSAStartup = !WSAStartup(MAKEWORD(1, 1), &lhnet_winsockdata);
void LHNET_Shutdown(void)
{
- lhnetpacket_t *p;
+ lhnetsocket_t *s, *snext;
+ lhnetpacket_t *p, *pnext;
if (!lhnet_active)
return;
- while (lhnet_socketlist.next != &lhnet_socketlist)
- LHNET_CloseSocket(lhnet_socketlist.next);
- while (lhnet_packetlist.next != &lhnet_packetlist)
+ List_For_Each_Entry_Safe(s, snext, &lhnet_socketlist.list, lhnetsocket_t, list)
+ LHNET_CloseSocket(s);
+ List_For_Each_Entry_Safe(p, pnext, &lhnet_packetlist.list, lhnetpacket_t, list)
{
- p = lhnet_packetlist.next;
- p->prev->next = p->next;
- p->next->prev = p->prev;
+ List_Delete(&p->list);
Z_Free(p);
}
#ifdef WIN32
lhnetsocket_t *s;
FD_ZERO(&fdreadset);
lastfd = 0;
- for (s = lhnet_socketlist.next;s != &lhnet_socketlist;s = s->next)
+ List_For_Each_Entry(s, &lhnet_socketlist.list, lhnetsocket_t, list)
{
if (s->address.addresstype == LHNETADDRESSTYPE_INET4 || s->address.addresstype == LHNETADDRESSTYPE_INET6)
{
lhnetsocket->address.port = 1024;
for (;;)
{
- for (s = lhnet_socketlist.next;s != &lhnet_socketlist;s = s->next)
+ List_For_Each_Entry(s, &lhnet_socketlist.list, lhnetsocket_t, list)
if (s->address.addresstype == lhnetsocket->address.addresstype && s->address.port == lhnetsocket->address.port)
break;
if (s == &lhnet_socketlist)
}
}
// check if the port is available
- for (s = lhnet_socketlist.next;s != &lhnet_socketlist;s = s->next)
+ List_For_Each_Entry(s, &lhnet_socketlist.list, lhnetsocket_t, list)
if (s->address.addresstype == lhnetsocket->address.addresstype && s->address.port == lhnetsocket->address.port)
break;
if (s == &lhnet_socketlist && lhnetsocket->address.port != 0)
{
- lhnetsocket->next = &lhnet_socketlist;
- lhnetsocket->prev = lhnetsocket->next->prev;
- lhnetsocket->next->prev = lhnetsocket;
- lhnetsocket->prev->next = lhnetsocket;
+ List_Add_Tail(&lhnetsocket->list, &lhnet_socketlist.list);
return lhnetsocket;
}
break;
}
}
#endif
- lhnetsocket->next = &lhnet_socketlist;
- lhnetsocket->prev = lhnetsocket->next->prev;
- lhnetsocket->next->prev = lhnetsocket;
- lhnetsocket->prev->next = lhnetsocket;
+ List_Add_Tail(&lhnetsocket->list, &lhnet_socketlist.list);
#ifdef WIN32
if (ioctlsocket(lhnetsocket->inetsocket, SIO_UDP_CONNRESET, &_false) == -1)
Con_DPrintf("LHNET_OpenSocket_Connectionless: ioctlsocket SIO_UDP_CONNRESET returned error: %s\n", LHNETPRIVATE_StrError());
{
if (lhnetsocket)
{
- // unlink from socket list
- if (lhnetsocket->next == NULL)
- return; // invalid!
- lhnetsocket->next->prev = lhnetsocket->prev;
- lhnetsocket->prev->next = lhnetsocket->next;
- lhnetsocket->next = NULL;
- lhnetsocket->prev = NULL;
-
+ List_Delete(&lhnetsocket->list);
// no special close code for loopback, just inet
if (lhnetsocket->address.addresstype == LHNETADDRESSTYPE_INET4 || lhnetsocket->address.addresstype == LHNETADDRESSTYPE_INET6)
{
// scan for any old packets to timeout while searching for a packet
// that is waiting to be delivered to this socket
currenttime = time(NULL);
- for (p = lhnet_packetlist.next;p != &lhnet_packetlist;p = pnext)
+ List_For_Each_Entry_Safe(p, pnext, &lhnet_packetlist.list, lhnetpacket_t, list)
{
- pnext = p->next;
if (p->timeout < currenttime)
{
// unlink and free
- p->next->prev = p->prev;
- p->prev->next = p->next;
+ List_Delete(&p->list);
Z_Free(p);
continue;
}
else
value = -1;
// unlink and free
- p->next->prev = p->prev;
- p->prev->next = p->next;
+ List_Delete(&p->list);
Z_Free(p);
}
}
p->sourceport = lhnetsocket->address.port;
p->destinationport = address->port;
p->timeout = time(NULL) + 10;
- p->next = &lhnet_packetlist;
- p->prev = p->next->prev;
- p->next->prev = p;
- p->prev->next = p;
+ List_Add_Tail(&p->list, &lhnet_packetlist.list);
+
#ifndef STANDALONETEST
p->sentdoubletime = host.realtime;
#endif
#define LHNET_H
#include <stddef.h>
+#include "com_list.h"
typedef enum lhnetaddresstype_e
{
{
lhnetaddress_t address;
int inetsocket;
- struct lhnetsocket_s *next, *prev;
+ llist_t list;
}
lhnetsocket_t;
#include "fs.h"
#include "libcurl.h"
#include "thread.h"
-
+#include "com_list.h"
#include "image.h"
#include "jpeg.h"
#include "image_png.h"
size_t bytes_received; // for buffer
double bytes_received_curl; // for throttling
double bytes_sent_curl; // for throttling
- struct downloadinfo_s *next, *prev;
+ llist_t list;
qbool forthismap;
double maxspeed;
curl_slist *slist; // http headers
const char *extraheaders;
}
downloadinfo;
-static downloadinfo *downloads = NULL;
+LIST_HEAD(downloads);
static int numdownloads = 0;
static qbool noclear = false;
if(noclear)
return;
if (curl_mutex) Thread_LockMutex(curl_mutex);
- for(di = downloads; di; di = di->next)
+ List_For_Each_Entry(di, &downloads, downloadinfo, list)
di->forthismap = false;
Curl_CommandWhenError(NULL);
Curl_CommandWhenDone(NULL);
if(numdownloads_fail == 0)
{
Con_DPrintf("cURL downloads occurred, executing %s\n", command_when_done);
- Cbuf_AddText(cmd_client, "\n");
- Cbuf_AddText(cmd_client, command_when_done);
- Cbuf_AddText(cmd_client, "\n");
+ Cbuf_AddText(cmd_local, "\n");
+ Cbuf_AddText(cmd_local, command_when_done);
+ Cbuf_AddText(cmd_local, "\n");
}
else
{
Con_DPrintf("cURL downloads FAILED, executing %s\n", command_when_error);
- Cbuf_AddText(cmd_client, "\n");
- Cbuf_AddText(cmd_client, command_when_error);
- Cbuf_AddText(cmd_client, "\n");
+ Cbuf_AddText(cmd_local, "\n");
+ Cbuf_AddText(cmd_local, command_when_error);
+ Cbuf_AddText(cmd_local, "\n");
}
Curl_Clear_forthismap();
}
CLEAR_AND_RETRY();
}
- if(di->prev)
- di->prev->next = di->next;
- else
- downloads = di->next;
- if(di->next)
- di->next->prev = di->prev;
+ List_Delete(&di->list);
--numdownloads;
if(di->forthismap)
if(numdownloads < cl_curl_maxdownloads.integer)
{
downloadinfo *di;
- for(di = downloads; di; di = di->next)
+ List_For_Each_Entry(di, &downloads, downloadinfo, list)
{
if(!di->started)
{
downloadinfo *di;
if(!curl_dll)
return NULL;
- for(di = downloads; di; di = di->next)
+ List_For_Each_Entry(di, &downloads, downloadinfo, list)
if(!strcasecmp(di->filename, filename))
return di;
return NULL;
void Curl_Cancel_ToMemory(curl_callback_t callback, void *cbdata)
{
- downloadinfo *di;
+ downloadinfo *di, *ndi;
if(!curl_dll)
return;
- for(di = downloads; di; )
+ List_For_Each_Entry_Safe(di, ndi, &downloads, downloadinfo, list)
{
if(di->callback == callback && di->callback_data == cbdata)
{
di->callback = curl_quiet_callback; // do NOT call the callback
Curl_EndDownload(di, CURL_DOWNLOAD_ABORTED, CURLE_OK, NULL);
- di = downloads;
}
- else
- di = di->next;
}
}
di->bytes_received_curl = 0;
di->bytes_sent_curl = 0;
di->extraheaders = extraheaders;
- di->next = downloads;
- di->prev = NULL;
- if(di->next)
- di->next->prev = di;
-
di->buffer = buf;
di->buffersize = bufsize;
if(callback == NULL)
di->postbufsize = 0;
}
- downloads = di;
- if (curl_mutex) Thread_UnlockMutex(curl_mutex);
+ List_Add(&di->list, &downloads);
+
+ if (curl_mutex)
+ Thread_UnlockMutex(curl_mutex);
+
return true;
}
}
/*
====================
-Curl_Run
+Curl_Frame
call this regularily as this will always download as much as possible without
blocking.
====================
*/
-void Curl_Run(void)
+void Curl_Frame(void)
{
double maxspeed;
downloadinfo *di;
Curl_CheckCommandWhenDone();
- if(!downloads)
+ if(List_Is_Empty(&downloads))
{
if (curl_mutex) Thread_UnlockMutex(curl_mutex);
return;
}
while(mc == CURLM_CALL_MULTI_PERFORM);
- for(di = downloads; di; di = di->next)
+ List_For_Each_Entry(di, &downloads, downloadinfo, list)
{
double b = 0;
if(di->curle)
// use the slowest allowing download to derive the maxspeed... this CAN
// be done better, but maybe later
maxspeed = cl_curl_maxspeed.value;
- for(di = downloads; di; di = di->next)
+ List_For_Each_Entry(di, &downloads, downloadinfo, list)
if(di->maxspeed > 0)
if(di->maxspeed < maxspeed || maxspeed <= 0)
maxspeed = di->maxspeed;
if (curl_mutex) Thread_LockMutex(curl_mutex);
- while(downloads)
+ while(!List_Is_Empty(&downloads))
{
- Curl_EndDownload(downloads, CURL_DOWNLOAD_ABORTED, CURLE_OK, NULL);
+ Curl_EndDownload(List_First_Entry(&downloads, downloadinfo, list), CURL_DOWNLOAD_ABORTED, CURLE_OK, NULL);
// INVARIANT: downloads will point to the next download after that!
}
====================
Curl_Running
-returns true iff there is a download running.
+returns true if there is a download running.
====================
*/
qbool Curl_Running(void)
if(!curl_dll)
return false;
- return downloads != NULL;
+ return !List_Is_Empty(&downloads);
}
/*
{
if (curl_mutex) Thread_LockMutex(curl_mutex);
Con_Print("Currently running downloads:\n");
- for(di = downloads; di; di = di->next)
+ List_For_Each_Entry(di, &downloads, downloadinfo, list)
{
double speed, percent;
Con_Printf(" %s -> %s ", CleanURL(di->url, urlbuf, sizeof(urlbuf)), di->filename);
Cvar_RegisterVariable (&cl_curl_useragent);
Cvar_RegisterVariable (&cl_curl_useragent_append);
Cmd_AddCommand(CF_CLIENT | CF_CLIENT_FROM_SERVER, "curl", Curl_Curl_f, "download data from an URL and add to search path");
- //Cmd_AddCommand(cmd_client, "curlcat", Curl_CurlCat_f, "display data from an URL (debugging command)");
+ //Cmd_AddCommand(cmd_local, "curlcat", Curl_CurlCat_f, "display data from an URL (debugging command)");
}
/*
if (curl_mutex) Thread_LockMutex(curl_mutex);
i = 0;
- for(di = downloads; di; di = di->next)
+ List_For_Each_Entry(di, &downloads, downloadinfo, list)
++i;
downinfo = (Curl_downloadinfo_t *) Z_Malloc(sizeof(*downinfo) * i);
i = 0;
- for(di = downloads; di; di = di->next)
+ List_For_Each_Entry(di, &downloads, downloadinfo, list)
{
// do not show infobars for background downloads
if(developer.integer <= 0)
typedef void (*curl_callback_t) (int status, size_t length_received, unsigned char *buffer, void *cbdata);
// code is one of the CURLCBSTATUS constants, or the HTTP error code (when > 0).
-void Curl_Run(void);
+void Curl_Frame(void);
qbool Curl_Running(void);
qbool Curl_Begin_ToFile(const char *URL, double maxspeed, const char *name, int loadtype, qbool forthismap);
DP_LINK_SDL?=shared
DP_LINK_ZLIB?=shared
DP_LINK_JPEG?=shared
- DP_LINK_ODE?=dlopen
+ DP_LINK_ODE?=
DP_LINK_CRYPTO?=dlopen
DP_LINK_CRYPTO_RIJNDAEL?=dlopen
DP_LINK_XMP?=dlopen
DP_LINK_SDL?=shared
DP_LINK_ZLIB?=shared
DP_LINK_JPEG?=dlopen
- DP_LINK_ODE?=dlopen
+ DP_LINK_ODE?=
DP_LINK_CRYPTO?=dlopen
DP_LINK_CRYPTO_RIJNDAEL?=dlopen
DP_LINK_XMP?=dlopen
DP_LINK_SDL?=shared
DP_LINK_ZLIB?=shared
DP_LINK_JPEG?=shared
- DP_LINK_ODE?=dlopen
+ DP_LINK_ODE?=
DP_LINK_CRYPTO?=dlopen
DP_LINK_CRYPTO_RIJNDAEL?=dlopen
DP_LINK_XMP?=dlopen
DP_LINK_SDL?=shared
DP_LINK_ZLIB?=shared
DP_LINK_JPEG?=shared
- DP_LINK_ODE?=dlopen
+ DP_LINK_ODE?=
DP_LINK_CRYPTO?=dlopen
DP_LINK_CRYPTO_RIJNDAEL?=dlopen
DP_LINK_XMP?=dlopen
DP_LINK_SDL?=shared
DP_LINK_ZLIB?=dlopen
DP_LINK_JPEG?=shared
- DP_LINK_ODE?=dlopen
+ DP_LINK_ODE?=
DP_LINK_CRYPTO?=dlopen
DP_LINK_CRYPTO_RIJNDAEL?=dlopen
DP_LINK_XMP?=dlopen
OBJ_SND_NULL=snd_null.o
LIB_SND_NULL=
-# Open Sound System (Linux, FreeBSD and Solaris)
-OBJ_SND_OSS=$(OBJ_SND_COMMON) snd_oss.o
-LIB_SND_OSS=
-
-# Advanced Linux Sound Architecture (Linux)
-OBJ_SND_ALSA=$(OBJ_SND_COMMON) snd_alsa.o
-LIB_SND_ALSA=-lasound
-
-# Core Audio (Mac OS X)
-OBJ_SND_COREAUDIO=$(OBJ_SND_COMMON) snd_coreaudio.o
-LIB_SND_COREAUDIO=-framework CoreAudio
-
-# BSD / Sun audio API (NetBSD and OpenBSD)
-OBJ_SND_BSD=$(OBJ_SND_COMMON) snd_bsd.o
-LIB_SND_BSD=
-
-# DirectX and Win32 WAVE output (Win32)
-OBJ_SND_WIN=$(OBJ_SND_COMMON) snd_win.o
-LIB_SND_WIN=
-
-
###### Common objects and flags #####
# Common objects
com_ents.o \
com_ents4.o \
com_game.o \
- com_list.o \
+ com_infostring.o \
com_msg.o \
common.o \
console.o \
#this checks USEODE when compiling so it needs the ODE flags as well
-prvm_cmds.o: prvm_cmds.c
+cl_parse.o: cl_parse.c
$(CHECKLEVEL2)
$(DO_CC) $(CFLAGS_ODE)
-world.o: world.c
+cs_progs.o: cs_progs.c
+ $(CHECKLEVEL2)
+ $(DO_CC) $(CFLAGS_ODE)
+
+sv_main.o: sv_main.c
$(CHECKLEVEL2)
$(DO_CC) $(CFLAGS_ODE)
-vid_glx.o: vid_glx.c
+sv_phys.o: sv_phys.c
$(CHECKLEVEL2)
- $(DO_CC) -I/usr/X11R6/include
+ $(DO_CC) $(CFLAGS_ODE)
-keysym2ucs.o: keysym2ucs.c
+prvm_cmds.o: prvm_cmds.c
$(CHECKLEVEL2)
- $(DO_CC) -I/usr/X11R6/include
+ $(DO_CC) $(CFLAGS_ODE)
+
+world.o: world.c
+ $(CHECKLEVEL2)
+ $(DO_CC) $(CFLAGS_ODE)
crypto.o: crypto.c
$(CHECKLEVEL2)
{
if(mode == 0)
return; // the menu is off, and we want it off
- M_Menu_Main_f (cmd_client);
+ M_Menu_Main_f (cmd_local);
}
else
{
void M_KeyEvent (int key, int ascii, qbool downevent)
{
- cmd_state_t *cmd = cmd_client;
+ cmd_state_t *cmd = cmd_local;
if (!downevent)
return;
switch (m_state)
for (i=0 ; i<prog->num_edicts ; i++)
{
ent = PRVM_EDICT_NUM(i);
- if (ent->priv.required->free)
+ if (ent->free)
continue;
active++;
}
static void MP_Init (void)
{
prvm_prog_t *prog = MVM_prog;
- PRVM_Prog_Init(prog, cmd_client);
+ PRVM_Prog_Init(prog, cmd_local);
prog->edictprivate_size = 0; // no private struct used
prog->name = "menu";
void MP_ToggleMenu (int mode);
void MP_Shutdown (void);*/
+qbool MP_ConsoleCommand(const char *text);
+
//
// menu router
//
biggestorigin = max(biggestorigin, fabs(k->origin[2]));
}
loadmodel->num_posescale = biggestorigin / 32767.0f;
+ if (loadmodel->num_posescale == 0) // don't divide by zero
+ loadmodel->num_posescale = 1.0;
loadmodel->num_poseinvscale = 1.0f / loadmodel->num_posescale;
// load the poses from the animkeys
biggestorigin = max(biggestorigin, fabs(p->basepose.origin[2]));
}
loadmodel->num_posescale = biggestorigin / 32767.0f;
+ if (loadmodel->num_posescale == 0) // don't divide by zero
+ loadmodel->num_posescale = 1.0;
loadmodel->num_poseinvscale = 1.0f / loadmodel->num_posescale;
// load the basepose as a frame
for (j = 0; j < Q3MAXTCMODS && layer->tcmods[j].tcmod != Q3TCMOD_NONE; j++)
shaderpass->tcmods[j] = layer->tcmods[j];
for (j = 0; j < layer->numframes; j++)
- {
- for (int i = 0; layer->texturename[j][i]; i++)
- if(layer->texturename[j][i] == '\\')
- layer->texturename[j][i] = '/';
shaderpass->skinframes[j] = R_SkinFrame_LoadExternal(layer->texturename[j], texflags, false, true);
- }
return shaderpass;
}
if(cls.state == ca_dedicated)
return;
- info = (Mod_MakeSortedSurfaces_qsortsurface_t*)R_FrameData_Alloc(mod->num_surfaces * sizeof(*info));
+ info = (Mod_MakeSortedSurfaces_qsortsurface_t*)Mem_Alloc(loadmodel->mempool, mod->num_surfaces * sizeof(*info));
if (!mod->modelsurfaces_sorted)
mod->modelsurfaces_sorted = (int *) Mem_Alloc(loadmodel->mempool, mod->num_surfaces * sizeof(*mod->modelsurfaces_sorted));
// the goal is to sort by submodel (can't change which submodel a surface belongs to), and then by effects and textures
qsort(info + mod->brush.submodels[k]->submodelsurfaces_start, (size_t)mod->brush.submodels[k]->submodelsurfaces_end - mod->brush.submodels[k]->submodelsurfaces_start, sizeof(*info), Mod_MakeSortedSurfaces_qsortfunc);
for (j = 0; j < mod->num_surfaces; j++)
mod->modelsurfaces_sorted[j] = info[j].surfaceindex;
+ Mem_Free(info);
}
void Mod_BuildVBOs(void)
return surf;
}
-static void Mod_Mesh_RebuildHashTable(model_t *mod, msurface_t *surf)
+int Mod_Mesh_IndexForVertex(model_t *mod, msurface_t *surf, float x, float y, float z, float nx, float ny, float nz, float s, float t, float u, float v, float r, float g, float b, float a)
{
int hashindex, h, vnum, mask;
surfmesh_t *mesh = &mod->surfmesh;
-
- // rebuild the hash table
- mesh->num_vertexhashsize = 4 * mesh->max_vertices;
- mesh->num_vertexhashsize &= ~(mesh->num_vertexhashsize - 1); // round down to pow2
- mesh->data_vertexhash = (int *)Mem_Realloc(mod->mempool, mesh->data_vertexhash, mesh->num_vertexhashsize * sizeof(*mesh->data_vertexhash));
- memset(mesh->data_vertexhash, -1, mesh->num_vertexhashsize * sizeof(*mesh->data_vertexhash));
- mask = mod->surfmesh.num_vertexhashsize - 1;
- // no need to hash the vertices for the entire model, the latest surface will suffice.
- for (vnum = surf ? surf->num_firstvertex : 0; vnum < mesh->num_vertices; vnum++)
- {
- // this uses prime numbers intentionally for computing the hash
- hashindex = (unsigned int)(mesh->data_vertex3f[vnum * 3 + 0] * 2003 + mesh->data_vertex3f[vnum * 3 + 1] * 4001 + mesh->data_vertex3f[vnum * 3 + 2] * 7919 + mesh->data_normal3f[vnum * 3 + 0] * 4097 + mesh->data_normal3f[vnum * 3 + 1] * 257 + mesh->data_normal3f[vnum * 3 + 2] * 17) & mask;
- for (h = hashindex; mesh->data_vertexhash[h] >= 0; h = (h + 1) & mask)
- ; // just iterate until we find the terminator
- mesh->data_vertexhash[h] = vnum;
- }
-}
-
-void Mod_Mesh_CheckResize_Vertex(model_t *mod, msurface_t *surf)
-{
- surfmesh_t *mesh = &mod->surfmesh;
if (mesh->max_vertices == mesh->num_vertices)
{
mesh->max_vertices = max(mesh->num_vertices * 2, 256);
mesh->data_texcoordtexture2f = (float *)Mem_Realloc(mod->mempool, mesh->data_texcoordtexture2f, mesh->max_vertices * sizeof(float[2]));
mesh->data_texcoordlightmap2f = (float *)Mem_Realloc(mod->mempool, mesh->data_texcoordlightmap2f, mesh->max_vertices * sizeof(float[2]));
mesh->data_lightmapcolor4f = (float *)Mem_Realloc(mod->mempool, mesh->data_lightmapcolor4f, mesh->max_vertices * sizeof(float[4]));
- Mod_Mesh_RebuildHashTable(mod, surf);
+ // rebuild the hash table
+ mesh->num_vertexhashsize = 4 * mesh->max_vertices;
+ mesh->num_vertexhashsize &= ~(mesh->num_vertexhashsize - 1); // round down to pow2
+ mesh->data_vertexhash = (int *)Mem_Realloc(mod->mempool, mesh->data_vertexhash, mesh->num_vertexhashsize * sizeof(*mesh->data_vertexhash));
+ memset(mesh->data_vertexhash, -1, mesh->num_vertexhashsize * sizeof(*mesh->data_vertexhash));
+ mask = mod->surfmesh.num_vertexhashsize - 1;
+ // no need to hash the vertices for the entire model, the latest surface will suffice.
+ for (vnum = surf ? surf->num_firstvertex : 0; vnum < mesh->num_vertices; vnum++)
+ {
+ // this uses prime numbers intentionally for computing the hash
+ hashindex = (unsigned int)(mesh->data_vertex3f[vnum * 3 + 0] * 2003 + mesh->data_vertex3f[vnum * 3 + 1] * 4001 + mesh->data_vertex3f[vnum * 3 + 2] * 7919 + mesh->data_normal3f[vnum * 3 + 0] * 4097 + mesh->data_normal3f[vnum * 3 + 1] * 257 + mesh->data_normal3f[vnum * 3 + 2] * 17) & mask;
+ for (h = hashindex; mesh->data_vertexhash[h] >= 0; h = (h + 1) & mask)
+ ; // just iterate until we find the terminator
+ mesh->data_vertexhash[h] = vnum;
+ }
+ }
+ mask = mod->surfmesh.num_vertexhashsize - 1;
+ // this uses prime numbers intentionally for computing the hash
+ hashindex = (unsigned int)(x * 2003 + y * 4001 + z * 7919 + nx * 4097 + ny * 257 + nz * 17) & mask;
+ // when possible find an identical vertex within the same surface and return it
+ for(h = hashindex;(vnum = mesh->data_vertexhash[h]) >= 0;h = (h + 1) & mask)
+ {
+ if (vnum >= surf->num_firstvertex
+ && mesh->data_vertex3f[vnum * 3 + 0] == x && mesh->data_vertex3f[vnum * 3 + 1] == y && mesh->data_vertex3f[vnum * 3 + 2] == z
+ && mesh->data_normal3f[vnum * 3 + 0] == nx && mesh->data_normal3f[vnum * 3 + 1] == ny && mesh->data_normal3f[vnum * 3 + 2] == nz
+ && mesh->data_texcoordtexture2f[vnum * 2 + 0] == s && mesh->data_texcoordtexture2f[vnum * 2 + 1] == t
+ && mesh->data_texcoordlightmap2f[vnum * 2 + 0] == u && mesh->data_texcoordlightmap2f[vnum * 2 + 1] == v
+ && mesh->data_lightmapcolor4f[vnum * 4 + 0] == r && mesh->data_lightmapcolor4f[vnum * 4 + 1] == g && mesh->data_lightmapcolor4f[vnum * 4 + 2] == b && mesh->data_lightmapcolor4f[vnum * 4 + 3] == a)
+ return vnum;
}
-}
-
-int Mod_Mesh_AddVertex(model_t *mod, msurface_t *surf, float x, float y, float z, float nx, float ny, float nz, float s, float t, float u, float v, float r, float g, float b, float a)
-{
- int vnum;
- surfmesh_t *mesh = &mod->surfmesh;
-
// add the new vertex
vnum = mesh->num_vertices++;
if (surf->num_vertices > 0)
VectorSet(surf->maxs, x, y, z);
}
surf->num_vertices = mesh->num_vertices - surf->num_firstvertex;
+ mesh->data_vertexhash[h] = vnum;
mesh->data_vertex3f[vnum * 3 + 0] = x;
mesh->data_vertex3f[vnum * 3 + 1] = y;
mesh->data_vertex3f[vnum * 3 + 2] = z;
return vnum;
}
-int Mod_Mesh_IndexForVertex(model_t *mod, msurface_t *surf, float x, float y, float z, float nx, float ny, float nz, float s, float t, float u, float v, float r, float g, float b, float a)
-{
- int hashindex, h, vnum, mask;
- surfmesh_t *mesh = &mod->surfmesh;
-
- Mod_Mesh_CheckResize_Vertex(mod, surf);
-
- mask = mod->surfmesh.num_vertexhashsize - 1;
- // this uses prime numbers intentionally for computing the hash
- hashindex = (unsigned int)(x * 2003 + y * 4001 + z * 7919 + nx * 4097 + ny * 257 + nz * 17) & mask;
- // when possible find an identical vertex within the same surface and return it
- for(h = hashindex;(vnum = mesh->data_vertexhash[h]) >= 0;h = (h + 1) & mask)
- {
- if (vnum >= surf->num_firstvertex
- && mesh->data_vertex3f[vnum * 3 + 0] == x && mesh->data_vertex3f[vnum * 3 + 1] == y && mesh->data_vertex3f[vnum * 3 + 2] == z
- && mesh->data_normal3f[vnum * 3 + 0] == nx && mesh->data_normal3f[vnum * 3 + 1] == ny && mesh->data_normal3f[vnum * 3 + 2] == nz
- && mesh->data_texcoordtexture2f[vnum * 2 + 0] == s && mesh->data_texcoordtexture2f[vnum * 2 + 1] == t
- && mesh->data_texcoordlightmap2f[vnum * 2 + 0] == u && mesh->data_texcoordlightmap2f[vnum * 2 + 1] == v
- && mesh->data_lightmapcolor4f[vnum * 4 + 0] == r && mesh->data_lightmapcolor4f[vnum * 4 + 1] == g && mesh->data_lightmapcolor4f[vnum * 4 + 2] == b && mesh->data_lightmapcolor4f[vnum * 4 + 3] == a)
- return vnum;
- }
- vnum = Mod_Mesh_AddVertex(mod, surf, x, y, z, nx, ny, nz, s, t, u, v, r, g, b, a);
- mesh->data_vertexhash[h] = vnum;
- return vnum;
-}
-
void Mod_Mesh_AddTriangle(model_t *mod, msurface_t *surf, int e0, int e1, int e2)
{
surfmesh_t *mesh = &mod->surfmesh;
{
int i, j;
texture_t *tex;
- unsigned char* included = (unsigned char *)R_FrameData_Alloc(mod->num_surfaces * sizeof(unsigned char));
// build the sorted surfaces list properly to reduce material setup
// this is easy because we're just sorting on texture and don't care about the order of textures
mod->submodelsurfaces_start = 0;
mod->submodelsurfaces_end = 0;
for (i = 0; i < mod->num_surfaces; i++)
- included[i] = 0;
+ mod->data_surfaces[i].included = false;
for (i = 0; i < mod->num_surfaces; i++)
{
- if (included[i])
+ if (mod->data_surfaces[i].included)
continue;
tex = mod->data_surfaces[i].texture;
// j = i is intentional
for (j = i; j < mod->num_surfaces; j++)
{
- if (!included[j] && mod->data_surfaces[j].texture == tex)
+ if (!mod->data_surfaces[j].included && mod->data_surfaces[j].texture == tex)
{
- included[j] = 1;
+ mod->data_surfaces[j].included = 1;
mod->modelsurfaces_sorted[mod->submodelsurfaces_end++] = j;
}
}
int num_firstcollisiontriangle; // q3bsp only
int num_collisiontriangles; // number of triangles (if surface has collisions enabled)
int num_collisionvertices; // number of vertices referenced by collision triangles (if surface has collisions enabled)
+
+ // used by Mod_Mesh_Finalize when building sortedmodelsurfaces
+ qbool included;
}
msurface_t;
void Mod_Mesh_Reset(model_t *mod);
texture_t *Mod_Mesh_GetTexture(model_t *mod, const char *name, int defaultdrawflags, int defaulttexflags, int defaultmaterialflags);
msurface_t *Mod_Mesh_AddSurface(model_t *mod, texture_t *tex, qbool batchwithprevioussurface);
-void Mod_Mesh_CheckResize_Vertex(model_t *mod, msurface_t *surf);
-int Mod_Mesh_AddVertex(model_t *mod, msurface_t *surf, float x, float y, float z, float nx, float ny, float nz, float s, float t, float u, float v, float r, float g, float b, float a);
int Mod_Mesh_IndexForVertex(model_t *mod, msurface_t *surf, float x, float y, float z, float nx, float ny, float nz, float s, float t, float u, float v, float r, float g, float b, float a);
void Mod_Mesh_AddTriangle(model_t *mod, msurface_t *surf, int e0, int e1, int e2);
void Mod_Mesh_Validate(model_t *mod);
NULL
};
+qbool MP_ConsoleCommand(const char *text)
+{
+ prvm_prog_t *prog = MVM_prog;
+ return PRVM_ConsoleCommand(prog, text, &prog->funcoffsets.GameCommand, false, -1, 0, prog->loaded, "QC function GameCommand is missing");
+}
+
/*
=========
VM_M_setmousetarget
CL_RestartVideo( video );
}
+static void VM_M_registercommand(prvm_prog_t *prog)
+{
+ VM_SAFEPARMCOUNT(1, VM_M_registercommand);
+ if(!Cmd_Exists(cmd_local, PRVM_G_STRING(OFS_PARM0)))
+ Cmd_AddCommand(CF_CLIENT, PRVM_G_STRING(OFS_PARM0), NULL, "console command created by QuakeC");
+}
+
prvm_builtin_t vm_m_builtins[] = {
NULL, // #0 NULL function (not callable)
VM_checkextension, // #1
VM_vectoyaw, // #10
VM_vectoangles, // #11
VM_random, // #12
-VM_localcmd_client, // #13
+VM_localcmd_local, // #13
VM_cvar, // #14
VM_cvar_set, // #15
VM_dprint, // #16
VM_CL_isdemo, // #349
NULL, // #350
NULL, // #351
-NULL, // #352
+VM_M_registercommand, // #352 void(string cmdname)
VM_wasfreed, // #353 float(entity ent) wasfreed
NULL, // #354
VM_CL_videoplaying, // #355
static int clientport = -1;
static int clientport2 = -1;
static int hostport = -1;
-void NetConn_UpdateSockets(void)
-{
- int i, j;
- // TODO add logic to automatically close sockets if needed
- LHNET_DefaultDSCP(net_tos_dscp.integer);
+// Call on disconnect, during startup, or if cl_netport is changed
+void NetConn_UpdateSockets_Client(void)
+{
+ if (cls.state == ca_disconnected && clientport != clientport2)
+ {
+ clientport = clientport2;
+ NetConn_CloseClientPorts();
+ }
+ if (cl_numsockets == 0)
+ NetConn_OpenClientPorts();
+}
- if (cls.state != ca_dedicated)
+// Call when cl_port is changed
+static void NetConn_cl_netport_Callback(cvar_t *var)
+{
+ if(cls.state != ca_dedicated)
{
- if (clientport2 != cl_netport.integer)
+ if (clientport2 != var->integer)
{
- clientport2 = cl_netport.integer;
+ clientport2 = var->integer;
if (cls.state == ca_connected)
Con_Print("Changing \"cl_port\" will not take effect until you reconnect.\n");
}
- if (cls.state == ca_disconnected && clientport != clientport2)
- {
- clientport = clientport2;
- NetConn_CloseClientPorts();
- }
- if (cl_numsockets == 0)
- NetConn_OpenClientPorts();
+ NetConn_UpdateSockets_Client();
}
+}
- if (hostport != sv_netport.integer)
+// Call when port is changed
+static void NetConn_sv_netport_Callback(cvar_t *var)
+{
+ if (hostport != var->integer)
{
- hostport = sv_netport.integer;
+ hostport = var->integer;
if (sv.active)
Con_Print("Changing \"port\" will not take effect until \"map\" command is executed.\n");
}
+}
+
+void NetConn_UpdateSockets(void)
+{
+ int i, j;
+
+ // TODO add logic to automatically close sockets if needed
+ LHNET_DefaultDSCP(net_tos_dscp.integer);
for (j = 0;j < MAX_RCONS;j++)
{
#ifdef CONFIG_MENU
M_Update_Return_Reason("");
#endif
- // if we're connecting to a remote server, shut down any local server
- if (LHNETADDRESS_GetAddressType(peeraddress) != LHNETADDRESSTYPE_LOOP && sv.active)
- {
- SV_LockThreadMutex();
- SV_Shutdown ();
- SV_UnlockThreadMutex();
- }
+ // Disconnect from the current server or stop demo playback
if(cls.state == ca_connected || cls.demoplayback)
CL_Disconnect();
// allocate a net connection to keep track of things
NetConn_QueryQueueFrame();
#endif
if (cls.netcon && host.realtime > cls.netcon->timeout && !sv.active)
- {
- Con_Print("Connection timed out\n");
- CL_Disconnect();
- SV_LockThreadMutex();
- SV_Shutdown ();
- SV_UnlockThreadMutex();
- }
+ CL_DisconnectEx(true, "Connection timed out");
}
static void NetConn_BuildChallengeString(char *buffer, int bufferlength)
if(l)
{
client_t *host_client_save = host_client;
- Cmd_ExecuteString(cmd_server, s, src_local, true);
+ Cmd_ExecuteString(cmd_local, s, src_local, true);
host_client = host_client_save;
// in case it is a command that changes host_client (like restart)
}
Cvar_RegisterCallback(&net_slist_favorites, NetConn_UpdateFavorites_c);
#endif
Cvar_RegisterVariable(&net_slist_pause);
- if(LHNET_DefaultDSCP(-1) >= 0) // register cvar only if supported
- Cvar_RegisterVariable(&net_tos_dscp);
+#ifdef IP_TOS // register cvar only if supported
+ Cvar_RegisterVariable(&net_tos_dscp);
+#endif
Cvar_RegisterVariable(&net_messagetimeout);
Cvar_RegisterVariable(&net_connecttimeout);
Cvar_RegisterVariable(&net_connectfloodblockingtimeout);
Cvar_RegisterVariable(&net_fakelag);
Cvar_RegisterVariable(&net_fakeloss_send);
Cvar_RegisterVariable(&net_fakeloss_receive);
- Cvar_RegisterAlias(&net_fakelag, "cl_netlocalping");
- Cvar_RegisterAlias(&net_fakeloss_send, "cl_netpacketloss_send");
- Cvar_RegisterAlias(&net_fakeloss_receive, "cl_netpacketloss_receive");
+ Cvar_RegisterVirtual(&net_fakelag, "cl_netlocalping");
+ Cvar_RegisterVirtual(&net_fakeloss_send, "cl_netpacketloss_send");
+ Cvar_RegisterVirtual(&net_fakeloss_receive, "cl_netpacketloss_receive");
Cvar_RegisterVariable(&hostname);
Cvar_RegisterVariable(&developer_networking);
Cvar_RegisterVariable(&cl_netport);
+ Cvar_RegisterCallback(&cl_netport, NetConn_cl_netport_Callback);
Cvar_RegisterVariable(&sv_netport);
+ Cvar_RegisterCallback(&sv_netport, NetConn_sv_netport_Callback);
Cvar_RegisterVariable(&net_address);
Cvar_RegisterVariable(&net_address_ipv6);
Cvar_RegisterVariable(&sv_public);
void NetConn_OpenClientPorts(void);
void NetConn_CloseServerPorts(void);
void NetConn_OpenServerPorts(int opennetports);
+void NetConn_UpdateSockets_Client(void);
void NetConn_UpdateSockets(void);
lhnetsocket_t *NetConn_ChooseClientSocketForAddress(lhnetaddress_t *address);
lhnetsocket_t *NetConn_ChooseServerSocketForAddress(lhnetaddress_t *address);
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<packages>\r
+ <package id="sdl2.nuget" version="2.0.14" targetFramework="native" />\r
+ <package id="sdl2.nuget.redist" version="2.0.14" targetFramework="native" />\r
+</packages>
\ No newline at end of file
#ifndef PROGS_H
#define PROGS_H
#include "pr_comp.h" // defs shared with qcc
+#include "qtypes.h"
+
#define ENTITYGRIDAREAS 16
#define MAX_ENTITYCLUSTERS 16
+#ifdef PRVM_64
+#define PRVM_FLOAT_IS_TRUE_FOR_INT(x) DOUBLE_IS_TRUE_FOR_INT(x)
+#define PRVM_FLOAT_LOSSLESS_FORMAT DOUBLE_LOSSLESS_FORMAT
+#define PRVM_VECTOR_LOSSLESS_FORMAT DOUBLE_VECTOR_LOSSLESS_FORMAT
+#else
+#define PRVM_FLOAT_IS_TRUE_FOR_INT(x) FLOAT_IS_TRUE_FOR_INT(x)
+#define PRVM_FLOAT_LOSSLESS_FORMAT FLOAT_LOSSLESS_FORMAT
+#define PRVM_VECTOR_LOSSLESS_FORMAT FLOAT_VECTOR_LOSSLESS_FORMAT
+#endif
+
+#ifdef USEODE
#define GEOMTYPE_NONE -1
#define GEOMTYPE_SOLID 0
#define GEOMTYPE_BOX 1
vec3_t v2;
struct edict_odefunc_s *next;
}edict_odefunc_t;
+#endif
typedef struct edict_engineprivate_s
{
- // true if this edict is unused
- qbool free;
- // sv.time when the object was freed (to prevent early reuse which could
- // mess up client interpolation or obscure severe QuakeC bugs)
- double freetime;
// mark for the leak detector
int mark;
// place in the code where it was allocated (for the leak detector)
const char *allocation_origin;
+
// initially false to prevent projectiles from moving on their first frame
// (even if they were spawned by an synchronous client think)
qbool move;
frameblend_t frameblend[MAX_FRAMEBLENDS];
skeleton_t skeleton;
+#ifdef USEODE
// physics parameters
qbool ode_physics;
void *ode_body;
vec3_t ode_joint_velocity; // second joint axis
vec3_t ode_joint_movedir; // parameters
void *ode_massbuf;
+#endif
}
edict_engineprivate_t;
const char *name;
} prvm_required_field_t;
-
+#define PRVM_EDICT_MARK_WAIT_FOR_SETORIGIN -1
+#define PRVM_EDICT_MARK_SETORIGIN_CAUGHT -2
// AK: I dont call it engine private cause it doesnt really belongs to the engine
// it belongs to prvm.
typedef struct prvm_edict_private_s
{
- qbool free;
- double freetime; // realtime of last change to "free" (i.e. also set on allocation)
- int mark; // used during leaktest (0 = unref, >0 = referenced); special values during server physics:
-#define PRVM_EDICT_MARK_WAIT_FOR_SETORIGIN -1
-#define PRVM_EDICT_MARK_SETORIGIN_CAUGHT -2
+ // mark for the leak detector
+ int mark;
+ // place in the code where it was allocated (for the leak detector)
const char *allocation_origin;
} prvm_edict_private_t;
typedef struct prvm_edict_s
{
+ // true if this edict is unused
+ qbool free;
+ // sv.time when the object was freed (to prevent early reuse which could
+ // mess up client interpolation or obscure severe QuakeC bugs)
+ double freetime;
+
// engine-private fields (stored in dynamically resized array)
- //edict_engineprivate_t *e;
union
{
prvm_edict_private_t *required;
struct fssearch_s *opensearches[PRVM_MAX_OPENSEARCHES];
const char * opensearches_origin[PRVM_MAX_OPENSEARCHES];
struct skeleton_s *skeletons[MAX_EDICTS];
- struct cmd_state_s *console_cmd; // points to the relevant console command interpreter for this vm (cmd_client or &cmd_server), also used to access cvars
+ struct cmd_state_s *console_cmd; // points to the relevant console command interpreter for this vm (cmd_local or &cmd_server), also used to access cvars
// buffer for storing all tempstrings created during one invocation of ExecuteProgram
sizebuf_t tempstringsbuf;
}
protocolversioninfo[] =
{
+ { 3505, PROTOCOL_DARKPLACES8 , "DP8"},
{ 3504, PROTOCOL_DARKPLACES7 , "DP7"},
{ 3503, PROTOCOL_DARKPLACES6 , "DP6"},
{ 3502, PROTOCOL_DARKPLACES5 , "DP5"},
buffer[0] = 0;
for (i = 0;protocolversioninfo[i].name;i++)
{
- if (i > 1)
+ if (i > 0)
strlcat(buffer, " ", buffersize);
strlcat(buffer, protocolversioninfo[i].name, buffersize);
}
double time; // time the move is executed for (non-cl_movement is executed at receivetime)
float receivetime; // time the move was received at (used for ping)
- int msec; // for predicted moves
+ unsigned char msec; // for predicted moves
int buttons;
int impulse;
unsigned int sequence;
prog->error_cmd("%s: Bad string", prog->name);
}
+qbool PRVM_ConsoleCommand (prvm_prog_t *prog, const char *text, int *func, qbool preserve_self, int curself, double ptime, qbool prog_loaded, const char *error_message)
+{
+ int restorevm_tempstringsbuf_cursize;
+ int save_self = 0; // hush compiler warning
+ qbool r = false;
+
+ if(!prog_loaded)
+ return false;
+
+ if(func)
+ {
+ if(preserve_self)
+ save_self = PRVM_gameglobaledict(self);
+ if(ptime)
+ PRVM_gameglobalfloat(time) = ptime;
+ PRVM_gameglobaledict(self) = curself;
+ restorevm_tempstringsbuf_cursize = prog->tempstringsbuf.cursize;
+ PRVM_G_INT(OFS_PARM0) = PRVM_SetTempString(prog, text);
+ prog->ExecuteProgram(prog, *func, error_message);
+ prog->tempstringsbuf.cursize = restorevm_tempstringsbuf_cursize;
+ if(preserve_self)
+ PRVM_gameglobaledict(self) = save_self;
+ r = (int) PRVM_G_FLOAT(OFS_RETURN) != 0;
+ }
+
+ return r;
+}
+
void VM_GenerateFrameGroupBlend(prvm_prog_t *prog, framegroupblend_t *framegroupblend, const prvm_edict_t *ed)
{
// self.frame is the interpolation target (new frame)
=========
VM_localsound
-localsound(string sample)
+localsound(string sample, float chan, float vol)
=========
*/
void VM_localsound(prvm_prog_t *prog)
{
const char *s;
+ float chan, vol;
- VM_SAFEPARMCOUNT(1,VM_localsound);
+ VM_SAFEPARMCOUNTRANGE(1, 3,VM_localsound);
s = PRVM_G_STRING(OFS_PARM0);
-
- if(!S_LocalSound (s))
+ if(prog->argc == 3)
+ {
+ chan = PRVM_G_FLOAT(OFS_PARM1);
+ vol = PRVM_G_FLOAT(OFS_PARM2) == 0 ? 1 : PRVM_G_FLOAT(OFS_PARM2);
+ if(!S_LocalSoundEx(s, chan, vol))
+ {
+ PRVM_G_FLOAT(OFS_RETURN) = -4;
+ VM_Warning(prog, "VM_localsound: Failed to play %s for %s !\n", s, prog->name);
+ return;
+ }
+ }
+ else if(!S_LocalSound (s))
{
PRVM_G_FLOAT(OFS_RETURN) = -4;
VM_Warning(prog, "VM_localsound: Failed to play %s for %s !\n", s, prog->name);
/*
=================
-VM_localcmd_client
+VM_localcmd_local
Sends text over to the client's execution buffer
cmd (string, ...)
=================
*/
-void VM_localcmd_client(prvm_prog_t *prog)
+void VM_localcmd_local(prvm_prog_t *prog)
{
char string[VM_STRINGTEMP_LENGTH];
- VM_SAFEPARMCOUNTRANGE(1, 8, VM_localcmd_client);
+ VM_SAFEPARMCOUNTRANGE(1, 8, VM_localcmd_local);
VM_VarString(prog, 0, string, sizeof(string));
- Cbuf_AddText(cmd_client, string);
+ Cbuf_AddText(cmd_local, string);
}
/*
char string[VM_STRINGTEMP_LENGTH];
VM_SAFEPARMCOUNTRANGE(1, 8, VM_localcmd_server);
VM_VarString(prog, 0, string, sizeof(string));
- Cbuf_AddText(cmd_server, string);
+ Cbuf_AddText(cmd_local, string);
}
static qbool PRVM_Cvar_ReadOk(prvm_prog_t *prog, const char *string)
VM_SAFEPARMCOUNT(1, VM_ftoe);
ent = (prvm_int_t)PRVM_G_FLOAT(OFS_PARM0);
- if (ent < 0 || ent >= prog->max_edicts || PRVM_PROG_TO_EDICT(ent)->priv.required->free)
+ if (ent < 0 || ent >= prog->max_edicts || PRVM_PROG_TO_EDICT(ent)->free)
ent = 0; // return world instead of a free or invalid entity
PRVM_G_INT(OFS_RETURN) = ent;
if (developer.integer > 0)
VM_Warning(prog, "VM_remove: tried to remove the null entity or a reserved entity!\n" );
}
- else if( ed->priv.required->free )
+ else if( ed->free )
{
if (developer.integer > 0)
VM_Warning(prog, "VM_remove: tried to remove an already freed entity!\n" );
{
prog->xfunction->builtinsprofile++;
ed = PRVM_EDICT_NUM(e);
- if (ed->priv.required->free)
+ if (ed->free)
continue;
t = PRVM_E_STRING(ed,f);
if (!t)
{
prog->xfunction->builtinsprofile++;
ed = PRVM_EDICT_NUM(e);
- if (ed->priv.required->free)
+ if (ed->free)
continue;
if (PRVM_E_FLOAT(ed,f) == s)
{
for (i = 1;i < prog->num_edicts;i++, ent = PRVM_NEXT_EDICT(ent))
{
prog->xfunction->builtinsprofile++;
- if (ent->priv.required->free)
+ if (ent->free)
continue;
t = PRVM_E_STRING(ent,f);
if (!t)
for (i = 1;i < prog->num_edicts;i++, ent = PRVM_NEXT_EDICT(ent))
{
prog->xfunction->builtinsprofile++;
- if (ent->priv.required->free)
+ if (ent->free)
continue;
if (PRVM_E_FLOAT(ent,f) != s)
continue;
{
prog->xfunction->builtinsprofile++;
ed = PRVM_EDICT_NUM(e);
- if (ed->priv.required->free)
+ if (ed->free)
continue;
if (!PRVM_E_FLOAT(ed,f))
continue;
for (i = 1;i < prog->num_edicts;i++, ent = PRVM_NEXT_EDICT(ent))
{
prog->xfunction->builtinsprofile++;
- if (ent->priv.required->free)
+ if (ent->free)
continue;
if (!PRVM_E_FLOAT(ent,f))
continue;
*/
void VM_coredump(prvm_prog_t *prog)
{
- cmd_state_t *cmd = !host_isclient.integer ? cmd_server : cmd_client;
VM_SAFEPARMCOUNT(0,VM_coredump);
- Cbuf_AddText(cmd, "prvm_edicts ");
- Cbuf_AddText(cmd, prog->name);
- Cbuf_AddText(cmd, "\n");
+ Cbuf_AddText(cmd_local, "prvm_edicts ");
+ Cbuf_AddText(cmd_local, prog->name);
+ Cbuf_AddText(cmd_local, "\n");
}
/*
return;
}
ent = PRVM_EDICT_NUM(i);
- if (!ent->priv.required->free)
+ if (!ent->free)
{
VM_RETURN_EDICT(ent);
return;
return;
svs.changelevel_issued = true;
- Cbuf_AddText(cmd_server, va(vabuf, sizeof(vabuf), "changelevel %s\n", PRVM_G_STRING(OFS_PARM0)));
+ Cbuf_AddText(cmd_local, va(vabuf, sizeof(vabuf), "changelevel %s\n", PRVM_G_STRING(OFS_PARM0)));
}
/*
return;
// check for overlap with a command
- if (Cmd_Exists(cmd_client, name) || Cmd_Exists(cmd_server, name))
+ if (Cmd_Exists(cmd_local, name))
{
VM_Warning(prog, "VM_registercvar: %s is a command\n", name);
return;
}
ent = PRVM_G_EDICT(OFS_PARM1);
- if(ent->priv.required->free)
+ if(ent->free)
{
VM_Warning(prog, "VM_writetofile: %s: entity %i is free !\n", prog->name, PRVM_NUM_FOR_EDICT(ent));
return;
// get the entity
ent = PRVM_G_EDICT(OFS_PARM1);
- if(ent->priv.required->free)
+ if(ent->free)
{
PRVM_G_INT(OFS_RETURN) = PRVM_SetTempString(prog, "");
VM_Warning(prog, "VM_entityfielddata: %s: entity %i is free !\n", prog->name, PRVM_NUM_FOR_EDICT(ent));
// get the entity
ent = PRVM_G_EDICT(OFS_PARM1);
- if(ent->priv.required->free)
+ if(ent->free)
{
VM_Warning(prog, "VM_entityfielddata: %s: entity %i is free !\n", prog->name, PRVM_NUM_FOR_EDICT(ent));
PRVM_G_FLOAT(OFS_RETURN) = 0.0f;
// get edict and test it
ent = PRVM_G_EDICT(OFS_PARM0);
- if (ent->priv.required->free)
+ if (ent->free)
prog->error_cmd("VM_parseentitydata: %s: Can only set already spawned entities (entity %i is free)!", prog->name, PRVM_NUM_FOR_EDICT(ent));
data = PRVM_G_STRING(OFS_PARM1);
VM_Warning(prog, "changeyaw: can not modify world entity\n");
return;
}
- if (ent->priv.server->free)
+ if (ent->free)
{
VM_Warning(prog, "changeyaw: can not modify free entity\n");
return;
VM_Warning(prog, "changepitch: can not modify world entity\n");
return;
}
- if (ent->priv.server->free)
+ if (ent->free)
{
VM_Warning(prog, "changepitch: can not modify free entity\n");
return;
void VM_wasfreed (prvm_prog_t *prog)
{
VM_SAFEPARMCOUNT(1, VM_wasfreed);
- PRVM_G_FLOAT(OFS_RETURN) = PRVM_G_EDICT(OFS_PARM0)->priv.required->free;
+ PRVM_G_FLOAT(OFS_RETURN) = PRVM_G_EDICT(OFS_PARM0)->free;
}
void VM_SetTraceGlobals(prvm_prog_t *prog, const trace_t *trace)
ed = PRVM_G_EDICT(OFS_PARM0);
VectorCopy(PRVM_G_VECTOR(OFS_PARM1), point);
- if (!ed || ed->priv.server->free)
+ if (!ed || ed->free)
return;
model = getmodel(prog, ed);
if (!model || !model->num_surfaces)
// physics builtins
//
+#ifdef USEODE
#define VM_physics_ApplyCmd(ed,f) if (!ed->priv.server->ode_body) VM_physics_newstackfunction(prog, ed, f); else World_Physics_ApplyCmd(ed, f)
static edict_odefunc_t *VM_physics_newstackfunction(prvm_prog_t *prog, prvm_edict_t *ed, edict_odefunc_t *f)
}
return newfunc;
}
+#endif
// void(entity e, float physics_enabled) physics_enable = #;
void VM_physics_enable(prvm_prog_t *prog)
{
+#ifdef USEODE
prvm_edict_t *ed;
edict_odefunc_t f;
-
+#endif
VM_SAFEPARMCOUNT(2, VM_physics_enable);
+#ifdef USEODE
ed = PRVM_G_EDICT(OFS_PARM0);
if (!ed)
{
}
f.type = PRVM_G_FLOAT(OFS_PARM1) == 0 ? ODEFUNC_DISABLE : ODEFUNC_ENABLE;
VM_physics_ApplyCmd(ed, &f);
+#endif
}
// void(entity e, vector force, vector relative_ofs) physics_addforce = #;
void VM_physics_addforce(prvm_prog_t *prog)
{
+#ifdef USEODE
prvm_edict_t *ed;
edict_odefunc_t f;
-
+#endif
VM_SAFEPARMCOUNT(3, VM_physics_addforce);
+#ifdef USEODE
ed = PRVM_G_EDICT(OFS_PARM0);
if (!ed)
{
VectorCopy(PRVM_G_VECTOR(OFS_PARM1), f.v1);
VectorCopy(PRVM_G_VECTOR(OFS_PARM2), f.v2);
VM_physics_ApplyCmd(ed, &f);
+#endif
}
// void(entity e, vector torque) physics_addtorque = #;
void VM_physics_addtorque(prvm_prog_t *prog)
{
+#ifdef USEODE
prvm_edict_t *ed;
edict_odefunc_t f;
-
+#endif
VM_SAFEPARMCOUNT(2, VM_physics_addtorque);
+#ifdef USEODE
ed = PRVM_G_EDICT(OFS_PARM0);
if (!ed)
{
f.type = ODEFUNC_TORQUE;
VectorCopy(PRVM_G_VECTOR(OFS_PARM1), f.v1);
VM_physics_ApplyCmd(ed, &f);
+#endif
}
extern cvar_t prvm_coverage;
// general functions
void VM_CheckEmptyString (prvm_prog_t *prog, const char *s);
void VM_VarString(prvm_prog_t *prog, int first, char *out, int outlength);
+qbool PRVM_ConsoleCommand (prvm_prog_t *prog, const char *text, int *func, qbool preserve_self, int curself, double ptime, qbool prog_loaded, const char *error_message);
prvm_stringbuffer_t *BufStr_FindCreateReplace (prvm_prog_t *prog, int bufindex, int flags, const char *format);
void BufStr_Set(prvm_prog_t *prog, prvm_stringbuffer_t *stringbuffer, int strindex, const char *str);
void BufStr_Del(prvm_prog_t *prog, prvm_stringbuffer_t *stringbuffer);
void VM_random (prvm_prog_t *prog);
void VM_localsound(prvm_prog_t *prog);
void VM_break (prvm_prog_t *prog);
-void VM_localcmd_client(prvm_prog_t *prog);
+void VM_localcmd_local(prvm_prog_t *prog);
void VM_localcmd_server(prvm_prog_t *prog);
void VM_cvar (prvm_prog_t *prog);
void VM_cvar_string(prvm_prog_t *prog);
void PRVM_ED_ClearEdict(prvm_prog_t *prog, prvm_edict_t *e)
{
memset(e->fields.fp, 0, prog->entityfields * sizeof(prvm_vec_t));
- e->priv.required->free = false;
- e->priv.required->freetime = host.realtime;
+ e->free = false;
+ e->freetime = host.realtime;
if(e->priv.required->allocation_origin)
Mem_Free((char *)e->priv.required->allocation_origin);
e->priv.required->allocation_origin = PRVM_AllocationOrigin(prog);
*/
qbool PRVM_ED_CanAlloc(prvm_prog_t *prog, prvm_edict_t *e)
{
- if(!e->priv.required->free)
+ if(!e->free)
return false;
if(prvm_reuseedicts_always_allow == host.realtime)
return true;
- if(host.realtime <= e->priv.required->freetime + 0.1 && prvm_reuseedicts_neverinsameframe.integer)
+ if(host.realtime <= e->freetime + 0.1 && prvm_reuseedicts_neverinsameframe.integer)
return false; // never allow reuse in same frame (causes networking trouble)
- if(e->priv.required->freetime < prog->starttime + prvm_reuseedicts_startuptime.value)
+ if(e->freetime < prog->starttime + prvm_reuseedicts_startuptime.value)
return true;
- if(host.realtime > e->priv.required->freetime + 1)
+ if(host.realtime > e->freetime + 1)
return true;
return false; // entity slot still blocked because the entity was freed less than one second ago
}
prog->free_edict(prog, ed);
- ed->priv.required->free = true;
- ed->priv.required->freetime = host.realtime;
+ ed->free = true;
+ ed->freetime = host.realtime;
if(ed->priv.required->allocation_origin)
{
Mem_Free((char *)ed->priv.required->allocation_origin);
break;
case ev_float:
// LadyHavoc: changed from %5.1f to %10.4f
- dpsnprintf (line, linelength, FLOAT_LOSSLESS_FORMAT, val->_float);
+ dpsnprintf (line, linelength, PRVM_FLOAT_LOSSLESS_FORMAT, val->_float);
break;
case ev_vector:
// LadyHavoc: changed from %5.1f to %10.4f
- dpsnprintf (line, linelength, "'" VECTOR_LOSSLESS_FORMAT "'", val->vector[0], val->vector[1], val->vector[2]);
+ dpsnprintf (line, linelength, "'" PRVM_VECTOR_LOSSLESS_FORMAT "'", val->vector[0], val->vector[1], val->vector[2]);
break;
case ev_pointer:
dpsnprintf (line, linelength, "pointer");
dpsnprintf (line, linelength, "void");
break;
case ev_float:
- dpsnprintf (line, linelength, FLOAT_LOSSLESS_FORMAT, val->_float);
+ dpsnprintf (line, linelength, PRVM_FLOAT_LOSSLESS_FORMAT, val->_float);
break;
case ev_vector:
- dpsnprintf (line, linelength, VECTOR_LOSSLESS_FORMAT, val->vector[0], val->vector[1], val->vector[2]);
+ dpsnprintf (line, linelength, PRVM_VECTOR_LOSSLESS_FORMAT, val->vector[0], val->vector[1], val->vector[2]);
break;
default:
dpsnprintf (line, linelength, "bad type %i", type);
char tempstring[MAX_INPUTLINE], tempstring2[260]; // temporary string buffers
char valuebuf[MAX_INPUTLINE];
- if (ed->priv.required->free)
+ if (ed->free)
{
Con_Printf("%s: FREE\n",prog->name);
return;
FS_Print(f, "{\n");
- if (ed->priv.required->free)
+ if (ed->free)
{
FS_Print(f, "}\n");
return;
}
if (!init) {
- ent->priv.required->free = true;
- ent->priv.required->freetime = host.realtime;
+ ent->free = true;
+ ent->freetime = host.realtime;
}
return data;
//
// immediately call spawn function, but only if there is a self global and a classname
//
- if (!ent->priv.required->free)
+ if (!ent->free)
{
if (!PRVM_alledictstring(ent, classname))
{
void PRVM_ED_CallPostspawnFunction (prvm_prog_t *prog, prvm_edict_t *ent)
{
- if(!ent->priv.required->free)
+ if(!ent->free)
if (PRVM_serverfunction(SV_OnEntityPostSpawnFunction))
{
// self = ent
PRVM_ED_CallPrespawnFunction(prog, ent);
- if(ent->priv.required->free)
+ if(ent->free)
{
inhibited++;
continue;
PRVM_ED_CallPostspawnFunction(prog, ent);
spawned++;
- if (ent->priv.required->free)
+ if (ent->free)
died++;
}
for (ednum = 0;ednum < prog->max_edicts;ednum++)
{
ed = PRVM_EDICT_NUM(ednum);
- if (ed->priv.required->free)
+ if (ed->free)
continue;
for (i = 1;i < prog->numfielddefs;i++)
{
for(j = 0; j < prog->num_edicts; ++j)
{
prvm_edict_t *ed = PRVM_EDICT_NUM(j);
- if (ed->priv.required->free)
+ if (ed->free)
continue;
for (i=0; i<prog->numfielddefs; ++i)
{
char vabuf2[1024];
if(PRVM_NUM_FOR_EDICT(edict) <= prog->reserved_edicts)
return true; // world or clients
- if (edict->priv.required->freetime <= prog->inittime)
+ if (edict->freetime <= prog->inittime)
return true; // created during startup
if (prog == SVVM_prog)
{
for(j = 0; j < prog->num_edicts; ++j)
{
prvm_edict_t *ed = PRVM_EDICT_NUM(j);
- if(ed->priv.required->free)
+ if(ed->free)
continue;
ed->priv.required->mark = PRVM_IsEdictRelevant(prog, ed) ? stage : 0;
}
for(j = 0; j < prog->num_edicts; ++j)
{
prvm_edict_t *ed = PRVM_EDICT_NUM(j);
- if(ed->priv.required->free)
+ if(ed->free)
continue;
if(ed->priv.required->mark)
continue;
for(j = 0; j < prog->num_edicts; ++j)
{
prvm_edict_t *ed = PRVM_EDICT_NUM(j);
- if(ed->priv.required->free)
+ if(ed->free)
continue;
if(!ed->priv.required->mark)
if(ed->priv.required->allocation_origin)
OPC->_float = OPA->_float < OPB->_float;
DISPATCH_OPCODE();
HANDLE_OPCODE(OP_AND):
- OPC->_float = FLOAT_IS_TRUE_FOR_INT(OPA->_int) && FLOAT_IS_TRUE_FOR_INT(OPB->_int); // TODO change this back to float, and add AND_I to be used by fteqcc for anything not a float
+ OPC->_float = PRVM_FLOAT_IS_TRUE_FOR_INT(OPA->_int) && PRVM_FLOAT_IS_TRUE_FOR_INT(OPB->_int); // TODO change this back to float, and add AND_I to be used by fteqcc for anything not a float
DISPATCH_OPCODE();
HANDLE_OPCODE(OP_OR):
- OPC->_float = FLOAT_IS_TRUE_FOR_INT(OPA->_int) || FLOAT_IS_TRUE_FOR_INT(OPB->_int); // TODO change this back to float, and add OR_I to be used by fteqcc for anything not a float
+ OPC->_float = PRVM_FLOAT_IS_TRUE_FOR_INT(OPA->_int) || PRVM_FLOAT_IS_TRUE_FOR_INT(OPB->_int); // TODO change this back to float, and add OR_I to be used by fteqcc for anything not a float
DISPATCH_OPCODE();
HANDLE_OPCODE(OP_NOT_F):
- OPC->_float = !FLOAT_IS_TRUE_FOR_INT(OPA->_int);
+ OPC->_float = !PRVM_FLOAT_IS_TRUE_FOR_INT(OPA->_int);
DISPATCH_OPCODE();
HANDLE_OPCODE(OP_NOT_V):
OPC->_float = !OPA->vector[0] && !OPA->vector[1] && !OPA->vector[2];
#define DP_FUNC_PRINTF(n) __attribute__ ((format (printf, n, n+1)))
#define DP_FUNC_PURE __attribute__ ((pure))
#define DP_FUNC_NORETURN __attribute__ ((noreturn))
+#define DP_FUNC_ALWAYS_INLINE inline __attribute__((always_inline))
#else
#define DP_FUNC_PRINTF(n)
#define DP_FUNC_PURE
#define DP_FUNC_NORETURN
-#endif
-
-#ifdef DP_GCC_COMPATIBLE
-#define Q_typeof(var) typeof(var)
-#elif defined (MSVC)
-#define Q_typeof(var) decltype(var)
+# if defined (_MSC_VER)
+# define DP_FUNC_ALWAYS_INLINE __forceinline
+# else
+# define DP_FUNC_ALWAYS_INLINE inline
+# endif
#endif
#define MAX_NUM_ARGVS 50
// This also includes extended characters, and ALL control chars
#define ISWHITESPACEORCONTROL(ch) ((signed char) (ch) <= (signed char) ' ')
-#ifdef PRVM_64
-#define FLOAT_IS_TRUE_FOR_INT(x) ((x) & 0x7FFFFFFFFFFFFFFF) // also match "negative zero" doubles of value 0x8000000000000000
-#define FLOAT_LOSSLESS_FORMAT "%.17g"
-#define VECTOR_LOSSLESS_FORMAT "%.17g %.17g %.17g"
-#else
+#define DOUBLE_IS_TRUE_FOR_INT(x) ((x) & 0x7FFFFFFFFFFFFFFF) // also match "negative zero" doubles of value 0x8000000000000000
+#define DOUBLE_LOSSLESS_FORMAT "%.17g"
+#define DOUBLE_VECTOR_LOSSLESS_FORMAT "%.17g %.17g %.17g"
+
#define FLOAT_IS_TRUE_FOR_INT(x) ((x) & 0x7FFFFFFF) // also match "negative zero" floats of value 0x80000000
#define FLOAT_LOSSLESS_FORMAT "%.9g"
-#define VECTOR_LOSSLESS_FORMAT "%.9g %.9g %.9g"
-#endif
+#define FLOAT_VECTOR_LOSSLESS_FORMAT "%.9g %.9g %.9g"
// originally this was _MSC_VER
// but here we want to test the system libc, which on win32 is borked, and NOT the compiler
#define INT_LOSSLESS_FORMAT_CONVERT_U(x) ((uintmax_t)(x))
#endif
+// simple safe library to handle integer overflows when doing buffer size calculations
+// Usage:
+// - calculate data size using INTOVERFLOW_??? macros
+// - compare: calculated-size <= INTOVERFLOW_NORMALIZE(buffersize)
+// Functionality:
+// - all overflows (values > INTOVERFLOW_MAX) and errors are mapped to INTOVERFLOW_MAX
+// - if any input of an operation is INTOVERFLOW_MAX, INTOVERFLOW_MAX will be returned
+// - otherwise, regular arithmetics apply
+
+#define INTOVERFLOW_MAX 2147483647
+
+#define INTOVERFLOW_ADD(a,b) (((a) < INTOVERFLOW_MAX && (b) < INTOVERFLOW_MAX && (a) < INTOVERFLOW_MAX - (b)) ? ((a) + (b)) : INTOVERFLOW_MAX)
+#define INTOVERFLOW_SUB(a,b) (((a) < INTOVERFLOW_MAX && (b) < INTOVERFLOW_MAX && (b) <= (a)) ? ((a) - (b)) : INTOVERFLOW_MAX)
+#define INTOVERFLOW_MUL(a,b) (((a) < INTOVERFLOW_MAX && (b) < INTOVERFLOW_MAX && (a) < INTOVERFLOW_MAX / (b)) ? ((a) * (b)) : INTOVERFLOW_MAX)
+#define INTOVERFLOW_DIV(a,b) (((a) < INTOVERFLOW_MAX && (b) < INTOVERFLOW_MAX && (b) > 0) ? ((a) / (b)) : INTOVERFLOW_MAX)
+
+#define INTOVERFLOW_NORMALIZE(a) (((a) < INTOVERFLOW_MAX) ? (a) : (INTOVERFLOW_MAX - 1))
+
#endif
#define RESTRICT
#endif
+typedef int8_t i8;
+typedef int16_t i16;
+typedef int32_t i32;
+typedef int64_t i64;
+
+typedef uint8_t u8;
+typedef uint16_t u16;
+typedef uint32_t u32;
+typedef uint64_t u64;
+
+typedef intptr_t iptr;
+typedef uintptr_t uptr;
+
// LadyHavoc: upgrade the prvm to double precision for better time values
// LadyHavoc: to be enabled when bugs are worked out...
//#define PRVM_64
typedef vec_t vec2_t[2];
typedef vec_t vec3_t[3];
typedef vec_t vec4_t[4];
-typedef vec_t vec5_t[5];
-typedef vec_t vec6_t[6];
-typedef vec_t vec7_t[7];
-typedef vec_t vec8_t[8];
-
#endif
}
if(R_CompileShader_CheckStaticParms())
- R_GLSL_Restart_f(cmd_client);
+ R_GLSL_Restart_f(cmd_local);
}
qbool R_Shadow_ShadowMappingEnabled(void)
if (r_editlights_sprcubemapnoshadowlight) { R_SkinFrame_MarkUsed(r_editlights_sprcubemapnoshadowlight); }
if (r_editlights_sprselection) { R_SkinFrame_MarkUsed(r_editlights_sprselection); }
if (strncmp(cl.worldname, r_shadow_mapname, sizeof(r_shadow_mapname)))
- R_Shadow_EditLights_Reload_f(cmd_client);
+ R_Shadow_EditLights_Reload_f(cmd_local);
}
void R_Shadow_Init(void)
continue;
}
// skip if expanded light box is offscreen
- if (R_CullBox(cullmins, cullmaxs))
+ if (R_CullFrustum(cullmins, cullmaxs))
continue;
// skip if overall light intensity is zero
if (w * VectorLength2(rtlight->color) == 0.0f)
if ((remainingbounces == r_shadow_bouncegrid_state.settings.maxbounce || r_shadow_bouncegrid_state.settings.includedirectlighting) && p->numpaths < PHOTON_MAX_PATHS)
{
qbool notculled = true;
- // cull paths that fail R_CullBox in dynamic mode
+ // cull paths that fail R_CullFrustum in dynamic mode
if (!r_shadow_bouncegrid_state.settings.staticmode
&& r_shadow_bouncegrid_dynamic_culllightpaths.integer)
{
cullmaxs[0] = max(shotstart[0], shothit[0]) + r_shadow_bouncegrid_state.settings.spacing[0] + r_shadow_bouncegrid_state.settings.lightpathsize;
cullmaxs[1] = max(shotstart[1], shothit[1]) + r_shadow_bouncegrid_state.settings.spacing[1] + r_shadow_bouncegrid_state.settings.lightpathsize;
cullmaxs[2] = max(shotstart[2], shothit[2]) + r_shadow_bouncegrid_state.settings.spacing[2] + r_shadow_bouncegrid_state.settings.lightpathsize;
- if (R_CullBox(cullmins, cullmaxs))
+ if (R_CullFrustum(cullmins, cullmaxs))
notculled = false;
}
if (notculled)
}
// skip if the light box is off screen
- if (R_CullBox(rtlight->cullmins, rtlight->cullmaxs))
+ if (R_CullFrustum(rtlight->cullmins, rtlight->cullmaxs))
return;
// in the typical case this will be quickly replaced by GetLightInfo
shadowtrispvs = r_shadow_buffer_shadowtrispvs;
lighttrispvs = r_shadow_buffer_lighttrispvs;
// if the reduced leaf bounds are offscreen, skip it
- if (R_CullBox(rtlight->cached_cullmins, rtlight->cached_cullmaxs))
+ if (R_CullFrustum(rtlight->cached_cullmins, rtlight->cached_cullmaxs))
return;
}
else
continue;
// skip the object entirely if it is not within the valid
// shadow-casting region (which includes the lit region)
- if (R_CullBoxCustomPlanes(ent->mins, ent->maxs, rtlight->cached_numfrustumplanes, rtlight->cached_frustumplanes))
+ if (R_CullBox(ent->mins, ent->maxs, rtlight->cached_numfrustumplanes, rtlight->cached_frustumplanes))
continue;
if (!(model = ent->model))
continue;
if (!light)
continue;
R_Shadow_SelectLight(light);
- R_Shadow_EditLights_Edit_f(cmd_client);
+ R_Shadow_EditLights_Edit_f(cmd_local);
}
// return to old selected (to not mess editing once selection is locked)
R_Shadow_SelectLight(oldselected);
i++;
x2 = max(x, x + width - sum * scalex);
y2 = y + height - (data[index] - range_min) * scaley;
- DrawQ_Line(1, x1, y1, x2, y2, r_speeds_graph_colors[color][0], r_speeds_graph_colors[color][1], r_speeds_graph_colors[color][2], r_speeds_graph_colors[color][3], 0, true);
+ DrawQ_Line(1, x1, y1, x2, y2, r_speeds_graph_colors[color][0], r_speeds_graph_colors[color][1], r_speeds_graph_colors[color][2], r_speeds_graph_colors[color][3], 0);
}
}
}
#define gl_solid_format 3
#define gl_alpha_format 4
-int R_CullBox(const vec3_t mins, const vec3_t maxs);
-int R_CullBoxCustomPlanes(const vec3_t mins, const vec3_t maxs, int numplanes, const mplane_t *planes);
+qbool R_CullFrustum(const vec3_t mins, const vec3_t maxs);
+qbool R_CullBox(const vec3_t mins, const vec3_t maxs, int numplanes, const mplane_t *planes);
qbool R_CanSeeBox(int numsamples, vec_t eyejitter, vec_t entboxenlarge, vec_t entboxexpand, vec_t pad, vec3_t eye, vec3_t entboxmins, vec3_t entboxmaxs);
#include "r_modules.h"
Cvar_RegisterVariable(&cl_showdate_format);
Cvar_RegisterVariable(&cl_showtex);
- Cvar_RegisterAlias(&cl_showfps, "showfps");
- Cvar_RegisterAlias(&cl_showsound, "showsound");
- Cvar_RegisterAlias(&cl_showblur, "showblur");
- Cvar_RegisterAlias(&cl_showspeed, "showspeed");
- Cvar_RegisterAlias(&cl_showtopspeed, "showtopspeed");
- Cvar_RegisterAlias(&cl_showtime, "showtime");
- Cvar_RegisterAlias(&cl_showtime_format, "showtime_format");
- Cvar_RegisterAlias(&cl_showdate, "showdate");
- Cvar_RegisterAlias(&cl_showdate_format, "showdate_format");
- Cvar_RegisterAlias(&cl_showtex, "showtex");
+ Cvar_RegisterVirtual(&cl_showfps, "showfps");
+ Cvar_RegisterVirtual(&cl_showsound, "showsound");
+ Cvar_RegisterVirtual(&cl_showblur, "showblur");
+ Cvar_RegisterVirtual(&cl_showspeed, "showspeed");
+ Cvar_RegisterVirtual(&cl_showtopspeed, "showtopspeed");
+ Cvar_RegisterVirtual(&cl_showtime, "showtime");
+ Cvar_RegisterVirtual(&cl_showtime_format, "showtime_format");
+ Cvar_RegisterVirtual(&cl_showdate, "showdate");
+ Cvar_RegisterVirtual(&cl_showdate_format, "showdate_format");
+ Cvar_RegisterVirtual(&cl_showtex, "showtex");
Cvar_RegisterVariable(&sbar_alpha_bg);
Cvar_RegisterVariable(&sbar_alpha_fg);
void SV_StartPointSound (vec3_t origin, const char *sample, int volume, float attenuation, float speed);
void SV_ConnectClient (int clientnum, netconn_t *netconnection);
-void SV_DropClient (qbool crash);
+void SV_DropClient (qbool leaving, const char *reason, ... );
void SV_ClientCommands(const char *fmt, ...) DP_FUNC_PRINTF(1);
void SV_SetupVM(void);
-const char *Host_TimingReport(char *buf, size_t buflen); ///< for output in SV_Status_f
+const char *SV_TimingReport(char *buf, size_t buflen); ///< for output in SV_Status_f
int SV_GetPitchSign(prvm_prog_t *prog, prvm_edict_t *ent);
void SV_GetEntityMatrix(prvm_prog_t *prog, prvm_edict_t *ent, matrix4x4_t *out, qbool viewmatrix);
if (Sys_CheckParm("-nosound"))
{
// dummy out Play and Play2 because mods stuffcmd that
- Cmd_AddCommand(CF_CLIENT, "play", Host_NoOperation_f, "does nothing because -nosound was specified");
- Cmd_AddCommand(CF_CLIENT, "play2", Host_NoOperation_f, "does nothing because -nosound was specified");
+ Cmd_AddCommand(CF_CLIENT, "play", Cmd_NoOperation_f, "does nothing because -nosound was specified");
+ Cmd_AddCommand(CF_CLIENT, "play2", Cmd_NoOperation_f, "does nothing because -nosound was specified");
return;
}
S_PaintAndSubmit();
}
-qbool S_LocalSound (const char *sound)
+qbool S_LocalSoundEx (const char *sound, int chan, float fvol)
{
sfx_t *sfx;
int ch_ind;
// fun fact: in Quake 1, this used -1 "replace any entity channel",
// which we no longer support anyway
// changed by Black in r4297 "Changed S_LocalSound to play multiple sounds at a time."
- ch_ind = S_StartSound (cl.viewentity, 0, sfx, vec3_origin, 1, 0);
+ ch_ind = S_StartSound (cl.viewentity, chan, sfx, vec3_origin, fvol, 0);
if (ch_ind < 0)
return false;
channels[ch_ind].flags |= CHANNELFLAG_LOCALSOUND;
return true;
}
+
+qbool S_LocalSound (const char *sound)
+{
+ return S_LocalSoundEx(sound, 0, 1);
+}
return false;
}
+qbool S_LocalSoundEx (const char *s, int chan, float fvol)
+{
+ return false;
+}
+
void S_BlockSound (void)
{
}
// S_StartSound returns the channel index, or -1 if an error occurred
int S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation);
int S_StartSound_StartPosition_Flags (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation, float startposition, int flags, float fspeed);
+qbool S_LocalSoundEx (const char *s, int chan, float fvol);
qbool S_LocalSound (const char *s);
void S_StaticSound (sfx_t *sfx, vec3_t origin, float fvol, float attenuation);
Cvar_Set(&cvars_all, "warpmark", "");
if(host.hook.Disconnect)
- host.hook.Disconnect();
+ host.hook.Disconnect(false, NULL);
SV_Shutdown();
print ("version: %s build %s (gamename %s)\n", gamename, buildstring, gamenetworkfiltername);
print ("protocol: %i (%s)\n", Protocol_NumberForEnum(sv.protocol), Protocol_NameForEnum(sv.protocol));
print ("map: %s\n", sv.name);
- print ("timing: %s\n", Host_TimingReport(vabuf, sizeof(vabuf)));
+ print ("timing: %s\n", SV_TimingReport(vabuf, sizeof(vabuf)));
print ("players: %i active (%i max)\n\n", players, svs.maxclients);
if (in == 1)
{
const char *who;
const char *message = NULL;
+ char reason[512];
client_t *save;
int i;
qbool byNumber = false;
message++;
}
if (message)
- SV_ClientPrintf("Kicked by %s: %s\n", who, message);
+ SV_DropClient (false, va(reason, sizeof(reason), "Kicked by %s: %s", who, message)); // kicked
+ //SV_ClientPrintf("Kicked by %s: %s\n", who, message);
else
- SV_ClientPrintf("Kicked by %s\n", who);
- SV_DropClient (false); // kicked
+ //SV_ClientPrintf("Kicked by %s\n", who);
+ SV_DropClient (false, va(reason, sizeof(reason), "Kicked by %s", who)); // kicked
}
host_client = save;
return;
}
- if(!ed->priv.required->free)
+ if(!ed->free)
{
print("Removed a \"%s\"\n", PRVM_GetString(prog, PRVM_serveredictstring(ed, classname)));
PRVM_ED_ClearEdict(prog, ed);
for (i = 0, rmcount = 0, ed = PRVM_EDICT_NUM(i); i < prog->num_edicts; i++, ed = PRVM_NEXT_EDICT(ed))
{
- if(!ed->priv.required->free && !strcmp(PRVM_GetString(prog, PRVM_serveredictstring(ed, classname)), Cmd_Argv(cmd, 1)))
+ if(!ed->free && !strcmp(PRVM_GetString(prog, PRVM_serveredictstring(ed, classname)), Cmd_Argv(cmd, 1)))
{
if(!i)
{
Cmd_AddCommand(CF_SHARED, "maxplayers", SV_MaxPlayers_f, "sets limit on how many players (or bots) may be connected to the server at once");
host.hook.SV_SendCvar = SV_SendCvar_f;
- // commands that do not have automatic forwarding from cmd_client, these are internal details of the network protocol and not of interest to users (if they know what they are doing they can still use a generic "cmd prespawn" or similar)
+ // commands that do not have automatic forwarding from cmd_local, these are internal details of the network protocol and not of interest to users (if they know what they are doing they can still use a generic "cmd prespawn" or similar)
Cmd_AddCommand(CF_SERVER_FROM_CLIENT, "prespawn", SV_PreSpawn_f, "internal use - signon 1 (client acknowledges that server information has been received)");
Cmd_AddCommand(CF_SERVER_FROM_CLIENT, "spawn", SV_Spawn_f, "internal use - signon 2 (client has sent player information, and is asking server to send scoreboard rankings)");
Cmd_AddCommand(CF_SERVER_FROM_CLIENT, "begin", SV_Begin_f, "internal use - signon 3 (client asks server to start sending entities, and will go to signon 4 (playing) when the first entity update is received)");
cvar_t pr_checkextension = {CF_SERVER | CF_READONLY, "pr_checkextension", "1", "indicates to QuakeC that the standard quakec extensions system is available (if 0, quakec should not attempt to use extensions)"};
cvar_t samelevel = {CF_SERVER | CF_NOTIFY, "samelevel","0", "repeats same level if level ends (due to timelimit or someone hitting an exit)"};
cvar_t skill = {CF_SERVER, "skill","1", "difficulty level of game, affects monster layouts in levels, 0 = easy, 1 = normal, 2 = hard, 3 = nightmare (same layout as hard but monsters fire twice)"};
+cvar_t campaign = {CF_SERVER, "campaign", "0", "singleplayer mode"};
cvar_t host_timescale = {CF_CLIENT | CF_SERVER, "host_timescale", "1.0", "controls game speed, 0.5 is half speed, 2 is double speed"};
cvar_t sv_accelerate = {CF_SERVER, "sv_accelerate", "10", "rate at which a player accelerates to sv_maxspeed"};
cvar_t sv_mapformat_is_quake2 = {CF_SERVER, "sv_mapformat_is_quake2", "0", "indicates the current map is q2bsp format (useful to know because of different entity behaviors, .frame on submodels and other things)"};
cvar_t sv_mapformat_is_quake3 = {CF_SERVER, "sv_mapformat_is_quake3", "0", "indicates the current map is q2bsp format (useful to know because of different entity behaviors)"};
+cvar_t sv_writepicture_quality = {CF_SERVER | CF_ARCHIVE, "sv_writepicture_quality", "10", "WritePicture quality offset (higher means better quality, but slower)"};
+
server_t sv;
server_static_t svs;
World_PrintAreaStats(&sv.world, "server");
}
-static qbool SV_CanSave(void)
-{
- prvm_prog_t *prog = SVVM_prog;
- if(SV_IsLocalServer() == 1)
- {
- // singleplayer checks
- if ((svs.clients[0].active && PRVM_serveredictfloat(svs.clients[0].edict, deadflag)))
- {
- Con_Print("Can't savegame with a dead player\n");
- return false;
- }
-
- if(host.hook.CL_Intermission && host.hook.CL_Intermission())
- {
- Con_Print("Can't save in intermission.\n");
- return false;
- }
- }
- else
- Con_Print(CON_WARN "Warning: saving a multiplayer game may have strange results when restored (to properly resume, all players must join in the same player slots and then the game can be reloaded).\n");
- return true;
-
-}
-
static void SV_ServerOptions (void)
{
int i;
Cvar_RegisterVariable (&pr_checkextension);
Cvar_RegisterVariable (&samelevel);
Cvar_RegisterVariable (&skill);
+ Cvar_RegisterVariable (&campaign);
Cvar_RegisterVariable (&host_timescale);
Cvar_RegisterCallback (&host_timescale, Host_Timescale_c);
- Cvar_RegisterAlias (&host_timescale, "slowmo");
- Cvar_RegisterAlias (&host_timescale, "timescale");
+ Cvar_RegisterVirtual (&host_timescale, "slowmo");
+ Cvar_RegisterVirtual (&host_timescale, "timescale");
Cvar_RegisterVariable (&sv_accelerate);
Cvar_RegisterVariable (&sv_aim);
Cvar_RegisterVariable (&sv_airaccel_qw);
Cvar_RegisterVariable (&sv_protocolname);
Cvar_RegisterVariable (&sv_random_seed);
Cvar_RegisterVariable (&host_limitlocal);
- Cvar_RegisterAlias(&host_limitlocal, "sv_ratelimitlocalplayer");
+ Cvar_RegisterVirtual(&host_limitlocal, "sv_ratelimitlocalplayer");
Cvar_RegisterVariable (&sv_sound_land);
Cvar_RegisterVariable (&sv_sound_watersplash);
Cvar_RegisterVariable (&sv_stepheight);
Cvar_RegisterVariable (&sv_mapformat_is_quake2);
Cvar_RegisterVariable (&sv_mapformat_is_quake3);
+ Cvar_RegisterVariable (&sv_writepicture_quality);
+
SV_InitOperatorCommands();
- host.hook.SV_CanSave = SV_CanSave;
+ host.hook.SV_Shutdown = SV_Shutdown;
sv_mempool = Mem_AllocPool("server", 0, NULL);
SV_ServerOptions();
+ Cvar_Callback(&sv_netport);
}
static void SV_SaveEntFile_f(cmd_state_t *cmd)
SV_DropClient
Called when the player is getting totally kicked off the host
-if (crash = true), don't bother sending signofs
+if (leaving = true), don't bother sending signofs
=====================
*/
-void SV_DropClient(qbool crash)
+void SV_DropClient(qbool leaving, const char *fmt, ... )
{
prvm_prog_t *prog = SVVM_prog;
int i;
- Con_Printf("Client \"%s\" dropped\n", host_client->name);
+
+ va_list argptr;
+ char reason[512] = "";
+
+ Con_Printf("Client \"%s\" dropped", host_client->name);
+
+ if(fmt)
+ {
+ va_start(argptr, fmt);
+ dpvsnprintf(reason, sizeof(reason), fmt, argptr);
+ va_end(argptr);
+
+ Con_Printf(" (%s)\n", reason);
+ }
+ else
+ {
+ Con_Printf(" \n");
+ }
SV_StopDemoRecording(host_client);
if (host_client->netconnection)
{
// tell the client to be gone
- if (!crash)
+ if (!leaving)
{
// LadyHavoc: no opportunity for resending, so use unreliable 3 times
- unsigned char bufdata[8];
+ unsigned char bufdata[520]; // Disconnect reason string can be 512 characters
sizebuf_t buf;
memset(&buf, 0, sizeof(buf));
buf.data = bufdata;
buf.maxsize = sizeof(bufdata);
MSG_WriteByte(&buf, svc_disconnect);
+ if(fmt)
+ {
+ if(sv.protocol == PROTOCOL_DARKPLACES8)
+ MSG_WriteString(&buf, reason);
+ else
+ SV_ClientPrintf("%s\n", reason);
+ }
NetConn_SendUnreliableMessage(host_client->netconnection, &buf, sv.protocol, 10000, 0, false);
NetConn_SendUnreliableMessage(host_client->netconnection, &buf, sv.protocol, 10000, 0, false);
NetConn_SendUnreliableMessage(host_client->netconnection, &buf, sv.protocol, 10000, 0, false);
NetConn_Close(host_client->netconnection);
host_client->netconnection = NULL;
}
+ if(fmt)
+ SV_BroadcastPrintf("\003^3%s left the game (%s)\n", host_client->name, reason);
+ else
+ SV_BroadcastPrintf("\003^3%s left the game\n", host_client->name);
// if a download is active, close it
if (host_client->download_file)
if (!sv_allowdownloads_archive.integer)
{
- if (!strcasecmp(extension, "pak") || !strcasecmp(extension, "pk3"))
+ if (!strcasecmp(extension, "pak") || !strcasecmp(extension, "pk3") || !strcasecmp(extension, "dpk"))
{
SV_ClientPrintf("Download rejected: file \"%s\" is an archive\nYou must separately download or purchase the data archives for this game/mod to get this file\n", host_client->download_name);
SV_ClientCommands("\nstopdownload\n");
{
prvm_prog_t *prog = SVVM_prog;
int modelindex;
- if (!ed || ed->priv.server->free)
+ if (!ed || ed->free)
return NULL;
modelindex = (int)PRVM_serveredictfloat(ed, modelindex);
return (modelindex > 0 && modelindex < MAX_MODELS) ? sv.models[modelindex] : NULL;
// LadyHavoc: always clear state values, whether the entity is in use or not
svent->priv.server->baseline = defaultstate;
- if (svent->priv.server->free)
+ if (svent->free)
continue;
if (entnum > svs.maxclients && !PRVM_serveredictfloat(svent, modelindex))
continue;
//
// make cvars consistant
//
+
if (coop.integer)
+ {
Cvar_SetValueQuick(&deathmatch, 0);
+ Cvar_SetValueQuick(&campaign, 0);
+ }
+ else if(!deathmatch.integer)
+ Cvar_SetValueQuick(&campaign, 1);
+ else
+ Cvar_SetValueQuick(&campaign, 0);
// LadyHavoc: it can be useful to have skills outside the range 0-3...
//current_skill = bound(0, (int)(skill.value + 0.5), 3);
//Cvar_SetValue ("skill", (float)current_skill);
// AK possible hack since num_edicts is still 0
ent = PRVM_EDICT_NUM(0);
memset (ent->fields.fp, 0, prog->entityfields * sizeof(prvm_vec_t));
- ent->priv.server->free = false;
+ ent->free = false;
PRVM_serveredictstring(ent, model) = PRVM_SetEngineString(prog, sv.worldname);
PRVM_serveredictfloat(ent, modelindex) = 1; // world model
PRVM_serveredictfloat(ent, solid) = SOLID_BSP;
prvm_prog_t *prog = SVVM_prog;
int i;
- Con_DPrintf("SV_Shutdown\n");
+ SV_LockThreadMutex();
if (!sv.active)
- return;
+ goto end;
+
+ Con_DPrintf("SV_Shutdown\n");
NetConn_Heartbeat(2);
NetConn_Heartbeat(2);
}
for (i = 0, host_client = svs.clients;i < svs.maxclients;i++, host_client++)
if (host_client->active)
- SV_DropClient(false); // server shutdown
+ SV_DropClient(false, "Server shutting down"); // server shutdown
NetConn_CloseServerPorts();
//
memset(&sv, 0, sizeof(sv));
memset(svs.clients, 0, svs.maxclients*sizeof(client_t));
-
- cl.islocalgame = false;
+end:
+ SV_UnlockThreadMutex();
}
/////////////////////////////////////////////////////
// link every entity except world
for (i = 1, ent = prog->edicts;i < prog->num_edicts;i++, ent++)
- if (!ent->priv.server->free && !VectorCompare(PRVM_serveredictvector(ent, absmin), PRVM_serveredictvector(ent, absmax)))
+ if (!ent->free && !VectorCompare(PRVM_serveredictvector(ent, absmin), PRVM_serveredictvector(ent, absmax)))
SV_LinkEdict(ent);
}
PRVM_serveredictfloat(ed, solid) = 0;
VM_RemoveEdictSkeleton(prog, ed);
+#ifdef USEODE
World_Physics_RemoveFromEntity(&sv.world, ed);
World_Physics_RemoveJointFromEntity(&sv.world, ed);
-
+#endif
// make sure csqc networking is aware of the removed entity
e = PRVM_NUM_FOR_EDICT(ed);
sv.csqcentityversion[e] = 0;
for (i=0 ; i<prog->num_edicts ; i++)
{
ent = PRVM_EDICT_NUM(i);
- if (ent->priv.server->free)
+ if (ent->free)
continue;
active++;
if (PRVM_serveredictfloat(ent, solid))
static void SV_VM_Setup(void)
{
prvm_prog_t *prog = SVVM_prog;
- PRVM_Prog_Init(prog, cmd_server);
+ PRVM_Prog_Init(prog, cmd_local);
// allocate the mempools
// TODO: move the magic numbers/constants into #defines [9/13/2006 Black]
// never timeout loopback connections
for (i = (host_isclient.integer ? 1 : 0), host_client = &svs.clients[i]; i < svs.maxclients; i++, host_client++)
- {
if (host_client->netconnection && host.realtime > host_client->netconnection->timeout)
- {
- Con_Printf("Client \"%s\" connection timed out\n", host_client->name);
- SV_DropClient(false);
- }
- }
+ SV_DropClient(false, "Timed out");
+}
+
+/*
+==================
+SV_TimeReport
+
+Returns a time report string, for example for
+==================
+*/
+const char *SV_TimingReport(char *buf, size_t buflen)
+{
+ return va(buf, buflen, "%.1f%% CPU, %.2f%% lost, offset avg %.1fms, max %.1fms, sdev %.1fms", svs.perf_cpuload * 100, svs.perf_lost * 100, svs.perf_offset_avg * 1000, svs.perf_offset_max * 1000, svs.perf_offset_sdev * 1000);
}
extern cvar_t host_maxwait;
}
if(svs.perf_lost > 0 && developer_extra.integer && playing) // only complain if anyone is looking
- Con_DPrintf("Server can't keep up: %s\n", Host_TimingReport(vabuf, sizeof(vabuf)));
+ Con_DPrintf("Server can't keep up: %s\n", SV_TimingReport(vabuf, sizeof(vabuf)));
}
if(svs.perf_acc_realtime > 5 || sv.time < 10)
}
if(svs.perf_lost > 0 && developer_extra.integer)
if(playing)
- Con_DPrintf("Server can't keep up: %s\n", Host_TimingReport(vabuf, sizeof(vabuf)));
+ Con_DPrintf("Server can't keep up: %s\n", SV_TimingReport(vabuf, sizeof(vabuf)));
svs.perf_acc_realtime = svs.perf_acc_sleeptime = svs.perf_acc_lost = svs.perf_acc_offset = svs.perf_acc_offset_squared = svs.perf_acc_offset_max = svs.perf_acc_offset_samples = 0;
}
for (edictindex = 1;edictindex < prog->num_edicts;edictindex++)
{
ed = PRVM_EDICT_NUM(edictindex);
- if (!ed->priv.required->free && BoxesOverlap(PRVM_serveredictvector(ed, absmin), PRVM_serveredictvector(ed, absmax), paddedmins, paddedmaxs))
+ if (!ed->free && BoxesOverlap(PRVM_serveredictvector(ed, absmin), PRVM_serveredictvector(ed, absmax), paddedmins, paddedmaxs))
{
resultedicts[numresultedicts++] = ed;
if (numresultedicts == maxedicts)
if (ent == prog->edicts)
return; // don't add the world
- if (ent->priv.server->free)
+ if (ent->free)
return;
if (PRVM_serveredictfloat(ent, solid) == SOLID_NOT)
if (ent == prog->edicts)
return; // don't add the world
- if (ent->priv.server->free)
+ if (ent->free)
return;
modelindex = (int)PRVM_serveredictfloat(ent, modelindex);
if (PRVM_serveredictfloat(ent, nextthink) <= 0 || PRVM_serveredictfloat(ent, nextthink) > sv.time + sv.frametime)
return true;
- for (iterations = 0;iterations < 128 && !ent->priv.server->free;iterations++)
+ for (iterations = 0;iterations < 128 && !ent->free;iterations++)
{
PRVM_serverglobalfloat(time) = max(sv.time, PRVM_serveredictfloat(ent, nextthink));
PRVM_serveredictfloat(ent, nextthink) = 0;
if (PRVM_serveredictfloat(ent, nextthink) <= PRVM_serverglobalfloat(time) || PRVM_serveredictfloat(ent, nextthink) > sv.time + sv.frametime || !sv_gameplayfix_multiplethinksperframe.integer)
break;
}
- return !ent->priv.server->free;
+ return !ent->free;
}
/*
VM_SetTraceGlobals(prog, trace);
- if (!e1->priv.server->free && !e2->priv.server->free && PRVM_serveredictfunction(e1, touch) && PRVM_serveredictfloat(e1, solid) != SOLID_NOT)
+ if (!e1->free && !e2->free && PRVM_serveredictfunction(e1, touch) && PRVM_serveredictfloat(e1, solid) != SOLID_NOT)
{
PRVM_serverglobalfloat(time) = sv.time;
PRVM_serverglobaledict(self) = PRVM_EDICT_TO_PROG(e1);
prog->ExecuteProgram(prog, PRVM_serveredictfunction(e1, touch), "QC function self.touch is missing");
}
- if (!e1->priv.server->free && !e2->priv.server->free && PRVM_serveredictfunction(e2, touch) && PRVM_serveredictfloat(e2, solid) != SOLID_NOT)
+ if (!e1->free && !e2->free && PRVM_serveredictfunction(e2, touch) && PRVM_serveredictfloat(e2, solid) != SOLID_NOT)
{
PRVM_serverglobalfloat(time) = sv.time;
PRVM_serverglobaledict(self) = PRVM_EDICT_TO_PROG(e2);
// we can trust FL_ONGROUND if groundentity is world because it never moves
return;
}
- else if (ent->priv.server->suspendedinairflag && groundentity->priv.server->free)
+ else if (ent->priv.server->suspendedinairflag && groundentity->free)
{
// if ent was supported by a brush model on previous frame,
// and groundentity is now freed, set groundentity to 0 (world)
VectorScale(PRVM_serveredictvector(ent, velocity), movetime, move);
if(!SV_PushEntity(&trace, ent, move, true))
return; // teleported
- if (ent->priv.server->free)
+ if (ent->free)
return;
if (trace.bmodelstartsolid && sv_gameplayfix_unstickentities.integer)
{
SV_UnstickEntity(ent);
if(!SV_PushEntity(&trace, ent, move, true))
return; // teleported
- if (ent->priv.server->free)
+ if (ent->free)
return;
}
if (trace.fraction == 1)
PRVM_serverglobalfloat(frametime) = sv.frametime;
prog->ExecuteProgram(prog, PRVM_serverfunction(StartFrame), "QC function StartFrame is missing");
+#ifdef USEODE
// run physics engine
World_Physics_Frame(&sv.world, sv.frametime, sv_gravity.value);
+#endif
//
// treat each object in turn
// if force_retouch, relink all the entities
if (PRVM_serverglobalfloat(force_retouch) > 0)
for (i = 1, ent = PRVM_EDICT_NUM(i);i < prog->num_edicts;i++, ent = PRVM_NEXT_EDICT(ent))
- if (!ent->priv.server->free)
+ if (!ent->free)
SV_LinkEdict_TouchAreaGrid(ent); // force retouch even for stationary
if (sv_gameplayfix_consistentplayerprethink.integer)
{
// run physics on the client entities in 3 stages
for (i = 1, ent = PRVM_EDICT_NUM(i), host_client = svs.clients;i <= svs.maxclients;i++, ent = PRVM_NEXT_EDICT(ent), host_client++)
- if (!ent->priv.server->free)
+ if (!ent->free)
SV_Physics_ClientEntity_PreThink(ent);
for (i = 1, ent = PRVM_EDICT_NUM(i), host_client = svs.clients;i <= svs.maxclients;i++, ent = PRVM_NEXT_EDICT(ent), host_client++)
- if (!ent->priv.server->free)
+ if (!ent->free)
SV_Physics_ClientEntity(ent);
for (i = 1, ent = PRVM_EDICT_NUM(i), host_client = svs.clients;i <= svs.maxclients;i++, ent = PRVM_NEXT_EDICT(ent), host_client++)
- if (!ent->priv.server->free)
+ if (!ent->free)
SV_Physics_ClientEntity_PostThink(ent);
}
else
// run physics on the client entities
for (i = 1, ent = PRVM_EDICT_NUM(i), host_client = svs.clients;i <= svs.maxclients;i++, ent = PRVM_NEXT_EDICT(ent), host_client++)
{
- if (!ent->priv.server->free)
+ if (!ent->free)
{
SV_Physics_ClientEntity_PreThink(ent);
SV_Physics_ClientEntity(ent);
if (!sv_freezenonclients.integer)
{
for (;i < prog->num_edicts;i++, ent = PRVM_NEXT_EDICT(ent))
- if (!ent->priv.server->free)
+ if (!ent->free)
SV_Physics_Entity(ent);
// make a second pass to see if any ents spawned this frame and make
// sure they run their move/think
if (sv_gameplayfix_delayprojectiles.integer < 0)
for (i = svs.maxclients + 1, ent = PRVM_EDICT_NUM(i);i < prog->num_edicts;i++, ent = PRVM_NEXT_EDICT(ent))
- if (!ent->priv.server->move && !ent->priv.server->free)
+ if (!ent->priv.server->move && !ent->free)
SV_Physics_Entity(ent);
}
Con_Print("done.\n");
}
+static qbool SV_CanSave(void)
+{
+ prvm_prog_t *prog = SVVM_prog;
+ if(SV_IsLocalServer() == 1)
+ {
+ // singleplayer checks
+ // FIXME: This only checks if the first player is dead?
+ if ((svs.clients[0].active && PRVM_serveredictfloat(svs.clients[0].edict, deadflag)))
+ {
+ Con_Print("Can't savegame with a dead player\n");
+ return false;
+ }
+
+ if(host.hook.CL_Intermission && host.hook.CL_Intermission())
+ {
+ Con_Print("Can't save in intermission.\n");
+ return false;
+ }
+ }
+ else
+ Con_Print(CON_WARN "Warning: saving a multiplayer game may have strange results when restored (to properly resume, all players must join in the same player slots and then the game can be reloaded).\n");
+ return true;
+}
+
/*
===============
SV_Savegame_f
return;
}
- if(host.hook.SV_CanSave)
- {
- if(!host.hook.SV_CanSave())
- return;
- }
+ if(!SV_CanSave())
+ return;
if (Cmd_Argc(cmd) != 2)
{
Con_Printf("Loading game from %s...\n", filename);
- // stop playing demos
- if (cls.demoplayback)
- CL_Disconnect ();
+ if(host.hook.Disconnect)
+ host.hook.Disconnect(false, NULL);
-#ifdef CONFIG_MENU
- // remove menu
- if (key_dest == key_menu || key_dest == key_menu_grabbed)
- MR_ToggleMenu(0);
-#endif
- key_dest = key_game;
+ if(host.hook.ToggleMenu)
+ host.hook.ToggleMenu();
cls.demonum = -1; // stop demo loop in case this fails
PRVM_MEM_IncreaseEdicts(prog);
ent = PRVM_EDICT_NUM(entnum);
memset(ent->fields.fp, 0, prog->entityfields * sizeof(prvm_vec_t));
- ent->priv.server->free = false;
+ ent->free = false;
if(developer_entityparsing.integer)
Con_Printf("SV_Loadgame_f: loading edict %d\n", entnum);
PRVM_ED_ParseEdict (prog, start, ent);
// link it into the bsp tree
- if (!ent->priv.server->free && !VectorCompare(PRVM_serveredictvector(ent, absmin), PRVM_serveredictvector(ent, absmax)))
+ if (!ent->free && !VectorCompare(PRVM_serveredictvector(ent, absmin), PRVM_serveredictvector(ent, absmax)))
SV_LinkEdict(ent);
}
memset(sv.sendentitiesindex, 0, prog->num_edicts * sizeof(*sv.sendentitiesindex));
for (e = 1, ent = PRVM_NEXT_EDICT(prog->edicts);e < prog->num_edicts;e++, ent = PRVM_NEXT_EDICT(ent))
{
- if (!ent->priv.server->free && SV_PrepareEntityForSending(ent, sv.sendentities + sv.numsendentities, e))
+ if (!ent->free && SV_PrepareEntityForSending(ent, sv.sendentities + sv.numsendentities, e))
{
sv.sendentitiesindex[e] = sv.sendentities + sv.numsendentities;
sv.numsendentities++;
// check line of sight to portal entities and add them to PVS
for (e = 1, ed = PRVM_NEXT_EDICT(prog->edicts);e < prog->num_edicts;e++, ed = PRVM_NEXT_EDICT(ed))
{
- if (!ed->priv.server->free)
+ if (!ed->free)
{
if(PRVM_serveredictfunction(ed, camera_transform))
{
if (clientcamera > 0)
{
int oldclientcamera = host_client->clientcamera;
- if (clientcamera >= prog->max_edicts || PRVM_EDICT_NUM(clientcamera)->priv.required->free)
+ if (clientcamera >= prog->max_edicts || PRVM_EDICT_NUM(clientcamera)->free)
clientcamera = PRVM_NUM_FOR_EDICT(host_client->edict);
host_client->clientcamera = clientcamera;
if (host_client->netconnection->message.overflowed)
{
- SV_DropClient (true); // if the message couldn't send, kick off
+ SV_DropClient (true, "Buffer overflow in net message"); // if the message couldn't send, kick off
continue;
}
}
// as requested by FrikaC, cursor_trace_ent is reset to world if the
// entity is free at time of receipt
- if (PRVM_EDICT_NUM(move->cursor_entitynumber)->priv.server->free)
+ if (PRVM_EDICT_NUM(move->cursor_entitynumber)->free)
move->cursor_entitynumber = 0;
if (sv_message.badread) Con_Printf("SV_ReadClientMessage: badread at %s:%i\n", __FILE__, __LINE__);
}
if (!host_client->active)
{
// a command caused an error
- SV_DropClient (false);
+ SV_DropClient (false, "Connection closing");
return;
}
if (sv_message.badread)
{
Con_Print("SV_ReadClientMessage: badread\n");
- SV_DropClient (false);
+ SV_DropClient (false, "An internal server error occurred");
return;
}
Con_Printf("SV_ReadClientMessage: unknown command char %i (at offset 0x%x)\n", netcmd, sv_message.readcount);
if (developer_networking.integer)
Com_HexDumpToConsole(sv_message.data, sv_message.cursize);
- SV_DropClient (false);
+ SV_DropClient (false, "Unknown message sent to the server");
return;
case clc_nop:
break;
case clc_disconnect:
- SV_DropClient (false); // client wants to disconnect
+ SV_DropClient (true, sv.protocol == PROTOCOL_DARKPLACES8
+ ? MSG_ReadString(&sv_message, sv_readstring, sizeof(sv_readstring))
+ : "Disconnect by user"); // client wants to disconnect
return;
case clc_move:
VM_Warning(prog, "setorigin: can not modify world entity\n");
return;
}
- if (e->priv.server->free)
+ if (e->free)
{
VM_Warning(prog, "setorigin: can not modify free entity\n");
return;
VM_Warning(prog, "setsize: can not modify world entity\n");
return;
}
- if (e->priv.server->free)
+ if (e->free)
{
VM_Warning(prog, "setsize: can not modify free entity\n");
return;
VM_Warning(prog, "setmodel: can not modify world entity\n");
return;
}
- if (e->priv.server->free)
+ if (e->free)
{
VM_Warning(prog, "setmodel: can not modify free entity\n");
return;
// look up the client's edict
ent = PRVM_EDICT_NUM(i);
// check if it is to be ignored, but never ignore the one we started on (prevent infinite loop)
- if (i != check && (ent->priv.server->free || PRVM_serveredictfloat(ent, health) <= 0 || ((int)PRVM_serveredictfloat(ent, flags) & FL_NOTARGET)))
+ if (i != check && (ent->free || PRVM_serveredictfloat(ent, health) <= 0 || ((int)PRVM_serveredictfloat(ent, flags) & FL_NOTARGET)))
continue;
// found a valid client (possibly the same one again)
break;
// return check if it might be visible
ent = PRVM_EDICT_NUM(sv.lastcheck);
- if (ent->priv.server->free || PRVM_serveredictfloat(ent, health) <= 0)
+ if (ent->free || PRVM_serveredictfloat(ent, health) <= 0)
{
VM_RETURN_EDICT(prog->edicts);
return;
VectorCopy(PRVM_G_VECTOR(OFS_PARM0), viewpos);
viewee = PRVM_G_EDICT(OFS_PARM1);
- if(viewee->priv.server->free)
+ if(viewee->free)
{
VM_Warning(prog, "checkpvs: can not check free entity\n");
PRVM_G_FLOAT(OFS_RETURN) = 4;
VM_Warning(prog, "walkmove: can not modify world entity\n");
return;
}
- if (ent->priv.server->free)
+ if (ent->free)
{
VM_Warning(prog, "walkmove: can not modify free entity\n");
return;
VM_Warning(prog, "droptofloor: can not modify world entity\n");
return;
}
- if (ent->priv.server->free)
+ if (ent->free)
{
VM_Warning(prog, "droptofloor: can not modify free entity\n");
return;
VM_Warning(prog, "aim: can not use world entity\n");
return;
}
- if (ent->priv.server->free)
+ if (ent->free)
{
VM_Warning(prog, "aim: can not use free entity\n");
return;
VM_Warning(prog, "makestatic: can not modify world entity\n");
return;
}
- if (ent->priv.server->free)
+ if (ent->free)
{
VM_Warning(prog, "makestatic: can not modify free entity\n");
return;
VM_Warning(prog, "copyentity: can not read world entity\n");
return;
}
- if (in->priv.server->free)
+ if (in->free)
{
VM_Warning(prog, "copyentity: can not read free entity\n");
return;
VM_Warning(prog, "copyentity: can not modify world entity\n");
return;
}
- if (out->priv.server->free)
+ if (out->free)
{
VM_Warning(prog, "copyentity: can not modify free entity\n");
return;
VM_Warning(prog, "setattachment: can not modify world entity\n");
return;
}
- if (e->priv.server->free)
+ if (e->free)
{
VM_Warning(prog, "setattachment: can not modify free entity\n");
return;
if (ent == prog->edicts)
return 1;
- if (ent->priv.server->free)
+ if (ent->free)
return 2;
modelindex = (int)PRVM_serveredictfloat(ent, modelindex);
VM_Warning(prog, "VM_SV_gettagindex(entity #%i): can't affect world entity\n", PRVM_NUM_FOR_EDICT(ent));
return;
}
- if (ent->priv.server->free)
+ if (ent->free)
{
VM_Warning(prog, "VM_SV_gettagindex(entity #%i): can't affect free entity\n", PRVM_NUM_FOR_EDICT(ent));
return;
}
oldhostclient = host_client;
host_client = svs.clients + clientnum;
- SV_DropClient(false);
+ SV_DropClient(false, "Client dropped");
host_client = oldhostclient;
}
VM_Warning(prog, "setmodelindex: can not modify world entity\n");
return;
}
- if (e->priv.server->free)
+ if (e->free)
{
VM_Warning(prog, "setmodelindex: can not modify free entity\n");
return;
qbool SV_VM_ConsoleCommand (const char *text)
{
prvm_prog_t *prog = SVVM_prog;
- int restorevm_tempstringsbuf_cursize;
- int save_self;
- qbool r = false;
-
- if(!sv.active || !prog || !prog->loaded)
- return false;
-
- if (PRVM_serverfunction(ConsoleCmd))
- {
- save_self = PRVM_serverglobaledict(self);
- PRVM_serverglobalfloat(time) = sv.time;
- restorevm_tempstringsbuf_cursize = prog->tempstringsbuf.cursize;
- PRVM_serverglobaledict(self) = PRVM_EDICT_TO_PROG(sv.world.prog->edicts);
- PRVM_G_INT(OFS_PARM0) = PRVM_SetTempString(prog, text);
- prog->ExecuteProgram(prog, PRVM_serverfunction(ConsoleCmd), "QC function ConsoleCmd is missing");
- prog->tempstringsbuf.cursize = restorevm_tempstringsbuf_cursize;
- PRVM_serverglobaledict(self) = save_self;
- r = (int) PRVM_G_FLOAT(OFS_RETURN) != 0;
- }
- return r;
+ return PRVM_ConsoleCommand(prog, text, &prog->funcoffsets.ConsoleCmd, true, PRVM_EDICT_TO_PROG(sv.world.prog->edicts), sv.time, !(!sv.active || !prog || !prog->loaded), "QC function ConsoleCmd is missing");
}
// #352 void(string cmdname) registercommand (EXT_CSQC)
static void VM_SV_registercommand (prvm_prog_t *prog)
{
VM_SAFEPARMCOUNT(1, VM_SV_registercmd);
- if(!Cmd_Exists(cmd_server, PRVM_G_STRING(OFS_PARM0)))
+ if(!Cmd_Exists(cmd_local, PRVM_G_STRING(OFS_PARM0)))
Cmd_AddCommand(CF_SERVER, PRVM_G_STRING(OFS_PARM0), NULL, "console command created by QuakeC");
}
int Sys_CheckParm (const char *parm);
-/// called early in Host_Init
-void Sys_InitConsole (void);
/// called after command system is initialized but before first Con_Print
void Sys_Init_Commands (void);
void Sys_Error (const char *error, ...) DP_FUNC_PRINTF(1) DP_FUNC_NORETURN;
/// (may) output text to terminal which launched program
-void Sys_PrintToTerminal(const char *text);
-void Sys_PrintfToTerminal(const char *fmt, ...);
+void Sys_Print(const char *text);
+void Sys_Printf(const char *fmt, ...);
/// INFO: This is only called by Host_Shutdown so we dont need testing for recursion
void Sys_Shutdown (void);
-#include "darkplaces.h"
-
#ifdef WIN32
-#include <io.h>
+#include <io.h> // Include this BEFORE darkplaces.h because it uses strncpy which trips DP_STATIC_ASSERT
#include "conio.h"
#else
#include <unistd.h>
#include <signal.h>
+/*
+ * Include this BEFORE darkplaces.h because it breaks wrapping
+ * _Static_assert. Cloudwalk has no idea how or why so don't ask.
+ */
#include <SDL.h>
+#include "darkplaces.h"
+
#ifdef WIN32
#ifdef _MSC_VER
#pragma comment(lib, "sdl2.lib")
if(!nocrashdialog)
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Engine Error", string, NULL);
- Host_Shutdown ();
+ //Host_Shutdown ();
exit (1);
}
-void Sys_PrintToTerminal(const char *text)
+void Sys_Print(const char *text)
{
#ifdef __ANDROID__
if (developer.integer > 0)
return data;
}
-void Sys_InitConsole (void)
-{
-}
-
int main (int argc, char *argv[])
{
signal(SIGFPE, SIG_IGN);
void Sys_Quit (int returnvalue)
{
// Unlock mutexes because the quit command may jump directly here, causing a deadlock
- if ((cmd_client)->cbuf->lock)
- Cbuf_Unlock((cmd_client)->cbuf);
- if ((cmd_server)->cbuf->lock)
- Cbuf_Unlock((cmd_server)->cbuf);
+ if ((cmd_local)->cbuf->lock)
+ Cbuf_Unlock((cmd_local)->cbuf);
SV_UnlockThreadMutex();
TaskQueue_Frame(true);
if(sys_debugsleep.integer)
{
t = Sys_DirtyTime() - t;
- Sys_PrintfToTerminal("%d %d # debugsleep\n", microseconds, (unsigned int)(t * 1000000));
+ Sys_Printf("%d %d # debugsleep\n", microseconds, (unsigned int)(t * 1000000));
}
}
-void Sys_PrintfToTerminal(const char *fmt, ...)
+void Sys_Printf(const char *fmt, ...)
{
va_list argptr;
char msg[MAX_INPUTLINE];
dpvsnprintf(msg,sizeof(msg),fmt,argptr);
va_end(argptr);
- Sys_PrintToTerminal(msg);
+ Sys_Print(msg);
}
#ifndef WIN32
Con_Printf(CON_ERROR "Engine Error: %s\n", string);
- Host_Shutdown ();
+ //Host_Shutdown ();
exit (1);
}
-void Sys_PrintToTerminal(const char *text)
+void Sys_Print(const char *text)
{
if(sys.outfd < 0)
return;
return NULL;
}
-void Sys_InitConsole (void)
-{
-}
-
int main (int argc, char **argv)
{
signal(SIGFPE, SIG_IGN);
+++ /dev/null
-/*
-Copyright (C) 1996-1997 Id Software, Inc.
-
-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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-*/
-// sys_win.c -- Win32 system interface code
-
-#include <windows.h>
-#include <mmsystem.h>
-#include <direct.h>
-#ifdef SUPPORTDIRECTX
-#include <dsound.h>
-#endif
-
-#include "qtypes.h"
-
-#include "quakedef.h"
-#include <errno.h>
-#include "resource.h"
-#include "conproc.h"
-
-HANDLE hinput, houtput;
-
-#ifdef QHOST
-static HANDLE tevent;
-static HANDLE hFile;
-static HANDLE heventParent;
-static HANDLE heventChild;
-#endif
-
-sys_t sys;
-
-/*
-===============================================================================
-
-SYSTEM IO
-
-===============================================================================
-*/
-
-void Sys_Error (const char *error, ...)
-{
- va_list argptr;
- char text[MAX_INPUTLINE];
- static int in_sys_error0 = 0;
- static int in_sys_error1 = 0;
- static int in_sys_error2 = 0;
- static int in_sys_error3 = 0;
-
- va_start (argptr, error);
- dpvsnprintf (text, sizeof (text), error, argptr);
- va_end (argptr);
-
- Con_Printf(CON_ERROR "Engine Error: %s\n", text);
-
- // close video so the message box is visible, unless we already tried that
- if (!in_sys_error0 && cls.state != ca_dedicated)
- {
- in_sys_error0 = 1;
- VID_Shutdown();
- }
-
- if (!in_sys_error3 && cls.state != ca_dedicated)
- {
- in_sys_error3 = true;
- MessageBox(NULL, text, "Engine Error", MB_OK | MB_SETFOREGROUND | MB_ICONSTOP);
- }
-
- if (!in_sys_error1)
- {
- in_sys_error1 = 1;
- Host_Shutdown ();
- }
-
-// shut down QHOST hooks if necessary
- if (!in_sys_error2)
- {
- in_sys_error2 = 1;
- Sys_Shutdown ();
- }
-
- exit (1);
-}
-
-void Sys_Shutdown (void)
-{
-#ifdef QHOST
- if (tevent)
- CloseHandle (tevent);
-#endif
-
- if (cls.state == ca_dedicated)
- FreeConsole ();
-
-#ifdef QHOST
-// shut down QHOST hooks if necessary
- DeinitConProc ();
-#endif
-}
-
-void Sys_PrintToTerminal(const char *text)
-{
- DWORD dummy;
- extern HANDLE houtput;
-
- if ((houtput != 0) && (houtput != INVALID_HANDLE_VALUE))
- WriteFile(houtput, text, (DWORD) strlen(text), &dummy, NULL);
-}
-
-char *Sys_ConsoleInput (void)
-{
- static char text[MAX_INPUTLINE];
- static int len;
- INPUT_RECORD recs[1024];
- int ch;
- DWORD numread, numevents, dummy;
-
- if (cls.state != ca_dedicated)
- return NULL;
-
- for ( ;; )
- {
- if (!GetNumberOfConsoleInputEvents (hinput, &numevents))
- Sys_Error ("Error getting # of console events (error code %x)", (unsigned int)GetLastError());
-
- if (numevents <= 0)
- break;
-
- if (!ReadConsoleInput(hinput, recs, 1, &numread))
- Sys_Error ("Error reading console input (error code %x)", (unsigned int)GetLastError());
-
- if (numread != 1)
- Sys_Error ("Couldn't read console input (error code %x)", (unsigned int)GetLastError());
-
- if (recs[0].EventType == KEY_EVENT)
- {
- if (!recs[0].Event.KeyEvent.bKeyDown)
- {
- ch = recs[0].Event.KeyEvent.uChar.AsciiChar;
-
- switch (ch)
- {
- case '\r':
- WriteFile(houtput, "\r\n", 2, &dummy, NULL);
-
- if (len)
- {
- text[len] = 0;
- len = 0;
- return text;
- }
-
- break;
-
- case '\b':
- WriteFile(houtput, "\b \b", 3, &dummy, NULL);
- if (len)
- {
- len--;
- }
- break;
-
- default:
- if (ch >= (int) (unsigned char) ' ')
- {
- WriteFile(houtput, &ch, 1, &dummy, NULL);
- text[len] = ch;
- len = (len + 1) & 0xff;
- }
-
- break;
-
- }
- }
- }
- }
-
- return NULL;
-}
-
-char *Sys_GetClipboardData (void)
-{
- char *data = NULL;
- char *cliptext;
-
- if (OpenClipboard (NULL) != 0)
- {
- HANDLE hClipboardData;
-
- if ((hClipboardData = GetClipboardData (CF_TEXT)) != 0)
- {
- if ((cliptext = (char *)GlobalLock (hClipboardData)) != 0)
- {
- size_t allocsize;
- allocsize = GlobalSize (hClipboardData) + 1;
- data = (char *)Z_Malloc (allocsize);
- strlcpy (data, cliptext, allocsize);
- GlobalUnlock (hClipboardData);
- }
- }
- CloseClipboard ();
- }
- return data;
-}
-
-void Sys_InitConsole (void)
-{
-#ifdef QHOST
- int t;
-
- // initialize the windows dedicated server console if needed
- tevent = CreateEvent(NULL, false, false, NULL);
-
- if (!tevent)
- Sys_Error ("Couldn't create event");
-#endif
-
- houtput = GetStdHandle (STD_OUTPUT_HANDLE);
- hinput = GetStdHandle (STD_INPUT_HANDLE);
-
- // LadyHavoc: can't check cls.state because it hasn't been initialized yet
- // if (cls.state == ca_dedicated)
- if (Sys_CheckParm("-dedicated"))
- {
- //if ((houtput == 0) || (houtput == INVALID_HANDLE_VALUE)) // LadyHavoc: on Windows XP this is never 0 or invalid, but hinput is invalid
- {
- if (!AllocConsole ())
- Sys_Error ("Couldn't create dedicated server console (error code %x)", (unsigned int)GetLastError());
- houtput = GetStdHandle (STD_OUTPUT_HANDLE);
- hinput = GetStdHandle (STD_INPUT_HANDLE);
- }
- if ((houtput == 0) || (houtput == INVALID_HANDLE_VALUE))
- Sys_Error ("Couldn't create dedicated server console");
-
-
-#ifdef QHOST
-#ifdef _WIN64
-#define atoi _atoi64
-#endif
- // give QHOST a chance to hook into the console
- if ((t = Sys_CheckParm ("-HFILE")) > 0)
- {
- if (t < sys.argc)
- hFile = (HANDLE)atoi (sys.argv[t+1]);
- }
-
- if ((t = Sys_CheckParm ("-HPARENT")) > 0)
- {
- if (t < sys.argc)
- heventParent = (HANDLE)atoi (sys.argv[t+1]);
- }
-
- if ((t = Sys_CheckParm ("-HCHILD")) > 0)
- {
- if (t < sys.argc)
- heventChild = (HANDLE)atoi (sys.argv[t+1]);
- }
-
- InitConProc (hFile, heventParent, heventChild);
-#endif
- }
-
-// because sound is off until we become active
- S_BlockSound ();
-}
-
-/*
-==============================================================================
-
-WINDOWS CRAP
-
-==============================================================================
-*/
-
-
-/*
-==================
-WinMain
-==================
-*/
-HINSTANCE global_hInstance;
-const char *argv[MAX_NUM_ARGVS];
-char program_name[MAX_OSPATH];
-
-int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
-{
- MEMORYSTATUS lpBuffer;
-
- /* previous instances do not exist in Win32 */
- if (hPrevInstance)
- return 0;
-
- global_hInstance = hInstance;
-
- lpBuffer.dwLength = sizeof(MEMORYSTATUS);
- GlobalMemoryStatus (&lpBuffer);
-
- program_name[sizeof(program_name)-1] = 0;
- GetModuleFileNameA(NULL, program_name, sizeof(program_name) - 1);
-
- sys.argc = 1;
- sys.argv = argv;
- argv[0] = program_name;
-
- // FIXME: this tokenizer is rather redundent, call a more general one
- while (*lpCmdLine && (sys.argc < MAX_NUM_ARGVS))
- {
- while (*lpCmdLine && ISWHITESPACE(*lpCmdLine))
- lpCmdLine++;
-
- if (!*lpCmdLine)
- break;
-
- if (*lpCmdLine == '\"')
- {
- // quoted string
- lpCmdLine++;
- argv[sys.argc] = lpCmdLine;
- sys.argc++;
- while (*lpCmdLine && (*lpCmdLine != '\"'))
- lpCmdLine++;
- }
- else
- {
- // unquoted word
- argv[sys.argc] = lpCmdLine;
- sys.argc++;
- while (*lpCmdLine && !ISWHITESPACE(*lpCmdLine))
- lpCmdLine++;
- }
-
- if (*lpCmdLine)
- {
- *lpCmdLine = 0;
- lpCmdLine++;
- }
- }
-
- Sys_ProvideSelfFD();
-
- // used by everything
- Memory_Init();
-
- Host_Main();
-
- Sys_Quit(0);
-
- /* return success of application */
- return true;
-}
-
-#if 0
-// unused, this file is only used when building windows client and vid_wgl provides WinMain() instead
-int main (int argc, const char* argv[])
-{
- MEMORYSTATUS lpBuffer;
-
- global_hInstance = GetModuleHandle (0);
-
- lpBuffer.dwLength = sizeof(MEMORYSTATUS);
- GlobalMemoryStatus (&lpBuffer);
-
- program_name[sizeof(program_name)-1] = 0;
- GetModuleFileNameA(NULL, program_name, sizeof(program_name) - 1);
-
- sys.argc = argc;
- sys.argv = argv;
-
- Host_Main();
-
- return true;
-}
-#endif
-
-qbool sys_supportsdlgetticks = false;
-unsigned int Sys_SDL_GetTicks (void)
-{
- Sys_Error("Called Sys_SDL_GetTicks on non-SDL target");
- return 0;
-}
-void Sys_SDL_Delay (unsigned int milliseconds)
-{
- Sys_Error("Called Sys_SDL_Delay on non-SDL target");
-}
#include "qtypes.h"
-// enable Sys_PrintfToTerminal calls on nearly every threading call
+// enable Sys_Printf calls on nearly every threading call
//#define THREADDEBUG
//#define THREADDISABLE
// use recursive mutex (non-posix) extensions in thread_pthread
#endif
pthread_mutex_t *mutexp = (pthread_mutex_t *) Z_Malloc(sizeof(pthread_mutex_t));
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p mutex create %s:%i\n" , mutexp, filename, fileline);
+ Sys_Printf("%p mutex create %s:%i\n" , mutexp, filename, fileline);
#endif
#ifdef THREADRECURSIVE
pthread_mutexattr_init(&attr);
{
pthread_mutex_t *mutexp = (pthread_mutex_t *) mutex;
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p mutex destroy %s:%i\n", mutex, filename, fileline);
+ Sys_Printf("%p mutex destroy %s:%i\n", mutex, filename, fileline);
#endif
pthread_mutex_destroy(mutexp);
Z_Free(mutexp);
{
pthread_mutex_t *mutexp = (pthread_mutex_t *) mutex;
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p mutex lock %s:%i\n" , mutex, filename, fileline);
+ Sys_Printf("%p mutex lock %s:%i\n" , mutex, filename, fileline);
#endif
return pthread_mutex_lock(mutexp);
}
{
pthread_mutex_t *mutexp = (pthread_mutex_t *) mutex;
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p mutex unlock %s:%i\n" , mutex, filename, fileline);
+ Sys_Printf("%p mutex unlock %s:%i\n" , mutex, filename, fileline);
#endif
return pthread_mutex_unlock(mutexp);
}
pthread_cond_t *condp = (pthread_cond_t *) Z_Malloc(sizeof(pthread_cond_t));
pthread_cond_init(condp, NULL);
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p cond create %s:%i\n" , condp, filename, fileline);
+ Sys_Printf("%p cond create %s:%i\n" , condp, filename, fileline);
#endif
return condp;
}
{
pthread_cond_t *condp = (pthread_cond_t *) cond;
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p cond destroy %s:%i\n" , cond, filename, fileline);
+ Sys_Printf("%p cond destroy %s:%i\n" , cond, filename, fileline);
#endif
pthread_cond_destroy(condp);
Z_Free(condp);
{
pthread_cond_t *condp = (pthread_cond_t *) cond;
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p cond signal %s:%i\n" , cond, filename, fileline);
+ Sys_Printf("%p cond signal %s:%i\n" , cond, filename, fileline);
#endif
return pthread_cond_signal(condp);
}
{
pthread_cond_t *condp = (pthread_cond_t *) cond;
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p cond broadcast %s:%i\n" , cond, filename, fileline);
+ Sys_Printf("%p cond broadcast %s:%i\n" , cond, filename, fileline);
#endif
return pthread_cond_broadcast(condp);
}
pthread_cond_t *condp = (pthread_cond_t *) cond;
pthread_mutex_t *mutexp = (pthread_mutex_t *) mutex;
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p cond wait %s:%i\n" , cond, filename, fileline);
+ Sys_Printf("%p cond wait %s:%i\n" , cond, filename, fileline);
#endif
return pthread_cond_wait(condp, mutexp);
}
{
pthread_t *threadp = (pthread_t *) Z_Malloc(sizeof(pthread_t));
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p thread create %s:%i\n" , threadp, filename, fileline);
+ Sys_Printf("%p thread create %s:%i\n" , threadp, filename, fileline);
#endif
int r = pthread_create(threadp, NULL, (void * (*) (void *)) fn, data);
if(r)
pthread_t *threadp = (pthread_t *) thread;
void *status = (void *) (intptr_t) retval;
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p thread wait %s:%i\n" , thread, filename, fileline);
+ Sys_Printf("%p thread wait %s:%i\n" , thread, filename, fileline);
#endif
pthread_join(*threadp, &status);
Z_Free(threadp);
{
pthread_barrier_t *b = (pthread_barrier_t *) Z_Malloc(sizeof(pthread_barrier_t));
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p barrier create(%d) %s:%i\n", b, count, filename, fileline);
+ Sys_Printf("%p barrier create(%d) %s:%i\n", b, count, filename, fileline);
#endif
pthread_barrier_init(b, NULL, count);
return (void *) b;
{
pthread_barrier_t *b = (pthread_barrier_t *) barrier;
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p barrier destroy %s:%i\n", b, filename, fileline);
+ Sys_Printf("%p barrier destroy %s:%i\n", b, filename, fileline);
#endif
pthread_barrier_destroy(b);
}
{
pthread_barrier_t *b = (pthread_barrier_t *) barrier;
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p barrier wait %s:%i\n", b, filename, fileline);
+ Sys_Printf("%p barrier wait %s:%i\n", b, filename, fileline);
#endif
pthread_barrier_wait(b);
}
{
volatile barrier_t *b = (volatile barrier_t *) Z_Malloc(sizeof(barrier_t));
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p barrier create(%d) %s:%i\n", b, count, filename, fileline);
+ Sys_Printf("%p barrier create(%d) %s:%i\n", b, count, filename, fileline);
#endif
b->needed = count;
b->called = 0;
{
volatile barrier_t *b = (volatile barrier_t *) barrier;
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p barrier destroy %s:%i\n", b, filename, fileline);
+ Sys_Printf("%p barrier destroy %s:%i\n", b, filename, fileline);
#endif
Thread_DestroyMutex(b->mutex);
Thread_DestroyCond(b->cond);
{
volatile barrier_t *b = (volatile barrier_t *) barrier;
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p barrier wait %s:%i\n", b, filename, fileline);
+ Sys_Printf("%p barrier wait %s:%i\n", b, filename, fileline);
#endif
Thread_LockMutex(b->mutex);
b->called++;
{
void *mutex = SDL_CreateMutex();
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p mutex create %s:%i\n" , mutex, filename, fileline);
+ Sys_Printf("%p mutex create %s:%i\n" , mutex, filename, fileline);
#endif
return mutex;
}
void _Thread_DestroyMutex(void *mutex, const char *filename, int fileline)
{
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p mutex destroy %s:%i\n", mutex, filename, fileline);
+ Sys_Printf("%p mutex destroy %s:%i\n", mutex, filename, fileline);
#endif
SDL_DestroyMutex((SDL_mutex *)mutex);
}
int _Thread_LockMutex(void *mutex, const char *filename, int fileline)
{
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p mutex lock %s:%i\n" , mutex, filename, fileline);
+ Sys_Printf("%p mutex lock %s:%i\n" , mutex, filename, fileline);
#endif
return SDL_LockMutex((SDL_mutex *)mutex);
}
int _Thread_UnlockMutex(void *mutex, const char *filename, int fileline)
{
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p mutex unlock %s:%i\n" , mutex, filename, fileline);
+ Sys_Printf("%p mutex unlock %s:%i\n" , mutex, filename, fileline);
#endif
return SDL_UnlockMutex((SDL_mutex *)mutex);
}
{
void *cond = (void *)SDL_CreateCond();
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p cond create %s:%i\n" , cond, filename, fileline);
+ Sys_Printf("%p cond create %s:%i\n" , cond, filename, fileline);
#endif
return cond;
}
void _Thread_DestroyCond(void *cond, const char *filename, int fileline)
{
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p cond destroy %s:%i\n" , cond, filename, fileline);
+ Sys_Printf("%p cond destroy %s:%i\n" , cond, filename, fileline);
#endif
SDL_DestroyCond((SDL_cond *)cond);
}
int _Thread_CondSignal(void *cond, const char *filename, int fileline)
{
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p cond signal %s:%i\n" , cond, filename, fileline);
+ Sys_Printf("%p cond signal %s:%i\n" , cond, filename, fileline);
#endif
return SDL_CondSignal((SDL_cond *)cond);
}
int _Thread_CondBroadcast(void *cond, const char *filename, int fileline)
{
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p cond broadcast %s:%i\n" , cond, filename, fileline);
+ Sys_Printf("%p cond broadcast %s:%i\n" , cond, filename, fileline);
#endif
return SDL_CondBroadcast((SDL_cond *)cond);
}
int _Thread_CondWait(void *cond, void *mutex, const char *filename, int fileline)
{
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p cond wait %s:%i\n" , cond, filename, fileline);
+ Sys_Printf("%p cond wait %s:%i\n" , cond, filename, fileline);
#endif
return SDL_CondWait((SDL_cond *)cond, (SDL_mutex *)mutex);
}
{
void *thread = (void *)SDL_CreateThread(fn, filename, data);
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p thread create %s:%i\n" , thread, filename, fileline);
+ Sys_Printf("%p thread create %s:%i\n" , thread, filename, fileline);
#endif
return thread;
}
{
int status = retval;
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p thread wait %s:%i\n" , thread, filename, fileline);
+ Sys_Printf("%p thread wait %s:%i\n" , thread, filename, fileline);
#endif
SDL_WaitThread((SDL_Thread *)thread, &status);
return status;
{
volatile barrier_t *b = (volatile barrier_t *) Z_Malloc(sizeof(barrier_t));
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p barrier create(%d) %s:%i\n", b, count, filename, fileline);
+ Sys_Printf("%p barrier create(%d) %s:%i\n", b, count, filename, fileline);
#endif
b->needed = count;
b->called = 0;
{
volatile barrier_t *b = (volatile barrier_t *) barrier;
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p barrier destroy %s:%i\n", b, filename, fileline);
+ Sys_Printf("%p barrier destroy %s:%i\n", b, filename, fileline);
#endif
Thread_DestroyMutex(b->mutex);
Thread_DestroyCond(b->cond);
{
volatile barrier_t *b = (volatile barrier_t *) barrier;
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p barrier wait %s:%i\n", b, filename, fileline);
+ Sys_Printf("%p barrier wait %s:%i\n", b, filename, fileline);
#endif
Thread_LockMutex(b->mutex);
b->called++;
int _Thread_AtomicGet(Thread_Atomic *a, const char *filename, int fileline)
{
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p atomic get at %s:%i\n", a, filename, fileline);
+ Sys_Printf("%p atomic get at %s:%i\n", a, filename, fileline);
#endif
return SDL_AtomicGet((SDL_atomic_t *)a);
}
int _Thread_AtomicSet(Thread_Atomic *a, int v, const char *filename, int fileline)
{
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p atomic set %v at %s:%i\n", a, v, filename, fileline);
+ Sys_Printf("%p atomic set %v at %s:%i\n", a, v, filename, fileline);
#endif
return SDL_AtomicSet((SDL_atomic_t *)a, v);
}
int _Thread_AtomicAdd(Thread_Atomic *a, int v, const char *filename, int fileline)
{
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p atomic add %v at %s:%i\n", a, v, filename, fileline);
+ Sys_Printf("%p atomic add %v at %s:%i\n", a, v, filename, fileline);
#endif
return SDL_AtomicAdd((SDL_atomic_t *)a, v);
}
void _Thread_AtomicIncRef(Thread_Atomic *a, const char *filename, int fileline)
{
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p atomic incref %s:%i\n", a, filename, fileline);
+ Sys_Printf("%p atomic incref %s:%i\n", a, filename, fileline);
#endif
SDL_AtomicIncRef((SDL_atomic_t *)a);
}
qbool _Thread_AtomicDecRef(Thread_Atomic *a, const char *filename, int fileline)
{
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p atomic decref %s:%i\n", a, filename, fileline);
+ Sys_Printf("%p atomic decref %s:%i\n", a, filename, fileline);
#endif
return SDL_AtomicDecRef((SDL_atomic_t *)a) != SDL_FALSE;
}
qbool _Thread_AtomicTryLock(Thread_SpinLock *lock, const char *filename, int fileline)
{
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p atomic try lock %s:%i\n", lock, filename, fileline);
+ Sys_Printf("%p atomic try lock %s:%i\n", lock, filename, fileline);
#endif
return SDL_AtomicTryLock(lock) != SDL_FALSE;
}
void _Thread_AtomicLock(Thread_SpinLock *lock, const char *filename, int fileline)
{
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p atomic lock %s:%i\n", lock, filename, fileline);
+ Sys_Printf("%p atomic lock %s:%i\n", lock, filename, fileline);
#endif
SDL_AtomicLock(lock);
}
void _Thread_AtomicUnlock(Thread_SpinLock *lock, const char *filename, int fileline)
{
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p atomic unlock %s:%i\n", lock, filename, fileline);
+ Sys_Printf("%p atomic unlock %s:%i\n", lock, filename, fileline);
#endif
SDL_AtomicUnlock(lock);
}
{
void *mutex = (void *)CreateMutex(NULL, FALSE, NULL);
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p mutex create %s:%i\n" , mutex, filename, fileline);
+ Sys_Printf("%p mutex create %s:%i\n" , mutex, filename, fileline);
#endif
return mutex;
}
void _Thread_DestroyMutex(void *mutex, const char *filename, int fileline)
{
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p mutex destroy %s:%i\n", mutex, filename, fileline);
+ Sys_Printf("%p mutex destroy %s:%i\n", mutex, filename, fileline);
#endif
CloseHandle(mutex);
}
int _Thread_LockMutex(void *mutex, const char *filename, int fileline)
{
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p mutex lock %s:%i\n" , mutex, filename, fileline);
+ Sys_Printf("%p mutex lock %s:%i\n" , mutex, filename, fileline);
#endif
return (WaitForSingleObject(mutex, INFINITE) == WAIT_FAILED) ? -1 : 0;
}
int _Thread_UnlockMutex(void *mutex, const char *filename, int fileline)
{
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p mutex unlock %s:%i\n" , mutex, filename, fileline);
+ Sys_Printf("%p mutex unlock %s:%i\n" , mutex, filename, fileline);
#endif
return (ReleaseMutex(mutex) == false) ? -1 : 0;
}
c->waiting = 0;
c->signals = 0;
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p cond create %s:%i\n" , c, filename, fileline);
+ Sys_Printf("%p cond create %s:%i\n" , c, filename, fileline);
#endif
return c;
}
{
thread_cond_t *c = (thread_cond_t *)cond;
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p cond destroy %s:%i\n" , cond, filename, fileline);
+ Sys_Printf("%p cond destroy %s:%i\n" , cond, filename, fileline);
#endif
Thread_DestroySemaphore(c->sem);
Thread_DestroySemaphore(c->done);
thread_cond_t *c = (thread_cond_t *)cond;
int n;
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p cond signal %s:%i\n" , cond, filename, fileline);
+ Sys_Printf("%p cond signal %s:%i\n" , cond, filename, fileline);
#endif
WaitForSingleObject(c->mutex, INFINITE);
n = c->waiting - c->signals;
int i = 0;
int n = 0;
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p cond broadcast %s:%i\n" , cond, filename, fileline);
+ Sys_Printf("%p cond broadcast %s:%i\n" , cond, filename, fileline);
#endif
WaitForSingleObject(c->mutex, INFINITE);
n = c->waiting - c->signals;
thread_cond_t *c = (thread_cond_t *)cond;
int waitresult;
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p cond wait %s:%i\n" , cond, filename, fileline);
+ Sys_Printf("%p cond wait %s:%i\n" , cond, filename, fileline);
#endif
WaitForSingleObject(c->mutex, INFINITE);
{
threadwrapper_t *w = (threadwrapper_t *)calloc(sizeof(*w), 1);
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p thread create %s:%i\n" , w, filename, fileline);
+ Sys_Printf("%p thread create %s:%i\n" , w, filename, fileline);
#endif
w->fn = fn;
w->data = data;
{
threadwrapper_t *w = (threadwrapper_t *)d;
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p thread wait %s:%i\n" , w, filename, fileline);
+ Sys_Printf("%p thread wait %s:%i\n" , w, filename, fileline);
#endif
WaitForSingleObject(w->handle, INFINITE);
CloseHandle(w->handle);
{
volatile barrier_t *b = (volatile barrier_t *) Z_Malloc(sizeof(barrier_t));
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p barrier create(%d) %s:%i\n", b, count, filename, fileline);
+ Sys_Printf("%p barrier create(%d) %s:%i\n", b, count, filename, fileline);
#endif
b->needed = count;
b->called = 0;
{
volatile barrier_t *b = (volatile barrier_t *) barrier;
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p barrier destroy %s:%i\n", b, filename, fileline);
+ Sys_Printf("%p barrier destroy %s:%i\n", b, filename, fileline);
#endif
Thread_DestroyMutex(b->mutex);
Thread_DestroyCond(b->cond);
{
volatile barrier_t *b = (volatile barrier_t *) barrier;
#ifdef THREADDEBUG
- Sys_PrintfToTerminal("%p barrier wait %s:%i\n", b, filename, fileline);
+ Sys_Printf("%p barrier wait %s:%i\n", b, filename, fileline);
#endif
Thread_LockMutex(b->mutex);
b->called++;
+/*
+Copyright (C) 2009-2020 DarkPlaces contributors
+
+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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
/*
* UTF-8 utility functions for DarkPlaces
*/
{
}
+#ifndef WIN32
static void signal_handler(int sig)
{
Con_Printf("Received signal %d, exiting...\n", sig);
static void InitSig(void)
{
-#ifndef WIN32
signal(SIGHUP, signal_handler);
signal(SIGINT, signal_handler);
signal(SIGQUIT, signal_handler);
signal(SIGFPE, signal_handler);
signal(SIGSEGV, signal_handler);
signal(SIGTERM, signal_handler);
-#endif
}
+#endif
void VID_SetMouse (qbool fullscreengrab, qbool relative, qbool hidecursor)
{
void VID_Init(void)
{
+#ifndef WIN32
InitSig(); // trap evil signals
+#endif
}
qbool VID_InitMode(viddef_mode_t *mode)
if (!VID_ShowingKeyboard())
{
// user entered a command, close the console now
- Con_ToggleConsole_f(cmd_client);
+ Con_ToggleConsole_f(cmd_local);
}
VID_TouchscreenArea( 0, 0, 0, 0, 0, NULL , 0.0f, NULL, NULL, &buttons[15], (keynum_t)0, NULL, 0, 0, 0, true);
VID_TouchscreenArea( 0, 0, 0, 0, 0, NULL , 0.0f, NULL, move, &buttons[0], K_MOUSE4, NULL, 0, 0, 0, true);
// so, let's better queue it for next frame
if(!sdl_needs_restart)
{
- Cbuf_AddText(cmd_client, "\nr_restart\n");
+ Cbuf_AddText(cmd_local, "\nr_restart\n");
sdl_needs_restart = true;
}
#endif
/*
-Copyright (C) 2021 David Knapp (Cloudwalk)
+Copyright (C) 2020-2021 David Knapp (Cloudwalk)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
#ifndef VPK_H
#define VPK_H
-#include "qtypes.h"
-#include "qdefs.h"
+#include <stdint.h>
/*
* The VPK format is Valve's package format for Source engine games,
#include "quakedef.h"
#include "clvm_cmds.h"
#include "cl_collision.h"
+#include "com_list.h"
/*
*/
+#ifdef USEODE
static void World_Physics_Init(void);
+#endif
void World_Init(void)
{
Collision_Init();
+#ifdef USEODE
World_Physics_Init();
+#endif
}
+#ifdef USEODE
static void World_Physics_Shutdown(void);
+#endif
void World_Shutdown(void)
{
+#ifdef USEODE
World_Physics_Shutdown();
+#endif
}
+#ifdef USEODE
static void World_Physics_Start(world_t *world);
+#endif
void World_Start(world_t *world)
{
+#ifdef USEODE
World_Physics_Start(world);
+#endif
}
+#ifdef USEODE
static void World_Physics_End(world_t *world);
+#endif
void World_End(world_t *world)
{
+#ifdef USEODE
World_Physics_End(world);
+#endif
}
//============================================================================
// unlink all entities one by one
grid = &world->areagrid_outside;
while (grid->list.next != &grid->list)
- World_UnlinkEdict(PRVM_EDICT_NUM(List_Entry(*grid->list.next, link_t, list)->entitynumber));
+ World_UnlinkEdict(PRVM_EDICT_NUM(List_Entry(grid->list.next, link_t, list)->entitynumber));
for (i = 0, grid = world->areagrid;i < AREA_GRIDNODES;i++, grid++)
while (grid->list.next != &grid->list)
- World_UnlinkEdict(PRVM_EDICT_NUM(List_Entry(*grid->list.next, link_t, list)->entitynumber));
+ World_UnlinkEdict(PRVM_EDICT_NUM(List_Entry(grid->list.next, link_t, list)->entitynumber));
}
/*
{
prvm_prog_t *prog = world->prog;
int numlist;
- llist_t *pos;
link_t *grid;
link_t *l;
prvm_edict_t *ent;
if (world->areagrid_outside.list.next)
{
grid = &world->areagrid_outside;
- List_For_Each(pos, &grid->list)
+ List_For_Each_Entry(l, &grid->list, link_t, list)
{
- l = List_Entry(*pos, link_t, list);
ent = PRVM_EDICT_NUM(l->entitynumber);
if (ent->priv.server->areagridmarknumber != world->areagrid_marknumber)
{
ent->priv.server->areagridmarknumber = world->areagrid_marknumber;
- if (!ent->priv.server->free && BoxesOverlap(paddedmins, paddedmaxs, ent->priv.server->areamins, ent->priv.server->areamaxs))
+ if (!ent->free && BoxesOverlap(paddedmins, paddedmaxs, ent->priv.server->areamins, ent->priv.server->areamaxs))
{
if (numlist < maxlist)
list[numlist] = ent;
{
if (grid->list.next)
{
- List_For_Each(pos, &grid->list)
+ List_For_Each_Entry(l, &grid->list, link_t, list)
{
- l = List_Entry(*pos, link_t, list);
ent = PRVM_EDICT_NUM(l->entitynumber);
if (ent->priv.server->areagridmarknumber != world->areagrid_marknumber)
{
ent->priv.server->areagridmarknumber = world->areagrid_marknumber;
- if (!ent->priv.server->free && BoxesOverlap(paddedmins, paddedmaxs, ent->priv.server->areamins, ent->priv.server->areamaxs))
+ if (!ent->free && BoxesOverlap(paddedmins, paddedmaxs, ent->priv.server->areamins, ent->priv.server->areamaxs))
{
if (numlist < maxlist)
list[numlist] = ent;
return;
// don't add free entities
- if (ent->priv.server->free)
+ if (ent->free)
return;
VectorCopy(mins, ent->priv.server->areamins);
// {"dGeomTriMeshDataUpdate", (void **) &dGeomTriMeshDataUpdate},
{NULL, NULL}
};
-
// Handle for ODE DLL
dllhandle_t ode_dll = NULL;
#endif
-#endif
static void World_Physics_Init(void)
{
-#ifdef USEODE
#ifndef LINK_TO_LIBODE
const char* dllnames [] =
{
}
#endif
}
-#endif
}
-
static void World_Physics_Shutdown(void)
{
-#ifdef USEODE
#ifndef LINK_TO_LIBODE
if (ode_dll)
#endif
ode_dll = NULL;
#endif
}
-#endif
}
-#ifdef USEODE
static void World_Physics_UpdateODE(world_t *world)
{
dWorldID odeworld;
World_Physics_UpdateODE(world);
}
-#endif
static void World_Physics_Start(world_t *world)
{
-#ifdef USEODE
if (world->physics.ode)
return;
World_Physics_EnableODE(world);
-#endif
}
static void World_Physics_End(world_t *world)
{
-#ifdef USEODE
if (world->physics.ode)
{
dWorldDestroy((dWorldID)world->physics.ode_world);
dJointGroupDestroy((dJointGroupID)world->physics.ode_contactgroup);
world->physics.ode = false;
}
-#endif
}
void World_Physics_RemoveJointFromEntity(world_t *world, prvm_edict_t *ed)
{
ed->priv.server->ode_joint_type = 0;
-#ifdef USEODE
if(ed->priv.server->ode_joint)
dJointDestroy((dJointID)ed->priv.server->ode_joint);
ed->priv.server->ode_joint = NULL;
-#endif
}
void World_Physics_RemoveFromEntity(world_t *world, prvm_edict_t *ed)
// entity is not physics controlled, free any physics data
ed->priv.server->ode_physics = false;
-#ifdef USEODE
if (ed->priv.server->ode_geom)
dGeomDestroy((dGeomID)ed->priv.server->ode_geom);
ed->priv.server->ode_geom = NULL;
dBodyDestroy((dBodyID)ed->priv.server->ode_body);
}
ed->priv.server->ode_body = NULL;
-#endif
if (ed->priv.server->ode_vertex3f)
Mem_Free(ed->priv.server->ode_vertex3f);
ed->priv.server->ode_vertex3f = NULL;
void World_Physics_ApplyCmd(prvm_edict_t *ed, edict_odefunc_t *f)
{
-#ifdef USEODE
dBodyID body = (dBodyID)ed->priv.server->ode_body;
switch(f->type)
default:
break;
}
-#endif
}
-#ifdef USEODE
static void World_Physics_Frame_BodyToEntity(world_t *world, prvm_edict_t *ed)
{
prvm_prog_t *prog = world->prog;
if (!forcetype)
return;
enemy = PRVM_gameedictedict(ed, enemy);
- if (enemy <= 0 || enemy >= prog->num_edicts || prog->edicts[enemy].priv.required->free || prog->edicts[enemy].priv.server->ode_body == 0)
+ if (enemy <= 0 || enemy >= prog->num_edicts || prog->edicts[enemy].free || prog->edicts[enemy].priv.server->ode_body == 0)
return;
VectorCopy(PRVM_gameedictvector(ed, movedir), movedir);
VectorCopy(PRVM_gameedictvector(ed, origin), origin);
VectorCopy(PRVM_gameedictvector(ed, movedir), movedir);
if(movetype == MOVETYPE_PHYSICS)
jointtype = JOINTTYPE_NONE; // can't have both
- if(enemy <= 0 || enemy >= prog->num_edicts || prog->edicts[enemy].priv.required->free || prog->edicts[enemy].priv.server->ode_body == 0)
+ if(enemy <= 0 || enemy >= prog->num_edicts || prog->edicts[enemy].free || prog->edicts[enemy].priv.server->ode_body == 0)
enemy = 0;
- if(aiment <= 0 || aiment >= prog->num_edicts || prog->edicts[aiment].priv.required->free || prog->edicts[aiment].priv.server->ode_body == 0)
+ if(aiment <= 0 || aiment >= prog->num_edicts || prog->edicts[aiment].free || prog->edicts[aiment].priv.server->ode_body == 0)
aiment = 0;
// see http://www.ode.org/old_list_archives/2006-January/017614.html
// we want to set ERP? make it fps independent and work like a spring constant
return;
ed1 = (prvm_edict_t *) dGeomGetData(o1);
- if(ed1 && ed1->priv.server->free)
+ if(ed1 && ed1->free)
ed1 = NULL;
if(ed1)
{
}
ed2 = (prvm_edict_t *) dGeomGetData(o2);
- if(ed2 && ed2->priv.server->free)
+ if(ed2 && ed2->free)
ed2 = NULL;
if(ed2)
{
dJointAttach(c, b1, b2);
}
}
-#endif
void World_Physics_Frame(world_t *world, double frametime, double gravity)
{
-#ifdef USEODE
prvm_prog_t *prog = world->prog;
double tdelta, tdelta2, tdelta3, simulationtime, collisiontime;
if (prog)
{
for (i = 0, ed = prog->edicts + i;i < prog->num_edicts;i++, ed++)
- if (!prog->edicts[i].priv.required->free)
+ if (!prog->edicts[i].free)
World_Physics_Frame_BodyFromEntity(world, ed);
// oh, and it must be called after all bodies were created
for (i = 0, ed = prog->edicts + i;i < prog->num_edicts;i++, ed++)
- if (!prog->edicts[i].priv.required->free)
+ if (!prog->edicts[i].free)
World_Physics_Frame_JointFromEntity(world, ed);
}
{
int j;
for (j = 0, ed = prog->edicts + j;j < prog->num_edicts;j++, ed++)
- if (!prog->edicts[j].priv.required->free)
+ if (!prog->edicts[j].free)
World_Physics_Frame_ForceFromEntity(world, ed);
}
// run physics (move objects, calculate new velocities)
if (prog)
{
for (i = 1, ed = prog->edicts + i;i < prog->num_edicts;i++, ed++)
- if (!prog->edicts[i].priv.required->free)
+ if (!prog->edicts[i].free)
World_Physics_Frame_BodyToEntity(world, ed);
// print stats
world->physics.ode_activeovjects = 0;
for (i = 1, ed = prog->edicts + i;i < prog->num_edicts;i++, ed++)
{
- if (prog->edicts[i].priv.required->free)
+ if (prog->edicts[i].free)
continue;
body = (dBodyID)prog->edicts[i].priv.server->ode_body;
if (!body)
}
}
}
-#endif
}
+#endif
#define WORLD_H
#include "qtypes.h"
-#include "com_list.h"
#include "collision.h"
#define MOVE_NORMAL 0
// (Windows growing its swapfile for example)
static void *attempt_malloc(size_t size)
{
+#ifndef WIN32
+ return malloc(size);
+#else
void *base;
// try for half a second or so
unsigned int attempts = 500;
Sys_Sleep(1000);
}
return NULL;
+#endif
}
#endif
memcpy((unsigned char *) mem + sizeof(memheader_t) + mem->size, &sentinel2, sizeof(sentinel2));
// append to head of list
- mem->next = pool->chain;
- mem->prev = NULL;
- pool->chain = mem;
- if (mem->next)
- mem->next->prev = mem;
+ List_Add(&mem->list, &pool->chain);
if (mem_mutex)
Thread_UnlockMutex(mem_mutex);
if (developer_memory.integer)
Con_DPrintf("Mem_Free: pool %s, alloc %s:%i, free %s:%i, size %i bytes\n", pool->name, mem->filename, mem->fileline, filename, fileline, (int)(mem->size));
// unlink memheader from doubly linked list
- if ((mem->prev ? mem->prev->next != mem : pool->chain != mem) || (mem->next && mem->next->prev != mem))
+ if (mem->list.prev->next != &mem->list || mem->list.next->prev != &mem->list)
Sys_Error("Mem_Free: not allocated or double freed (free at %s:%i)", filename, fileline);
if (mem_mutex)
Thread_LockMutex(mem_mutex);
- if (mem->prev)
- mem->prev->next = mem->next;
- else
- pool->chain = mem->next;
- if (mem->next)
- mem->next->prev = mem->prev;
+ List_Delete(&mem->list);
// memheader has been unlinked, do the actual free now
size = mem->size;
realsize = sizeof(memheader_t) + size + sizeof(sentinel2);
pool->filename = filename;
pool->fileline = fileline;
pool->flags = flags;
- pool->chain = NULL;
+ List_Create(&pool->chain);
pool->totalsize = 0;
pool->realsize = sizeof(mempool_t);
strlcpy (pool->name, name, sizeof (pool->name));
*chainaddress = pool->next;
// free memory owned by the pool
- while (pool->chain)
- _Mem_FreeBlock(pool->chain, filename, fileline);
+ while (!List_Is_Empty(&pool->chain))
+ _Mem_FreeBlock(List_First_Entry(&pool->chain, memheader_t, list), filename, fileline);
// free child pools, too
for(iter = poolchain; iter; iter = temp) {
Sys_Error("Mem_EmptyPool: trashed pool sentinel 2 (allocpool at %s:%i, emptypool at %s:%i)", pool->filename, pool->fileline, filename, fileline);
// free memory owned by the pool
- while (pool->chain)
- _Mem_FreeBlock(pool->chain, filename, fileline);
+ while (!List_Is_Empty(&pool->chain))
+ _Mem_FreeBlock(List_First_Entry(&pool->chain, memheader_t, list), filename, fileline);
// empty child pools, too
for(chainaddress = poolchain; chainaddress; chainaddress = chainaddress->next)
Sys_Error("Mem_CheckSentinelsGlobal: trashed pool sentinel 2 (allocpool at %s:%i, sentinel check at %s:%i)", pool->filename, pool->fileline, filename, fileline);
}
for (pool = poolchain;pool;pool = pool->next)
- for (mem = pool->chain;mem;mem = mem->next)
+ List_For_Each_Entry(mem, &pool->chain, memheader_t, list)
_Mem_CheckSentinels((void *)((unsigned char *) mem + sizeof(memheader_t)), filename, fileline);
#if MEMCLUMPING
for (pool = poolchain;pool;pool = pool->next)
{
// search only one pool
target = (memheader_t *)((unsigned char *) data - sizeof(memheader_t));
- for( header = pool->chain ; header ; header = header->next )
+ List_For_Each_Entry(header, &pool->chain, memheader_t, list)
if( header == target )
return true;
}
Con_Printf("total allocated size: %lu bytes (%.3fMB)\n", (unsigned long)realsize, realsize / 1048576.0);
for (pool = poolchain;pool;pool = pool->next)
{
- if ((pool->flags & POOLFLAG_TEMP) && pool->chain)
+ if ((pool->flags & POOLFLAG_TEMP) && !List_Is_Empty(&pool->chain))
{
Con_Printf("Memory pool %p has sprung a leak totalling %lu bytes (%.3fMB)! Listing contents...\n", (void *)pool, (unsigned long)pool->totalsize, pool->totalsize / 1048576.0);
- for (mem = pool->chain;mem;mem = mem->next)
+ List_For_Each_Entry(mem, &pool->chain, memheader_t, list)
Con_Printf("%10lu bytes allocated at %s:%i\n", (unsigned long)mem->size, mem->filename, mem->fileline);
}
}
{
Con_Printf("%10luk (%10luk actual) %s (%+li byte change) %s\n", (unsigned long) ((pool->totalsize + 1023) / 1024), (unsigned long)((pool->realsize + 1023) / 1024), pool->name, (long)(pool->totalsize - pool->lastchecksize), (pool->flags & POOLFLAG_TEMP) ? "TEMP" : "");
pool->lastchecksize = pool->totalsize;
- for (mem = pool->chain;mem;mem = mem->next)
+ List_For_Each_Entry(mem, &pool->chain, memheader_t, list)
if (mem->size >= minallocationsize)
Con_Printf("%10lu bytes allocated at %s:%i\n", (unsigned long)mem->size, mem->filename, mem->fileline);
}
}
-char* Mem_strdup (mempool_t *pool, const char* s)
+char* _Mem_strdup (mempool_t *pool, const char* s, const char *filename, int fileline)
{
char* p;
size_t sz;
if (s == NULL)
return NULL;
sz = strlen (s) + 1;
- p = (char*)Mem_Alloc (pool, sz);
+ p = (char*)_Mem_Alloc (pool, NULL, sz, 16, filename, fileline);
strlcpy (p, s, sz);
return p;
}
#include <stddef.h>
#include "qtypes.h"
#include "qdefs.h"
+#include "com_list.h"
extern qbool mem_bigendian;
// address returned by Chunk_Alloc (may be significantly before this header to satisify alignment)
void *baseaddress;
// next and previous memheaders in chain belonging to pool
- struct memheader_s *next;
- struct memheader_s *prev;
+ struct llist_s list;
// pool this memheader belongs to
struct mempool_s *pool;
// size of the memory after the header (excluding header and sentinel2)
// should always be MEMPOOL_SENTINEL
unsigned int sentinel1;
// chain of individual memory allocations
- struct memheader_s *chain;
+ struct llist_s chain;
// POOLFLAG_*
int flags;
// total memory allocated in this pool (inside memheaders)
#define Mem_Memalign(pool,alignment,size) _Mem_Alloc(pool, NULL, size, alignment, __FILE__, __LINE__)
#define Mem_Realloc(pool,data,size) _Mem_Alloc(pool, data, size, 16, __FILE__, __LINE__)
#define Mem_Free(mem) _Mem_Free(mem, __FILE__, __LINE__)
+#define Mem_strdup(pool, s) _Mem_strdup(pool, s, __FILE__, __LINE__)
#define Mem_CheckSentinels(data) _Mem_CheckSentinels(data, __FILE__, __LINE__)
#if MEMPARANOIA
#define Mem_CheckSentinelsGlobal() _Mem_CheckSentinelsGlobal(__FILE__, __LINE__)
// if pool is NULL this searches ALL pools for the allocation
qbool Mem_IsAllocated(mempool_t *pool, void *data);
-char* Mem_strdup (mempool_t *pool, const char* s);
+char* _Mem_strdup (mempool_t *pool, const char* s, const char *filename, int fileline);
typedef struct memexpandablearray_array_s
{
void Memory_Init_Commands (void);
extern mempool_t *zonemempool;
-#define Z_Malloc(size) Mem_Alloc(zonemempool,size)
+#define Z_Malloc(size) Mem_Alloc(zonemempool, size)
+#define Z_Realloc(data, size) Mem_Realloc(zonemempool, data, size)
+#define Z_strdup(s) Mem_strdup(zonemempool, s)
#define Z_Free(data) Mem_Free(data)
extern struct cvar_s developer_memory;